commit 30e61fe4097725c13e4e0b0404f0db9258b09a62 Author: greg Date: Wed Dec 4 01:57:47 2019 -0800 Initial commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..53eaa21 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +/target +**/*.rs.bk diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 0000000..596fe9f --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,9 @@ +[package] +name = "rust-most" +version = "0.1.0" +authors = ["greg "] +edition = "2018" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] diff --git a/src/main.rs b/src/main.rs new file mode 100644 index 0000000..e7a11a9 --- /dev/null +++ b/src/main.rs @@ -0,0 +1,3 @@ +fn main() { + println!("Hello, world!"); +} diff --git a/vendor/most-5.1.0/COPYING b/vendor/most-5.1.0/COPYING new file mode 100644 index 0000000..e77696a --- /dev/null +++ b/vendor/most-5.1.0/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 + + 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/vendor/most-5.1.0/COPYRIGHT b/vendor/most-5.1.0/COPYRIGHT new file mode 100644 index 0000000..7df7d57 --- /dev/null +++ b/vendor/most-5.1.0/COPYRIGHT @@ -0,0 +1,17 @@ + This file is part of MOST. + + Copyright (c) 1991, 1999, 2002, 2005-2018,2019 John E. Davis + + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the Free + Software Foundation; either version 2 of the License, or (at your option) + any later version. + + This program is distributed in the hope that 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. diff --git a/vendor/most-5.1.0/Makefile b/vendor/most-5.1.0/Makefile new file mode 100644 index 0000000..bc824b7 --- /dev/null +++ b/vendor/most-5.1.0/Makefile @@ -0,0 +1,43 @@ +# -*- sh -*- + +#This is a UNIX-only makefile. + + +SHELL = /bin/sh + +all: makefiles + cd src; $(MAKE) all +Makefile: configure autoconf/Makefile.in + @echo "Makefile is older than the configure script". + @echo "Please re-run the configure script." + @exit 1 +src/Makefile: configure src/Makefile.in src/config.hin + @echo "src/Makefile is older than its dependencies". + @echo "Please re-run the configure script." + @exit 1 +makefiles: Makefile src/Makefile +clean: + /bin/rm -f *~ + cd src; $(MAKE) clean +# +distclean: + /bin/rm -f *~ Makefile config.status config.log config.cache files.pck + cd src; $(MAKE) distclean +# +install: all + cd src; $(MAKE) install +# + +# The symlinks target is for my own private use. It simply creates the object +# directory as a symbolic link to a local disk instead of an NFS mounted one. +symlinks: + cd src; $(MAKE) symlinks +configure: autoconf/aclocal.m4 autoconf/configure.ac + cd autoconf && autoconf && mv ./configure .. +update: autoconf/config.sub autoconf/config.guess +autoconf/config.guess: /usr/share/misc/config.guess + /bin/cp -f /usr/share/misc/config.guess autoconf/config.guess +autoconf/config.sub: /usr/share/misc/config.sub + /bin/cp -f /usr/share/misc/config.sub autoconf/config.sub + +.PHONY: all clean distclean install symlinks update makefiles diff --git a/vendor/most-5.1.0/NEWS b/vendor/most-5.1.0/NEWS new file mode 100644 index 0000000..409c47b --- /dev/null +++ b/vendor/most-5.1.0/NEWS @@ -0,0 +1,12 @@ +NEWS for v5.1.0 + +This is primarily a maintenance release. + +The most notable update is that regular expression (RE) searches are +supported again. In ancient times, most supported RE searches, but +was RE support was dropped was dropped when UTF-8 support was added. +The default is still to use a non-RE search. The -r command line +switch may be used to make the default a RE-based search. Within +most, ":r" may be used to toggle the search type between RE and +non-RE. + diff --git a/vendor/most-5.1.0/README b/vendor/most-5.1.0/README new file mode 100644 index 0000000..928e8d0 --- /dev/null +++ b/vendor/most-5.1.0/README @@ -0,0 +1,95 @@ +Compiling MOST requires an ANSI C compiler. In addition you MUST have +a copy of the S-Lang library version 2.X. Version 1 is no longer +supported. This library is available from +. + + INSTALLATION INSTRUCTIONS + +On Unix, you should be able to simply type: + + ./configure; make + +at the Unix prompt. If you are using CYGWIN, you will need to ensure +that libslang.dll is on your PATH; otherwise the chkslang program will +not run. + +If using DJGPP or MINGW32, do: + + + cd src + make -f makefile.w32 + +For VMS, edit the file `vmsmake.com'. When finished, either type `@vmsmake' +or `@vmsmake gcc' at the VMS prompt. Once MOST has been created, it must be +installed as a foreign command. This means that you must first type: + + $ most :== $device:[dir.containing.most]most.exe + +I suggest that you first build MOST then view the doc file using MOST (`most +most.doc'). If you need help, hit the `h' key from within MOST. + +MOST understands the following environment variables: + + MOST_SWITCHES + MOST_EDITOR, SLANG_EDITOR, EDITOR + MOST_INITFILE + MOST_HELP + + 1. MOST_SWITCHES is a list of commonly used switches. + + 2. MOST_EDITOR and SLANG_EDITOR are formatted strings describing what + editor to use. The string can contain %s and %d formatting descriptors + that represent the file name and line number, respectively. For + example, if JED is your editor, then set MOST_EDITOR to 'jed %s -g %d'. + Since MOST is just one of several programs that use the S-Lang library, + I suggest that you use SLANG_EDITOR instead of MOST_EDITOR. + + 3. MOST_INITFILE specifies a configuration file for MOST. One can specify + keymaps, colors, etc. via this file. In the absence of + MOST_INITFILE, the program will look for a file call .mostrc in + the home directory (most.rc on non-Unix systems). + + See `lesskeys.rc' for an example of a key definition file that + causes MOST to emulate the `less' pager. See also most-fun.txt + for a list of functions that can be used for key definitions. The + file `most.rc' list the bindings that are built-in to the + viewer. + + 4. If MOST_HELP is defined to point to an existing file, MOST will load a + file as a help file. This is useful for describing custom keymaps. + +Any problems with MOST should be reported to jed@jedsoft.org. + + [Note also that this is really the first non-trivial C program that + I ever wrote. Because of this, much of the code appears very + amateurish. For example, I tried very hard to avoid C constructs + that some authors strongly discourage, e.g., goto, continue, + break. Of course this made some of the code convoluted, e.g., + contrast + + int test = 1; + while (test) + { + function (); + + if (-1 == some_function ()) + test = 0; + + if (test) + some_other_function (); + } + + with: + + while (1) + { + function (); + if (-1 == some_function ()) break; + some_other_function (); + } + + I have since concluded that many text-book authors never actually + wrote anything non-trivial. Whenever I work on MOST, I try to make + some changes in an effort to clean it up. ] + +--John Davis diff --git a/vendor/most-5.1.0/autoconf/Makefile b/vendor/most-5.1.0/autoconf/Makefile new file mode 100644 index 0000000..8112319 --- /dev/null +++ b/vendor/most-5.1.0/autoconf/Makefile @@ -0,0 +1,8 @@ +../configure: aclocal.m4 configure.ac + /bin/rm -rf autom4te.cache + autoconf && mv ./configure .. +update: config.sub config.guess +config.guess: /usr/share/misc/config.guess + /bin/cp -f /usr/share/misc/config.guess config.guess +config.sub: /usr/share/misc/config.sub + /bin/cp -f /usr/share/misc/config.sub config.sub diff --git a/vendor/most-5.1.0/autoconf/Makefile.in b/vendor/most-5.1.0/autoconf/Makefile.in new file mode 100644 index 0000000..351ebdb --- /dev/null +++ b/vendor/most-5.1.0/autoconf/Makefile.in @@ -0,0 +1,43 @@ +# -*- sh -*- + +#This is a UNIX-only makefile. + +@SET_MAKE@ +SHELL = /bin/sh + +all: makefiles + cd src; $(MAKE) all +Makefile: configure autoconf/Makefile.in + @echo "Makefile is older than the configure script". + @echo "Please re-run the configure script." + @exit 1 +src/Makefile: configure src/Makefile.in src/config.hin + @echo "src/Makefile is older than its dependencies". + @echo "Please re-run the configure script." + @exit 1 +makefiles: Makefile src/Makefile +clean: + /bin/rm -f *~ + cd src; $(MAKE) clean +# +distclean: + /bin/rm -f *~ Makefile config.status config.log config.cache files.pck + cd src; $(MAKE) distclean +# +install: all + cd src; $(MAKE) install +# + +# The symlinks target is for my own private use. It simply creates the object +# directory as a symbolic link to a local disk instead of an NFS mounted one. +symlinks: + cd src; $(MAKE) symlinks +configure: autoconf/aclocal.m4 autoconf/configure.ac + cd autoconf && autoconf && mv ./configure .. +update: autoconf/config.sub autoconf/config.guess +autoconf/config.guess: /usr/share/misc/config.guess + /bin/cp -f /usr/share/misc/config.guess autoconf/config.guess +autoconf/config.sub: /usr/share/misc/config.sub + /bin/cp -f /usr/share/misc/config.sub autoconf/config.sub + +.PHONY: all clean distclean install symlinks update makefiles diff --git a/vendor/most-5.1.0/autoconf/aclocal.m4 b/vendor/most-5.1.0/autoconf/aclocal.m4 new file mode 100644 index 0000000..2b5c447 --- /dev/null +++ b/vendor/most-5.1.0/autoconf/aclocal.m4 @@ -0,0 +1,1096 @@ +dnl# -*- mode: sh; mode: fold -*- +dnl# 0.3.3-1: Use INSTALL instead of INSTALL_DATA to install modules to get executable permissions +dnl# 0.3.3-0: Added $(OBJ_O_DEPS) and $(ELF_O_DEPS) to PROGRAM_OBJECT_RULES +dnl# 0.3.2-0: Add rpath support for freebsd +dnl# 0.3.1-0: New output variable: CC_SHARED_FLAGS; CC_SHARED is deprecated +dnl# 0.3.0-0: Added support for parsing /etc/ld.so.conf +dnl# 0.2.7-3: Change ncurses5w-config to ncursesw5-config (Gilles Espinasse) +dnl# 0.2.7-2: For the Makefile rules, use cd foo && bar instead of cd foo; bar +dnl# 0.2.7-1: Use "$ARCH"elfobjs instead of elf"$ARCH"objs for better flexibility +dnl# 0.2.7-0: Instead of expanding $ARCH at configure time, use \$ARCH for compile-time expansion +dnl# 0.2.6-2: Missing hyphen for cygwin ELFLIB_MAJOR (Marco Atzeri) +dnl# 0.2.6-1: Added optional second and third arguments to AC_DEFINE (Marco Atzeri) +dnl# 0.2.6-0: On cygwin, change libfooX_Y_Z.dll to cygfoo-X_Y_Z.dll (Marco Atzeri) +dnl# 0.2.5-3: Changed AC_DEFUN(foo...) to AC_DEFUN([foo]...) +dnl# 0.2.5-2: JD_CHECK_FOR_LIBRARY will alse output *_INC_DIR and *_LIB_DIR +dnl# 0.2.5-1: Updated using autoupdate +dnl# 0.2.5-0: M_LIB output variable created for haiku support (Scott McCreary) +dnl# 0.2.4-0: Added optional 3rd argument to JD_WITH_LIBRARY for a default path +dnl# 0.2.3-2: X was missing in a "test" statement (Joerg Sommer) +dnl# 0.2.3-1: AC_AIX needs to be called before running the compiler (Miroslav Lichvar) +dnl# 0.2.3: rewrote JD_CHECK_FOR_LIBRARY to loop over include/lib pairs +dnl# 0.2.2-1: JD_WITH_LIBRARY bug-fix +dnl# 0.2.2: Use ncurses5-config to search for terminfo dirs. +dnl# 0.2.1: Add .dll.a to list of extensions to when searching for libs (cygwin) +dnl# 0.2.0: Added install target name and more fixes for cygwin +dnl# 0.1.12: Improved support for cygwin +dnl# 0.1.11: Fixed elf linking on freebsd (Renato Botelho (garga at freebsd, org) +dnl# Version 0.1.10: rpath support for netbsd +dnl# Version 0.1.9: When searching for libs, use dylib on darwin +dnl# Version 0.1.8: Add rpath support for OpenBSD +dnl# Version 0.1.7: removed "-K pic" from IRIX compiler lines +dnl# Version 0.1.6: Added cygwin module support +dnl# Version 0.1.5: Added gcc version-script support. + +AC_DEFUN([JD_INIT], dnl#{{{ +[ +#These variable are initialized by JD init function +CONFIG_DIR=`pwd` +cd $srcdir +if test "`pwd`" != "$CONFIG_DIR" +then + AC_MSG_ERROR("This software does not support configuring from another directory. See the INSTALL file") +fi +dnl# if test "X$PWD" != "X" +dnl# then +dnl# CONFIG_DIR="$PWD" +dnl# fi +AC_SUBST(CONFIG_DIR)dnl +# Note: these will differ if one is a symbolic link +if test -f /usr/bin/dirname; then + JD_Above_Dir=`dirname $CONFIG_DIR` +else +# system is a loser + JD_Above_Dir=`cd ..;pwd` +fi +JD_Above_Dir2=`cd ..;pwd` +]) +dnl#}}} + +dnl# This function expand the "prefix variables. For example, it will expand +dnl# values such as ${exec_prefix}/foo when ${exec_prefix} itself has a +dnl# of ${prefix}. This function produces the shell variables: +dnl# jd_prefix_libdir, jd_prefix_incdir +AC_DEFUN([JD_EXPAND_PREFIX], dnl#{{{ +[ + if test "X$jd_prefix" = "X" + then + jd_prefix=$ac_default_prefix + if test "X$prefix" != "XNONE" + then + jd_prefix="$prefix" + fi + jd_exec_prefix="$jd_prefix" + if test "X$exec_prefix" != "XNONE" + then + jd_exec_prefix="$exec_prefix" + fi + + dnl#Unfortunately, exec_prefix may have a value like ${prefix}, etc. + dnl#Let the shell expand those. Yuk. + eval `sh <>)dnl +define(<<$2>>, translit($1, [a-z], [A-Z]))dnl +changequote([, ])dnl +]) +#}}} + +AC_DEFUN([JD_SIMPLE_LIB_DIR], dnl#{{{ +[ +JD_UPPERCASE($1,JD_UP_NAME) +JD_UP_NAME[]_LIB_DIR=$JD_Above_Dir/$1/libsrc/"$ARCH"objs +JD_UP_NAME[]_INCLUDE=$JD_Above_Dir/$1/libsrc + +if test ! -d "[$]JD_UP_NAME[]_INCLUDE" +then + JD_UP_NAME[]_LIB_DIR=$JD_Above_Dir/$1/src/"$ARCH"objs + JD_UP_NAME[]_INCLUDE=$JD_Above_Dir/$1/src + if test ! -d "[$]JD_UP_NAME[]_INCLUDE" + then + echo "" + echo WARNING------Unable to find the JD_UP_NAME directory + echo You may have to edit $CONFIG_DIR/src/Makefile. + echo "" + fi +fi + +AC_SUBST(JD_UP_NAME[]_LIB_DIR)dnl +AC_SUBST(JD_UP_NAME[]_INCLUDE)dnl +undefine([JD_UP_NAME])dnl +]) + +dnl#}}} + +AC_DEFUN([JD_FIND_GENERIC], dnl#{{{ +[ + AC_REQUIRE([JD_EXPAND_PREFIX])dnl + + changequote(<<, >>)dnl + define(<>, translit($1, [a-z], [A-Z]))dnl + changequote([, ])dnl +# Look for the JD_UP_NAME package +#JD_UP_NAME[]_INCLUDE="" +#JD_UP_NAME[]_LIB_DIR="" + +# This list consists of "include,lib include,lib ..." +JD_Search_Dirs="$JD_Above_Dir2/$1/libsrc,$JD_Above_Dir2/$1/libsrc/"$ARCH"objs \ + $JD_Above_Dir/$1/libsrc,$JD_Above_Dir/$1/libsrc/"$ARCH"objs \ + $JD_Above_Dir2/$1/src,$JD_Above_Dir2/$1/src/"$ARCH"objs \ + $JD_Above_Dir/$1/src,$JD_Above_Dir/$1/src/"$ARCH"objs" + +JD_Search_Dirs="$JD_Search_Dirs \ + $jd_prefix_incdir,$jd_prefix_libdir \ + $HOME/include,$HOME/lib" + +if test -n "$ARCH" +then + JD_Search_Dirs="$JD_Search_Dirs $HOME/include,$HOME/$ARCH/lib" + JD_Search_Dirs="$JD_Search_Dirs $HOME/include,$HOME/sys/$ARCH/lib" +fi + +# Now add the standard system includes. The reason for doing this is that +# the other directories may have a better chance of containing a more recent +# version. + +JD_Search_Dirs="$JD_Search_Dirs \ + /usr/local/include,/usr/local/lib \ + /usr/include,/usr/lib \ + /usr/include/$1,/usr/lib \ + /usr/include/$1,/usr/lib/$1" + +echo looking for the JD_UP_NAME library + +for include_and_lib in $JD_Search_Dirs +do + # Yuk. Is there a better way to set these variables?? + generic_include=`echo $include_and_lib | tr ',' ' ' | awk '{print [$]1}'` + generic_lib=`echo $include_and_lib | tr ',' ' ' | awk '{print [$]2}'` + echo Looking for $1.h in $generic_include + echo and lib$1.a in $generic_lib + if test -r $generic_include/$1.h && test -r $generic_lib/lib$1.a + then + echo Found it. + JD_UP_NAME[]_LIB_DIR="$generic_lib" + JD_UP_NAME[]_INCLUDE="$generic_include" + break + else + if test -r $generic_include/$1.h && test -r $generic_lib/lib$1.so + then + echo Found it. + JD_UP_NAME[]_LIB_DIR="$generic_lib" + JD_UP_NAME[]_INCLUDE="$generic_include" + break + fi + fi +done + +if test -n "[$]JD_UP_NAME[]_LIB_DIR" +then + jd_have_$1="yes" +else + echo Unable to find the $JD_UP_NAME library. + echo You may have to edit $CONFIG_DIR/src/Makefile. + JD_UP_NAME[]_INCLUDE=$JD_Above_Dir/$1/src + JD_UP_NAME[]_LIB_DIR=$JD_Above_Dir/$1/src/"$ARCH"objs + jd_have_$1="no" +fi + +JD_UP_NAME[]_INC="-I[$]JD_UP_NAME[]_INCLUDE" +JD_UP_NAME[]_LIB="-L[$]JD_UP_NAME[]_LIB_DIR" +JD_SET_RPATH([$]JD_UP_NAME[]_LIB_DIR) +dnl# if test "X$GCC" = Xyes +dnl# then +dnl# RPATH_[]JD_UP_NAME="-Wl,-R[$]JD_UP_NAME[]_LIB_DIR" +dnl# else +dnl# RPATH_[]JD_UP_NAME="-R[$]JD_UP_NAME[]_LIB_DIR" +dnl# fi + +# gcc under solaris is often not installed correctly. Avoid specifying +# -I/usr/include. +if test "[$]JD_UP_NAME[]_INC" = "-I/usr/include" +then + JD_UP_NAME[]_INC="" +fi + +if test "[$]JD_UP_NAME[]_LIB" = "-L/usr/lib" +then + JD_UP_NAME[]_LIB="" + RPATH_[]JD_UP_NAME="" +fi + +AC_SUBST(JD_UP_NAME[]_LIB)dnl +AC_SUBST(JD_UP_NAME[]_INC)dnl +AC_SUBST(JD_UP_NAME[]_LIB_DIR)dnl +AC_SUBST(JD_UP_NAME[]_INCLUDE)dnl +dnl# AC_SUBST(RPATH_[]JD_UP_NAME)dnl +undefine([JD_UP_NAME])dnl +]) + +dnl#}}} + +AC_DEFUN([JD_FIND_SLANG], dnl#{{{ +[ +JD_FIND_GENERIC(slang) +]) + +dnl#}}} + +AC_DEFUN([JD_GCC_WARNINGS], dnl#{{{ +[ +AC_ARG_ENABLE(warnings, + AC_HELP_STRING([--enable-warnings],[turn on GCC compiler warnings]), + [gcc_warnings=$enableval]) +if test -n "$GCC" +then + #CFLAGS="$CFLAGS -fno-strength-reduce" + if test -n "$gcc_warnings" + then + CFLAGS="$CFLAGS -Wall -W -pedantic -Winline -Wmissing-prototypes \ + -Wnested-externs -Wpointer-arith -Wcast-align -Wshadow -Wstrict-prototypes \ + -Wformat=2" + # Now trim excess whitespace + CFLAGS=`echo $CFLAGS` + fi +fi +]) + +dnl#}}} + +IEEE_CFLAGS="" +AC_DEFUN([JD_IEEE_CFLAGS], dnl#{{{ +[ +case "$host_cpu" in + *alpha* ) + if test "$GCC" = yes + then + IEEE_CFLAGS="-mieee" + else + IEEE_CFLAGS="-ieee_with_no_inexact" + fi + ;; + * ) + IEEE_CFLAGS="" +esac +]) + +dnl#}}} + +AC_DEFUN([JD_CREATE_ORULE], dnl#{{{ +[ +PROGRAM_OBJECT_RULES="$PROGRAM_OBJECT_RULES +\$(OBJDIR)/$1.o : \$(SRCDIR)/$1.c \$(DOT_O_DEPS) \$(OBJ_O_DEPS) \$("$1"_O_DEP) + cd \$(OBJDIR) && \$(COMPILE_CMD) \$("$1"_C_FLAGS) \$(SRCDIR)/$1.c +" +]) + +dnl#}}} + +AC_DEFUN([JD_CREATE_ELFORULE], dnl#{{{ +[ +PROGRAM_ELF_ORULES="$PROGRAM_ELF_ORULES +\$(ELFDIR)/$1.o : \$(SRCDIR)/$1.c \$(DOT_O_DEPS) \$(ELF_O_DEPS) \$("$1"_O_DEP) + cd \$(ELFDIR) && \$(ELFCOMPILE_CMD) \$("$1"_C_FLAGS) \$(SRCDIR)/$1.c +" +]) + +dnl#}}} + +AC_DEFUN([JD_CREATE_EXEC_RULE], dnl#{{{ +[ +PROGRAM_OBJECT_RULES="$PROGRAM_OBJECT_RULES +$1 : \$(OBJDIR)/$1 + @echo $1 created in \$(OBJDIR) +\$(OBJDIR)/$1 : \$(OBJDIR)/$1.o \$("$1"_DEPS) \$(EXECDEPS) + \$(CC) -o \$(OBJDIR)/$1 \$(LDFLAGS) \$(OBJDIR)/$1.o \$("$1"_LIBS) \$(EXECLIBS) +\$(OBJDIR)/$1.o : \$(SRCDIR)/$1.c \$(DOT_O_DEPS) \$("$1"_O_DEP) + cd \$(OBJDIR) && \$(COMPILE_CMD) \$("$1"_INC) \$(EXECINC) \$(SRCDIR)/$1.c +" +]) + +dnl#}}} + +AC_DEFUN([JD_CREATE_MODULE_ORULES], dnl#{{{ +[ + for program_module in $Program_Modules; do + JD_CREATE_ORULE($program_module) + JD_CREATE_ELFORULE($program_module) + done +]) + +dnl#}}} + +AC_DEFUN([JD_GET_MODULES], dnl#{{{ +[ + PROGRAM_HFILES="" + PROGRAM_OFILES="" + PROGRAM_CFILES="" + PROGRAM_OBJECTS="" + PROGRAM_ELFOBJECTS="" + PROGRAM_OBJECT_RULES="" + PROGRAM_ELF_ORULES="" + if test -z "$1" + then + Program_Modules="" + else + comment_re="^#" + Program_Modules=`grep -v '$comment_re' $1 | awk '{print [$]1}'` + Program_H_Modules=`grep -v '$comment_re' $1 | awk '{print [$]2}'` + for program_module in $Program_H_Modules; do + PROGRAM_HFILES="$PROGRAM_HFILES $program_module" + done + fi + for program_module in $Program_Modules; do + PROGRAM_OFILES="$PROGRAM_OFILES $program_module.o" + PROGRAM_CFILES="$PROGRAM_CFILES $program_module.c" + PROGRAM_OBJECTS="$PROGRAM_OBJECTS \$(OBJDIR)/$program_module.o" + PROGRAM_ELFOBJECTS="$PROGRAM_ELFOBJECTS \$(ELFDIR)/$program_module.o" + done +dnl echo $PROGRAM_OFILES +dnl echo $PROGRAM_HFILES +AC_SUBST(PROGRAM_OFILES)dnl +AC_SUBST(PROGRAM_CFILES)dnl +AC_SUBST(PROGRAM_HFILES)dnl +AC_SUBST(PROGRAM_OBJECTS)dnl +AC_SUBST(PROGRAM_ELFOBJECTS)dnl +]) + +dnl#}}} + +AC_DEFUN([JD_APPEND_RULES], dnl#{{{ +[ + echo "$PROGRAM_OBJECT_RULES" >> $1 +]) + +dnl#}}} + +AC_DEFUN([JD_APPEND_ELFRULES], dnl#{{{ +[ + echo "$PROGRAM_ELF_ORULES" >> $1 +]) + +dnl#}}} + +AC_DEFUN([JD_CREATE_MODULE_EXEC_RULES], dnl#{{{ +[ + for program_module in $Program_Modules; do + JD_CREATE_EXEC_RULE($program_module) + done +]) + +dnl#}}} + +AC_DEFUN([JD_TERMCAP], dnl#{{{ +[ +AC_PATH_PROG(nc5config, ncurses5-config, no) +if test "$nc5config" = "no" +then + AC_PATH_PROG(nc5config, ncursesw5-config, no) +fi +AC_MSG_CHECKING(for terminfo) +if test "$nc5config" != "no" +then + MISC_TERMINFO_DIRS=`$nc5config --terminfo` +else + MISC_TERMINFO_DIRS="" +fi +JD_Terminfo_Dirs="$MISC_TERMINFO_DIRS \ + /usr/lib/terminfo \ + /usr/share/terminfo \ + /usr/share/lib/terminfo \ + /usr/local/lib/terminfo" +TERMCAP=-ltermcap + +for terminfo_dir in $JD_Terminfo_Dirs +do + if test -d $terminfo_dir + then + AC_MSG_RESULT(yes) + TERMCAP="" + break + fi +done +if test "$TERMCAP"; then + AC_MSG_RESULT(no) + AC_DEFINE(USE_TERMCAP,1,[Define to use termcap]) +fi +AC_SUBST(TERMCAP)dnl +AC_SUBST(MISC_TERMINFO_DIRS)dnl +]) + +dnl#}}} + +AC_DEFUN([JD_ANSI_CC], dnl#{{{ +[ +AC_AIX +AC_REQUIRE([AC_PROG_CC]) +AC_REQUIRE([AC_PROG_CPP]) +AC_REQUIRE([AC_PROG_GCC_TRADITIONAL]) +AC_ISC_POSIX + +dnl #This stuff came from Yorick config script +dnl +dnl # HPUX needs special stuff +dnl +AC_EGREP_CPP(yes, +[#ifdef hpux + yes +#endif +], [ +AC_DEFINE(_HPUX_SOURCE,1,[Special define needed for HPUX]) +if test "$CC" = cc; then CC="cc -Ae"; fi +])dnl +dnl +dnl #Be sure we've found compiler that understands prototypes +dnl +AC_MSG_CHECKING(C compiler that understands ANSI prototypes) +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[ + extern int silly (int);]])],[ + AC_MSG_RESULT($CC looks ok. Good.)],[ + AC_MSG_RESULT($CC is not a good enough compiler) + AC_MSG_ERROR(Set env variable CC to your ANSI compiler and rerun configure.) + ])dnl +])dnl + +dnl#}}} + +AC_DEFUN([JD_ELF_COMPILER], dnl#{{{ +[ +dnl #------------------------------------------------------------------------- +dnl # Check for dynamic linker +dnl #------------------------------------------------------------------------- +DYNAMIC_LINK_LIB="" + +dnl# AH_TEMPLATE([HAVE_DLOPEN],1,[Define if you have dlopen]) + +AC_CHECK_HEADER(dlfcn.h,[ + AC_DEFINE(HAVE_DLFCN_H,1,[Define if you have the dlfcn.h header]) + AC_CHECK_LIB(dl,dlopen,[ + DYNAMIC_LINK_LIB="-ldl" + AC_DEFINE(HAVE_DLOPEN,1,[Define if you have dlopen]) + ],[ + AC_CHECK_FUNC(dlopen,AC_DEFINE(HAVE_DLOPEN,[Define if you have dlopen])) + if test "$ac_cv_func_dlopen" != yes + then + AC_MSG_WARN(cannot perform dynamic linking) + fi + ])]) +AC_SUBST(DYNAMIC_LINK_LIB) + +if test "$GCC" = yes +then + if test X"$CFLAGS" = X + then + CFLAGS="-O2" + fi +fi + +dnl #Some defaults +ELFLIB="lib\$(THIS_LIB).so" +ELFLIB_MAJOR="\$(ELFLIB).\$(ELF_MAJOR_VERSION)" +ELFLIB_MAJOR_MINOR="\$(ELFLIB_MAJOR).\$(ELF_MINOR_VERSION)" +ELFLIB_MAJOR_MINOR_MICRO="\$(ELFLIB_MAJOR_MINOR).\$(ELF_MICRO_VERSION)" + +dnl# This specifies the target to use in the makefile to install the shared library +INSTALL_ELFLIB_TARGET="install-elf-and-links" +ELFLIB_BUILD_NAME="\$(ELFLIB_MAJOR_MINOR_MICRO)" +INSTALL_MODULE="\$(INSTALL)" +SLANG_DLL_CFLAGS="" +M_LIB="-lm" + +case "$host_os" in + *linux*|*gnu*|k*bsd*-gnu ) + DYNAMIC_LINK_FLAGS="-Wl,-export-dynamic" + ELF_CC="\$(CC)" + ELF_CFLAGS="\$(CFLAGS) -fPIC" + ELF_LINK="\$(CC) \$(LDFLAGS) -shared -Wl,-O1 -Wl,--version-script,\$(VERSION_SCRIPT) -Wl,-soname,\$(ELFLIB_MAJOR)" + ELF_DEP_LIBS="\$(DL_LIB) -lm -lc" + CC_SHARED_FLAGS="-shared -fPIC" + CC_SHARED="\$(CC) $CC_SHARED_FLAGS \$(CFLAGS)" + ;; + *solaris* ) + if test "$GCC" = yes + then + DYNAMIC_LINK_FLAGS="" + ELF_CC="\$(CC)" + ELF_CFLAGS="\$(CFLAGS) -fPIC" + ELF_LINK="\$(CC) \$(LDFLAGS) -shared -Wl,-ztext -Wl,-h,\$(ELFLIB_MAJOR)" + ELF_DEP_LIBS="\$(DL_LIB) -lm -lc" + CC_SHARED_FLAGS="-G -fPIC" + CC_SHARED="\$(CC) $CC_SHARED_FLAGS \$(CFLAGS)" + else + DYNAMIC_LINK_FLAGS="" + ELF_CC="\$(CC)" + ELF_CFLAGS="\$(CFLAGS) -K PIC" + ELF_LINK="\$(CC) \$(LDFLAGS) -G -h\$(ELFLIB_MAJOR)" + ELF_DEP_LIBS="\$(DL_LIB) -lm -lc" + CC_SHARED_FLAGS="-G -K PIC" + CC_SHARED="\$(CC) $CC_SHARED_FLAGS \$(CFLAGS)" + fi + ;; + # osr5 or unixware7 with current or late autoconf + *sco3.2v5* | *unixware-5* | *sco-sysv5uw7*) + if test "$GCC" = yes + then + DYNAMIC_LINK_FLAGS="" + ELF_CC="\$(CC)" + ELF_CFLAGS="\$(CFLAGS) -fPIC" + ELF_LINK="\$(CC) \$(LDFLAGS) -shared -Wl,-h,\$(ELFLIB_MAJOR)" + ELF_DEP_LIBS= + CC_SHARED_FLAGS="-G -fPIC" + CC_SHARED="\$(CC) $CC_SHARED_FLAGS \$(CFLAGS)" + else + DYNAMIC_LINK_FLAGS="" + ELF_CC="\$(CC)" + ELF_CFLAGS="\$(CFLAGS) -K pic" + # ELF_LINK="ld -G -z text -h#" + ELF_LINK="\$(CC) \$(LDFLAGS) -G -z text -h\$(ELFLIB_MAJOR)" + ELF_DEP_LIBS= + CC_SHARED_FLAGS="-G -K pic" + CC_SHARED="\$(CC) $CC_SHARED_FLAGS \$(CFLAGS)" + fi + ;; + *irix6.5* ) + echo "Note: ELF compiler for host_os=$host_os may not be correct" + echo "double-check: 'mode_t', 'pid_t' may be wrong!" + if test "$GCC" = yes + then + # not tested + DYNAMIC_LINK_FLAGS="" + ELF_CC="\$(CC)" + ELF_CFLAGS="\$(CFLAGS) -fPIC" + ELF_LINK="\$(CC) \$(LDFLAGS) -shared -Wl,-h,\$(ELFLIB_MAJOR)" + ELF_DEP_LIBS= + CC_SHARED_FLAGS="-shared -fPIC" + CC_SHARED="\$(CC) $CC_SHARED_FLAGS \$(CFLAGS)" + else + DYNAMIC_LINK_FLAGS="" + ELF_CC="\$(CC)" + ELF_CFLAGS="\$(CFLAGS)" # default anyhow + ELF_LINK="\$(CC) \$(LDFLAGS) -shared -o \$(ELFLIB_MAJOR)" + ELF_DEP_LIBS= + CC_SHARED_FLAGS="-shared" + CC_SHARED="\$(CC) $CC_SHARED_FLAGS \$(CFLAGS)" + fi + ;; + *darwin* ) + DYNAMIC_LINK_FLAGS="" + ELF_CC="\$(CC)" + ELF_CFLAGS="\$(CFLAGS) -fno-common" + ELF_LINK="\$(CC) \$(LDFLAGS) -dynamiclib -install_name \$(install_lib_dir)/\$(ELFLIB_MAJOR) -compatibility_version \$(ELF_MAJOR_VERSION) -current_version \$(ELF_MAJOR_VERSION).\$(ELF_MINOR_VERSION)" + ELF_DEP_LIBS="\$(LDFLAGS) \$(DL_LIB)" + CC_SHARED_FLAGS="-bundle -flat_namespace -undefined suppress -fno-common" + CC_SHARED="\$(CC) $CC_SHARED_FLAGS \$(CFLAGS)" + ELFLIB="lib\$(THIS_LIB).dylib" + ELFLIB_MAJOR="lib\$(THIS_LIB).\$(ELF_MAJOR_VERSION).dylib" + ELFLIB_MAJOR_MINOR="lib\$(THIS_LIB).\$(ELF_MAJOR_VERSION).\$(ELF_MINOR_VERSION).dylib" + ELFLIB_MAJOR_MINOR_MICRO="lib\$(THIS_LIB).\$(ELF_MAJOR_VERSION).\$(ELF_MINOR_VERSION).\$(ELF_MICRO_VERSION).dylib" + ;; + *freebsd* ) + ELF_CC="\$(CC)" + ELF_CFLAGS="\$(CFLAGS) -fPIC" + #if test "X$PORTOBJFORMAT" = "Xelf" ; then + # ELF_LINK="\$(CC) \$(LDFLAGS) -shared -Wl,-soname,\$(ELFLIB_MAJOR)" + #else + # ELF_LINK="ld -Bshareable -x" + #fi + ELF_LINK="\$(CC) \$(LDFLAGS) -shared -Wl,-soname,\$(ELFLIB_MAJOR)" + ELF_DEP_LIBS="\$(DL_LIB) -lm" + CC_SHARED_FLAGS="-shared -fPIC" + CC_SHARED="\$(CC) $CC_SHARED_FLAGS \$(CFLAGS)" + ;; + *cygwin* ) + DYNAMIC_LINK_FLAGS="" + ELF_CC="\$(CC)" + SLANG_DLL_CFLAGS="-DSLANG_DLL=1" + ELF_CFLAGS="\$(CFLAGS) -DBUILD_DLL=1" + DLL_IMPLIB_NAME="lib\$(THIS_LIB)\$(ELFLIB_MAJOR_VERSION).dll.a" + #ELF_LINK="\$(CC) \$(LDFLAGS) -shared -Wl,-O1 -Wl,--version-script,\$(VERSION_SCRIPT) -Wl,-soname,\$(ELFLIB_MAJOR) -Wl,--out-implib=\$(DLL_IMPLIB_NAME) -Wl,-export-all-symbols -Wl,-enable-auto-import" + ELF_LINK="\$(CC) \$(LDFLAGS) -shared -Wl,-O1 -Wl,--version-script,\$(VERSION_SCRIPT) -Wl,-soname,\$(ELFLIB_MAJOR) -Wl,--out-implib=\$(DLL_IMPLIB_NAME)" + ELF_DEP_LIBS="\$(DL_LIB) -lm" + CC_SHARED_FLAGS="-shared -DSLANG_DLL=1" + CC_SHARED="\$(CC) $CC_SHARED_FLAGS \$(CFLAGS)" + dnl# CYGWIN prohibits undefined symbols when linking shared libs + SLANG_LIB_FOR_MODULES="-L\$(ELFDIR) -lslang" + INSTALL_MODULE="\$(INSTALL)" + INSTALL_ELFLIB_TARGET="install-elf-cygwin" + ELFLIB="lib\$(THIS_LIB).dll" + ELFLIB_MAJOR="cyg\$(THIS_LIB)-\$(ELF_MAJOR_VERSION).dll" + ELFLIB_MAJOR_MINOR="cyg\$(THIS_LIB)-\$(ELF_MAJOR_VERSION)_\$(ELF_MINOR_VERSION).dll" + ELFLIB_MAJOR_MINOR_MICRO="cyg\$(THIS_LIB)-\$(ELF_MAJOR_VERSION)_\$(ELF_MINOR_VERSION)_\$(ELF_MICRO_VERSION).dll" + ELFLIB_BUILD_NAME="\$(ELFLIB_MAJOR)" + ;; + *haiku* ) + M_LIB="" + DYNAMIC_LINK_FLAGS="-Wl,-export-dynamic" + ELF_CC="\$(CC)" + ELF_CFLAGS="\$(CFLAGS) -fPIC" + ELF_LINK="\$(CC) \$(LDFLAGS) -shared -Wl,-O1 -Wl,--version-script,\$(VERSION_SCRIPT) -Wl,-soname,\$(ELFLIB_MAJOR)" + ELF_DEP_LIBS="\$(DL_LIB)" + CC_SHARED_FLAGS="-shared -fPIC" + CC_SHARED="\$(CC) $CC_SHARED_FLAGS \$(CFLAGS)" + ;; + * ) + echo "Note: ELF compiler for host_os=$host_os may be wrong" + ELF_CC="\$(CC)" + ELF_CFLAGS="\$(CFLAGS) -fPIC" + ELF_LINK="\$(CC) \$(LDFLAGS) -shared" + ELF_DEP_LIBS="\$(DL_LIB) -lm -lc" + CC_SHARED_FLAGS="-shared -fPIC" + CC_SHARED="\$(CC) $CC_SHARED_FLAGS \$(CFLAGS)" +esac + +AC_SUBST(ELF_CC) +AC_SUBST(ELF_CFLAGS) +AC_SUBST(ELF_LINK) +AC_SUBST(ELF_LINK_CMD) +AC_SUBST(ELF_DEP_LIBS) +AC_SUBST(DYNAMIC_LINK_FLAGS) +AC_SUBST(CC_SHARED_FLAGS) +AC_SUBST(CC_SHARED) +AC_SUBST(ELFLIB) +AC_SUBST(ELFLIB_MAJOR) +AC_SUBST(ELFLIB_MAJOR_MINOR) +AC_SUBST(ELFLIB_MAJOR_MINOR_MICRO) +AC_SUBST(SLANG_LIB_FOR_MODULES) +AC_SUBST(DLL_IMPLIB_NAME) +AC_SUBST(INSTALL_MODULE) +AC_SUBST(INSTALL_ELFLIB_TARGET) +AC_SUBST(ELFLIB_BUILD_NAME) +AC_SUBST(SLANG_DLL_CFLAGS) +AC_SUBST(M_LIB) +]) + +dnl#}}} + +AC_DEFUN([JD_F77_COMPILER], dnl#{{{ +[ +case "$host_os" in + *linux* ) + F77="g77" + F77_LIBS="-lg2c" + ;; + *solaris*) + F77=f77 + #F77_LIBS="-lF77 -lM77 -L/opt/SUNWspro/SC4.0/lib -lsunmath" + F77_LIBS="-lF77 -lM77 -lsunmath" + ;; + *) + echo "" + echo "WARNING: Assuming f77 as your FORTRAN compiler" + echo "" + F77=f77 + F77_LIBS="" +esac +AC_SUBST(F77) +AC_SUBST(F77_LIBS) +]) + +dnl#}}} + +dnl# This macro process the --with-xxx, --with-xxxinc, and --with-xxxlib +dnl# command line arguments and returns the values as shell variables +dnl# jd_xxx_include_dir and jd_xxx_library_dir. It does not perform any +dnl# substitutions, nor check for the existence of the supplied values. +AC_DEFUN([JD_WITH_LIBRARY_PATHS], dnl#{{{ +[ + JD_UPPERCASE($1,JD_ARG1) + jd_$1_include_dir="" + jd_$1_library_dir="" + if test X"$jd_with_$1_library" = X + then + jd_with_$1_library="" + fi + + AC_ARG_WITH($1, + [ --with-$1=DIR Use DIR/lib and DIR/include for $1], + [jd_with_$1_arg=$withval], [jd_with_$1_arg=unspecified]) + + case "x$jd_with_$1_arg" in + xno) + jd_with_$1_library="no" + ;; + x) + dnl# AC_MSG_ERROR(--with-$1 requires a value-- try yes or no) + jd_with_$1_library="yes" + ;; + xunspecified) + ;; + xyes) + jd_with_$1_library="yes" + ;; + *) + jd_with_$1_library="yes" + jd_$1_include_dir="$jd_with_$1_arg"/include + jd_$1_library_dir="$jd_with_$1_arg"/lib + ;; + esac + + AC_ARG_WITH($1lib, + [ --with-$1lib=DIR $1 library in DIR], + [jd_with_$1lib_arg=$withval], [jd_with_$1lib_arg=unspecified]) + case "x$jd_with_$1lib_arg" in + xunspecified) + ;; + xno) + ;; + x) + AC_MSG_ERROR(--with-$1lib requres a value) + ;; + *) + jd_with_$1_library="yes" + jd_$1_library_dir="$jd_with_$1lib_arg" + ;; + esac + + AC_ARG_WITH($1inc, + [ --with-$1inc=DIR $1 include files in DIR], + [jd_with_$1inc_arg=$withval], [jd_with_$1inc_arg=unspecified]) + case "x$jd_with_$1inc_arg" in + x) + AC_MSG_ERROR(--with-$1inc requres a value) + ;; + xunspecified) + ;; + xno) + ;; + *) + jd_with_$1_library="yes" + jd_$1_include_dir="$jd_with_$1inc_arg" + ;; + esac +]) +dnl#}}} + +dnl# This function checks for the existence of the specified library $1 with +dnl# header file $2. If the library exists, then the shell variables will +dnl# be created: +dnl# jd_with_$1_library=yes/no, +dnl# jd_$1_inc_file +dnl# jd_$1_include_dir +dnl# jd_$1_library_dir +dnl# If $3 is present, then also look in $3/include+$3/lib +AC_DEFUN([JD_CHECK_FOR_LIBRARY], dnl#{{{ +[ + AC_REQUIRE([JD_EXPAND_PREFIX])dnl + AC_REQUIRE([JD_GET_SYS_INCLIBS])dnl + dnl JD_UPPERCASE($1,JD_ARG1) + JD_WITH_LIBRARY_PATHS($1) + AC_MSG_CHECKING(for the $1 library and header files $2) + if test X"$jd_with_$1_library" != Xno + then + jd_$1_inc_file=$2 + dnl# jd_with_$1_library="yes" + + if test "X$jd_$1_inc_file" = "X" + then + jd_$1_inc_file=$1.h + fi + + if test X"$jd_$1_include_dir" = X + then + inc_and_lib_dirs="\ + $jd_prefix_incdir,$jd_prefix_libdir \ + /usr/local/$1/include,/usr/local/$1/lib \ + /usr/local/include/$1,/usr/local/lib \ + /usr/local/include,/usr/local/lib \ + $JD_SYS_INCLIBS \ + /usr/include/$1,/usr/lib \ + /usr/$1/include,/usr/$1/lib \ + /usr/include,/usr/lib \ + /opt/include/$1,/opt/lib \ + /opt/$1/include,/opt/$1/lib \ + /opt/include,/opt/lib" + + if test X$3 != X + then + inc_and_lib_dirs="$3/include,$3/lib $inc_and_lib_dirs" + fi + + case "$host_os" in + *darwin* ) + exts="dylib so a" + ;; + *cygwin* ) + exts="dll.a so a" + ;; + * ) + exts="so a" + esac + + xincfile="$jd_$1_inc_file" + xlibfile="lib$1" + jd_with_$1_library="no" + + for include_and_lib in $inc_and_lib_dirs + do + # Yuk. Is there a better way to set these variables?? + xincdir=`echo $include_and_lib | tr ',' ' ' | awk '{print [$]1}'` + xlibdir=`echo $include_and_lib | tr ',' ' ' | awk '{print [$]2}'` + found=0 + if test -r $xincdir/$xincfile + then + for E in $exts + do + if test -r "$xlibdir/$xlibfile.$E" + then + jd_$1_include_dir="$xincdir" + jd_$1_library_dir="$xlibdir" + jd_with_$1_library="yes" + found=1 + break + fi + done + fi + if test $found -eq 1 + then + break + fi + done + fi + fi + + if test X"$jd_$1_include_dir" != X -a X"$jd_$1_library_dir" != X + then + AC_MSG_RESULT(yes: $jd_$1_library_dir and $jd_$1_include_dir) + jd_with_$1_library="yes" + dnl# Avoid using /usr/lib and /usr/include because of problems with + dnl# gcc on some solaris systems. + JD_ARG1[]_LIB=-L$jd_$1_library_dir + JD_ARG1[]_LIB_DIR=$jd_$1_library_dir + if test "X$jd_$1_library_dir" = "X/usr/lib" -o "X$jd_$1_include_dir" = "X/usr/include" + then + JD_ARG1[]_LIB="" + else + JD_SET_RPATH($jd_$1_library_dir) + fi + + JD_ARG1[]_INC=-I$jd_$1_include_dir + JD_ARG1[]_INC_DIR=$jd_$1_include_dir + if test "X$jd_$1_include_dir" = "X/usr/include" + then + JD_ARG1[]_INC="" + fi + else + AC_MSG_RESULT(no) + jd_with_$1_library="no" + JD_ARG1[]_INC="" + JD_ARG1[]_LIB="" + JD_ARG1[]_INC_DIR="" + JD_ARG1[]_LIB_DIR="" + fi + AC_SUBST(JD_ARG1[]_LIB) + AC_SUBST(JD_ARG1[]_INC) + AC_SUBST(JD_ARG1[]_LIB_DIR) + AC_SUBST(JD_ARG1[]_INC_DIR) +]) +dnl#}}} + +AC_DEFUN([JD_WITH_LIBRARY], dnl#{{{ +[ + JD_CHECK_FOR_LIBRARY($1, $2, $3) + if test "$jd_with_$1_library" = "no" + then + AC_MSG_ERROR(unable to find the $1 library and header file $jd_$1_inc_file) + fi +]) +dnl#}}} + +AC_DEFUN([JD_SLANG_VERSION], dnl#{{{ +[ + slang_h=$jd_slang_include_dir/slang.h + AC_MSG_CHECKING(SLANG_VERSION in $slang_h) +slang_version=`grep "^#define *SLANG_VERSION " $slang_h | + awk '{ print [$]3 }'` +slang_major_version=`echo $slang_version | + awk '{ print int([$]1/10000) }'` +slang_minor_version=`echo $slang_version $slang_major_version | + awk '{ print int(([$]1 - [$]2*10000)/100) }'` +slang_patchlevel_version=`echo $slang_version $slang_major_version $slang_minor_version | + awk '{ print ([$]1 - [$]2*10000 - [$]3*100) }'` + +AC_MSG_RESULT($slang_major_version.$slang_minor_version.$slang_patchlevel_version) +AC_SUBST(slang_version) +AC_SUBST(slang_major_version) +AC_SUBST(slang_minor_version) +AC_SUBST(slang_patchlevel_version) +]) +#}}} + +AC_DEFUN([JD_SLANG_MODULE_INSTALL_DIR], dnl#{{{ +[ + AC_REQUIRE([JD_SLANG_VERSION]) + if test "X$slang_major_version" = "X1" + then + MODULE_INSTALL_DIR="$libdir/slang/modules" + else + MODULE_INSTALL_DIR="$libdir/slang/v$slang_major_version/modules" + fi + SL_FILES_INSTALL_DIR=$datadir/slsh/local-packages + AC_SUBST(MODULE_INSTALL_DIR) + AC_SUBST(SL_FILES_INSTALL_DIR) +]) +#}}} + +AC_DEFUN([JD_CHECK_LONG_LONG], dnl#{{{ +[ + AC_CHECK_TYPES(long long) + AC_CHECK_SIZEOF(long long) +]) +dnl#}}} + +AC_DEFUN([JD_LARGE_FILE_SUPPORTXXX], dnl#{{{ +[ + AC_REQUIRE([JD_CHECK_LONG_LONG]) + AC_MSG_CHECKING(whether to explicitly activate long file support) + AC_DEFINE(_LARGEFILE_SOURCE, 1) + AC_DEFINE(_FILE_OFFSET_BITS, 64) + jd_large_file_support=no + if test X$ac_cv_type_long_long = Xyes + then + if test $ac_cv_sizeof_long_long -ge 8 + then + jd_large_file_support=yes + fi + fi + + if test $jd_large_file_support = yes + then + AC_DEFINE(HAVE_LARGEFILE_SUPPORT, 1) + AC_MSG_RESULT(yes) + else + AC_MSG_RESULT(no) + fi +]) +dnl#}}} + +AC_DEFUN([JD_LARGE_FILE_SUPPORT], dnl#{{{ +[ + AC_SYS_LARGEFILE + AC_FUNC_FSEEKO + AC_TYPE_OFF_T + AC_CHECK_SIZEOF(off_t) +]) +#}}} + +AC_DEFUN([JD_HAVE_ISINF], dnl#{{{ +[ + AC_MSG_CHECKING([for isinf]) + AC_LINK_IFELSE([AC_LANG_PROGRAM( [[#include ]], [[isinf (0.0);]])], + [AC_MSG_RESULT([yes]) + AC_DEFINE(HAVE_ISINF, 1)]) +]) +#}}} diff --git a/vendor/most-5.1.0/autoconf/config.guess b/vendor/most-5.1.0/autoconf/config.guess new file mode 100755 index 0000000..d622a44 --- /dev/null +++ b/vendor/most-5.1.0/autoconf/config.guess @@ -0,0 +1,1530 @@ +#! /bin/sh +# Attempt to guess a canonical system name. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, +# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, +# 2011, 2012 Free Software Foundation, Inc. + +timestamp='2012-02-10' + +# 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, see . +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + + +# Originally written by Per Bothner. Please send patches (context +# diff format) to and include a ChangeLog +# entry. +# +# This script attempts to guess a canonical system name similar to +# config.sub. If it succeeds, it prints the system name on stdout, and +# exits with 0. Otherwise, it exits with 1. +# +# You can get the latest version of this script from: +# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] + +Output the configuration name of the system \`$me' is run on. + +Operation modes: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to ." + +version="\ +GNU config.guess ($timestamp) + +Originally written by Per Bothner. +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, +2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 +Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit ;; + --version | -v ) + echo "$version" ; exit ;; + --help | --h* | -h ) + echo "$usage"; exit ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" >&2 + exit 1 ;; + * ) + break ;; + esac +done + +if test $# != 0; then + echo "$me: too many arguments$help" >&2 + exit 1 +fi + +trap 'exit 1' 1 2 15 + +# CC_FOR_BUILD -- compiler used by this script. Note that the use of a +# compiler to aid in system detection is discouraged as it requires +# temporary files to be created and, as you can see below, it is a +# headache to deal with in a portable fashion. + +# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still +# use `HOST_CC' if defined, but it is deprecated. + +# Portable tmp directory creation inspired by the Autoconf team. + +set_cc_for_build=' +trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; +trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; +: ${TMPDIR=/tmp} ; + { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || + { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || + { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || + { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; +dummy=$tmp/dummy ; +tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; +case $CC_FOR_BUILD,$HOST_CC,$CC in + ,,) echo "int x;" > $dummy.c ; + for c in cc gcc c89 c99 ; do + if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then + CC_FOR_BUILD="$c"; break ; + fi ; + done ; + if test x"$CC_FOR_BUILD" = x ; then + CC_FOR_BUILD=no_compiler_found ; + fi + ;; + ,,*) CC_FOR_BUILD=$CC ;; + ,*,*) CC_FOR_BUILD=$HOST_CC ;; +esac ; set_cc_for_build= ;' + +# This is needed to find uname on a Pyramid OSx when run in the BSD universe. +# (ghazi@noc.rutgers.edu 1994-08-24) +if (test -f /.attbin/uname) >/dev/null 2>&1 ; then + PATH=$PATH:/.attbin ; export PATH +fi + +UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown +UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown +UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown +UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown + +# Note: order is significant - the case branches are not exclusive. + +case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in + *:NetBSD:*:*) + # NetBSD (nbsd) targets should (where applicable) match one or + # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, + # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently + # switched to ELF, *-*-netbsd* would select the old + # object file format. This provides both forward + # compatibility and a consistent mechanism for selecting the + # object file format. + # + # Note: NetBSD doesn't particularly care about the vendor + # portion of the name. We always set it to "unknown". + sysctl="sysctl -n hw.machine_arch" + UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ + /usr/sbin/$sysctl 2>/dev/null || echo unknown)` + case "${UNAME_MACHINE_ARCH}" in + armeb) machine=armeb-unknown ;; + arm*) machine=arm-unknown ;; + sh3el) machine=shl-unknown ;; + sh3eb) machine=sh-unknown ;; + sh5el) machine=sh5le-unknown ;; + *) machine=${UNAME_MACHINE_ARCH}-unknown ;; + esac + # The Operating System including object format, if it has switched + # to ELF recently, or will in the future. + case "${UNAME_MACHINE_ARCH}" in + arm*|i386|m68k|ns32k|sh3*|sparc|vax) + eval $set_cc_for_build + if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ELF__ + then + # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). + # Return netbsd for either. FIX? + os=netbsd + else + os=netbsdelf + fi + ;; + *) + os=netbsd + ;; + esac + # The OS release + # Debian GNU/NetBSD machines have a different userland, and + # thus, need a distinct triplet. However, they do not need + # kernel version information, so it can be replaced with a + # suitable tag, in the style of linux-gnu. + case "${UNAME_VERSION}" in + Debian*) + release='-gnu' + ;; + *) + release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` + ;; + esac + # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: + # contains redundant information, the shorter form: + # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. + echo "${machine}-${os}${release}" + exit ;; + *:OpenBSD:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` + echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} + exit ;; + *:ekkoBSD:*:*) + echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} + exit ;; + *:SolidBSD:*:*) + echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} + exit ;; + macppc:MirBSD:*:*) + echo powerpc-unknown-mirbsd${UNAME_RELEASE} + exit ;; + *:MirBSD:*:*) + echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} + exit ;; + alpha:OSF1:*:*) + case $UNAME_RELEASE in + *4.0) + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` + ;; + *5.*) + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` + ;; + esac + # According to Compaq, /usr/sbin/psrinfo has been available on + # OSF/1 and Tru64 systems produced since 1995. I hope that + # covers most systems running today. This code pipes the CPU + # types through head -n 1, so we only detect the type of CPU 0. + ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` + case "$ALPHA_CPU_TYPE" in + "EV4 (21064)") + UNAME_MACHINE="alpha" ;; + "EV4.5 (21064)") + UNAME_MACHINE="alpha" ;; + "LCA4 (21066/21068)") + UNAME_MACHINE="alpha" ;; + "EV5 (21164)") + UNAME_MACHINE="alphaev5" ;; + "EV5.6 (21164A)") + UNAME_MACHINE="alphaev56" ;; + "EV5.6 (21164PC)") + UNAME_MACHINE="alphapca56" ;; + "EV5.7 (21164PC)") + UNAME_MACHINE="alphapca57" ;; + "EV6 (21264)") + UNAME_MACHINE="alphaev6" ;; + "EV6.7 (21264A)") + UNAME_MACHINE="alphaev67" ;; + "EV6.8CB (21264C)") + UNAME_MACHINE="alphaev68" ;; + "EV6.8AL (21264B)") + UNAME_MACHINE="alphaev68" ;; + "EV6.8CX (21264D)") + UNAME_MACHINE="alphaev68" ;; + "EV6.9A (21264/EV69A)") + UNAME_MACHINE="alphaev69" ;; + "EV7 (21364)") + UNAME_MACHINE="alphaev7" ;; + "EV7.9 (21364A)") + UNAME_MACHINE="alphaev79" ;; + esac + # A Pn.n version is a patched version. + # A Vn.n version is a released version. + # A Tn.n version is a released field test version. + # A Xn.n version is an unreleased experimental baselevel. + # 1.2 uses "1.2" for uname -r. + echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + # Reset EXIT trap before exiting to avoid spurious non-zero exit code. + exitcode=$? + trap '' 0 + exit $exitcode ;; + Alpha\ *:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # Should we change UNAME_MACHINE based on the output of uname instead + # of the specific Alpha model? + echo alpha-pc-interix + exit ;; + 21064:Windows_NT:50:3) + echo alpha-dec-winnt3.5 + exit ;; + Amiga*:UNIX_System_V:4.0:*) + echo m68k-unknown-sysv4 + exit ;; + *:[Aa]miga[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-amigaos + exit ;; + *:[Mm]orph[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-morphos + exit ;; + *:OS/390:*:*) + echo i370-ibm-openedition + exit ;; + *:z/VM:*:*) + echo s390-ibm-zvmoe + exit ;; + *:OS400:*:*) + echo powerpc-ibm-os400 + exit ;; + arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) + echo arm-acorn-riscix${UNAME_RELEASE} + exit ;; + arm:riscos:*:*|arm:RISCOS:*:*) + echo arm-unknown-riscos + exit ;; + SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) + echo hppa1.1-hitachi-hiuxmpp + exit ;; + Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) + # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. + if test "`(/bin/universe) 2>/dev/null`" = att ; then + echo pyramid-pyramid-sysv3 + else + echo pyramid-pyramid-bsd + fi + exit ;; + NILE*:*:*:dcosx) + echo pyramid-pyramid-svr4 + exit ;; + DRS?6000:unix:4.0:6*) + echo sparc-icl-nx6 + exit ;; + DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) + case `/usr/bin/uname -p` in + sparc) echo sparc-icl-nx7; exit ;; + esac ;; + s390x:SunOS:*:*) + echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4H:SunOS:5.*:*) + echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) + echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) + echo i386-pc-auroraux${UNAME_RELEASE} + exit ;; + i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) + eval $set_cc_for_build + SUN_ARCH="i386" + # If there is a compiler, see if it is configured for 64-bit objects. + # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. + # This test works for both compilers. + if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then + if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + SUN_ARCH="x86_64" + fi + fi + echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4*:SunOS:6*:*) + # According to config.sub, this is the proper way to canonicalize + # SunOS6. Hard to guess exactly what SunOS6 will be like, but + # it's likely to be more like Solaris than SunOS4. + echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4*:SunOS:*:*) + case "`/usr/bin/arch -k`" in + Series*|S4*) + UNAME_RELEASE=`uname -v` + ;; + esac + # Japanese Language versions have a version number like `4.1.3-JL'. + echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` + exit ;; + sun3*:SunOS:*:*) + echo m68k-sun-sunos${UNAME_RELEASE} + exit ;; + sun*:*:4.2BSD:*) + UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` + test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 + case "`/bin/arch`" in + sun3) + echo m68k-sun-sunos${UNAME_RELEASE} + ;; + sun4) + echo sparc-sun-sunos${UNAME_RELEASE} + ;; + esac + exit ;; + aushp:SunOS:*:*) + echo sparc-auspex-sunos${UNAME_RELEASE} + exit ;; + # The situation for MiNT is a little confusing. The machine name + # can be virtually everything (everything which is not + # "atarist" or "atariste" at least should have a processor + # > m68000). The system name ranges from "MiNT" over "FreeMiNT" + # to the lowercase version "mint" (or "freemint"). Finally + # the system name "TOS" denotes a system which is actually not + # MiNT. But MiNT is downward compatible to TOS, so this should + # be no problem. + atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) + echo m68k-milan-mint${UNAME_RELEASE} + exit ;; + hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) + echo m68k-hades-mint${UNAME_RELEASE} + exit ;; + *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) + echo m68k-unknown-mint${UNAME_RELEASE} + exit ;; + m68k:machten:*:*) + echo m68k-apple-machten${UNAME_RELEASE} + exit ;; + powerpc:machten:*:*) + echo powerpc-apple-machten${UNAME_RELEASE} + exit ;; + RISC*:Mach:*:*) + echo mips-dec-mach_bsd4.3 + exit ;; + RISC*:ULTRIX:*:*) + echo mips-dec-ultrix${UNAME_RELEASE} + exit ;; + VAX*:ULTRIX*:*:*) + echo vax-dec-ultrix${UNAME_RELEASE} + exit ;; + 2020:CLIX:*:* | 2430:CLIX:*:*) + echo clipper-intergraph-clix${UNAME_RELEASE} + exit ;; + mips:*:*:UMIPS | mips:*:*:RISCos) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c +#ifdef __cplusplus +#include /* for printf() prototype */ + int main (int argc, char *argv[]) { +#else + int main (argc, argv) int argc; char *argv[]; { +#endif + #if defined (host_mips) && defined (MIPSEB) + #if defined (SYSTYPE_SYSV) + printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_SVR4) + printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) + printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); + #endif + #endif + exit (-1); + } +EOF + $CC_FOR_BUILD -o $dummy $dummy.c && + dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && + SYSTEM_NAME=`$dummy $dummyarg` && + { echo "$SYSTEM_NAME"; exit; } + echo mips-mips-riscos${UNAME_RELEASE} + exit ;; + Motorola:PowerMAX_OS:*:*) + echo powerpc-motorola-powermax + exit ;; + Motorola:*:4.3:PL8-*) + echo powerpc-harris-powermax + exit ;; + Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) + echo powerpc-harris-powermax + exit ;; + Night_Hawk:Power_UNIX:*:*) + echo powerpc-harris-powerunix + exit ;; + m88k:CX/UX:7*:*) + echo m88k-harris-cxux7 + exit ;; + m88k:*:4*:R4*) + echo m88k-motorola-sysv4 + exit ;; + m88k:*:3*:R3*) + echo m88k-motorola-sysv3 + exit ;; + AViiON:dgux:*:*) + # DG/UX returns AViiON for all architectures + UNAME_PROCESSOR=`/usr/bin/uname -p` + if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] + then + if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ + [ ${TARGET_BINARY_INTERFACE}x = x ] + then + echo m88k-dg-dgux${UNAME_RELEASE} + else + echo m88k-dg-dguxbcs${UNAME_RELEASE} + fi + else + echo i586-dg-dgux${UNAME_RELEASE} + fi + exit ;; + M88*:DolphinOS:*:*) # DolphinOS (SVR3) + echo m88k-dolphin-sysv3 + exit ;; + M88*:*:R3*:*) + # Delta 88k system running SVR3 + echo m88k-motorola-sysv3 + exit ;; + XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) + echo m88k-tektronix-sysv3 + exit ;; + Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) + echo m68k-tektronix-bsd + exit ;; + *:IRIX*:*:*) + echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` + exit ;; + ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. + echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id + exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' + i*86:AIX:*:*) + echo i386-ibm-aix + exit ;; + ia64:AIX:*:*) + if [ -x /usr/bin/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + fi + echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} + exit ;; + *:AIX:2:3) + if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + + main() + { + if (!__power_pc()) + exit(1); + puts("powerpc-ibm-aix3.2.5"); + exit(0); + } +EOF + if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` + then + echo "$SYSTEM_NAME" + else + echo rs6000-ibm-aix3.2.5 + fi + elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then + echo rs6000-ibm-aix3.2.4 + else + echo rs6000-ibm-aix3.2 + fi + exit ;; + *:AIX:*:[4567]) + IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` + if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then + IBM_ARCH=rs6000 + else + IBM_ARCH=powerpc + fi + if [ -x /usr/bin/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + fi + echo ${IBM_ARCH}-ibm-aix${IBM_REV} + exit ;; + *:AIX:*:*) + echo rs6000-ibm-aix + exit ;; + ibmrt:4.4BSD:*|romp-ibm:BSD:*) + echo romp-ibm-bsd4.4 + exit ;; + ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and + echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to + exit ;; # report: romp-ibm BSD 4.3 + *:BOSX:*:*) + echo rs6000-bull-bosx + exit ;; + DPX/2?00:B.O.S.:*:*) + echo m68k-bull-sysv3 + exit ;; + 9000/[34]??:4.3bsd:1.*:*) + echo m68k-hp-bsd + exit ;; + hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) + echo m68k-hp-bsd4.4 + exit ;; + 9000/[34678]??:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + case "${UNAME_MACHINE}" in + 9000/31? ) HP_ARCH=m68000 ;; + 9000/[34]?? ) HP_ARCH=m68k ;; + 9000/[678][0-9][0-9]) + if [ -x /usr/bin/getconf ]; then + sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` + sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` + case "${sc_cpu_version}" in + 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 + 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 + 532) # CPU_PA_RISC2_0 + case "${sc_kernel_bits}" in + 32) HP_ARCH="hppa2.0n" ;; + 64) HP_ARCH="hppa2.0w" ;; + '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 + esac ;; + esac + fi + if [ "${HP_ARCH}" = "" ]; then + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + + #define _HPUX_SOURCE + #include + #include + + int main () + { + #if defined(_SC_KERNEL_BITS) + long bits = sysconf(_SC_KERNEL_BITS); + #endif + long cpu = sysconf (_SC_CPU_VERSION); + + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1"); break; + case CPU_PA_RISC2_0: + #if defined(_SC_KERNEL_BITS) + switch (bits) + { + case 64: puts ("hppa2.0w"); break; + case 32: puts ("hppa2.0n"); break; + default: puts ("hppa2.0"); break; + } break; + #else /* !defined(_SC_KERNEL_BITS) */ + puts ("hppa2.0"); break; + #endif + default: puts ("hppa1.0"); break; + } + exit (0); + } +EOF + (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` + test -z "$HP_ARCH" && HP_ARCH=hppa + fi ;; + esac + if [ ${HP_ARCH} = "hppa2.0w" ] + then + eval $set_cc_for_build + + # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating + # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler + # generating 64-bit code. GNU and HP use different nomenclature: + # + # $ CC_FOR_BUILD=cc ./config.guess + # => hppa2.0w-hp-hpux11.23 + # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess + # => hppa64-hp-hpux11.23 + + if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | + grep -q __LP64__ + then + HP_ARCH="hppa2.0w" + else + HP_ARCH="hppa64" + fi + fi + echo ${HP_ARCH}-hp-hpux${HPUX_REV} + exit ;; + ia64:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + echo ia64-hp-hpux${HPUX_REV} + exit ;; + 3050*:HI-UX:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + int + main () + { + long cpu = sysconf (_SC_CPU_VERSION); + /* The order matters, because CPU_IS_HP_MC68K erroneously returns + true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct + results, however. */ + if (CPU_IS_PA_RISC (cpu)) + { + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; + case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; + default: puts ("hppa-hitachi-hiuxwe2"); break; + } + } + else if (CPU_IS_HP_MC68K (cpu)) + puts ("m68k-hitachi-hiuxwe2"); + else puts ("unknown-hitachi-hiuxwe2"); + exit (0); + } +EOF + $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && + { echo "$SYSTEM_NAME"; exit; } + echo unknown-hitachi-hiuxwe2 + exit ;; + 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) + echo hppa1.1-hp-bsd + exit ;; + 9000/8??:4.3bsd:*:*) + echo hppa1.0-hp-bsd + exit ;; + *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) + echo hppa1.0-hp-mpeix + exit ;; + hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) + echo hppa1.1-hp-osf + exit ;; + hp8??:OSF1:*:*) + echo hppa1.0-hp-osf + exit ;; + i*86:OSF1:*:*) + if [ -x /usr/sbin/sysversion ] ; then + echo ${UNAME_MACHINE}-unknown-osf1mk + else + echo ${UNAME_MACHINE}-unknown-osf1 + fi + exit ;; + parisc*:Lites*:*:*) + echo hppa1.1-hp-lites + exit ;; + C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) + echo c1-convex-bsd + exit ;; + C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit ;; + C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) + echo c34-convex-bsd + exit ;; + C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) + echo c38-convex-bsd + exit ;; + C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) + echo c4-convex-bsd + exit ;; + CRAY*Y-MP:*:*:*) + echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*[A-Z]90:*:*:*) + echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ + | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ + -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ + -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*TS:*:*:*) + echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*T3E:*:*:*) + echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*SV1:*:*:*) + echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + *:UNICOS/mp:*:*) + echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) + FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` + echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit ;; + 5000:UNIX_System_V:4.*:*) + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` + echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit ;; + i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) + echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} + exit ;; + sparc*:BSD/OS:*:*) + echo sparc-unknown-bsdi${UNAME_RELEASE} + exit ;; + *:BSD/OS:*:*) + echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} + exit ;; + *:FreeBSD:*:*) + UNAME_PROCESSOR=`/usr/bin/uname -p` + case ${UNAME_PROCESSOR} in + amd64) + echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + *) + echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + esac + exit ;; + i*:CYGWIN*:*) + echo ${UNAME_MACHINE}-pc-cygwin + exit ;; + *:MINGW*:*) + echo ${UNAME_MACHINE}-pc-mingw32 + exit ;; + i*:MSYS*:*) + echo ${UNAME_MACHINE}-pc-msys + exit ;; + i*:windows32*:*) + # uname -m includes "-pc" on this system. + echo ${UNAME_MACHINE}-mingw32 + exit ;; + i*:PW*:*) + echo ${UNAME_MACHINE}-pc-pw32 + exit ;; + *:Interix*:*) + case ${UNAME_MACHINE} in + x86) + echo i586-pc-interix${UNAME_RELEASE} + exit ;; + authenticamd | genuineintel | EM64T) + echo x86_64-unknown-interix${UNAME_RELEASE} + exit ;; + IA64) + echo ia64-unknown-interix${UNAME_RELEASE} + exit ;; + esac ;; + [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) + echo i${UNAME_MACHINE}-pc-mks + exit ;; + 8664:Windows_NT:*) + echo x86_64-pc-mks + exit ;; + i*:Windows_NT*:* | Pentium*:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we + # UNAME_MACHINE based on the output of uname instead of i386? + echo i586-pc-interix + exit ;; + i*:UWIN*:*) + echo ${UNAME_MACHINE}-pc-uwin + exit ;; + amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) + echo x86_64-unknown-cygwin + exit ;; + p*:CYGWIN*:*) + echo powerpcle-unknown-cygwin + exit ;; + prep*:SunOS:5.*:*) + echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + *:GNU:*:*) + # the GNU system + echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` + exit ;; + *:GNU/*:*:*) + # other systems with GNU libc and userland + echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu + exit ;; + i*86:Minix:*:*) + echo ${UNAME_MACHINE}-pc-minix + exit ;; + aarch64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + aarch64_be:Linux:*:*) + UNAME_MACHINE=aarch64_be + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + alpha:Linux:*:*) + case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in + EV5) UNAME_MACHINE=alphaev5 ;; + EV56) UNAME_MACHINE=alphaev56 ;; + PCA56) UNAME_MACHINE=alphapca56 ;; + PCA57) UNAME_MACHINE=alphapca56 ;; + EV6) UNAME_MACHINE=alphaev6 ;; + EV67) UNAME_MACHINE=alphaev67 ;; + EV68*) UNAME_MACHINE=alphaev68 ;; + esac + objdump --private-headers /bin/sh | grep -q ld.so.1 + if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi + echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} + exit ;; + arm*:Linux:*:*) + eval $set_cc_for_build + if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_EABI__ + then + echo ${UNAME_MACHINE}-unknown-linux-gnu + else + if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_PCS_VFP + then + echo ${UNAME_MACHINE}-unknown-linux-gnueabi + else + echo ${UNAME_MACHINE}-unknown-linux-gnueabihf + fi + fi + exit ;; + avr32*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + cris:Linux:*:*) + echo ${UNAME_MACHINE}-axis-linux-gnu + exit ;; + crisv32:Linux:*:*) + echo ${UNAME_MACHINE}-axis-linux-gnu + exit ;; + frv:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + hexagon:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + i*86:Linux:*:*) + LIBC=gnu + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #ifdef __dietlibc__ + LIBC=dietlibc + #endif +EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` + echo "${UNAME_MACHINE}-pc-linux-${LIBC}" + exit ;; + ia64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + m32r*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + m68*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + mips:Linux:*:* | mips64:Linux:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #undef CPU + #undef ${UNAME_MACHINE} + #undef ${UNAME_MACHINE}el + #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) + CPU=${UNAME_MACHINE}el + #else + #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) + CPU=${UNAME_MACHINE} + #else + CPU= + #endif + #endif +EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` + test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } + ;; + or32:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + padre:Linux:*:*) + echo sparc-unknown-linux-gnu + exit ;; + parisc64:Linux:*:* | hppa64:Linux:*:*) + echo hppa64-unknown-linux-gnu + exit ;; + parisc:Linux:*:* | hppa:Linux:*:*) + # Look for CPU level + case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in + PA7*) echo hppa1.1-unknown-linux-gnu ;; + PA8*) echo hppa2.0-unknown-linux-gnu ;; + *) echo hppa-unknown-linux-gnu ;; + esac + exit ;; + ppc64:Linux:*:*) + echo powerpc64-unknown-linux-gnu + exit ;; + ppc:Linux:*:*) + echo powerpc-unknown-linux-gnu + exit ;; + s390:Linux:*:* | s390x:Linux:*:*) + echo ${UNAME_MACHINE}-ibm-linux + exit ;; + sh64*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + sh*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + sparc:Linux:*:* | sparc64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + tile*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + vax:Linux:*:*) + echo ${UNAME_MACHINE}-dec-linux-gnu + exit ;; + x86_64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + xtensa*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + i*86:DYNIX/ptx:4*:*) + # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. + # earlier versions are messed up and put the nodename in both + # sysname and nodename. + echo i386-sequent-sysv4 + exit ;; + i*86:UNIX_SV:4.2MP:2.*) + # Unixware is an offshoot of SVR4, but it has its own version + # number series starting with 2... + # I am not positive that other SVR4 systems won't match this, + # I just have to hope. -- rms. + # Use sysv4.2uw... so that sysv4* matches it. + echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} + exit ;; + i*86:OS/2:*:*) + # If we were able to find `uname', then EMX Unix compatibility + # is probably installed. + echo ${UNAME_MACHINE}-pc-os2-emx + exit ;; + i*86:XTS-300:*:STOP) + echo ${UNAME_MACHINE}-unknown-stop + exit ;; + i*86:atheos:*:*) + echo ${UNAME_MACHINE}-unknown-atheos + exit ;; + i*86:syllable:*:*) + echo ${UNAME_MACHINE}-pc-syllable + exit ;; + i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) + echo i386-unknown-lynxos${UNAME_RELEASE} + exit ;; + i*86:*DOS:*:*) + echo ${UNAME_MACHINE}-pc-msdosdjgpp + exit ;; + i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) + UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` + if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then + echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} + else + echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} + fi + exit ;; + i*86:*:5:[678]*) + # UnixWare 7.x, OpenUNIX and OpenServer 6. + case `/bin/uname -X | grep "^Machine"` in + *486*) UNAME_MACHINE=i486 ;; + *Pentium) UNAME_MACHINE=i586 ;; + *Pent*|*Celeron) UNAME_MACHINE=i686 ;; + esac + echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} + exit ;; + i*86:*:3.2:*) + if test -f /usr/options/cb.name; then + UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then + UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` + (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 + (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ + && UNAME_MACHINE=i586 + (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ + && UNAME_MACHINE=i686 + (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ + && UNAME_MACHINE=i686 + echo ${UNAME_MACHINE}-pc-sco$UNAME_REL + else + echo ${UNAME_MACHINE}-pc-sysv32 + fi + exit ;; + pc:*:*:*) + # Left here for compatibility: + # uname -m prints for DJGPP always 'pc', but it prints nothing about + # the processor, so we play safe by assuming i586. + # Note: whatever this is, it MUST be the same as what config.sub + # prints for the "djgpp" host, or else GDB configury will decide that + # this is a cross-build. + echo i586-pc-msdosdjgpp + exit ;; + Intel:Mach:3*:*) + echo i386-pc-mach3 + exit ;; + paragon:*:*:*) + echo i860-intel-osf1 + exit ;; + i860:*:4.*:*) # i860-SVR4 + if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then + echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 + else # Add other i860-SVR4 vendors below as they are discovered. + echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 + fi + exit ;; + mini*:CTIX:SYS*5:*) + # "miniframe" + echo m68010-convergent-sysv + exit ;; + mc68k:UNIX:SYSTEM5:3.51m) + echo m68k-convergent-sysv + exit ;; + M680?0:D-NIX:5.3:*) + echo m68k-diab-dnix + exit ;; + M68*:*:R3V[5678]*:*) + test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; + 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) + OS_REL='' + test -r /etc/.relid \ + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4.3${OS_REL}; exit; } + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; + 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4; exit; } ;; + NCR*:*:4.2:* | MPRAS*:*:4.2:*) + OS_REL='.3' + test -r /etc/.relid \ + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4.3${OS_REL}; exit; } + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } + /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; + m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) + echo m68k-unknown-lynxos${UNAME_RELEASE} + exit ;; + mc68030:UNIX_System_V:4.*:*) + echo m68k-atari-sysv4 + exit ;; + TSUNAMI:LynxOS:2.*:*) + echo sparc-unknown-lynxos${UNAME_RELEASE} + exit ;; + rs6000:LynxOS:2.*:*) + echo rs6000-unknown-lynxos${UNAME_RELEASE} + exit ;; + PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) + echo powerpc-unknown-lynxos${UNAME_RELEASE} + exit ;; + SM[BE]S:UNIX_SV:*:*) + echo mips-dde-sysv${UNAME_RELEASE} + exit ;; + RM*:ReliantUNIX-*:*:*) + echo mips-sni-sysv4 + exit ;; + RM*:SINIX-*:*:*) + echo mips-sni-sysv4 + exit ;; + *:SINIX-*:*:*) + if uname -p 2>/dev/null >/dev/null ; then + UNAME_MACHINE=`(uname -p) 2>/dev/null` + echo ${UNAME_MACHINE}-sni-sysv4 + else + echo ns32k-sni-sysv + fi + exit ;; + PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort + # says + echo i586-unisys-sysv4 + exit ;; + *:UNIX_System_V:4*:FTX*) + # From Gerald Hewes . + # How about differentiating between stratus architectures? -djm + echo hppa1.1-stratus-sysv4 + exit ;; + *:*:*:FTX*) + # From seanf@swdc.stratus.com. + echo i860-stratus-sysv4 + exit ;; + i*86:VOS:*:*) + # From Paul.Green@stratus.com. + echo ${UNAME_MACHINE}-stratus-vos + exit ;; + *:VOS:*:*) + # From Paul.Green@stratus.com. + echo hppa1.1-stratus-vos + exit ;; + mc68*:A/UX:*:*) + echo m68k-apple-aux${UNAME_RELEASE} + exit ;; + news*:NEWS-OS:6*:*) + echo mips-sony-newsos6 + exit ;; + R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) + if [ -d /usr/nec ]; then + echo mips-nec-sysv${UNAME_RELEASE} + else + echo mips-unknown-sysv${UNAME_RELEASE} + fi + exit ;; + BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. + echo powerpc-be-beos + exit ;; + BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. + echo powerpc-apple-beos + exit ;; + BePC:BeOS:*:*) # BeOS running on Intel PC compatible. + echo i586-pc-beos + exit ;; + BePC:Haiku:*:*) # Haiku running on Intel PC compatible. + echo i586-pc-haiku + exit ;; + SX-4:SUPER-UX:*:*) + echo sx4-nec-superux${UNAME_RELEASE} + exit ;; + SX-5:SUPER-UX:*:*) + echo sx5-nec-superux${UNAME_RELEASE} + exit ;; + SX-6:SUPER-UX:*:*) + echo sx6-nec-superux${UNAME_RELEASE} + exit ;; + SX-7:SUPER-UX:*:*) + echo sx7-nec-superux${UNAME_RELEASE} + exit ;; + SX-8:SUPER-UX:*:*) + echo sx8-nec-superux${UNAME_RELEASE} + exit ;; + SX-8R:SUPER-UX:*:*) + echo sx8r-nec-superux${UNAME_RELEASE} + exit ;; + Power*:Rhapsody:*:*) + echo powerpc-apple-rhapsody${UNAME_RELEASE} + exit ;; + *:Rhapsody:*:*) + echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} + exit ;; + *:Darwin:*:*) + UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown + case $UNAME_PROCESSOR in + i386) + eval $set_cc_for_build + if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then + if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + UNAME_PROCESSOR="x86_64" + fi + fi ;; + unknown) UNAME_PROCESSOR=powerpc ;; + esac + echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} + exit ;; + *:procnto*:*:* | *:QNX:[0123456789]*:*) + UNAME_PROCESSOR=`uname -p` + if test "$UNAME_PROCESSOR" = "x86"; then + UNAME_PROCESSOR=i386 + UNAME_MACHINE=pc + fi + echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} + exit ;; + *:QNX:*:4*) + echo i386-pc-qnx + exit ;; + NEO-?:NONSTOP_KERNEL:*:*) + echo neo-tandem-nsk${UNAME_RELEASE} + exit ;; + NSE-?:NONSTOP_KERNEL:*:*) + echo nse-tandem-nsk${UNAME_RELEASE} + exit ;; + NSR-?:NONSTOP_KERNEL:*:*) + echo nsr-tandem-nsk${UNAME_RELEASE} + exit ;; + *:NonStop-UX:*:*) + echo mips-compaq-nonstopux + exit ;; + BS2000:POSIX*:*:*) + echo bs2000-siemens-sysv + exit ;; + DS/*:UNIX_System_V:*:*) + echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} + exit ;; + *:Plan9:*:*) + # "uname -m" is not consistent, so use $cputype instead. 386 + # is converted to i386 for consistency with other x86 + # operating systems. + if test "$cputype" = "386"; then + UNAME_MACHINE=i386 + else + UNAME_MACHINE="$cputype" + fi + echo ${UNAME_MACHINE}-unknown-plan9 + exit ;; + *:TOPS-10:*:*) + echo pdp10-unknown-tops10 + exit ;; + *:TENEX:*:*) + echo pdp10-unknown-tenex + exit ;; + KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) + echo pdp10-dec-tops20 + exit ;; + XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) + echo pdp10-xkl-tops20 + exit ;; + *:TOPS-20:*:*) + echo pdp10-unknown-tops20 + exit ;; + *:ITS:*:*) + echo pdp10-unknown-its + exit ;; + SEI:*:*:SEIUX) + echo mips-sei-seiux${UNAME_RELEASE} + exit ;; + *:DragonFly:*:*) + echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` + exit ;; + *:*VMS:*:*) + UNAME_MACHINE=`(uname -p) 2>/dev/null` + case "${UNAME_MACHINE}" in + A*) echo alpha-dec-vms ; exit ;; + I*) echo ia64-dec-vms ; exit ;; + V*) echo vax-dec-vms ; exit ;; + esac ;; + *:XENIX:*:SysV) + echo i386-pc-xenix + exit ;; + i*86:skyos:*:*) + echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' + exit ;; + i*86:rdos:*:*) + echo ${UNAME_MACHINE}-pc-rdos + exit ;; + i*86:AROS:*:*) + echo ${UNAME_MACHINE}-pc-aros + exit ;; + x86_64:VMkernel:*:*) + echo ${UNAME_MACHINE}-unknown-esx + exit ;; +esac + +#echo '(No uname command or uname output not recognized.)' 1>&2 +#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 + +eval $set_cc_for_build +cat >$dummy.c < +# include +#endif +main () +{ +#if defined (sony) +#if defined (MIPSEB) + /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, + I don't know.... */ + printf ("mips-sony-bsd\n"); exit (0); +#else +#include + printf ("m68k-sony-newsos%s\n", +#ifdef NEWSOS4 + "4" +#else + "" +#endif + ); exit (0); +#endif +#endif + +#if defined (__arm) && defined (__acorn) && defined (__unix) + printf ("arm-acorn-riscix\n"); exit (0); +#endif + +#if defined (hp300) && !defined (hpux) + printf ("m68k-hp-bsd\n"); exit (0); +#endif + +#if defined (NeXT) +#if !defined (__ARCHITECTURE__) +#define __ARCHITECTURE__ "m68k" +#endif + int version; + version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; + if (version < 4) + printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); + else + printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); + exit (0); +#endif + +#if defined (MULTIMAX) || defined (n16) +#if defined (UMAXV) + printf ("ns32k-encore-sysv\n"); exit (0); +#else +#if defined (CMU) + printf ("ns32k-encore-mach\n"); exit (0); +#else + printf ("ns32k-encore-bsd\n"); exit (0); +#endif +#endif +#endif + +#if defined (__386BSD__) + printf ("i386-pc-bsd\n"); exit (0); +#endif + +#if defined (sequent) +#if defined (i386) + printf ("i386-sequent-dynix\n"); exit (0); +#endif +#if defined (ns32000) + printf ("ns32k-sequent-dynix\n"); exit (0); +#endif +#endif + +#if defined (_SEQUENT_) + struct utsname un; + + uname(&un); + + if (strncmp(un.version, "V2", 2) == 0) { + printf ("i386-sequent-ptx2\n"); exit (0); + } + if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ + printf ("i386-sequent-ptx1\n"); exit (0); + } + printf ("i386-sequent-ptx\n"); exit (0); + +#endif + +#if defined (vax) +# if !defined (ultrix) +# include +# if defined (BSD) +# if BSD == 43 + printf ("vax-dec-bsd4.3\n"); exit (0); +# else +# if BSD == 199006 + printf ("vax-dec-bsd4.3reno\n"); exit (0); +# else + printf ("vax-dec-bsd\n"); exit (0); +# endif +# endif +# else + printf ("vax-dec-bsd\n"); exit (0); +# endif +# else + printf ("vax-dec-ultrix\n"); exit (0); +# endif +#endif + +#if defined (alliant) && defined (i860) + printf ("i860-alliant-bsd\n"); exit (0); +#endif + + exit (1); +} +EOF + +$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && + { echo "$SYSTEM_NAME"; exit; } + +# Apollos put the system type in the environment. + +test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } + +# Convex versions that predate uname can use getsysinfo(1) + +if [ -x /usr/convex/getsysinfo ] +then + case `getsysinfo -f cpu_type` in + c1*) + echo c1-convex-bsd + exit ;; + c2*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit ;; + c34*) + echo c34-convex-bsd + exit ;; + c38*) + echo c38-convex-bsd + exit ;; + c4*) + echo c4-convex-bsd + exit ;; + esac +fi + +cat >&2 < in order to provide the needed +information to handle your system. + +config.guess timestamp = $timestamp + +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null` + +hostinfo = `(hostinfo) 2>/dev/null` +/bin/universe = `(/bin/universe) 2>/dev/null` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` +/bin/arch = `(/bin/arch) 2>/dev/null` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` + +UNAME_MACHINE = ${UNAME_MACHINE} +UNAME_RELEASE = ${UNAME_RELEASE} +UNAME_SYSTEM = ${UNAME_SYSTEM} +UNAME_VERSION = ${UNAME_VERSION} +EOF + +exit 1 + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff --git a/vendor/most-5.1.0/autoconf/config.sub b/vendor/most-5.1.0/autoconf/config.sub new file mode 100755 index 0000000..6205f84 --- /dev/null +++ b/vendor/most-5.1.0/autoconf/config.sub @@ -0,0 +1,1782 @@ +#! /bin/sh +# Configuration validation subroutine script. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, +# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, +# 2011, 2012 Free Software Foundation, Inc. + +timestamp='2012-04-18' + +# 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, see . +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + + +# Please send patches to . Submit a context +# diff and a properly formatted GNU ChangeLog entry. +# +# Configuration subroutine to validate and canonicalize a configuration type. +# Supply the specified configuration type as an argument. +# If it is invalid, we print an error message on stderr and exit with code 1. +# Otherwise, we print the canonical config type on stdout and succeed. + +# You can get the latest version of this script from: +# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD + +# This file is supposed to be the same for all GNU packages +# and recognize all the CPU types, system types and aliases +# that are meaningful with *any* GNU software. +# Each package is responsible for reporting which valid configurations +# it does not support. The user should be able to distinguish +# a failure to support a valid configuration from a meaningless +# configuration. + +# The goal of this file is to map all the various variations of a given +# machine specification into a single specification in the form: +# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM +# or in some cases, the newer four-part form: +# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM +# It is wrong to echo any other type of specification. + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] CPU-MFR-OPSYS + $0 [OPTION] ALIAS + +Canonicalize a configuration name. + +Operation modes: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to ." + +version="\ +GNU config.sub ($timestamp) + +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, +2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 +Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit ;; + --version | -v ) + echo "$version" ; exit ;; + --help | --h* | -h ) + echo "$usage"; exit ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" + exit 1 ;; + + *local*) + # First pass through any local machine types. + echo $1 + exit ;; + + * ) + break ;; + esac +done + +case $# in + 0) echo "$me: missing argument$help" >&2 + exit 1;; + 1) ;; + *) echo "$me: too many arguments$help" >&2 + exit 1;; +esac + +# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). +# Here we must recognize all the valid KERNEL-OS combinations. +maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` +case $maybe_os in + nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ + linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ + knetbsd*-gnu* | netbsd*-gnu* | \ + kopensolaris*-gnu* | \ + storm-chaos* | os2-emx* | rtmk-nova*) + os=-$maybe_os + basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` + ;; + android-linux) + os=-linux-android + basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown + ;; + *) + basic_machine=`echo $1 | sed 's/-[^-]*$//'` + if [ $basic_machine != $1 ] + then os=`echo $1 | sed 's/.*-/-/'` + else os=; fi + ;; +esac + +### Let's recognize common machines as not being operating systems so +### that things like config.sub decstation-3100 work. We also +### recognize some manufacturers as not being operating systems, so we +### can provide default operating systems below. +case $os in + -sun*os*) + # Prevent following clause from handling this invalid input. + ;; + -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ + -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ + -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ + -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ + -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ + -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ + -apple | -axis | -knuth | -cray | -microblaze) + os= + basic_machine=$1 + ;; + -bluegene*) + os=-cnk + ;; + -sim | -cisco | -oki | -wec | -winbond) + os= + basic_machine=$1 + ;; + -scout) + ;; + -wrs) + os=-vxworks + basic_machine=$1 + ;; + -chorusos*) + os=-chorusos + basic_machine=$1 + ;; + -chorusrdb) + os=-chorusrdb + basic_machine=$1 + ;; + -hiux*) + os=-hiuxwe2 + ;; + -sco6) + os=-sco5v6 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco5) + os=-sco3.2v5 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco4) + os=-sco3.2v4 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2.[4-9]*) + os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2v[4-9]*) + # Don't forget version if it is 3.2v4 or newer. + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco5v6*) + # Don't forget version if it is 3.2v4 or newer. + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco*) + os=-sco3.2v2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -udk*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -isc) + os=-isc2.2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -clix*) + basic_machine=clipper-intergraph + ;; + -isc*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -lynx*178) + os=-lynxos178 + ;; + -lynx*5) + os=-lynxos5 + ;; + -lynx*) + os=-lynxos + ;; + -ptx*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` + ;; + -windowsnt*) + os=`echo $os | sed -e 's/windowsnt/winnt/'` + ;; + -psos*) + os=-psos + ;; + -mint | -mint[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; +esac + +# Decode aliases for certain CPU-COMPANY combinations. +case $basic_machine in + # Recognize the basic CPU types without company name. + # Some are omitted here because they have special meanings below. + 1750a | 580 \ + | a29k \ + | aarch64 | aarch64_be \ + | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ + | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ + | am33_2.0 \ + | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ + | be32 | be64 \ + | bfin \ + | c4x | clipper \ + | d10v | d30v | dlx | dsp16xx \ + | epiphany \ + | fido | fr30 | frv \ + | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ + | hexagon \ + | i370 | i860 | i960 | ia64 \ + | ip2k | iq2000 \ + | le32 | le64 \ + | lm32 \ + | m32c | m32r | m32rle | m68000 | m68k | m88k \ + | maxq | mb | microblaze | mcore | mep | metag \ + | mips | mipsbe | mipseb | mipsel | mipsle \ + | mips16 \ + | mips64 | mips64el \ + | mips64octeon | mips64octeonel \ + | mips64orion | mips64orionel \ + | mips64r5900 | mips64r5900el \ + | mips64vr | mips64vrel \ + | mips64vr4100 | mips64vr4100el \ + | mips64vr4300 | mips64vr4300el \ + | mips64vr5000 | mips64vr5000el \ + | mips64vr5900 | mips64vr5900el \ + | mipsisa32 | mipsisa32el \ + | mipsisa32r2 | mipsisa32r2el \ + | mipsisa64 | mipsisa64el \ + | mipsisa64r2 | mipsisa64r2el \ + | mipsisa64sb1 | mipsisa64sb1el \ + | mipsisa64sr71k | mipsisa64sr71kel \ + | mipstx39 | mipstx39el \ + | mn10200 | mn10300 \ + | moxie \ + | mt \ + | msp430 \ + | nds32 | nds32le | nds32be \ + | nios | nios2 \ + | ns16k | ns32k \ + | open8 \ + | or32 \ + | pdp10 | pdp11 | pj | pjl \ + | powerpc | powerpc64 | powerpc64le | powerpcle \ + | pyramid \ + | rl78 | rx \ + | score \ + | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ + | sh64 | sh64le \ + | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ + | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ + | spu \ + | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ + | ubicom32 \ + | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ + | we32k \ + | x86 | xc16x | xstormy16 | xtensa \ + | z8k | z80) + basic_machine=$basic_machine-unknown + ;; + c54x) + basic_machine=tic54x-unknown + ;; + c55x) + basic_machine=tic55x-unknown + ;; + c6x) + basic_machine=tic6x-unknown + ;; + m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | picochip) + basic_machine=$basic_machine-unknown + os=-none + ;; + m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) + ;; + ms1) + basic_machine=mt-unknown + ;; + + strongarm | thumb | xscale) + basic_machine=arm-unknown + ;; + xgate) + basic_machine=$basic_machine-unknown + os=-none + ;; + xscaleeb) + basic_machine=armeb-unknown + ;; + + xscaleel) + basic_machine=armel-unknown + ;; + + # We use `pc' rather than `unknown' + # because (1) that's what they normally are, and + # (2) the word "unknown" tends to confuse beginning users. + i*86 | x86_64) + basic_machine=$basic_machine-pc + ;; + # Object if more than one company name word. + *-*-*) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; + # Recognize the basic CPU types with company name. + 580-* \ + | a29k-* \ + | aarch64-* | aarch64_be-* \ + | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ + | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ + | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ + | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ + | avr-* | avr32-* \ + | be32-* | be64-* \ + | bfin-* | bs2000-* \ + | c[123]* | c30-* | [cjt]90-* | c4x-* \ + | clipper-* | craynv-* | cydra-* \ + | d10v-* | d30v-* | dlx-* \ + | elxsi-* \ + | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ + | h8300-* | h8500-* \ + | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ + | hexagon-* \ + | i*86-* | i860-* | i960-* | ia64-* \ + | ip2k-* | iq2000-* \ + | le32-* | le64-* \ + | lm32-* \ + | m32c-* | m32r-* | m32rle-* \ + | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ + | m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \ + | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ + | mips16-* \ + | mips64-* | mips64el-* \ + | mips64octeon-* | mips64octeonel-* \ + | mips64orion-* | mips64orionel-* \ + | mips64r5900-* | mips64r5900el-* \ + | mips64vr-* | mips64vrel-* \ + | mips64vr4100-* | mips64vr4100el-* \ + | mips64vr4300-* | mips64vr4300el-* \ + | mips64vr5000-* | mips64vr5000el-* \ + | mips64vr5900-* | mips64vr5900el-* \ + | mipsisa32-* | mipsisa32el-* \ + | mipsisa32r2-* | mipsisa32r2el-* \ + | mipsisa64-* | mipsisa64el-* \ + | mipsisa64r2-* | mipsisa64r2el-* \ + | mipsisa64sb1-* | mipsisa64sb1el-* \ + | mipsisa64sr71k-* | mipsisa64sr71kel-* \ + | mipstx39-* | mipstx39el-* \ + | mmix-* \ + | mt-* \ + | msp430-* \ + | nds32-* | nds32le-* | nds32be-* \ + | nios-* | nios2-* \ + | none-* | np1-* | ns16k-* | ns32k-* \ + | open8-* \ + | orion-* \ + | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ + | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ + | pyramid-* \ + | rl78-* | romp-* | rs6000-* | rx-* \ + | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ + | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ + | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ + | sparclite-* \ + | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \ + | tahoe-* \ + | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ + | tile*-* \ + | tron-* \ + | ubicom32-* \ + | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ + | vax-* \ + | we32k-* \ + | x86-* | x86_64-* | xc16x-* | xps100-* \ + | xstormy16-* | xtensa*-* \ + | ymp-* \ + | z8k-* | z80-*) + ;; + # Recognize the basic CPU types without company name, with glob match. + xtensa*) + basic_machine=$basic_machine-unknown + ;; + # Recognize the various machine names and aliases which stand + # for a CPU type and a company and sometimes even an OS. + 386bsd) + basic_machine=i386-unknown + os=-bsd + ;; + 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) + basic_machine=m68000-att + ;; + 3b*) + basic_machine=we32k-att + ;; + a29khif) + basic_machine=a29k-amd + os=-udi + ;; + abacus) + basic_machine=abacus-unknown + ;; + adobe68k) + basic_machine=m68010-adobe + os=-scout + ;; + alliant | fx80) + basic_machine=fx80-alliant + ;; + altos | altos3068) + basic_machine=m68k-altos + ;; + am29k) + basic_machine=a29k-none + os=-bsd + ;; + amd64) + basic_machine=x86_64-pc + ;; + amd64-*) + basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + amdahl) + basic_machine=580-amdahl + os=-sysv + ;; + amiga | amiga-*) + basic_machine=m68k-unknown + ;; + amigaos | amigados) + basic_machine=m68k-unknown + os=-amigaos + ;; + amigaunix | amix) + basic_machine=m68k-unknown + os=-sysv4 + ;; + apollo68) + basic_machine=m68k-apollo + os=-sysv + ;; + apollo68bsd) + basic_machine=m68k-apollo + os=-bsd + ;; + aros) + basic_machine=i386-pc + os=-aros + ;; + aux) + basic_machine=m68k-apple + os=-aux + ;; + balance) + basic_machine=ns32k-sequent + os=-dynix + ;; + blackfin) + basic_machine=bfin-unknown + os=-linux + ;; + blackfin-*) + basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` + os=-linux + ;; + bluegene*) + basic_machine=powerpc-ibm + os=-cnk + ;; + c54x-*) + basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + c55x-*) + basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + c6x-*) + basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + c90) + basic_machine=c90-cray + os=-unicos + ;; + cegcc) + basic_machine=arm-unknown + os=-cegcc + ;; + convex-c1) + basic_machine=c1-convex + os=-bsd + ;; + convex-c2) + basic_machine=c2-convex + os=-bsd + ;; + convex-c32) + basic_machine=c32-convex + os=-bsd + ;; + convex-c34) + basic_machine=c34-convex + os=-bsd + ;; + convex-c38) + basic_machine=c38-convex + os=-bsd + ;; + cray | j90) + basic_machine=j90-cray + os=-unicos + ;; + craynv) + basic_machine=craynv-cray + os=-unicosmp + ;; + cr16 | cr16-*) + basic_machine=cr16-unknown + os=-elf + ;; + crds | unos) + basic_machine=m68k-crds + ;; + crisv32 | crisv32-* | etraxfs*) + basic_machine=crisv32-axis + ;; + cris | cris-* | etrax*) + basic_machine=cris-axis + ;; + crx) + basic_machine=crx-unknown + os=-elf + ;; + da30 | da30-*) + basic_machine=m68k-da30 + ;; + decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) + basic_machine=mips-dec + ;; + decsystem10* | dec10*) + basic_machine=pdp10-dec + os=-tops10 + ;; + decsystem20* | dec20*) + basic_machine=pdp10-dec + os=-tops20 + ;; + delta | 3300 | motorola-3300 | motorola-delta \ + | 3300-motorola | delta-motorola) + basic_machine=m68k-motorola + ;; + delta88) + basic_machine=m88k-motorola + os=-sysv3 + ;; + dicos) + basic_machine=i686-pc + os=-dicos + ;; + djgpp) + basic_machine=i586-pc + os=-msdosdjgpp + ;; + dpx20 | dpx20-*) + basic_machine=rs6000-bull + os=-bosx + ;; + dpx2* | dpx2*-bull) + basic_machine=m68k-bull + os=-sysv3 + ;; + ebmon29k) + basic_machine=a29k-amd + os=-ebmon + ;; + elxsi) + basic_machine=elxsi-elxsi + os=-bsd + ;; + encore | umax | mmax) + basic_machine=ns32k-encore + ;; + es1800 | OSE68k | ose68k | ose | OSE) + basic_machine=m68k-ericsson + os=-ose + ;; + fx2800) + basic_machine=i860-alliant + ;; + genix) + basic_machine=ns32k-ns + ;; + gmicro) + basic_machine=tron-gmicro + os=-sysv + ;; + go32) + basic_machine=i386-pc + os=-go32 + ;; + h3050r* | hiux*) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + h8300hms) + basic_machine=h8300-hitachi + os=-hms + ;; + h8300xray) + basic_machine=h8300-hitachi + os=-xray + ;; + h8500hms) + basic_machine=h8500-hitachi + os=-hms + ;; + harris) + basic_machine=m88k-harris + os=-sysv3 + ;; + hp300-*) + basic_machine=m68k-hp + ;; + hp300bsd) + basic_machine=m68k-hp + os=-bsd + ;; + hp300hpux) + basic_machine=m68k-hp + os=-hpux + ;; + hp3k9[0-9][0-9] | hp9[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k2[0-9][0-9] | hp9k31[0-9]) + basic_machine=m68000-hp + ;; + hp9k3[2-9][0-9]) + basic_machine=m68k-hp + ;; + hp9k6[0-9][0-9] | hp6[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k7[0-79][0-9] | hp7[0-79][0-9]) + basic_machine=hppa1.1-hp + ;; + hp9k78[0-9] | hp78[0-9]) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][13679] | hp8[0-9][13679]) + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][0-9] | hp8[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hppa-next) + os=-nextstep3 + ;; + hppaosf) + basic_machine=hppa1.1-hp + os=-osf + ;; + hppro) + basic_machine=hppa1.1-hp + os=-proelf + ;; + i370-ibm* | ibm*) + basic_machine=i370-ibm + ;; + i*86v32) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv32 + ;; + i*86v4*) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv4 + ;; + i*86v) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv + ;; + i*86sol2) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-solaris2 + ;; + i386mach) + basic_machine=i386-mach + os=-mach + ;; + i386-vsta | vsta) + basic_machine=i386-unknown + os=-vsta + ;; + iris | iris4d) + basic_machine=mips-sgi + case $os in + -irix*) + ;; + *) + os=-irix4 + ;; + esac + ;; + isi68 | isi) + basic_machine=m68k-isi + os=-sysv + ;; + m68knommu) + basic_machine=m68k-unknown + os=-linux + ;; + m68knommu-*) + basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` + os=-linux + ;; + m88k-omron*) + basic_machine=m88k-omron + ;; + magnum | m3230) + basic_machine=mips-mips + os=-sysv + ;; + merlin) + basic_machine=ns32k-utek + os=-sysv + ;; + microblaze) + basic_machine=microblaze-xilinx + ;; + mingw32) + basic_machine=i386-pc + os=-mingw32 + ;; + mingw32ce) + basic_machine=arm-unknown + os=-mingw32ce + ;; + miniframe) + basic_machine=m68000-convergent + ;; + *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; + mips3*-*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` + ;; + mips3*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown + ;; + monitor) + basic_machine=m68k-rom68k + os=-coff + ;; + morphos) + basic_machine=powerpc-unknown + os=-morphos + ;; + msdos) + basic_machine=i386-pc + os=-msdos + ;; + ms1-*) + basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` + ;; + msys) + basic_machine=i386-pc + os=-msys + ;; + mvs) + basic_machine=i370-ibm + os=-mvs + ;; + nacl) + basic_machine=le32-unknown + os=-nacl + ;; + ncr3000) + basic_machine=i486-ncr + os=-sysv4 + ;; + netbsd386) + basic_machine=i386-unknown + os=-netbsd + ;; + netwinder) + basic_machine=armv4l-rebel + os=-linux + ;; + news | news700 | news800 | news900) + basic_machine=m68k-sony + os=-newsos + ;; + news1000) + basic_machine=m68030-sony + os=-newsos + ;; + news-3600 | risc-news) + basic_machine=mips-sony + os=-newsos + ;; + necv70) + basic_machine=v70-nec + os=-sysv + ;; + next | m*-next ) + basic_machine=m68k-next + case $os in + -nextstep* ) + ;; + -ns2*) + os=-nextstep2 + ;; + *) + os=-nextstep3 + ;; + esac + ;; + nh3000) + basic_machine=m68k-harris + os=-cxux + ;; + nh[45]000) + basic_machine=m88k-harris + os=-cxux + ;; + nindy960) + basic_machine=i960-intel + os=-nindy + ;; + mon960) + basic_machine=i960-intel + os=-mon960 + ;; + nonstopux) + basic_machine=mips-compaq + os=-nonstopux + ;; + np1) + basic_machine=np1-gould + ;; + neo-tandem) + basic_machine=neo-tandem + ;; + nse-tandem) + basic_machine=nse-tandem + ;; + nsr-tandem) + basic_machine=nsr-tandem + ;; + op50n-* | op60c-*) + basic_machine=hppa1.1-oki + os=-proelf + ;; + openrisc | openrisc-*) + basic_machine=or32-unknown + ;; + os400) + basic_machine=powerpc-ibm + os=-os400 + ;; + OSE68000 | ose68000) + basic_machine=m68000-ericsson + os=-ose + ;; + os68k) + basic_machine=m68k-none + os=-os68k + ;; + pa-hitachi) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + paragon) + basic_machine=i860-intel + os=-osf + ;; + parisc) + basic_machine=hppa-unknown + os=-linux + ;; + parisc-*) + basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` + os=-linux + ;; + pbd) + basic_machine=sparc-tti + ;; + pbb) + basic_machine=m68k-tti + ;; + pc532 | pc532-*) + basic_machine=ns32k-pc532 + ;; + pc98) + basic_machine=i386-pc + ;; + pc98-*) + basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentium | p5 | k5 | k6 | nexgen | viac3) + basic_machine=i586-pc + ;; + pentiumpro | p6 | 6x86 | athlon | athlon_*) + basic_machine=i686-pc + ;; + pentiumii | pentium2 | pentiumiii | pentium3) + basic_machine=i686-pc + ;; + pentium4) + basic_machine=i786-pc + ;; + pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) + basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumpro-* | p6-* | 6x86-* | athlon-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentium4-*) + basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pn) + basic_machine=pn-gould + ;; + power) basic_machine=power-ibm + ;; + ppc | ppcbe) basic_machine=powerpc-unknown + ;; + ppc-* | ppcbe-*) + basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppcle | powerpclittle | ppc-le | powerpc-little) + basic_machine=powerpcle-unknown + ;; + ppcle-* | powerpclittle-*) + basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppc64) basic_machine=powerpc64-unknown + ;; + ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppc64le | powerpc64little | ppc64-le | powerpc64-little) + basic_machine=powerpc64le-unknown + ;; + ppc64le-* | powerpc64little-*) + basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ps2) + basic_machine=i386-ibm + ;; + pw32) + basic_machine=i586-unknown + os=-pw32 + ;; + rdos) + basic_machine=i386-pc + os=-rdos + ;; + rom68k) + basic_machine=m68k-rom68k + os=-coff + ;; + rm[46]00) + basic_machine=mips-siemens + ;; + rtpc | rtpc-*) + basic_machine=romp-ibm + ;; + s390 | s390-*) + basic_machine=s390-ibm + ;; + s390x | s390x-*) + basic_machine=s390x-ibm + ;; + sa29200) + basic_machine=a29k-amd + os=-udi + ;; + sb1) + basic_machine=mipsisa64sb1-unknown + ;; + sb1el) + basic_machine=mipsisa64sb1el-unknown + ;; + sde) + basic_machine=mipsisa32-sde + os=-elf + ;; + sei) + basic_machine=mips-sei + os=-seiux + ;; + sequent) + basic_machine=i386-sequent + ;; + sh) + basic_machine=sh-hitachi + os=-hms + ;; + sh5el) + basic_machine=sh5le-unknown + ;; + sh64) + basic_machine=sh64-unknown + ;; + sparclite-wrs | simso-wrs) + basic_machine=sparclite-wrs + os=-vxworks + ;; + sps7) + basic_machine=m68k-bull + os=-sysv2 + ;; + spur) + basic_machine=spur-unknown + ;; + st2000) + basic_machine=m68k-tandem + ;; + stratus) + basic_machine=i860-stratus + os=-sysv4 + ;; + strongarm-* | thumb-*) + basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + sun2) + basic_machine=m68000-sun + ;; + sun2os3) + basic_machine=m68000-sun + os=-sunos3 + ;; + sun2os4) + basic_machine=m68000-sun + os=-sunos4 + ;; + sun3os3) + basic_machine=m68k-sun + os=-sunos3 + ;; + sun3os4) + basic_machine=m68k-sun + os=-sunos4 + ;; + sun4os3) + basic_machine=sparc-sun + os=-sunos3 + ;; + sun4os4) + basic_machine=sparc-sun + os=-sunos4 + ;; + sun4sol2) + basic_machine=sparc-sun + os=-solaris2 + ;; + sun3 | sun3-*) + basic_machine=m68k-sun + ;; + sun4) + basic_machine=sparc-sun + ;; + sun386 | sun386i | roadrunner) + basic_machine=i386-sun + ;; + sv1) + basic_machine=sv1-cray + os=-unicos + ;; + symmetry) + basic_machine=i386-sequent + os=-dynix + ;; + t3e) + basic_machine=alphaev5-cray + os=-unicos + ;; + t90) + basic_machine=t90-cray + os=-unicos + ;; + tile*) + basic_machine=$basic_machine-unknown + os=-linux-gnu + ;; + tx39) + basic_machine=mipstx39-unknown + ;; + tx39el) + basic_machine=mipstx39el-unknown + ;; + toad1) + basic_machine=pdp10-xkl + os=-tops20 + ;; + tower | tower-32) + basic_machine=m68k-ncr + ;; + tpf) + basic_machine=s390x-ibm + os=-tpf + ;; + udi29k) + basic_machine=a29k-amd + os=-udi + ;; + ultra3) + basic_machine=a29k-nyu + os=-sym1 + ;; + v810 | necv810) + basic_machine=v810-nec + os=-none + ;; + vaxv) + basic_machine=vax-dec + os=-sysv + ;; + vms) + basic_machine=vax-dec + os=-vms + ;; + vpp*|vx|vx-*) + basic_machine=f301-fujitsu + ;; + vxworks960) + basic_machine=i960-wrs + os=-vxworks + ;; + vxworks68) + basic_machine=m68k-wrs + os=-vxworks + ;; + vxworks29k) + basic_machine=a29k-wrs + os=-vxworks + ;; + w65*) + basic_machine=w65-wdc + os=-none + ;; + w89k-*) + basic_machine=hppa1.1-winbond + os=-proelf + ;; + xbox) + basic_machine=i686-pc + os=-mingw32 + ;; + xps | xps100) + basic_machine=xps100-honeywell + ;; + xscale-* | xscalee[bl]-*) + basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'` + ;; + ymp) + basic_machine=ymp-cray + os=-unicos + ;; + z8k-*-coff) + basic_machine=z8k-unknown + os=-sim + ;; + z80-*-coff) + basic_machine=z80-unknown + os=-sim + ;; + none) + basic_machine=none-none + os=-none + ;; + +# Here we handle the default manufacturer of certain CPU types. It is in +# some cases the only manufacturer, in others, it is the most popular. + w89k) + basic_machine=hppa1.1-winbond + ;; + op50n) + basic_machine=hppa1.1-oki + ;; + op60c) + basic_machine=hppa1.1-oki + ;; + romp) + basic_machine=romp-ibm + ;; + mmix) + basic_machine=mmix-knuth + ;; + rs6000) + basic_machine=rs6000-ibm + ;; + vax) + basic_machine=vax-dec + ;; + pdp10) + # there are many clones, so DEC is not a safe bet + basic_machine=pdp10-unknown + ;; + pdp11) + basic_machine=pdp11-dec + ;; + we32k) + basic_machine=we32k-att + ;; + sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) + basic_machine=sh-unknown + ;; + sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) + basic_machine=sparc-sun + ;; + cydra) + basic_machine=cydra-cydrome + ;; + orion) + basic_machine=orion-highlevel + ;; + orion105) + basic_machine=clipper-highlevel + ;; + mac | mpw | mac-mpw) + basic_machine=m68k-apple + ;; + pmac | pmac-mpw) + basic_machine=powerpc-apple + ;; + *-unknown) + # Make sure to match an already-canonicalized machine name. + ;; + *) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; +esac + +# Here we canonicalize certain aliases for manufacturers. +case $basic_machine in + *-digital*) + basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` + ;; + *-commodore*) + basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` + ;; + *) + ;; +esac + +# Decode manufacturer-specific aliases for certain operating systems. + +if [ x"$os" != x"" ] +then +case $os in + # First match some system type aliases + # that might get confused with valid system types. + # -solaris* is a basic system type, with this one exception. + -auroraux) + os=-auroraux + ;; + -solaris1 | -solaris1.*) + os=`echo $os | sed -e 's|solaris1|sunos4|'` + ;; + -solaris) + os=-solaris2 + ;; + -svr4*) + os=-sysv4 + ;; + -unixware*) + os=-sysv4.2uw + ;; + -gnu/linux*) + os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` + ;; + # First accept the basic system types. + # The portable systems comes first. + # Each alternative MUST END IN A *, to match a version number. + # -sysv* is not here because it comes later, after sysvr4. + -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ + | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ + | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ + | -sym* | -kopensolaris* \ + | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ + | -aos* | -aros* \ + | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ + | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ + | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ + | -openbsd* | -solidbsd* \ + | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ + | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ + | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ + | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ + | -chorusos* | -chorusrdb* | -cegcc* \ + | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ + | -mingw32* | -linux-gnu* | -linux-android* \ + | -linux-newlib* | -linux-uclibc* \ + | -uxpv* | -beos* | -mpeix* | -udk* \ + | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ + | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ + | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ + | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ + | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ + | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ + | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*) + # Remember, each alternative MUST END IN *, to match a version number. + ;; + -qnx*) + case $basic_machine in + x86-* | i*86-*) + ;; + *) + os=-nto$os + ;; + esac + ;; + -nto-qnx*) + ;; + -nto*) + os=`echo $os | sed -e 's|nto|nto-qnx|'` + ;; + -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ + | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ + | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) + ;; + -mac*) + os=`echo $os | sed -e 's|mac|macos|'` + ;; + -linux-dietlibc) + os=-linux-dietlibc + ;; + -linux*) + os=`echo $os | sed -e 's|linux|linux-gnu|'` + ;; + -sunos5*) + os=`echo $os | sed -e 's|sunos5|solaris2|'` + ;; + -sunos6*) + os=`echo $os | sed -e 's|sunos6|solaris3|'` + ;; + -opened*) + os=-openedition + ;; + -os400*) + os=-os400 + ;; + -wince*) + os=-wince + ;; + -osfrose*) + os=-osfrose + ;; + -osf*) + os=-osf + ;; + -utek*) + os=-bsd + ;; + -dynix*) + os=-bsd + ;; + -acis*) + os=-aos + ;; + -atheos*) + os=-atheos + ;; + -syllable*) + os=-syllable + ;; + -386bsd) + os=-bsd + ;; + -ctix* | -uts*) + os=-sysv + ;; + -nova*) + os=-rtmk-nova + ;; + -ns2 ) + os=-nextstep2 + ;; + -nsk*) + os=-nsk + ;; + # Preserve the version number of sinix5. + -sinix5.*) + os=`echo $os | sed -e 's|sinix|sysv|'` + ;; + -sinix*) + os=-sysv4 + ;; + -tpf*) + os=-tpf + ;; + -triton*) + os=-sysv3 + ;; + -oss*) + os=-sysv3 + ;; + -svr4) + os=-sysv4 + ;; + -svr3) + os=-sysv3 + ;; + -sysvr4) + os=-sysv4 + ;; + # This must come after -sysvr4. + -sysv*) + ;; + -ose*) + os=-ose + ;; + -es1800*) + os=-ose + ;; + -xenix) + os=-xenix + ;; + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + os=-mint + ;; + -aros*) + os=-aros + ;; + -kaos*) + os=-kaos + ;; + -zvmoe) + os=-zvmoe + ;; + -dicos*) + os=-dicos + ;; + -nacl*) + ;; + -none) + ;; + *) + # Get rid of the `-' at the beginning of $os. + os=`echo $os | sed 's/[^-]*-//'` + echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 + exit 1 + ;; +esac +else + +# Here we handle the default operating systems that come with various machines. +# The value should be what the vendor currently ships out the door with their +# machine or put another way, the most popular os provided with the machine. + +# Note that if you're going to try to match "-MANUFACTURER" here (say, +# "-sun"), then you have to tell the case statement up towards the top +# that MANUFACTURER isn't an operating system. Otherwise, code above +# will signal an error saying that MANUFACTURER isn't an operating +# system, and we'll never get to this point. + +case $basic_machine in + score-*) + os=-elf + ;; + spu-*) + os=-elf + ;; + *-acorn) + os=-riscix1.2 + ;; + arm*-rebel) + os=-linux + ;; + arm*-semi) + os=-aout + ;; + c4x-* | tic4x-*) + os=-coff + ;; + hexagon-*) + os=-elf + ;; + tic54x-*) + os=-coff + ;; + tic55x-*) + os=-coff + ;; + tic6x-*) + os=-coff + ;; + # This must come before the *-dec entry. + pdp10-*) + os=-tops20 + ;; + pdp11-*) + os=-none + ;; + *-dec | vax-*) + os=-ultrix4.2 + ;; + m68*-apollo) + os=-domain + ;; + i386-sun) + os=-sunos4.0.2 + ;; + m68000-sun) + os=-sunos3 + ;; + m68*-cisco) + os=-aout + ;; + mep-*) + os=-elf + ;; + mips*-cisco) + os=-elf + ;; + mips*-*) + os=-elf + ;; + or32-*) + os=-coff + ;; + *-tti) # must be before sparc entry or we get the wrong os. + os=-sysv3 + ;; + sparc-* | *-sun) + os=-sunos4.1.1 + ;; + *-be) + os=-beos + ;; + *-haiku) + os=-haiku + ;; + *-ibm) + os=-aix + ;; + *-knuth) + os=-mmixware + ;; + *-wec) + os=-proelf + ;; + *-winbond) + os=-proelf + ;; + *-oki) + os=-proelf + ;; + *-hp) + os=-hpux + ;; + *-hitachi) + os=-hiux + ;; + i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) + os=-sysv + ;; + *-cbm) + os=-amigaos + ;; + *-dg) + os=-dgux + ;; + *-dolphin) + os=-sysv3 + ;; + m68k-ccur) + os=-rtu + ;; + m88k-omron*) + os=-luna + ;; + *-next ) + os=-nextstep + ;; + *-sequent) + os=-ptx + ;; + *-crds) + os=-unos + ;; + *-ns) + os=-genix + ;; + i370-*) + os=-mvs + ;; + *-next) + os=-nextstep3 + ;; + *-gould) + os=-sysv + ;; + *-highlevel) + os=-bsd + ;; + *-encore) + os=-bsd + ;; + *-sgi) + os=-irix + ;; + *-siemens) + os=-sysv4 + ;; + *-masscomp) + os=-rtu + ;; + f30[01]-fujitsu | f700-fujitsu) + os=-uxpv + ;; + *-rom68k) + os=-coff + ;; + *-*bug) + os=-coff + ;; + *-apple) + os=-macos + ;; + *-atari*) + os=-mint + ;; + *) + os=-none + ;; +esac +fi + +# Here we handle the case where we know the os, and the CPU type, but not the +# manufacturer. We pick the logical manufacturer. +vendor=unknown +case $basic_machine in + *-unknown) + case $os in + -riscix*) + vendor=acorn + ;; + -sunos*) + vendor=sun + ;; + -cnk*|-aix*) + vendor=ibm + ;; + -beos*) + vendor=be + ;; + -hpux*) + vendor=hp + ;; + -mpeix*) + vendor=hp + ;; + -hiux*) + vendor=hitachi + ;; + -unos*) + vendor=crds + ;; + -dgux*) + vendor=dg + ;; + -luna*) + vendor=omron + ;; + -genix*) + vendor=ns + ;; + -mvs* | -opened*) + vendor=ibm + ;; + -os400*) + vendor=ibm + ;; + -ptx*) + vendor=sequent + ;; + -tpf*) + vendor=ibm + ;; + -vxsim* | -vxworks* | -windiss*) + vendor=wrs + ;; + -aux*) + vendor=apple + ;; + -hms*) + vendor=hitachi + ;; + -mpw* | -macos*) + vendor=apple + ;; + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + vendor=atari + ;; + -vos*) + vendor=stratus + ;; + esac + basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` + ;; +esac + +echo $basic_machine$os +exit + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff --git a/vendor/most-5.1.0/autoconf/configure.ac b/vendor/most-5.1.0/autoconf/configure.ac new file mode 100644 index 0000000..cf099ca --- /dev/null +++ b/vendor/most-5.1.0/autoconf/configure.ac @@ -0,0 +1,76 @@ +dnl -*- sh -*- +AC_INIT(src/most.c) +JD_INIT +JD_ANSI_CC + +AC_CONFIG_AUX_DIR(autoconf) +AC_PROG_MAKE_SET +AC_PROG_INSTALL +AC_CANONICAL_HOST + +JD_ELF_COMPILER + +# determine X include and needed libs +AC_PATH_XTRA + +# Implementation of the --disable-dev-random switch. +AC_MSG_CHECKING([if you want to use mmap if available]) +AC_ARG_ENABLE(mmap, + AC_HELP_STRING([--disable-mmap],[disable the use of mmap]), + jd_use_mmap=$enableval, jd_use_mmap=yes) +AC_MSG_RESULT($jd_use_mmap) +case "x$jd_use_mmap" in +xyes ) + AC_DEFINE(USE_MMAP) + ;; +esac + +#Check these header since they cause trouble +AC_CHECK_HEADERS( \ +stdlib.h \ +unistd.h \ +memory.h \ +malloc.h \ +termios.h \ +sys/mman.h \ +) + +AC_HEADER_DIRENT + +AC_TYPE_MODE_T +AC_TYPE_PID_T +AC_TYPE_UID_T +AC_TYPE_SIZE_T + +AC_CHECK_SIZEOF(short, 2) +AC_CHECK_SIZEOF(int, 4) +AC_CHECK_SIZEOF(long, 4) +AC_CHECK_SIZEOF(float, 4) +AC_CHECK_SIZEOF(double, 8) + +JD_CHECK_LONG_LONG +JD_LARGE_FILE_SUPPORT + +AC_CHECK_FUNCS(\ +memset \ +memcpy \ +putenv \ +getcwd \ +mmap \ +snprintf \ +getpgrp tcgetpgrp \ +) + +JD_SET_OBJ_SRC_DIR +JD_TERMCAP +JD_WITH_LIBRARY(slang) +JD_GCC_WARNINGS +JD_GET_MODULES(src/modules.lis) +JD_CREATE_MODULE_ORULES + +AC_CONFIG_HEADER(src/sysconf.h:src/config.hin) +AC_OUTPUT(Makefile:autoconf/Makefile.in src/Makefile) + +JD_CREATE_ORULE(chkslang) +JD_APPEND_RULES(src/Makefile) + diff --git a/vendor/most-5.1.0/autoconf/install.sh b/vendor/most-5.1.0/autoconf/install.sh new file mode 100755 index 0000000..e9de238 --- /dev/null +++ b/vendor/most-5.1.0/autoconf/install.sh @@ -0,0 +1,251 @@ +#!/bin/sh +# +# install - install a program, script, or datafile +# This comes from X11R5 (mit/util/scripts/install.sh). +# +# Copyright 1991 by the Massachusetts Institute of Technology +# +# Permission to use, copy, modify, distribute, and sell this software and its +# documentation for any purpose is hereby granted without fee, provided that +# the above copyright notice appear in all copies and that both that +# copyright notice and this permission notice appear in supporting +# documentation, and that the name of M.I.T. not be used in advertising or +# publicity pertaining to distribution of the software without specific, +# written prior permission. M.I.T. makes no representations about the +# suitability of this software for any purpose. It is provided "as is" +# without express or implied warranty. +# +# Calling this script install-sh is preferred over install.sh, to prevent +# `make' implicit rules from creating a file called install from it +# when there is no Makefile. +# +# This script is compatible with the BSD install script, but was written +# from scratch. It can only install one file at a time, a restriction +# shared with many OS's install programs. + + +# set DOITPROG to echo to test this script + +# Don't use :- since 4.3BSD and earlier shells don't like it. +doit="${DOITPROG-}" + + +# put in absolute paths if you don't have them in your path; or use env. vars. + +mvprog="${MVPROG-mv}" +cpprog="${CPPROG-cp}" +chmodprog="${CHMODPROG-chmod}" +chownprog="${CHOWNPROG-chown}" +chgrpprog="${CHGRPPROG-chgrp}" +stripprog="${STRIPPROG-strip}" +rmprog="${RMPROG-rm}" +mkdirprog="${MKDIRPROG-mkdir}" + +transformbasename="" +transform_arg="" +instcmd="$mvprog" +chmodcmd="$chmodprog 0755" +chowncmd="" +chgrpcmd="" +stripcmd="" +rmcmd="$rmprog -f" +mvcmd="$mvprog" +src="" +dst="" +dir_arg="" + +while [ x"$1" != x ]; do + case $1 in + -c) instcmd="$cpprog" + shift + continue;; + + -d) dir_arg=true + shift + continue;; + + -m) chmodcmd="$chmodprog $2" + shift + shift + continue;; + + -o) chowncmd="$chownprog $2" + shift + shift + continue;; + + -g) chgrpcmd="$chgrpprog $2" + shift + shift + continue;; + + -s) stripcmd="$stripprog" + shift + continue;; + + -t=*) transformarg=`echo $1 | sed 's/-t=//'` + shift + continue;; + + -b=*) transformbasename=`echo $1 | sed 's/-b=//'` + shift + continue;; + + *) if [ x"$src" = x ] + then + src=$1 + else + # this colon is to work around a 386BSD /bin/sh bug + : + dst=$1 + fi + shift + continue;; + esac +done + +if [ x"$src" = x ] +then + echo "install: no input file specified" + exit 1 +else + true +fi + +if [ x"$dir_arg" != x ]; then + dst=$src + src="" + + if [ -d $dst ]; then + instcmd=: + chmodcmd="" + else + instcmd=mkdir + fi +else + +# Waiting for this to be detected by the "$instcmd $src $dsttmp" command +# might cause directories to be created, which would be especially bad +# if $src (and thus $dsttmp) contains '*'. + + if [ -f $src -o -d $src ] + then + true + else + echo "install: $src does not exist" + exit 1 + fi + + if [ x"$dst" = x ] + then + echo "install: no destination specified" + exit 1 + else + true + fi + +# If destination is a directory, append the input filename; if your system +# does not like double slashes in filenames, you may need to add some logic + + if [ -d $dst ] + then + dst="$dst"/`basename $src` + else + true + fi +fi + +## this sed command emulates the dirname command +dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` + +# Make sure that the destination directory exists. +# this part is taken from Noah Friedman's mkinstalldirs script + +# Skip lots of stat calls in the usual case. +if [ ! -d "$dstdir" ]; then +defaultIFS=' +' +IFS="${IFS-${defaultIFS}}" + +oIFS="${IFS}" +# Some sh's can't handle IFS=/ for some reason. +IFS='%' +set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'` +IFS="${oIFS}" + +pathcomp='' + +while [ $# -ne 0 ] ; do + pathcomp="${pathcomp}${1}" + shift + + if [ ! -d "${pathcomp}" ] ; + then + $mkdirprog "${pathcomp}" + else + true + fi + + pathcomp="${pathcomp}/" +done +fi + +if [ x"$dir_arg" != x ] +then + $doit $instcmd $dst && + + if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi && + if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi && + if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi && + if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi +else + +# If we're going to rename the final executable, determine the name now. + + if [ x"$transformarg" = x ] + then + dstfile=`basename $dst` + else + dstfile=`basename $dst $transformbasename | + sed $transformarg`$transformbasename + fi + +# don't allow the sed command to completely eliminate the filename + + if [ x"$dstfile" = x ] + then + dstfile=`basename $dst` + else + true + fi + +# Make a temp file name in the proper directory. + + dsttmp=$dstdir/#inst.$$# + +# Move or copy the file name to the temp name + + $doit $instcmd $src $dsttmp && + + trap "rm -f ${dsttmp}" 0 && + +# and set any options; do chmod last to preserve setuid bits + +# If any of these fail, we abort the whole thing. If we want to +# ignore errors from any of these, just make sure not to ignore +# errors from the above "$doit $instcmd $src $dsttmp" command. + + if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi && + if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi && + if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi && + if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi && + +# Now rename the file to the real destination. + + $doit $rmcmd -f $dstdir/$dstfile && + $doit $mvcmd $dsttmp $dstdir/$dstfile + +fi && + + +exit 0 diff --git a/vendor/most-5.1.0/autoconf/mkinsdir.sh b/vendor/most-5.1.0/autoconf/mkinsdir.sh new file mode 100755 index 0000000..cd1fe0a --- /dev/null +++ b/vendor/most-5.1.0/autoconf/mkinsdir.sh @@ -0,0 +1,32 @@ +#! /bin/sh +# mkinstalldirs --- make directory hierarchy +# Author: Noah Friedman +# Created: 1993-05-16 +# Public domain + +errstatus=0 + +for file +do + set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` + shift + + pathcomp= + for d in ${1+"$@"} ; do + pathcomp="$pathcomp$d" + case "$pathcomp" in + -* ) pathcomp=./$pathcomp ;; + esac + + if test ! -d "$pathcomp"; then + echo "mkdir $pathcomp" 1>&2 + mkdir "$pathcomp" || errstatus=$? + fi + + pathcomp="$pathcomp/" + done +done + +exit $errstatus + +# mkinstalldirs ends here diff --git a/vendor/most-5.1.0/autoconf/scripts/getsyslibs.sh b/vendor/most-5.1.0/autoconf/scripts/getsyslibs.sh new file mode 100755 index 0000000..3788e9b --- /dev/null +++ b/vendor/most-5.1.0/autoconf/scripts/getsyslibs.sh @@ -0,0 +1,77 @@ +#!/bin/sh + +# This script parses /etc/ld.so.conf and returns lib and include directories +# in a form that JD_CHECK_FOR_LIBRARY can grok. + +SH_TRUE=0 +SH_FALSE=1 + +# Usage: sh_substr string a b ==> string[a:b] (1s-based) +sh_substr() +{ + echo "$1" | cut "-c" "$2-$3" +} + +# if sh_is_comment line; then ... +sh_is_comment() +{ + ch=`sh_substr "$1" 1 1` + if test "X$ch" = "X#" -o "X$ch" = "X" + then + return $SH_TRUE; + fi + return $SH_FALSE; +} + +sh_read_ldsoconf () +{ + file="$1" + dirlist="" + if test ! -f "$file" + then + return $SH_FALSE; + fi + + while read line + do + if sh_is_comment "$line"; then continue; fi + read p1 p2 pn << EOF + ${line} +EOF + if test "$p1" = "include" + then + for file in $p2 + do + dirs=`sh_read_ldsoconf "$file"` + dirlist="$dirlist $dirs" + done + else + dirlist="$dirlist $p1" + fi + done < "$file" + echo "$dirlist" +} + +dirs=`sh_read_ldsoconf "/etc/ld.so.conf"` +XY="" +for Y in $dirs +do + if test "/usr/lib" = `sh_substr $Y 1 8` + then + X="/usr/include" + else + if test "/lib" = `sh_substr $Y 1 4` + then + X="/usr/include" + else + X=`dirname $Y`"/include" + fi + fi + if test -d "$Y" + then + XY="$XY $X,$Y" + fi +done + +echo $XY + diff --git a/vendor/most-5.1.0/changes.txt b/vendor/most-5.1.0/changes.txt new file mode 100644 index 0000000..53aef3c --- /dev/null +++ b/vendor/most-5.1.0/changes.txt @@ -0,0 +1,201 @@ +-*- mode: text; mode: fold -*- +Changes since 5.0.0 +1. src/Makefile.in: Install docs in $prefix/share/doc +2. src/most.h,sysdep.c: win32-specific patches (Andrew Wu) +3. most.1: Typo corrected (Stephane Blondon) +4. src/line.c: removed redundant switch in the most_forward_columns + function. +5. src/buffer.c: avoid call to SLutf8_skip_char if the character is + ascii. +6. src/file.c: Added an option to most_read_file_dsc to skip the line + count and made use of it in search.c to speed up the searches a bit. +7. src/display.c: When wrapping a line, the color was not "wrapping". +8. src/line.c: When moving forward n columns, skip over trailing 0 + length color escape sequences. +9. src/buffer.c: If a color escape sequence occurs at the end of a + line line whose display width is equal to the terminal width, do + not wrap the line. +10. src/keym.c: Limit the amount of loops when going to the end of the + buffer. It is possible for a run-away process to write to a + logfile that most is viewing causing it to loop forever seeking the + end of the file, which may never come. +11. src/help.c: Change DELETE to BACKSPACE. file.c: Indicate that + chdir return value is being ignored. +12. configure,autoconf/*: Updated configure script and related files. +13. src/most.c: when acting as `cat`, a file pointer was not being + closed (George Danchev). +14. src/*.c: Removed some unused variables. +15. configure: Use /etc/ld.so.conf to located system lib paths. +16. autoconf/*: updates +17. src/line.c, buffer.c: Fixed an issue with the display of + double-width characters to address + . +18. src/*.[ch]: Updated copyright year +19. src/search.c: Rewrote the search functions from scratch. Both + ordinary and regexp searches are now supported. Use -r to startup + with regular-expression searches. +20. src/keym.c: Added support for Home/End keys (top/bottom of buffer). +21. src/line.c: Added a work-around for programs that try colorize the + output using the clear-to-end-of-line escape sequence (ESC[K) + without regard for the value of isatty(fileno(sdout)). Most will + ignore ESC[K unless invoked with -v. +22. configure: Updated to use aclocal.m4 v0.3.3-1 +23. src/Makefile.in: Added LDFLAGS to chkslang linker line (Denis Pronin) +24. *: Converted the man page source most.1 to text-macro, and + regenerated it. Updated copyrights for upcoming release. +25. Updated manifest and copyrights updated for 2019 release. + +{{{ Previous Versions +Changes since 4.10.2 +0. src/most.c: version bumped to 5.0.0-x +1. src/line.c: Added support for embedded ANSI escape sequences that + seem to be more common in man pages. +2. When switching searching directions, and no search string was + entered at the search prompt, use the previous string. +3. Added patches for UTF-8 support kindly provided by Javier Kohen. +4. src/most.c: Removed references to Kanji from the usage message. + Kanji is not supported by slang-2. Use Unicode. +5. src/file.c: Most will automatically start up in binary mode if the + file contains a nul-byte in the first 512 characters. Previously, + it would switch into binary mode when the file contained any + characters with the most significant bit set. +6. autoconf/config.sub,config.guess: Updated to more recent versions. +7. src/most.c: Add +u/-u switches to force UTF-8 on/off. The default + behavior depends upon the locale. +8. src/sysdep.c: In most_getkey, if SLang_getkey returns an error, + then just exit. +9. src/search.c: Added `#undef SLANG_REGEXP' and `#undef + HAVE_V8_REGCOMP' until the regexp searches are rewritten. +10. src/edit.c: Filenames are quoted before being passed to the shell + for editing. +11. src/file.c: Filenames are quoted before being passed to the unzip + program. +12. src/sysdep.c: Check the process group id of the terminal and + if it does not match that of most, then exit. +13. src/keym.c: Added "find_next_other_dir" function and bound it to N. +14. src/most.c: New commandline switch: "-d". This switch disables + the display of the \ character used to denote a wrapped line. +15. src/line.c: Added support for embedded ansi-color escape + sequences, e.g., `ls --color | most` +16. src/window.c: Added an error hook to prevent slang from writing to + stderr. +17. src/line.c: An ascii character+combining character was not being + handled. + +Changes since 4.10.1 +1. src/window.c:most_read_from_minibuffer: An variable was not being + initialized. (Kevin Oberman, oberman at es, net). +2. configure: mmap is enabled by default. Use the --disable-mmap + configure option of you do not want it. + +Changes since 4.10.0 +1. src/most.h: Prototype for SLang_set_error inconsistent with the + function in most.c. +2. src/most.h: If compiled against slang2 without an snprintf + function, use _pSLsnprintf. + +Changes since 4.9.5 +0. src/*.c: Various changes to support slang 2. Version bumped to + 4.10.0. UTF-8 support not yet available. +1. src/keym.c: Ignore mouse events under DOS/Windows (Gisle Vanem, + giva at bgnett, no). + +Changes since 4.9.4 +1. src/line.c: A "length" variable was declared as unsigned char + instead of unsigned int, causing a SEGV for columns larger than 255. +2. src/file.c: fixed a buffer overflow caused by a long file name on + the command line. + +Changes since 4.9.3 + +1. src/buffer.c: SLtt_Screen_Rows and SLtt_Screen_Cols were swapped + causing a file to be improperly displayed in wrap mode. Adrian P. + van Bloois (adrian at accu.uu.nlhas) has my thanks for find this bug. +2. src/most.c: when run without arguments, S-Lang library version also + printed. + +Changes since 4.9.2 + +1. src/keym.c: added support for \xE0 type arrow keys (Win9X). +2. src/file.c: When resyncing mmaped buffer, make sure to preserve the + current line number. +3. src/sysdep.c: SLang_getkey_intr_hook is unix + specific and should not be used on VMS. +4. src/file.c: Make arrow-keys for next_file_cmd work on win32 systems. +5. src/file.h: be sure to quote filename argument (Mako Hill + ) +6. src/file.c: added support for bzip2 files +7. src/*.c: replace calls to sprintf with _SLsnprintf (Steve Kemp + ). + +Changes since 4.9.1 +0. Added support for using mmap to read files. Use configure + --enable-mmap to enable this experimental feature. +1. Wrapping bug fixed. Also some optimizations were made to speed up + the display of wrapped files. +2. File default.rc renamed to most.rc. +3. A^H_ interpreted as underline. Previously, _^HA was recognized. +4. Jerome Lauret provided most.hlp, as + well as a few VMS patches. +5. src/Makefile.in: patch to make most's Makefile respect DESTDIR as + well as removing the hardcoded use of $(prefix)/etc for the + location of most's config file. +6. src/line.c: some simplifications and cleanups designed to avoid + nasty problems with extremely long lines. + +Changes since 4.9.0 +1. MOST_SWITCHES env variable can now contain extended switches. +2. If most is reading from stdin, it will reinit the terminal when it + encounters an EOF on stdin. This is to work around a problem under + linux where for some reason, some other process resets the terminal. +Changes since 4.8.1 +1. Apparantly, the binary flag +b is not valid with POSIX popen. +2. Screen resize code modified so that most works in a SunOS cmdtool. +3. Color support added. Use `most -C' to disable. +4. Ported to Mingw32 (GNU C) + +Changes since 4.7 +1. Added tail -f type mode. Use F to activate. +2. OS/2 port provided by j.burnell@irl.cri.nz (John Burnell). +3. Left/Right arrow scroll 1 column. Use <, > to scroll in larger + chunks. + +Changes since 4.6 +0. Various cleanups and other improvements +1. Binary mode displays byte offset +2. Ported to DJGPP + +Changes since 4.5 +1. Many changes to enable MOST use the S-Lang screen management routines. + +Features in 4.5 +1. More cleanup/bug fixes +2. Regular expression searches +3. Automatic detection of compressed files. + +Features in 4.41: +1. Modified to read raw directry file in BINARY mode. + +New features in MOST 4.4: + +1. User definable keymaps +2. ISO Latin1 8 bit clean +3. Edit and recall previous search strings +4. Much friendlier, lots of messages and help +5. VMS ``Gopher ready'' +6. Cleaned up alot and small bugs fixed +7. Most now re-reads the file after editing. + +New Features since MOST version 3.x (Sept 25, 1994) + +1. Terminfo/termcap under Unix supported +2. -1 flag specifies terminal is a VT100 and not anything better, e.g., + VT102. (VMS only) +3. MOST will only read in what it has to. This means it starts up alot + faster on large files. +4. Cleaned up alot. + +John E. Davis +davis@space.mit.edu + +}}} diff --git a/vendor/most-5.1.0/config.log b/vendor/most-5.1.0/config.log new file mode 100644 index 0000000..0e67653 --- /dev/null +++ b/vendor/most-5.1.0/config.log @@ -0,0 +1,1216 @@ +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. + +It was created by configure, which was +generated by GNU Autoconf 2.69. Invocation command line was + + $ ./configure + +## --------- ## +## Platform. ## +## --------- ## + +hostname = ichigo +uname -m = x86_64 +uname -r = 5.3.8-arch1-1 +uname -s = Linux +uname -v = #1 SMP PREEMPT @1572357769 + +/usr/bin/uname -p = unknown +/bin/uname -X = unknown + +/bin/arch = unknown +/usr/bin/arch -k = unknown +/usr/convex/getsysinfo = unknown +/usr/bin/hostinfo = unknown +/bin/machine = unknown +/usr/bin/oslevel = unknown +/bin/universe = unknown + +PATH: /home/greg/.cargo/bin +PATH: /home/greg/.fzf/bin +PATH: /usr/local/sbin +PATH: /usr/local/bin +PATH: /usr/bin +PATH: /usr/bin/site_perl +PATH: /usr/bin/vendor_perl +PATH: /usr/bin/core_perl + + +## ----------- ## +## Core tests. ## +## ----------- ## + +configure:2462: checking for gcc +configure:2478: found /usr/bin/gcc +configure:2489: result: gcc +configure:2718: checking for C compiler version +configure:2727: gcc --version >&5 +gcc (GCC) 9.2.0 +Copyright (C) 2019 Free Software Foundation, Inc. +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +configure:2738: $? = 0 +configure:2727: gcc -v >&5 +Using built-in specs. +COLLECT_GCC=gcc +COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-pc-linux-gnu/9.2.0/lto-wrapper +Target: x86_64-pc-linux-gnu +Configured with: /build/gcc/src/gcc/configure --prefix=/usr --libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=https://bugs.archlinux.org/ --enable-languages=c,c++,ada,fortran,go,lto,objc,obj-c++,d --enable-shared --enable-threads=posix --with-system-zlib --with-isl --enable-__cxa_atexit --disable-libunwind-exceptions --enable-clocale=gnu --disable-libstdcxx-pch --disable-libssp --enable-gnu-unique-object --enable-linker-build-id --enable-lto --enable-plugin --enable-install-libiberty --with-linker-hash-style=gnu --enable-gnu-indirect-function --enable-multilib --disable-werror --enable-checking=release --enable-default-pie --enable-default-ssp --enable-cet=auto gdc_include_dir=/usr/include/dlang/gdc +Thread model: posix +gcc version 9.2.0 (GCC) +configure:2738: $? = 0 +configure:2727: gcc -V >&5 +gcc: error: unrecognized command line option '-V' +gcc: fatal error: no input files +compilation terminated. +configure:2738: $? = 1 +configure:2727: gcc -qversion >&5 +gcc: error: unrecognized command line option '-qversion'; did you mean '--version'? +gcc: fatal error: no input files +compilation terminated. +configure:2738: $? = 1 +configure:2758: checking whether the C compiler works +configure:2780: gcc conftest.c >&5 +configure:2784: $? = 0 +configure:2832: result: yes +configure:2835: checking for C compiler default output file name +configure:2837: result: a.out +configure:2843: checking for suffix of executables +configure:2850: gcc -o conftest conftest.c >&5 +configure:2854: $? = 0 +configure:2876: result: +configure:2898: checking whether we are cross compiling +configure:2906: gcc -o conftest conftest.c >&5 +configure:2910: $? = 0 +configure:2917: ./conftest +configure:2921: $? = 0 +configure:2909: result: no +configure:2914: checking for suffix of object files +configure:2936: gcc -c conftest.c >&5 +configure:2940: $? = 0 +configure:2961: result: o +configure:2965: checking whether we are using the GNU C compiler +configure:2984: gcc -c conftest.c >&5 +configure:2984: $? = 0 +configure:2993: result: yes +configure:3002: checking whether gcc accepts -g +configure:3022: gcc -c -g conftest.c >&5 +configure:3022: $? = 0 +configure:3063: result: yes +configure:3080: checking for gcc option to accept ISO C89 +configure:3143: gcc -c -g -O2 conftest.c >&5 +configure:3143: $? = 0 +configure:3156: result: none needed +configure:3182: checking how to run the C preprocessor +configure:3213: gcc -E conftest.c +configure:3213: $? = 0 +configure:3227: gcc -E conftest.c +conftest.c:9:10: fatal error: ac_nonexistent.h: No such file or directory + 9 | #include + | ^~~~~~~~~~~~~~~~~~ +compilation terminated. +configure:3227: $? = 1 +configure: failed program was: +| /* confdefs.h */ +| #define PACKAGE_NAME "" +| #define PACKAGE_TARNAME "" +| #define PACKAGE_VERSION "" +| #define PACKAGE_STRING "" +| #define PACKAGE_BUGREPORT "" +| #define PACKAGE_URL "" +| /* end confdefs.h. */ +| #include +configure:3252: result: gcc -E +configure:3272: gcc -E conftest.c +configure:3272: $? = 0 +configure:3286: gcc -E conftest.c +conftest.c:9:10: fatal error: ac_nonexistent.h: No such file or directory + 9 | #include + | ^~~~~~~~~~~~~~~~~~ +compilation terminated. +configure:3286: $? = 1 +configure: failed program was: +| /* confdefs.h */ +| #define PACKAGE_NAME "" +| #define PACKAGE_TARNAME "" +| #define PACKAGE_VERSION "" +| #define PACKAGE_STRING "" +| #define PACKAGE_BUGREPORT "" +| #define PACKAGE_URL "" +| /* end confdefs.h. */ +| #include +configure:3315: checking for grep that handles long lines and -e +configure:3373: result: /usr/bin/grep +configure:3378: checking for egrep +configure:3440: result: /usr/bin/grep -E +configure:3445: checking for ANSI C header files +configure:3465: gcc -c -g -O2 conftest.c >&5 +configure:3465: $? = 0 +configure:3538: gcc -o conftest -g -O2 conftest.c >&5 +configure:3538: $? = 0 +configure:3538: ./conftest +configure:3538: $? = 0 +configure:3549: result: yes +configure:3562: checking for sys/types.h +configure:3562: gcc -c -g -O2 conftest.c >&5 +configure:3562: $? = 0 +configure:3562: result: yes +configure:3562: checking for sys/stat.h +configure:3562: gcc -c -g -O2 conftest.c >&5 +configure:3562: $? = 0 +configure:3562: result: yes +configure:3562: checking for stdlib.h +configure:3562: gcc -c -g -O2 conftest.c >&5 +configure:3562: $? = 0 +configure:3562: result: yes +configure:3562: checking for string.h +configure:3562: gcc -c -g -O2 conftest.c >&5 +configure:3562: $? = 0 +configure:3562: result: yes +configure:3562: checking for memory.h +configure:3562: gcc -c -g -O2 conftest.c >&5 +configure:3562: $? = 0 +configure:3562: result: yes +configure:3562: checking for strings.h +configure:3562: gcc -c -g -O2 conftest.c >&5 +configure:3562: $? = 0 +configure:3562: result: yes +configure:3562: checking for inttypes.h +configure:3562: gcc -c -g -O2 conftest.c >&5 +configure:3562: $? = 0 +configure:3562: result: yes +configure:3562: checking for stdint.h +configure:3562: gcc -c -g -O2 conftest.c >&5 +configure:3562: $? = 0 +configure:3562: result: yes +configure:3562: checking for unistd.h +configure:3562: gcc -c -g -O2 conftest.c >&5 +configure:3562: $? = 0 +configure:3562: result: yes +configure:3575: checking minix/config.h usability +configure:3575: gcc -c -g -O2 conftest.c >&5 +conftest.c:52:10: fatal error: minix/config.h: No such file or directory + 52 | #include + | ^~~~~~~~~~~~~~~~ +compilation terminated. +configure:3575: $? = 1 +configure: failed program was: +| /* confdefs.h */ +| #define PACKAGE_NAME "" +| #define PACKAGE_TARNAME "" +| #define PACKAGE_VERSION "" +| #define PACKAGE_STRING "" +| #define PACKAGE_BUGREPORT "" +| #define PACKAGE_URL "" +| #define STDC_HEADERS 1 +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define HAVE_STDLIB_H 1 +| #define HAVE_STRING_H 1 +| #define HAVE_MEMORY_H 1 +| #define HAVE_STRINGS_H 1 +| #define HAVE_INTTYPES_H 1 +| #define HAVE_STDINT_H 1 +| #define HAVE_UNISTD_H 1 +| /* end confdefs.h. */ +| #include +| #ifdef HAVE_SYS_TYPES_H +| # include +| #endif +| #ifdef HAVE_SYS_STAT_H +| # include +| #endif +| #ifdef STDC_HEADERS +| # include +| # include +| #else +| # ifdef HAVE_STDLIB_H +| # include +| # endif +| #endif +| #ifdef HAVE_STRING_H +| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H +| # include +| # endif +| # include +| #endif +| #ifdef HAVE_STRINGS_H +| # include +| #endif +| #ifdef HAVE_INTTYPES_H +| # include +| #endif +| #ifdef HAVE_STDINT_H +| # include +| #endif +| #ifdef HAVE_UNISTD_H +| # include +| #endif +| #include +configure:3575: result: no +configure:3575: checking minix/config.h presence +configure:3575: gcc -E conftest.c +conftest.c:19:10: fatal error: minix/config.h: No such file or directory + 19 | #include + | ^~~~~~~~~~~~~~~~ +compilation terminated. +configure:3575: $? = 1 +configure: failed program was: +| /* confdefs.h */ +| #define PACKAGE_NAME "" +| #define PACKAGE_TARNAME "" +| #define PACKAGE_VERSION "" +| #define PACKAGE_STRING "" +| #define PACKAGE_BUGREPORT "" +| #define PACKAGE_URL "" +| #define STDC_HEADERS 1 +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define HAVE_STDLIB_H 1 +| #define HAVE_STRING_H 1 +| #define HAVE_MEMORY_H 1 +| #define HAVE_STRINGS_H 1 +| #define HAVE_INTTYPES_H 1 +| #define HAVE_STDINT_H 1 +| #define HAVE_UNISTD_H 1 +| /* end confdefs.h. */ +| #include +configure:3575: result: no +configure:3575: checking for minix/config.h +configure:3575: result: no +configure:3596: checking whether it is safe to define __EXTENSIONS__ +configure:3614: gcc -c -g -O2 conftest.c >&5 +configure:3614: $? = 0 +configure:3621: result: yes +configure:3636: checking whether gcc needs -traditional +configure:3670: result: no +configure:3682: checking for library containing strerror +configure:3713: gcc -o conftest -g -O2 conftest.c >&5 +configure:3713: $? = 0 +configure:3730: result: none required +configure:3756: checking C compiler that understands ANSI prototypes +configure:3770: gcc -c -g -O2 conftest.c >&5 +configure:3770: $? = 0 +configure:3772: result: gcc looks ok. Good. +configure:3812: checking whether make sets $(MAKE) +configure:3834: result: yes +configure:3857: checking for a BSD-compatible install +configure:3925: result: /usr/bin/install -c +configure:3940: checking build system type +configure:3954: result: x86_64-unknown-linux-gnu +configure:3974: checking host system type +configure:3987: result: x86_64-unknown-linux-gnu +configure:4012: checking dlfcn.h usability +configure:4012: gcc -c -g -O2 conftest.c >&5 +configure:4012: $? = 0 +configure:4012: result: yes +configure:4012: checking dlfcn.h presence +configure:4012: gcc -E conftest.c +configure:4012: $? = 0 +configure:4012: result: yes +configure:4012: checking for dlfcn.h +configure:4012: result: yes +configure:4018: checking for dlopen in -ldl +configure:4043: gcc -o conftest -g -O2 conftest.c -ldl >&5 +configure:4043: $? = 0 +configure:4052: result: yes +configure:4264: checking for X +configure:4372: gcc -E conftest.c +configure:4372: $? = 0 +configure:4403: gcc -o conftest -g -O2 conftest.c -lX11 >&5 +configure:4403: $? = 0 +configure:4453: result: libraries , headers +configure:4552: gcc -o conftest -g -O2 conftest.c -lX11 >&5 +configure:4552: $? = 0 +configure:4650: checking for gethostbyname +configure:4650: gcc -o conftest -g -O2 conftest.c >&5 +configure:4650: $? = 0 +configure:4650: result: yes +configure:4747: checking for connect +configure:4747: gcc -o conftest -g -O2 conftest.c >&5 +configure:4747: $? = 0 +configure:4747: result: yes +configure:4796: checking for remove +configure:4796: gcc -o conftest -g -O2 conftest.c >&5 +configure:4796: $? = 0 +configure:4796: result: yes +configure:4845: checking for shmat +configure:4845: gcc -o conftest -g -O2 conftest.c >&5 +configure:4845: $? = 0 +configure:4845: result: yes +configure:4903: checking for IceConnectionNumber in -lICE +configure:4928: gcc -o conftest -g -O2 conftest.c -lICE >&5 +configure:4928: $? = 0 +configure:4937: result: yes +configure:4949: checking if you want to use mmap if available +configure:4958: result: yes +configure:4978: checking for stdlib.h +configure:4978: result: yes +configure:4978: checking for unistd.h +configure:4978: result: yes +configure:4978: checking for memory.h +configure:4978: result: yes +configure:4978: checking malloc.h usability +configure:4978: gcc -c -g -O2 conftest.c >&5 +configure:4978: $? = 0 +configure:4978: result: yes +configure:4978: checking malloc.h presence +configure:4978: gcc -E conftest.c +configure:4978: $? = 0 +configure:4978: result: yes +configure:4978: checking for malloc.h +configure:4978: result: yes +configure:4978: checking termios.h usability +configure:4978: gcc -c -g -O2 conftest.c >&5 +configure:4978: $? = 0 +configure:4978: result: yes +configure:4978: checking termios.h presence +configure:4978: gcc -E conftest.c +configure:4978: $? = 0 +configure:4978: result: yes +configure:4978: checking for termios.h +configure:4978: result: yes +configure:4978: checking sys/mman.h usability +configure:4978: gcc -c -g -O2 conftest.c >&5 +configure:4978: $? = 0 +configure:4978: result: yes +configure:4978: checking sys/mman.h presence +configure:4978: gcc -E conftest.c +configure:4978: $? = 0 +configure:4978: result: yes +configure:4978: checking for sys/mman.h +configure:4978: result: yes +configure:4992: checking for dirent.h that defines DIR +configure:5011: gcc -c -g -O2 conftest.c >&5 +configure:5011: $? = 0 +configure:5019: result: yes +configure:5032: checking for library containing opendir +configure:5063: gcc -o conftest -g -O2 conftest.c >&5 +configure:5063: $? = 0 +configure:5080: result: none required +configure:5148: checking for mode_t +configure:5148: gcc -c -g -O2 conftest.c >&5 +configure:5148: $? = 0 +configure:5148: gcc -c -g -O2 conftest.c >&5 +conftest.c: In function 'main': +conftest.c:70:21: error: expected expression before ')' token + 70 | if (sizeof ((mode_t))) + | ^ +configure:5148: $? = 1 +configure: failed program was: +| /* confdefs.h */ +| #define PACKAGE_NAME "" +| #define PACKAGE_TARNAME "" +| #define PACKAGE_VERSION "" +| #define PACKAGE_STRING "" +| #define PACKAGE_BUGREPORT "" +| #define PACKAGE_URL "" +| #define STDC_HEADERS 1 +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define HAVE_STDLIB_H 1 +| #define HAVE_STRING_H 1 +| #define HAVE_MEMORY_H 1 +| #define HAVE_STRINGS_H 1 +| #define HAVE_INTTYPES_H 1 +| #define HAVE_STDINT_H 1 +| #define HAVE_UNISTD_H 1 +| #define __EXTENSIONS__ 1 +| #define _ALL_SOURCE 1 +| #define _GNU_SOURCE 1 +| #define _POSIX_PTHREAD_SEMANTICS 1 +| #define _TANDEM_SOURCE 1 +| #define HAVE_DLFCN_H 1 +| #define HAVE_DLOPEN 1 +| #define USE_MMAP 1 +| #define HAVE_STDLIB_H 1 +| #define HAVE_UNISTD_H 1 +| #define HAVE_MEMORY_H 1 +| #define HAVE_MALLOC_H 1 +| #define HAVE_TERMIOS_H 1 +| #define HAVE_SYS_MMAN_H 1 +| #define HAVE_DIRENT_H 1 +| /* end confdefs.h. */ +| #include +| #ifdef HAVE_SYS_TYPES_H +| # include +| #endif +| #ifdef HAVE_SYS_STAT_H +| # include +| #endif +| #ifdef STDC_HEADERS +| # include +| # include +| #else +| # ifdef HAVE_STDLIB_H +| # include +| # endif +| #endif +| #ifdef HAVE_STRING_H +| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H +| # include +| # endif +| # include +| #endif +| #ifdef HAVE_STRINGS_H +| # include +| #endif +| #ifdef HAVE_INTTYPES_H +| # include +| #endif +| #ifdef HAVE_STDINT_H +| # include +| #endif +| #ifdef HAVE_UNISTD_H +| # include +| #endif +| int +| main () +| { +| if (sizeof ((mode_t))) +| return 0; +| ; +| return 0; +| } +configure:5148: result: yes +configure:5159: checking for pid_t +configure:5159: gcc -c -g -O2 conftest.c >&5 +configure:5159: $? = 0 +configure:5159: gcc -c -g -O2 conftest.c >&5 +conftest.c: In function 'main': +conftest.c:70:20: error: expected expression before ')' token + 70 | if (sizeof ((pid_t))) + | ^ +configure:5159: $? = 1 +configure: failed program was: +| /* confdefs.h */ +| #define PACKAGE_NAME "" +| #define PACKAGE_TARNAME "" +| #define PACKAGE_VERSION "" +| #define PACKAGE_STRING "" +| #define PACKAGE_BUGREPORT "" +| #define PACKAGE_URL "" +| #define STDC_HEADERS 1 +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define HAVE_STDLIB_H 1 +| #define HAVE_STRING_H 1 +| #define HAVE_MEMORY_H 1 +| #define HAVE_STRINGS_H 1 +| #define HAVE_INTTYPES_H 1 +| #define HAVE_STDINT_H 1 +| #define HAVE_UNISTD_H 1 +| #define __EXTENSIONS__ 1 +| #define _ALL_SOURCE 1 +| #define _GNU_SOURCE 1 +| #define _POSIX_PTHREAD_SEMANTICS 1 +| #define _TANDEM_SOURCE 1 +| #define HAVE_DLFCN_H 1 +| #define HAVE_DLOPEN 1 +| #define USE_MMAP 1 +| #define HAVE_STDLIB_H 1 +| #define HAVE_UNISTD_H 1 +| #define HAVE_MEMORY_H 1 +| #define HAVE_MALLOC_H 1 +| #define HAVE_TERMIOS_H 1 +| #define HAVE_SYS_MMAN_H 1 +| #define HAVE_DIRENT_H 1 +| /* end confdefs.h. */ +| #include +| #ifdef HAVE_SYS_TYPES_H +| # include +| #endif +| #ifdef HAVE_SYS_STAT_H +| # include +| #endif +| #ifdef STDC_HEADERS +| # include +| # include +| #else +| # ifdef HAVE_STDLIB_H +| # include +| # endif +| #endif +| #ifdef HAVE_STRING_H +| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H +| # include +| # endif +| # include +| #endif +| #ifdef HAVE_STRINGS_H +| # include +| #endif +| #ifdef HAVE_INTTYPES_H +| # include +| #endif +| #ifdef HAVE_STDINT_H +| # include +| #endif +| #ifdef HAVE_UNISTD_H +| # include +| #endif +| int +| main () +| { +| if (sizeof ((pid_t))) +| return 0; +| ; +| return 0; +| } +configure:5159: result: yes +configure:5170: checking for uid_t in sys/types.h +configure:5189: result: yes +configure:5200: checking for size_t +configure:5200: gcc -c -g -O2 conftest.c >&5 +configure:5200: $? = 0 +configure:5200: gcc -c -g -O2 conftest.c >&5 +conftest.c: In function 'main': +conftest.c:70:21: error: expected expression before ')' token + 70 | if (sizeof ((size_t))) + | ^ +configure:5200: $? = 1 +configure: failed program was: +| /* confdefs.h */ +| #define PACKAGE_NAME "" +| #define PACKAGE_TARNAME "" +| #define PACKAGE_VERSION "" +| #define PACKAGE_STRING "" +| #define PACKAGE_BUGREPORT "" +| #define PACKAGE_URL "" +| #define STDC_HEADERS 1 +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define HAVE_STDLIB_H 1 +| #define HAVE_STRING_H 1 +| #define HAVE_MEMORY_H 1 +| #define HAVE_STRINGS_H 1 +| #define HAVE_INTTYPES_H 1 +| #define HAVE_STDINT_H 1 +| #define HAVE_UNISTD_H 1 +| #define __EXTENSIONS__ 1 +| #define _ALL_SOURCE 1 +| #define _GNU_SOURCE 1 +| #define _POSIX_PTHREAD_SEMANTICS 1 +| #define _TANDEM_SOURCE 1 +| #define HAVE_DLFCN_H 1 +| #define HAVE_DLOPEN 1 +| #define USE_MMAP 1 +| #define HAVE_STDLIB_H 1 +| #define HAVE_UNISTD_H 1 +| #define HAVE_MEMORY_H 1 +| #define HAVE_MALLOC_H 1 +| #define HAVE_TERMIOS_H 1 +| #define HAVE_SYS_MMAN_H 1 +| #define HAVE_DIRENT_H 1 +| /* end confdefs.h. */ +| #include +| #ifdef HAVE_SYS_TYPES_H +| # include +| #endif +| #ifdef HAVE_SYS_STAT_H +| # include +| #endif +| #ifdef STDC_HEADERS +| # include +| # include +| #else +| # ifdef HAVE_STDLIB_H +| # include +| # endif +| #endif +| #ifdef HAVE_STRING_H +| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H +| # include +| # endif +| # include +| #endif +| #ifdef HAVE_STRINGS_H +| # include +| #endif +| #ifdef HAVE_INTTYPES_H +| # include +| #endif +| #ifdef HAVE_STDINT_H +| # include +| #endif +| #ifdef HAVE_UNISTD_H +| # include +| #endif +| int +| main () +| { +| if (sizeof ((size_t))) +| return 0; +| ; +| return 0; +| } +configure:5200: result: yes +configure:5216: checking size of short +configure:5221: gcc -o conftest -g -O2 conftest.c >&5 +configure:5221: $? = 0 +configure:5221: ./conftest +configure:5221: $? = 0 +configure:5235: result: 2 +configure:5249: checking size of int +configure:5254: gcc -o conftest -g -O2 conftest.c >&5 +configure:5254: $? = 0 +configure:5254: ./conftest +configure:5254: $? = 0 +configure:5268: result: 4 +configure:5282: checking size of long +configure:5287: gcc -o conftest -g -O2 conftest.c >&5 +configure:5287: $? = 0 +configure:5287: ./conftest +configure:5287: $? = 0 +configure:5301: result: 8 +configure:5315: checking size of float +configure:5320: gcc -o conftest -g -O2 conftest.c >&5 +configure:5320: $? = 0 +configure:5320: ./conftest +configure:5320: $? = 0 +configure:5334: result: 4 +configure:5348: checking size of double +configure:5353: gcc -o conftest -g -O2 conftest.c >&5 +configure:5353: $? = 0 +configure:5353: ./conftest +configure:5353: $? = 0 +configure:5367: result: 8 +configure:5379: checking for long long +configure:5379: gcc -c -g -O2 conftest.c >&5 +configure:5379: $? = 0 +configure:5379: gcc -c -g -O2 conftest.c >&5 +conftest.c: In function 'main': +conftest.c:75:24: error: expected expression before ')' token + 75 | if (sizeof ((long long))) + | ^ +configure:5379: $? = 1 +configure: failed program was: +| /* confdefs.h */ +| #define PACKAGE_NAME "" +| #define PACKAGE_TARNAME "" +| #define PACKAGE_VERSION "" +| #define PACKAGE_STRING "" +| #define PACKAGE_BUGREPORT "" +| #define PACKAGE_URL "" +| #define STDC_HEADERS 1 +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define HAVE_STDLIB_H 1 +| #define HAVE_STRING_H 1 +| #define HAVE_MEMORY_H 1 +| #define HAVE_STRINGS_H 1 +| #define HAVE_INTTYPES_H 1 +| #define HAVE_STDINT_H 1 +| #define HAVE_UNISTD_H 1 +| #define __EXTENSIONS__ 1 +| #define _ALL_SOURCE 1 +| #define _GNU_SOURCE 1 +| #define _POSIX_PTHREAD_SEMANTICS 1 +| #define _TANDEM_SOURCE 1 +| #define HAVE_DLFCN_H 1 +| #define HAVE_DLOPEN 1 +| #define USE_MMAP 1 +| #define HAVE_STDLIB_H 1 +| #define HAVE_UNISTD_H 1 +| #define HAVE_MEMORY_H 1 +| #define HAVE_MALLOC_H 1 +| #define HAVE_TERMIOS_H 1 +| #define HAVE_SYS_MMAN_H 1 +| #define HAVE_DIRENT_H 1 +| #define SIZEOF_SHORT 2 +| #define SIZEOF_INT 4 +| #define SIZEOF_LONG 8 +| #define SIZEOF_FLOAT 4 +| #define SIZEOF_DOUBLE 8 +| /* end confdefs.h. */ +| #include +| #ifdef HAVE_SYS_TYPES_H +| # include +| #endif +| #ifdef HAVE_SYS_STAT_H +| # include +| #endif +| #ifdef STDC_HEADERS +| # include +| # include +| #else +| # ifdef HAVE_STDLIB_H +| # include +| # endif +| #endif +| #ifdef HAVE_STRING_H +| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H +| # include +| # endif +| # include +| #endif +| #ifdef HAVE_STRINGS_H +| # include +| #endif +| #ifdef HAVE_INTTYPES_H +| # include +| #endif +| #ifdef HAVE_STDINT_H +| # include +| #endif +| #ifdef HAVE_UNISTD_H +| # include +| #endif +| int +| main () +| { +| if (sizeof ((long long))) +| return 0; +| ; +| return 0; +| } +configure:5379: result: yes +configure:5393: checking size of long long +configure:5398: gcc -o conftest -g -O2 conftest.c >&5 +configure:5398: $? = 0 +configure:5398: ./conftest +configure:5398: $? = 0 +configure:5412: result: 8 +configure:5431: checking for special C compiler options needed for large files +configure:5476: result: no +configure:5482: checking for _FILE_OFFSET_BITS value needed for large files +configure:5507: gcc -c -g -O2 conftest.c >&5 +configure:5507: $? = 0 +configure:5539: result: no +configure:5624: checking for _LARGEFILE_SOURCE value needed for large files +configure:5643: gcc -o conftest -g -O2 conftest.c >&5 +configure:5643: $? = 0 +configure:5671: result: no +configure:5692: checking for off_t +configure:5692: gcc -c -g -O2 conftest.c >&5 +configure:5692: $? = 0 +configure:5692: gcc -c -g -O2 conftest.c >&5 +conftest.c: In function 'main': +conftest.c:78:20: error: expected expression before ')' token + 78 | if (sizeof ((off_t))) + | ^ +configure:5692: $? = 1 +configure: failed program was: +| /* confdefs.h */ +| #define PACKAGE_NAME "" +| #define PACKAGE_TARNAME "" +| #define PACKAGE_VERSION "" +| #define PACKAGE_STRING "" +| #define PACKAGE_BUGREPORT "" +| #define PACKAGE_URL "" +| #define STDC_HEADERS 1 +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define HAVE_STDLIB_H 1 +| #define HAVE_STRING_H 1 +| #define HAVE_MEMORY_H 1 +| #define HAVE_STRINGS_H 1 +| #define HAVE_INTTYPES_H 1 +| #define HAVE_STDINT_H 1 +| #define HAVE_UNISTD_H 1 +| #define __EXTENSIONS__ 1 +| #define _ALL_SOURCE 1 +| #define _GNU_SOURCE 1 +| #define _POSIX_PTHREAD_SEMANTICS 1 +| #define _TANDEM_SOURCE 1 +| #define HAVE_DLFCN_H 1 +| #define HAVE_DLOPEN 1 +| #define USE_MMAP 1 +| #define HAVE_STDLIB_H 1 +| #define HAVE_UNISTD_H 1 +| #define HAVE_MEMORY_H 1 +| #define HAVE_MALLOC_H 1 +| #define HAVE_TERMIOS_H 1 +| #define HAVE_SYS_MMAN_H 1 +| #define HAVE_DIRENT_H 1 +| #define SIZEOF_SHORT 2 +| #define SIZEOF_INT 4 +| #define SIZEOF_LONG 8 +| #define SIZEOF_FLOAT 4 +| #define SIZEOF_DOUBLE 8 +| #define HAVE_LONG_LONG 1 +| #define SIZEOF_LONG_LONG 8 +| #define HAVE_FSEEKO 1 +| /* end confdefs.h. */ +| #include +| #ifdef HAVE_SYS_TYPES_H +| # include +| #endif +| #ifdef HAVE_SYS_STAT_H +| # include +| #endif +| #ifdef STDC_HEADERS +| # include +| # include +| #else +| # ifdef HAVE_STDLIB_H +| # include +| # endif +| #endif +| #ifdef HAVE_STRING_H +| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H +| # include +| # endif +| # include +| #endif +| #ifdef HAVE_STRINGS_H +| # include +| #endif +| #ifdef HAVE_INTTYPES_H +| # include +| #endif +| #ifdef HAVE_STDINT_H +| # include +| #endif +| #ifdef HAVE_UNISTD_H +| # include +| #endif +| int +| main () +| { +| if (sizeof ((off_t))) +| return 0; +| ; +| return 0; +| } +configure:5692: result: yes +configure:5707: checking size of off_t +configure:5712: gcc -o conftest -g -O2 conftest.c >&5 +configure:5712: $? = 0 +configure:5712: ./conftest +configure:5712: $? = 0 +configure:5726: result: 8 +configure:5749: checking for memset +configure:5749: gcc -o conftest -g -O2 conftest.c >&5 +conftest.c:66:6: warning: conflicting types for built-in function 'memset'; expected 'void *(void *, int, long unsigned int)' [-Wbuiltin-declaration-mismatch] + 66 | char memset (); + | ^~~~~~ +conftest.c:54:1: note: 'memset' is declared in header '' + 53 | # include + 54 | #else +configure:5749: $? = 0 +configure:5749: result: yes +configure:5749: checking for memcpy +configure:5749: gcc -o conftest -g -O2 conftest.c >&5 +conftest.c:67:6: warning: conflicting types for built-in function 'memcpy'; expected 'void *(void *, const void *, long unsigned int)' [-Wbuiltin-declaration-mismatch] + 67 | char memcpy (); + | ^~~~~~ +conftest.c:55:1: note: 'memcpy' is declared in header '' + 54 | # include + 55 | #else +configure:5749: $? = 0 +configure:5749: result: yes +configure:5749: checking for putenv +configure:5749: gcc -o conftest -g -O2 conftest.c >&5 +configure:5749: $? = 0 +configure:5749: result: yes +configure:5749: checking for getcwd +configure:5749: gcc -o conftest -g -O2 conftest.c >&5 +configure:5749: $? = 0 +configure:5749: result: yes +configure:5749: checking for mmap +configure:5749: gcc -o conftest -g -O2 conftest.c >&5 +configure:5749: $? = 0 +configure:5749: result: yes +configure:5749: checking for snprintf +configure:5749: gcc -o conftest -g -O2 conftest.c >&5 +conftest.c:71:6: warning: conflicting types for built-in function 'snprintf'; expected 'int(char *, long unsigned int, const char *, ...)' [-Wbuiltin-declaration-mismatch] + 71 | char snprintf (); + | ^~~~~~~~ +conftest.c:59:1: note: 'snprintf' is declared in header '' + 58 | # include + 59 | #else +configure:5749: $? = 0 +configure:5749: result: yes +configure:5749: checking for getpgrp +configure:5749: gcc -o conftest -g -O2 conftest.c >&5 +configure:5749: $? = 0 +configure:5749: result: yes +configure:5749: checking for tcgetpgrp +configure:5749: gcc -o conftest -g -O2 conftest.c >&5 +configure:5749: $? = 0 +configure:5749: result: yes +configure:5782: checking for ncurses5-config +configure:5813: result: no +configure:5825: checking for ncursesw5-config +configure:5856: result: no +configure:5865: checking for terminfo +configure:5884: result: yes +configure:6014: checking for the slang library and header files +configure:6090: result: yes: /usr/lib and /usr/include +configure:6360: creating ./config.status + +## ---------------------- ## +## Running config.status. ## +## ---------------------- ## + +This file was extended by config.status, which was +generated by GNU Autoconf 2.69. Invocation command line was + + CONFIG_FILES = + CONFIG_HEADERS = + CONFIG_LINKS = + CONFIG_COMMANDS = + $ ./config.status + +on ichigo + +config.status:883: creating Makefile +config.status:883: creating src/Makefile +config.status:883: creating src/sysconf.h + +## ---------------- ## +## Cache variables. ## +## ---------------- ## + +ac_cv_build=x86_64-unknown-linux-gnu +ac_cv_c_compiler_gnu=yes +ac_cv_env_CC_set= +ac_cv_env_CC_value= +ac_cv_env_CFLAGS_set= +ac_cv_env_CFLAGS_value= +ac_cv_env_CPPFLAGS_set= +ac_cv_env_CPPFLAGS_value= +ac_cv_env_CPP_set= +ac_cv_env_CPP_value= +ac_cv_env_LDFLAGS_set= +ac_cv_env_LDFLAGS_value= +ac_cv_env_LIBS_set= +ac_cv_env_LIBS_value= +ac_cv_env_XMKMF_set= +ac_cv_env_XMKMF_value= +ac_cv_env_build_alias_set= +ac_cv_env_build_alias_value= +ac_cv_env_host_alias_set= +ac_cv_env_host_alias_value= +ac_cv_env_target_alias_set= +ac_cv_env_target_alias_value= +ac_cv_func_connect=yes +ac_cv_func_getcwd=yes +ac_cv_func_gethostbyname=yes +ac_cv_func_getpgrp=yes +ac_cv_func_memcpy=yes +ac_cv_func_memset=yes +ac_cv_func_mmap=yes +ac_cv_func_putenv=yes +ac_cv_func_remove=yes +ac_cv_func_shmat=yes +ac_cv_func_snprintf=yes +ac_cv_func_tcgetpgrp=yes +ac_cv_have_x='have_x=yes ac_x_includes='\'''\'' ac_x_libraries='\'''\''' +ac_cv_header_dirent_dirent_h=yes +ac_cv_header_dlfcn_h=yes +ac_cv_header_inttypes_h=yes +ac_cv_header_malloc_h=yes +ac_cv_header_memory_h=yes +ac_cv_header_minix_config_h=no +ac_cv_header_stdc=yes +ac_cv_header_stdint_h=yes +ac_cv_header_stdlib_h=yes +ac_cv_header_string_h=yes +ac_cv_header_strings_h=yes +ac_cv_header_sys_mman_h=yes +ac_cv_header_sys_stat_h=yes +ac_cv_header_sys_types_h=yes +ac_cv_header_termios_h=yes +ac_cv_header_unistd_h=yes +ac_cv_host=x86_64-unknown-linux-gnu +ac_cv_lib_ICE_IceConnectionNumber=yes +ac_cv_lib_dl_dlopen=yes +ac_cv_objext=o +ac_cv_path_EGREP='/usr/bin/grep -E' +ac_cv_path_GREP=/usr/bin/grep +ac_cv_path_install='/usr/bin/install -c' +ac_cv_path_nc5config=no +ac_cv_prog_CPP='gcc -E' +ac_cv_prog_ac_ct_CC=gcc +ac_cv_prog_cc_c89= +ac_cv_prog_cc_g=yes +ac_cv_prog_gcc_traditional=no +ac_cv_prog_make_make_set=yes +ac_cv_safe_to_define___extensions__=yes +ac_cv_search_opendir='none required' +ac_cv_search_strerror='none required' +ac_cv_sizeof_double=8 +ac_cv_sizeof_float=4 +ac_cv_sizeof_int=4 +ac_cv_sizeof_long=8 +ac_cv_sizeof_long_long=8 +ac_cv_sizeof_off_t=8 +ac_cv_sizeof_short=2 +ac_cv_sys_file_offset_bits=no +ac_cv_sys_largefile_CC=no +ac_cv_sys_largefile_source=no +ac_cv_type_long_long=yes +ac_cv_type_mode_t=yes +ac_cv_type_off_t=yes +ac_cv_type_pid_t=yes +ac_cv_type_size_t=yes +ac_cv_type_uid_t=yes + +## ----------------- ## +## Output variables. ## +## ----------------- ## + +CC='gcc' +CC_SHARED='$(CC) -shared -fPIC $(CFLAGS)' +CC_SHARED_FLAGS='-shared -fPIC' +CFLAGS='-g -O2' +CONFIG_DIR='/home/greg/code/most-5.1.0' +CPP='gcc -E' +CPPFLAGS='' +DEFS='-DHAVE_CONFIG_H' +DLL_IMPLIB_NAME='' +DYNAMIC_LINK_FLAGS='-Wl,-export-dynamic' +DYNAMIC_LINK_LIB='-ldl' +ECHO_C='' +ECHO_N='-n' +ECHO_T='' +EGREP='/usr/bin/grep -E' +ELFDIR='/home/greg/code/most-5.1.0/src/$(ARCH)elfobjs' +ELFLIB='lib$(THIS_LIB).so' +ELFLIB_BUILD_NAME='$(ELFLIB_MAJOR_MINOR_MICRO)' +ELFLIB_MAJOR='$(ELFLIB).$(ELF_MAJOR_VERSION)' +ELFLIB_MAJOR_MINOR='$(ELFLIB_MAJOR).$(ELF_MINOR_VERSION)' +ELFLIB_MAJOR_MINOR_MICRO='$(ELFLIB_MAJOR_MINOR).$(ELF_MICRO_VERSION)' +ELF_CC='$(CC)' +ELF_CFLAGS='$(CFLAGS) -fPIC' +ELF_DEP_LIBS='$(DL_LIB) -lm -lc' +ELF_LINK='$(CC) $(LDFLAGS) -shared -Wl,-O1 -Wl,--version-script,$(VERSION_SCRIPT) -Wl,-soname,$(ELFLIB_MAJOR)' +ELF_LINK_CMD='' +EXEEXT='' +GREP='/usr/bin/grep' +INSTALL_DATA='${INSTALL} -m 644' +INSTALL_ELFLIB_TARGET='install-elf-and-links' +INSTALL_MODULE='$(INSTALL)' +INSTALL_PROGRAM='${INSTALL}' +INSTALL_SCRIPT='${INSTALL}' +LDFLAGS='' +LIBOBJS='' +LIBS='' +LTLIBOBJS='' +MISC_TERMINFO_DIRS='' +M_LIB='-lm' +OBJDIR='/home/greg/code/most-5.1.0/src/$(ARCH)objs' +OBJEXT='o' +PACKAGE_BUGREPORT='' +PACKAGE_NAME='' +PACKAGE_STRING='' +PACKAGE_TARNAME='' +PACKAGE_URL='' +PACKAGE_VERSION='' +PATH_SEPARATOR=':' +PROGRAM_CFILES=' buffer.c cmd.c display.c edit.c file.c help.c keym.c keyparse.c line.c main.c most.c search.c sysdep.c window.c' +PROGRAM_ELFOBJECTS=' $(ELFDIR)/buffer.o $(ELFDIR)/cmd.o $(ELFDIR)/display.o $(ELFDIR)/edit.o $(ELFDIR)/file.o $(ELFDIR)/help.o $(ELFDIR)/keym.o $(ELFDIR)/keyparse.o $(ELFDIR)/line.o $(ELFDIR)/main.o $(ELFDIR)/most.o $(ELFDIR)/search.o $(ELFDIR)/sysdep.o $(ELFDIR)/window.o' +PROGRAM_HFILES='' +PROGRAM_OBJECTS=' $(OBJDIR)/buffer.o $(OBJDIR)/cmd.o $(OBJDIR)/display.o $(OBJDIR)/edit.o $(OBJDIR)/file.o $(OBJDIR)/help.o $(OBJDIR)/keym.o $(OBJDIR)/keyparse.o $(OBJDIR)/line.o $(OBJDIR)/main.o $(OBJDIR)/most.o $(OBJDIR)/search.o $(OBJDIR)/sysdep.o $(OBJDIR)/window.o' +PROGRAM_OFILES=' buffer.o cmd.o display.o edit.o file.o help.o keym.o keyparse.o line.o main.o most.o search.o sysdep.o window.o' +RPATH='' +SET_MAKE='' +SHELL='/bin/sh' +SLANG_DLL_CFLAGS='' +SLANG_INC='' +SLANG_INC_DIR='/usr/include' +SLANG_LIB='' +SLANG_LIB_DIR='/usr/lib' +SLANG_LIB_FOR_MODULES='' +SRCDIR='/home/greg/code/most-5.1.0/src' +TERMCAP='' +XMKMF='' +X_CFLAGS='' +X_EXTRA_LIBS='' +X_LIBS='' +X_PRE_LIBS=' -lSM -lICE' +ac_ct_CC='gcc' +bindir='${exec_prefix}/bin' +build='x86_64-unknown-linux-gnu' +build_alias='' +build_cpu='x86_64' +build_os='linux-gnu' +build_vendor='unknown' +datadir='${datarootdir}' +datarootdir='${prefix}/share' +docdir='${datarootdir}/doc/${PACKAGE}' +dvidir='${docdir}' +exec_prefix='${prefix}' +host='x86_64-unknown-linux-gnu' +host_alias='' +host_cpu='x86_64' +host_os='linux-gnu' +host_vendor='unknown' +htmldir='${docdir}' +includedir='${prefix}/include' +infodir='${datarootdir}/info' +libdir='${exec_prefix}/lib' +libexecdir='${exec_prefix}/libexec' +localedir='${datarootdir}/locale' +localstatedir='${prefix}/var' +mandir='${datarootdir}/man' +nc5config='no' +oldincludedir='/usr/include' +pdfdir='${docdir}' +prefix='/usr/local' +program_transform_name='s,x,x,' +psdir='${docdir}' +sbindir='${exec_prefix}/sbin' +sharedstatedir='${prefix}/com' +sysconfdir='${prefix}/etc' +target_alias='' + +## ----------- ## +## confdefs.h. ## +## ----------- ## + +/* confdefs.h */ +#define PACKAGE_NAME "" +#define PACKAGE_TARNAME "" +#define PACKAGE_VERSION "" +#define PACKAGE_STRING "" +#define PACKAGE_BUGREPORT "" +#define PACKAGE_URL "" +#define STDC_HEADERS 1 +#define HAVE_SYS_TYPES_H 1 +#define HAVE_SYS_STAT_H 1 +#define HAVE_STDLIB_H 1 +#define HAVE_STRING_H 1 +#define HAVE_MEMORY_H 1 +#define HAVE_STRINGS_H 1 +#define HAVE_INTTYPES_H 1 +#define HAVE_STDINT_H 1 +#define HAVE_UNISTD_H 1 +#define __EXTENSIONS__ 1 +#define _ALL_SOURCE 1 +#define _GNU_SOURCE 1 +#define _POSIX_PTHREAD_SEMANTICS 1 +#define _TANDEM_SOURCE 1 +#define HAVE_DLFCN_H 1 +#define HAVE_DLOPEN 1 +#define USE_MMAP 1 +#define HAVE_STDLIB_H 1 +#define HAVE_UNISTD_H 1 +#define HAVE_MEMORY_H 1 +#define HAVE_MALLOC_H 1 +#define HAVE_TERMIOS_H 1 +#define HAVE_SYS_MMAN_H 1 +#define HAVE_DIRENT_H 1 +#define SIZEOF_SHORT 2 +#define SIZEOF_INT 4 +#define SIZEOF_LONG 8 +#define SIZEOF_FLOAT 4 +#define SIZEOF_DOUBLE 8 +#define HAVE_LONG_LONG 1 +#define SIZEOF_LONG_LONG 8 +#define HAVE_FSEEKO 1 +#define SIZEOF_OFF_T 8 +#define HAVE_MEMSET 1 +#define HAVE_MEMCPY 1 +#define HAVE_PUTENV 1 +#define HAVE_GETCWD 1 +#define HAVE_MMAP 1 +#define HAVE_SNPRINTF 1 +#define HAVE_GETPGRP 1 +#define HAVE_TCGETPGRP 1 + +configure: exit 0 diff --git a/vendor/most-5.1.0/config.status b/vendor/most-5.1.0/config.status new file mode 100755 index 0000000..636075c --- /dev/null +++ b/vendor/most-5.1.0/config.status @@ -0,0 +1,1082 @@ +#! /bin/sh +# Generated by configure. +# Run this file to recreate the current configuration. +# Compiler output produced by configure, useful for debugging +# configure, is in config.log if it exists. + +debug=false +ac_cs_recheck=false +ac_cs_silent=false + +SHELL=${CONFIG_SHELL-/bin/sh} +export SHELL +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi + + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in #( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +case $0 in #(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + + +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error + + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -pR'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -pR' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -pR' + fi +else + as_ln_s='cp -pR' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} # as_fn_mkdir_p +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p +as_test_x='test -x' +as_executable_p=as_fn_executable_p + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +exec 6>&1 +## ----------------------------------- ## +## Main body of $CONFIG_STATUS script. ## +## ----------------------------------- ## +# Save the log message, to keep $0 and so on meaningful, and to +# report actual input values of CONFIG_FILES etc. instead of their +# values after options handling. +ac_log=" +This file was extended by $as_me, which was +generated by GNU Autoconf 2.69. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + $ $0 $@ + +on `(hostname || uname -n) 2>/dev/null | sed 1q` +" + +# Files that config.status was made for. +config_files=" Makefile:autoconf/Makefile.in src/Makefile" +config_headers=" src/sysconf.h:src/config.hin" + +ac_cs_usage="\ +\`$as_me' instantiates files and other configuration actions +from templates according to the current configuration. Unless the files +and actions are specified as TAGs, all are instantiated by default. + +Usage: $0 [OPTION]... [TAG]... + + -h, --help print this help, then exit + -V, --version print version number and configuration settings, then exit + --config print configuration, then exit + -q, --quiet, --silent + do not print progress messages + -d, --debug don't remove temporary files + --recheck update $as_me by reconfiguring in the same conditions + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + --header=FILE[:TEMPLATE] + instantiate the configuration header FILE + +Configuration files: +$config_files + +Configuration headers: +$config_headers + +Report bugs to the package provider." + +ac_cs_config="" +ac_cs_version="\ +config.status +configured by ./configure, generated by GNU Autoconf 2.69, + with options \"$ac_cs_config\" + +Copyright (C) 2012 Free Software Foundation, Inc. +This config.status script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it." + +ac_pwd='/home/greg/code/most-5.1.0' +srcdir='.' +INSTALL='/usr/bin/install -c' +test -n "$AWK" || AWK=awk +# The default lists apply if the user does not specify any file. +ac_need_defaults=: +while test $# != 0 +do + case $1 in + --*=?*) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` + ac_shift=: + ;; + --*=) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg= + ac_shift=: + ;; + *) + ac_option=$1 + ac_optarg=$2 + ac_shift=shift + ;; + esac + + case $ac_option in + # Handling of the options. + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + ac_cs_recheck=: ;; + --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) + $as_echo "$ac_cs_version"; exit ;; + --config | --confi | --conf | --con | --co | --c ) + $as_echo "$ac_cs_config"; exit ;; + --debug | --debu | --deb | --de | --d | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + '') as_fn_error $? "missing file argument" ;; + esac + as_fn_append CONFIG_FILES " '$ac_optarg'" + ac_need_defaults=false;; + --header | --heade | --head | --hea ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + as_fn_append CONFIG_HEADERS " '$ac_optarg'" + ac_need_defaults=false;; + --he | --h) + # Conflict between --help and --header + as_fn_error $? "ambiguous option: \`$1' +Try \`$0 --help' for more information.";; + --help | --hel | -h ) + $as_echo "$ac_cs_usage"; exit ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; + + # This is an error. + -*) as_fn_error $? "unrecognized option: \`$1' +Try \`$0 --help' for more information." ;; + + *) as_fn_append ac_config_targets " $1" + ac_need_defaults=false ;; + + esac + shift +done + +ac_configure_extra_args= + +if $ac_cs_silent; then + exec 6>/dev/null + ac_configure_extra_args="$ac_configure_extra_args --silent" +fi + +if $ac_cs_recheck; then + set X /bin/sh './configure' $ac_configure_extra_args --no-create --no-recursion + shift + $as_echo "running CONFIG_SHELL=/bin/sh $*" >&6 + CONFIG_SHELL='/bin/sh' + export CONFIG_SHELL + exec "$@" +fi + +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX + $as_echo "$ac_log" +} >&5 + + +# Handling of arguments. +for ac_config_target in $ac_config_targets +do + case $ac_config_target in + "src/sysconf.h") CONFIG_HEADERS="$CONFIG_HEADERS src/sysconf.h:src/config.hin" ;; + "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile:autoconf/Makefile.in" ;; + "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; + + *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; + esac +done + + +# If the user did not use the arguments to specify the items to instantiate, +# then the envvar interface is used. Set only those that are not. +# We use the long form for the default assignment because of an extremely +# bizarre bug on SunOS 4.1.3. +if $ac_need_defaults; then + test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files + test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers +fi + +# Have a temporary directory for convenience. Make it in the build tree +# simply because there is no reason against having it here, and in addition, +# creating and moving files from /tmp can sometimes cause problems. +# Hook for its removal unless debugging. +# Note that there is a small window in which the directory will not be cleaned: +# after its creation but before its name has been assigned to `$tmp'. +$debug || +{ + tmp= ac_tmp= + trap 'exit_status=$? + : "${ac_tmp:=$tmp}" + { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status +' 0 + trap 'as_fn_exit 1' 1 2 13 15 +} +# Create a (secure) tmp directory for tmp files. + +{ + tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && + test -d "$tmp" +} || +{ + tmp=./conf$$-$RANDOM + (umask 077 && mkdir "$tmp") +} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 +ac_tmp=$tmp + +# Set up the scripts for CONFIG_FILES section. +# No need to generate them if there are no CONFIG_FILES. +# This happens for instance with `./config.status config.h'. +if test -n "$CONFIG_FILES"; then + + +ac_cr=`echo X | tr X '\015'` +# On cygwin, bash can eat \r inside `` if the user requested igncr. +# But we know of no other shell where ac_cr would be empty at this +# point, so we can use a bashism as a fallback. +if test "x$ac_cr" = x; then + eval ac_cr=\$\'\\r\' +fi +ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` +if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then + ac_cs_awk_cr='\\r' +else + ac_cs_awk_cr=$ac_cr +fi + +echo 'BEGIN {' >"$ac_tmp/subs1.awk" && +cat >>"$ac_tmp/subs1.awk" <<\_ACAWK && +S["LTLIBOBJS"]="" +S["LIBOBJS"]="" +S["PROGRAM_ELFOBJECTS"]=" $(ELFDIR)/buffer.o $(ELFDIR)/cmd.o $(ELFDIR)/display.o $(ELFDIR)/edit.o $(ELFDIR)/file.o $(ELFDIR)/help.o $(ELFDIR)/keym.o $(ELFDIR)/keyparse.o $(E"\ +"LFDIR)/line.o $(ELFDIR)/main.o $(ELFDIR)/most.o $(ELFDIR)/search.o $(ELFDIR)/sysdep.o $(ELFDIR)/window.o" +S["PROGRAM_OBJECTS"]=" $(OBJDIR)/buffer.o $(OBJDIR)/cmd.o $(OBJDIR)/display.o $(OBJDIR)/edit.o $(OBJDIR)/file.o $(OBJDIR)/help.o $(OBJDIR)/keym.o $(OBJDIR)/keyparse.o $(O"\ +"BJDIR)/line.o $(OBJDIR)/main.o $(OBJDIR)/most.o $(OBJDIR)/search.o $(OBJDIR)/sysdep.o $(OBJDIR)/window.o" +S["PROGRAM_HFILES"]="" +S["PROGRAM_CFILES"]=" buffer.c cmd.c display.c edit.c file.c help.c keym.c keyparse.c line.c main.c most.c search.c sysdep.c window.c" +S["PROGRAM_OFILES"]=" buffer.o cmd.o display.o edit.o file.o help.o keym.o keyparse.o line.o main.o most.o search.o sysdep.o window.o" +S["SLANG_INC_DIR"]="/usr/include" +S["SLANG_LIB_DIR"]="/usr/lib" +S["SLANG_INC"]="" +S["SLANG_LIB"]="" +S["MISC_TERMINFO_DIRS"]="" +S["TERMCAP"]="" +S["nc5config"]="no" +S["ELFDIR"]="/home/greg/code/most-5.1.0/src/$(ARCH)elfobjs" +S["OBJDIR"]="/home/greg/code/most-5.1.0/src/$(ARCH)objs" +S["SRCDIR"]="/home/greg/code/most-5.1.0/src" +S["X_EXTRA_LIBS"]="" +S["X_LIBS"]="" +S["X_PRE_LIBS"]=" -lSM -lICE" +S["X_CFLAGS"]="" +S["XMKMF"]="" +S["M_LIB"]="-lm" +S["SLANG_DLL_CFLAGS"]="" +S["ELFLIB_BUILD_NAME"]="$(ELFLIB_MAJOR_MINOR_MICRO)" +S["INSTALL_ELFLIB_TARGET"]="install-elf-and-links" +S["INSTALL_MODULE"]="$(INSTALL)" +S["DLL_IMPLIB_NAME"]="" +S["SLANG_LIB_FOR_MODULES"]="" +S["ELFLIB_MAJOR_MINOR_MICRO"]="$(ELFLIB_MAJOR_MINOR).$(ELF_MICRO_VERSION)" +S["ELFLIB_MAJOR_MINOR"]="$(ELFLIB_MAJOR).$(ELF_MINOR_VERSION)" +S["ELFLIB_MAJOR"]="$(ELFLIB).$(ELF_MAJOR_VERSION)" +S["ELFLIB"]="lib$(THIS_LIB).so" +S["CC_SHARED"]="$(CC) -shared -fPIC $(CFLAGS)" +S["CC_SHARED_FLAGS"]="-shared -fPIC" +S["DYNAMIC_LINK_FLAGS"]="-Wl,-export-dynamic" +S["ELF_DEP_LIBS"]="$(DL_LIB) -lm -lc" +S["ELF_LINK_CMD"]="" +S["ELF_LINK"]="$(CC) $(LDFLAGS) -shared -Wl,-O1 -Wl,--version-script,$(VERSION_SCRIPT) -Wl,-soname,$(ELFLIB_MAJOR)" +S["ELF_CFLAGS"]="$(CFLAGS) -fPIC" +S["ELF_CC"]="$(CC)" +S["DYNAMIC_LINK_LIB"]="-ldl" +S["host_os"]="linux-gnu" +S["host_vendor"]="unknown" +S["host_cpu"]="x86_64" +S["host"]="x86_64-unknown-linux-gnu" +S["build_os"]="linux-gnu" +S["build_vendor"]="unknown" +S["build_cpu"]="x86_64" +S["build"]="x86_64-unknown-linux-gnu" +S["INSTALL_DATA"]="${INSTALL} -m 644" +S["INSTALL_SCRIPT"]="${INSTALL}" +S["INSTALL_PROGRAM"]="${INSTALL}" +S["SET_MAKE"]="" +S["EGREP"]="/usr/bin/grep -E" +S["GREP"]="/usr/bin/grep" +S["CPP"]="gcc -E" +S["OBJEXT"]="o" +S["EXEEXT"]="" +S["ac_ct_CC"]="gcc" +S["CPPFLAGS"]="" +S["LDFLAGS"]="" +S["CFLAGS"]="-g -O2" +S["CC"]="gcc" +S["CONFIG_DIR"]="/home/greg/code/most-5.1.0" +S["target_alias"]="" +S["host_alias"]="" +S["build_alias"]="" +S["LIBS"]="" +S["ECHO_T"]="" +S["ECHO_N"]="-n" +S["ECHO_C"]="" +S["DEFS"]="-DHAVE_CONFIG_H" +S["mandir"]="${datarootdir}/man" +S["localedir"]="${datarootdir}/locale" +S["libdir"]="${exec_prefix}/lib" +S["psdir"]="${docdir}" +S["pdfdir"]="${docdir}" +S["dvidir"]="${docdir}" +S["htmldir"]="${docdir}" +S["infodir"]="${datarootdir}/info" +S["docdir"]="${datarootdir}/doc/${PACKAGE}" +S["oldincludedir"]="/usr/include" +S["includedir"]="${prefix}/include" +S["localstatedir"]="${prefix}/var" +S["sharedstatedir"]="${prefix}/com" +S["sysconfdir"]="${prefix}/etc" +S["datadir"]="${datarootdir}" +S["datarootdir"]="${prefix}/share" +S["libexecdir"]="${exec_prefix}/libexec" +S["sbindir"]="${exec_prefix}/sbin" +S["bindir"]="${exec_prefix}/bin" +S["program_transform_name"]="s,x,x," +S["prefix"]="/usr/local" +S["exec_prefix"]="${prefix}" +S["PACKAGE_URL"]="" +S["PACKAGE_BUGREPORT"]="" +S["PACKAGE_STRING"]="" +S["PACKAGE_VERSION"]="" +S["PACKAGE_TARNAME"]="" +S["PACKAGE_NAME"]="" +S["PATH_SEPARATOR"]=":" +S["SHELL"]="/bin/sh" +S["RPATH"]="" +_ACAWK +cat >>"$ac_tmp/subs1.awk" <<_ACAWK && + for (key in S) S_is_set[key] = 1 + FS = "" + +} +{ + line = $ 0 + nfields = split(line, field, "@") + substed = 0 + len = length(field[1]) + for (i = 2; i < nfields; i++) { + key = field[i] + keylen = length(key) + if (S_is_set[key]) { + value = S[key] + line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) + len += length(value) + length(field[++i]) + substed = 1 + } else + len += 1 + keylen + } + + print line +} + +_ACAWK +if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then + sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" +else + cat +fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ + || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 +fi # test -n "$CONFIG_FILES" + +# Set up the scripts for CONFIG_HEADERS section. +# No need to generate them if there are no CONFIG_HEADERS. +# This happens for instance with `./config.status Makefile'. +if test -n "$CONFIG_HEADERS"; then +cat >"$ac_tmp/defines.awk" <<\_ACAWK || +BEGIN { +D["PACKAGE_NAME"]=" \"\"" +D["PACKAGE_TARNAME"]=" \"\"" +D["PACKAGE_VERSION"]=" \"\"" +D["PACKAGE_STRING"]=" \"\"" +D["PACKAGE_BUGREPORT"]=" \"\"" +D["PACKAGE_URL"]=" \"\"" +D["STDC_HEADERS"]=" 1" +D["HAVE_SYS_TYPES_H"]=" 1" +D["HAVE_SYS_STAT_H"]=" 1" +D["HAVE_STDLIB_H"]=" 1" +D["HAVE_STRING_H"]=" 1" +D["HAVE_MEMORY_H"]=" 1" +D["HAVE_STRINGS_H"]=" 1" +D["HAVE_INTTYPES_H"]=" 1" +D["HAVE_STDINT_H"]=" 1" +D["HAVE_UNISTD_H"]=" 1" +D["__EXTENSIONS__"]=" 1" +D["_ALL_SOURCE"]=" 1" +D["_GNU_SOURCE"]=" 1" +D["_POSIX_PTHREAD_SEMANTICS"]=" 1" +D["_TANDEM_SOURCE"]=" 1" +D["HAVE_DLFCN_H"]=" 1" +D["HAVE_DLOPEN"]=" 1" +D["USE_MMAP"]=" 1" +D["HAVE_STDLIB_H"]=" 1" +D["HAVE_UNISTD_H"]=" 1" +D["HAVE_MEMORY_H"]=" 1" +D["HAVE_MALLOC_H"]=" 1" +D["HAVE_TERMIOS_H"]=" 1" +D["HAVE_SYS_MMAN_H"]=" 1" +D["HAVE_DIRENT_H"]=" 1" +D["SIZEOF_SHORT"]=" 2" +D["SIZEOF_INT"]=" 4" +D["SIZEOF_LONG"]=" 8" +D["SIZEOF_FLOAT"]=" 4" +D["SIZEOF_DOUBLE"]=" 8" +D["HAVE_LONG_LONG"]=" 1" +D["SIZEOF_LONG_LONG"]=" 8" +D["HAVE_FSEEKO"]=" 1" +D["SIZEOF_OFF_T"]=" 8" +D["HAVE_MEMSET"]=" 1" +D["HAVE_MEMCPY"]=" 1" +D["HAVE_PUTENV"]=" 1" +D["HAVE_GETCWD"]=" 1" +D["HAVE_MMAP"]=" 1" +D["HAVE_SNPRINTF"]=" 1" +D["HAVE_GETPGRP"]=" 1" +D["HAVE_TCGETPGRP"]=" 1" + for (key in D) D_is_set[key] = 1 + FS = "" +} +/^[\t ]*#[\t ]*(define|undef)[\t ]+[_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ][_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789]*([\t (]|$)/ { + line = $ 0 + split(line, arg, " ") + if (arg[1] == "#") { + defundef = arg[2] + mac1 = arg[3] + } else { + defundef = substr(arg[1], 2) + mac1 = arg[2] + } + split(mac1, mac2, "(") #) + macro = mac2[1] + prefix = substr(line, 1, index(line, defundef) - 1) + if (D_is_set[macro]) { + # Preserve the white space surrounding the "#". + print prefix "define", macro P[macro] D[macro] + next + } else { + # Replace #undef with comments. This is necessary, for example, + # in the case of _POSIX_SOURCE, which is predefined and required + # on some systems where configure will not decide to define it. + if (defundef == "undef") { + print "/*", prefix defundef, macro, "*/" + next + } + } +} +{ print } +_ACAWK + as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 +fi # test -n "$CONFIG_HEADERS" + + +eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS " +shift +for ac_tag +do + case $ac_tag in + :[FHLC]) ac_mode=$ac_tag; continue;; + esac + case $ac_mode$ac_tag in + :[FHL]*:*);; + :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; + :[FH]-) ac_tag=-:-;; + :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; + esac + ac_save_IFS=$IFS + IFS=: + set x $ac_tag + IFS=$ac_save_IFS + shift + ac_file=$1 + shift + + case $ac_mode in + :L) ac_source=$1;; + :[FH]) + ac_file_inputs= + for ac_f + do + case $ac_f in + -) ac_f="$ac_tmp/stdin";; + *) # Look for the file first in the build tree, then in the source tree + # (if the path is not absolute). The absolute path cannot be DOS-style, + # because $ac_f cannot contain `:'. + test -f "$ac_f" || + case $ac_f in + [\\/$]*) false;; + *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; + esac || + as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; + esac + case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac + as_fn_append ac_file_inputs " '$ac_f'" + done + + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + configure_input='Generated from '` + $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' + `' by configure.' + if test x"$ac_file" != x-; then + configure_input="$ac_file. $configure_input" + { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 +$as_echo "$as_me: creating $ac_file" >&6;} + fi + # Neutralize special characters interpreted by sed in replacement strings. + case $configure_input in #( + *\&* | *\|* | *\\* ) + ac_sed_conf_input=`$as_echo "$configure_input" | + sed 's/[\\\\&|]/\\\\&/g'`;; #( + *) ac_sed_conf_input=$configure_input;; + esac + + case $ac_tag in + *:-:* | *:-) cat >"$ac_tmp/stdin" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; + esac + ;; + esac + + ac_dir=`$as_dirname -- "$ac_file" || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + as_dir="$ac_dir"; as_fn_mkdir_p + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + + case $ac_mode in + :F) + # + # CONFIG_FILE + # + + case $INSTALL in + [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; + *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; + esac +# If the template does not know about datarootdir, expand it. +# FIXME: This hack should be removed a few years after 2.60. +ac_datarootdir_hack=; ac_datarootdir_seen= +ac_sed_dataroot=' +/datarootdir/ { + p + q +} +/@datadir@/p +/@docdir@/p +/@infodir@/p +/@localedir@/p +/@mandir@/p' +case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in +*datarootdir*) ac_datarootdir_seen=yes;; +*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} + ac_datarootdir_hack=' + s&@datadir@&${datarootdir}&g + s&@docdir@&${datarootdir}/doc/${PACKAGE}&g + s&@infodir@&${datarootdir}/info&g + s&@localedir@&${datarootdir}/locale&g + s&@mandir@&${datarootdir}/man&g + s&\${datarootdir}&${prefix}/share&g' ;; +esac +ac_sed_extra="/^[ ]*VPATH[ ]*=[ ]*/{ +h +s/// +s/^/:/ +s/[ ]*$/:/ +s/:\$(srcdir):/:/g +s/:\${srcdir}:/:/g +s/:@srcdir@:/:/g +s/^:*// +s/:*$// +x +s/\(=[ ]*\).*/\1/ +G +s/\n// +s/^[^=]*=[ ]*$// +} + +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s|@configure_input@|$ac_sed_conf_input|;t t +s&@top_builddir@&$ac_top_builddir_sub&;t t +s&@top_build_prefix@&$ac_top_build_prefix&;t t +s&@srcdir@&$ac_srcdir&;t t +s&@abs_srcdir@&$ac_abs_srcdir&;t t +s&@top_srcdir@&$ac_top_srcdir&;t t +s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t +s&@builddir@&$ac_builddir&;t t +s&@abs_builddir@&$ac_abs_builddir&;t t +s&@abs_top_builddir@&$ac_abs_top_builddir&;t t +s&@INSTALL@&$ac_INSTALL&;t t +$ac_datarootdir_hack +" +eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ + >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + +test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && + { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ + "$ac_tmp/out"`; test -z "$ac_out"; } && + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&5 +$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&2;} + + rm -f "$ac_tmp/stdin" + case $ac_file in + -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; + *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; + esac \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + ;; + :H) + # + # CONFIG_HEADER + # + if test x"$ac_file" != x-; then + { + $as_echo "/* $configure_input */" \ + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" + } >"$ac_tmp/config.h" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then + { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 +$as_echo "$as_me: $ac_file is unchanged" >&6;} + else + rm -f "$ac_file" + mv "$ac_tmp/config.h" "$ac_file" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + fi + else + $as_echo "/* $configure_input */" \ + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ + || as_fn_error $? "could not create -" "$LINENO" 5 + fi + ;; + + + esac + +done # for ac_tag + + +as_fn_exit 0 diff --git a/vendor/most-5.1.0/configure b/vendor/most-5.1.0/configure new file mode 100755 index 0000000..cdf1813 --- /dev/null +++ b/vendor/most-5.1.0/configure @@ -0,0 +1,7574 @@ +#! /bin/sh +# Guess values for system-dependent variables and create Makefiles. +# Generated by GNU Autoconf 2.69. +# +# +# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. +# +# +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi + + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in #( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +case $0 in #(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +# Use a proper internal environment variable to ensure we don't fall + # into an infinite loop, continuously re-executing ourselves. + if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then + _as_can_reexec=no; export _as_can_reexec; + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +as_fn_exit 255 + fi + # We don't want this to propagate to other subprocesses. + { _as_can_reexec=; unset _as_can_reexec;} +if test "x$CONFIG_SHELL" = x; then + as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which + # is contrary to our usage. Disable this feature. + alias -g '\${1+\"\$@\"}'='\"\$@\"' + setopt NO_GLOB_SUBST +else + case \`(set -o) 2>/dev/null\` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi +" + as_required="as_fn_return () { (exit \$1); } +as_fn_success () { as_fn_return 0; } +as_fn_failure () { as_fn_return 1; } +as_fn_ret_success () { return 0; } +as_fn_ret_failure () { return 1; } + +exitcode=0 +as_fn_success || { exitcode=1; echo as_fn_success failed.; } +as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } +as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } +as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } +if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : + +else + exitcode=1; echo positional parameters were not saved. +fi +test x\$exitcode = x0 || exit 1 +test -x / || exit 1" + as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO + as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO + eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && + test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 +test \$(( 1 + 1 )) = 2 || exit 1" + if (eval "$as_required") 2>/dev/null; then : + as_have_required=yes +else + as_have_required=no +fi + if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : + +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_found=false +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + as_found=: + case $as_dir in #( + /*) + for as_base in sh bash ksh sh5; do + # Try only shells that exist, to save several forks. + as_shell=$as_dir/$as_base + if { test -f "$as_shell" || test -f "$as_shell.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : + CONFIG_SHELL=$as_shell as_have_required=yes + if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : + break 2 +fi +fi + done;; + esac + as_found=false +done +$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : + CONFIG_SHELL=$SHELL as_have_required=yes +fi; } +IFS=$as_save_IFS + + + if test "x$CONFIG_SHELL" != x; then : + export CONFIG_SHELL + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +exit 255 +fi + + if test x$as_have_required = xno; then : + $as_echo "$0: This script requires a shell more modern than all" + $as_echo "$0: the shells that I found on your system." + if test x${ZSH_VERSION+set} = xset ; then + $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" + $as_echo "$0: be upgraded to zsh 4.3.4 or later." + else + $as_echo "$0: Please tell bug-autoconf@gnu.org about your system, +$0: including any error possibly output before this +$0: message. Then install a modern shell, or manually run +$0: the script under such a shell if you do have one." + fi + exit 1 +fi +fi +fi +SHELL=${CONFIG_SHELL-/bin/sh} +export SHELL +# Unset more variables known to interfere with behavior of common tools. +CLICOLOR_FORCE= GREP_OPTIONS= +unset CLICOLOR_FORCE GREP_OPTIONS + +## --------------------- ## +## M4sh Shell Functions. ## +## --------------------- ## +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} # as_fn_mkdir_p + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + + + as_lineno_1=$LINENO as_lineno_1a=$LINENO + as_lineno_2=$LINENO as_lineno_2a=$LINENO + eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && + test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { + # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | + sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno + N + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ + t loop + s/-\n.*// + ' >$as_me.lineno && + chmod +x "$as_me.lineno" || + { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } + + # If we had to re-execute with $CONFIG_SHELL, we're ensured to have + # already done that, so ensure we don't try to do so again and fall + # in an infinite loop. This has already happened in practice. + _as_can_reexec=no; export _as_can_reexec + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" + # Exit status is that of the last command. + exit +} + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -pR'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -pR' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -pR' + fi +else + as_ln_s='cp -pR' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +as_test_x='test -x' +as_executable_p=as_fn_executable_p + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +test -n "$DJDIR" || exec 7<&0 &1 + +# Name of the host. +# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, +# so uname gets run too. +ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` + +# +# Initializations. +# +ac_default_prefix=/usr/local +ac_clean_files= +ac_config_libobj_dir=. +LIBOBJS= +cross_compiling=no +subdirs= +MFLAGS= +MAKEFLAGS= + +# Identity of this package. +PACKAGE_NAME= +PACKAGE_TARNAME= +PACKAGE_VERSION= +PACKAGE_STRING= +PACKAGE_BUGREPORT= +PACKAGE_URL= + +ac_unique_file="src/most.c" +# Factoring default headers for most tests. +ac_includes_default="\ +#include +#ifdef HAVE_SYS_TYPES_H +# include +#endif +#ifdef HAVE_SYS_STAT_H +# include +#endif +#ifdef STDC_HEADERS +# include +# include +#else +# ifdef HAVE_STDLIB_H +# include +# endif +#endif +#ifdef HAVE_STRING_H +# if !defined STDC_HEADERS && defined HAVE_MEMORY_H +# include +# endif +# include +#endif +#ifdef HAVE_STRINGS_H +# include +#endif +#ifdef HAVE_INTTYPES_H +# include +#endif +#ifdef HAVE_STDINT_H +# include +#endif +#ifdef HAVE_UNISTD_H +# include +#endif" + +ac_subst_vars='LTLIBOBJS +LIBOBJS +PROGRAM_ELFOBJECTS +PROGRAM_OBJECTS +PROGRAM_HFILES +PROGRAM_CFILES +PROGRAM_OFILES +SLANG_INC_DIR +SLANG_LIB_DIR +SLANG_INC +SLANG_LIB +MISC_TERMINFO_DIRS +TERMCAP +nc5config +ELFDIR +OBJDIR +SRCDIR +X_EXTRA_LIBS +X_LIBS +X_PRE_LIBS +X_CFLAGS +XMKMF +M_LIB +SLANG_DLL_CFLAGS +ELFLIB_BUILD_NAME +INSTALL_ELFLIB_TARGET +INSTALL_MODULE +DLL_IMPLIB_NAME +SLANG_LIB_FOR_MODULES +ELFLIB_MAJOR_MINOR_MICRO +ELFLIB_MAJOR_MINOR +ELFLIB_MAJOR +ELFLIB +CC_SHARED +CC_SHARED_FLAGS +DYNAMIC_LINK_FLAGS +ELF_DEP_LIBS +ELF_LINK_CMD +ELF_LINK +ELF_CFLAGS +ELF_CC +DYNAMIC_LINK_LIB +host_os +host_vendor +host_cpu +host +build_os +build_vendor +build_cpu +build +INSTALL_DATA +INSTALL_SCRIPT +INSTALL_PROGRAM +SET_MAKE +EGREP +GREP +CPP +OBJEXT +EXEEXT +ac_ct_CC +CPPFLAGS +LDFLAGS +CFLAGS +CC +CONFIG_DIR +target_alias +host_alias +build_alias +LIBS +ECHO_T +ECHO_N +ECHO_C +DEFS +mandir +localedir +libdir +psdir +pdfdir +dvidir +htmldir +infodir +docdir +oldincludedir +includedir +localstatedir +sharedstatedir +sysconfdir +datadir +datarootdir +libexecdir +sbindir +bindir +program_transform_name +prefix +exec_prefix +PACKAGE_URL +PACKAGE_BUGREPORT +PACKAGE_STRING +PACKAGE_VERSION +PACKAGE_TARNAME +PACKAGE_NAME +PATH_SEPARATOR +SHELL +RPATH' +ac_subst_files='' +ac_user_opts=' +enable_option_checking +with_x +enable_mmap +enable_largefile +with_slang +with_slanglib +with_slanginc +enable_warnings +' + ac_precious_vars='build_alias +host_alias +target_alias +CC +CFLAGS +LDFLAGS +LIBS +CPPFLAGS +CPP +XMKMF' + + +# Initialize some variables set by options. +ac_init_help= +ac_init_version=false +ac_unrecognized_opts= +ac_unrecognized_sep= +# The variables have the same names as the options, with +# dashes changed to underlines. +cache_file=/dev/null +exec_prefix=NONE +no_create= +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= +verbose= +x_includes=NONE +x_libraries=NONE + +# Installation directory options. +# These are left unexpanded so users can "make install exec_prefix=/foo" +# and all the variables that are supposed to be based on exec_prefix +# by default will actually change. +# Use braces instead of parens because sh, perl, etc. also accept them. +# (The list follows the same order as the GNU Coding Standards.) +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datarootdir='${prefix}/share' +datadir='${datarootdir}' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +includedir='${prefix}/include' +oldincludedir='/usr/include' +docdir='${datarootdir}/doc/${PACKAGE}' +infodir='${datarootdir}/info' +htmldir='${docdir}' +dvidir='${docdir}' +pdfdir='${docdir}' +psdir='${docdir}' +libdir='${exec_prefix}/lib' +localedir='${datarootdir}/locale' +mandir='${datarootdir}/man' + +ac_prev= +ac_dashdash= +for ac_option +do + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval $ac_prev=\$ac_option + ac_prev= + continue + fi + + case $ac_option in + *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; + *=) ac_optarg= ;; + *) ac_optarg=yes ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case $ac_dashdash$ac_option in + --) + ac_dashdash=yes ;; + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir=$ac_optarg ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build_alias ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build_alias=$ac_optarg ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file=$ac_optarg ;; + + --config-cache | -C) + cache_file=config.cache ;; + + -datadir | --datadir | --datadi | --datad) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=*) + datadir=$ac_optarg ;; + + -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ + | --dataroo | --dataro | --datar) + ac_prev=datarootdir ;; + -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ + | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) + datarootdir=$ac_optarg ;; + + -disable-* | --disable-*) + ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=no ;; + + -docdir | --docdir | --docdi | --doc | --do) + ac_prev=docdir ;; + -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) + docdir=$ac_optarg ;; + + -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) + ac_prev=dvidir ;; + -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) + dvidir=$ac_optarg ;; + + -enable-* | --enable-*) + ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=\$ac_optarg ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix=$ac_optarg ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he | -h) + ac_init_help=long ;; + -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) + ac_init_help=recursive ;; + -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) + ac_init_help=short ;; + + -host | --host | --hos | --ho) + ac_prev=host_alias ;; + -host=* | --host=* | --hos=* | --ho=*) + host_alias=$ac_optarg ;; + + -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) + ac_prev=htmldir ;; + -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ + | --ht=*) + htmldir=$ac_optarg ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir=$ac_optarg ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir=$ac_optarg ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir=$ac_optarg ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir=$ac_optarg ;; + + -localedir | --localedir | --localedi | --localed | --locale) + ac_prev=localedir ;; + -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) + localedir=$ac_optarg ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst | --locals) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) + localstatedir=$ac_optarg ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir=$ac_optarg ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c | -n) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir=$ac_optarg ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix=$ac_optarg ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix=$ac_optarg ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix=$ac_optarg ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name=$ac_optarg ;; + + -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) + ac_prev=pdfdir ;; + -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) + pdfdir=$ac_optarg ;; + + -psdir | --psdir | --psdi | --psd | --ps) + ac_prev=psdir ;; + -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) + psdir=$ac_optarg ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir=$ac_optarg ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir=$ac_optarg ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site=$ac_optarg ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir=$ac_optarg ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir=$ac_optarg ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target_alias ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target_alias=$ac_optarg ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers | -V) + ac_init_version=: ;; + + -with-* | --with-*) + ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=\$ac_optarg ;; + + -without-* | --without-*) + ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=no ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes=$ac_optarg ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries=$ac_optarg ;; + + -*) as_fn_error $? "unrecognized option: \`$ac_option' +Try \`$0 --help' for more information" + ;; + + *=*) + ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` + # Reject names that are not valid shell variable names. + case $ac_envvar in #( + '' | [0-9]* | *[!_$as_cr_alnum]* ) + as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; + esac + eval $ac_envvar=\$ac_optarg + export $ac_envvar ;; + + *) + # FIXME: should be removed in autoconf 3.0. + $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && + $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" + ;; + + esac +done + +if test -n "$ac_prev"; then + ac_option=--`echo $ac_prev | sed 's/_/-/g'` + as_fn_error $? "missing argument to $ac_option" +fi + +if test -n "$ac_unrecognized_opts"; then + case $enable_option_checking in + no) ;; + fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; + *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; + esac +fi + +# Check all directory arguments for consistency. +for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ + datadir sysconfdir sharedstatedir localstatedir includedir \ + oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ + libdir localedir mandir +do + eval ac_val=\$$ac_var + # Remove trailing slashes. + case $ac_val in + */ ) + ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` + eval $ac_var=\$ac_val;; + esac + # Be sure to have absolute directory names. + case $ac_val in + [\\/$]* | ?:[\\/]* ) continue;; + NONE | '' ) case $ac_var in *prefix ) continue;; esac;; + esac + as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" +done + +# There might be people who depend on the old broken behavior: `$host' +# used to hold the argument of --host etc. +# FIXME: To remove some day. +build=$build_alias +host=$host_alias +target=$target_alias + +# FIXME: To remove some day. +if test "x$host_alias" != x; then + if test "x$build_alias" = x; then + cross_compiling=maybe + elif test "x$build_alias" != "x$host_alias"; then + cross_compiling=yes + fi +fi + +ac_tool_prefix= +test -n "$host_alias" && ac_tool_prefix=$host_alias- + +test "$silent" = yes && exec 6>/dev/null + + +ac_pwd=`pwd` && test -n "$ac_pwd" && +ac_ls_di=`ls -di .` && +ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || + as_fn_error $? "working directory cannot be determined" +test "X$ac_ls_di" = "X$ac_pwd_ls_di" || + as_fn_error $? "pwd does not report name of working directory" + + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then the parent directory. + ac_confdir=`$as_dirname -- "$as_myself" || +$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_myself" : 'X\(//\)[^/]' \| \ + X"$as_myself" : 'X\(//\)$' \| \ + X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_myself" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + srcdir=$ac_confdir + if test ! -r "$srcdir/$ac_unique_file"; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r "$srcdir/$ac_unique_file"; then + test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." + as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" +fi +ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" +ac_abs_confdir=`( + cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" + pwd)` +# When building in place, set srcdir=. +if test "$ac_abs_confdir" = "$ac_pwd"; then + srcdir=. +fi +# Remove unnecessary trailing slashes from srcdir. +# Double slashes in file names in object file debugging info +# mess up M-x gdb in Emacs. +case $srcdir in +*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; +esac +for ac_var in $ac_precious_vars; do + eval ac_env_${ac_var}_set=\${${ac_var}+set} + eval ac_env_${ac_var}_value=\$${ac_var} + eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} + eval ac_cv_env_${ac_var}_value=\$${ac_var} +done + +# +# Report the --help message. +# +if test "$ac_init_help" = "long"; then + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat <<_ACEOF +\`configure' configures this package to adapt to many kinds of systems. + +Usage: $0 [OPTION]... [VAR=VALUE]... + +To assign environment variables (e.g., CC, CFLAGS...), specify them as +VAR=VALUE. See below for descriptions of some of the useful variables. + +Defaults for the options are specified in brackets. + +Configuration: + -h, --help display this help and exit + --help=short display options specific to this package + --help=recursive display the short help of all the included packages + -V, --version display version information and exit + -q, --quiet, --silent do not print \`checking ...' messages + --cache-file=FILE cache test results in FILE [disabled] + -C, --config-cache alias for \`--cache-file=config.cache' + -n, --no-create do not create output files + --srcdir=DIR find the sources in DIR [configure dir or \`..'] + +Installation directories: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [PREFIX] + +By default, \`make install' will install all the files in +\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify +an installation prefix other than \`$ac_default_prefix' using \`--prefix', +for instance \`--prefix=\$HOME'. + +For better control, use the options below. + +Fine tuning of the installation directories: + --bindir=DIR user executables [EPREFIX/bin] + --sbindir=DIR system admin executables [EPREFIX/sbin] + --libexecdir=DIR program executables [EPREFIX/libexec] + --sysconfdir=DIR read-only single-machine data [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] + --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --libdir=DIR object code libraries [EPREFIX/lib] + --includedir=DIR C header files [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc [/usr/include] + --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] + --datadir=DIR read-only architecture-independent data [DATAROOTDIR] + --infodir=DIR info documentation [DATAROOTDIR/info] + --localedir=DIR locale-dependent data [DATAROOTDIR/locale] + --mandir=DIR man documentation [DATAROOTDIR/man] + --docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE] + --htmldir=DIR html documentation [DOCDIR] + --dvidir=DIR dvi documentation [DOCDIR] + --pdfdir=DIR pdf documentation [DOCDIR] + --psdir=DIR ps documentation [DOCDIR] +_ACEOF + + cat <<\_ACEOF + +X features: + --x-includes=DIR X include files are in DIR + --x-libraries=DIR X library files are in DIR + +System types: + --build=BUILD configure for building on BUILD [guessed] + --host=HOST cross-compile to build programs to run on HOST [BUILD] +_ACEOF +fi + +if test -n "$ac_init_help"; then + + cat <<\_ACEOF + +Optional Features: + --disable-option-checking ignore unrecognized --enable/--with options + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --disable-mmap disable the use of mmap + --disable-largefile omit support for large files + --enable-warnings turn on GCC compiler warnings + +Optional Packages: + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --with-x use the X Window System + --with-slang=DIR Use DIR/lib and DIR/include for slang + --with-slanglib=DIR slang library in DIR + --with-slanginc=DIR slang include files in DIR + +Some influential environment variables: + CC C compiler command + CFLAGS C compiler flags + LDFLAGS linker flags, e.g. -L if you have libraries in a + nonstandard directory + LIBS libraries to pass to the linker, e.g. -l + CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if + you have headers in a nonstandard directory + CPP C preprocessor + XMKMF Path to xmkmf, Makefile generator for X Window System + +Use these variables to override the choices made by `configure' or to help +it to find libraries and programs with nonstandard names/locations. + +Report bugs to the package provider. +_ACEOF +ac_status=$? +fi + +if test "$ac_init_help" = "recursive"; then + # If there are subdirs, report their specific --help. + for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue + test -d "$ac_dir" || + { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || + continue + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + cd "$ac_dir" || { ac_status=$?; continue; } + # Check for guested configure. + if test -f "$ac_srcdir/configure.gnu"; then + echo && + $SHELL "$ac_srcdir/configure.gnu" --help=recursive + elif test -f "$ac_srcdir/configure"; then + echo && + $SHELL "$ac_srcdir/configure" --help=recursive + else + $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + fi || ac_status=$? + cd "$ac_pwd" || { ac_status=$?; break; } + done +fi + +test -n "$ac_init_help" && exit $ac_status +if $ac_init_version; then + cat <<\_ACEOF +configure +generated by GNU Autoconf 2.69 + +Copyright (C) 2012 Free Software Foundation, Inc. +This configure script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it. +_ACEOF + exit +fi + +## ------------------------ ## +## Autoconf initialization. ## +## ------------------------ ## + +# ac_fn_c_try_compile LINENO +# -------------------------- +# Try to compile conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext + if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_compile + +# ac_fn_c_try_cpp LINENO +# ---------------------- +# Try to preprocess conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_cpp () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } > conftest.i && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_cpp + +# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES +# ------------------------------------------------------- +# Tests whether HEADER exists, giving a warning if it cannot be compiled using +# the include files in INCLUDES and setting the cache variable VAR +# accordingly. +ac_fn_c_check_header_mongrel () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if eval \${$3+:} false; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +else + # Is the header compilable? +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 +$as_echo_n "checking $2 usability... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +#include <$2> +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_header_compiler=yes +else + ac_header_compiler=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } + +# Is the header present? +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 +$as_echo_n "checking $2 presence... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <$2> +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + ac_header_preproc=yes +else + ac_header_preproc=no +fi +rm -f conftest.err conftest.i conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( + yes:no: ) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} + ;; + no:yes:* ) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} + ;; +esac + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + eval "$3=\$ac_header_compiler" +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_header_mongrel + +# ac_fn_c_try_run LINENO +# ---------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes +# that executables *can* be run. +ac_fn_c_try_run () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then : + ac_retval=0 +else + $as_echo "$as_me: program exited with status $ac_status" >&5 + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=$ac_status +fi + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_run + +# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES +# ------------------------------------------------------- +# Tests whether HEADER exists and can be compiled using the include files in +# INCLUDES, setting the cache variable VAR accordingly. +ac_fn_c_check_header_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +#include <$2> +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_header_compile + +# ac_fn_c_try_link LINENO +# ----------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_link () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext conftest$ac_exeext + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + test -x conftest$ac_exeext + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information + # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would + # interfere with the next link command; also delete a directory that is + # left behind by Apple's compiler. We do this before executing the actions. + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_link + +# ac_fn_c_check_func LINENO FUNC VAR +# ---------------------------------- +# Tests whether FUNC exists, setting the cache variable VAR accordingly +ac_fn_c_check_func () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Define $2 to an innocuous variant, in case declares $2. + For example, HP-UX 11i declares gettimeofday. */ +#define $2 innocuous_$2 + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $2 (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $2 + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $2 (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_$2 || defined __stub___$2 +choke me +#endif + +int +main () +{ +return $2 (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_func + +# ac_fn_c_check_type LINENO TYPE VAR INCLUDES +# ------------------------------------------- +# Tests whether TYPE exists after having included INCLUDES, setting cache +# variable VAR accordingly. +ac_fn_c_check_type () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + eval "$3=no" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +if (sizeof ($2)) + return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +if (sizeof (($2))) + return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +else + eval "$3=yes" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_type + +# ac_fn_c_compute_int LINENO EXPR VAR INCLUDES +# -------------------------------------------- +# Tries to find the compile-time value of EXPR in a program that includes +# INCLUDES, setting VAR accordingly. Returns whether the value could be +# computed +ac_fn_c_compute_int () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if test "$cross_compiling" = yes; then + # Depending upon the size, compute the lo and hi bounds. +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +static int test_array [1 - 2 * !(($2) >= 0)]; +test_array [0] = 0; +return test_array [0]; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_lo=0 ac_mid=0 + while :; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +static int test_array [1 - 2 * !(($2) <= $ac_mid)]; +test_array [0] = 0; +return test_array [0]; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_hi=$ac_mid; break +else + as_fn_arith $ac_mid + 1 && ac_lo=$as_val + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +static int test_array [1 - 2 * !(($2) < 0)]; +test_array [0] = 0; +return test_array [0]; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_hi=-1 ac_mid=-1 + while :; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +static int test_array [1 - 2 * !(($2) >= $ac_mid)]; +test_array [0] = 0; +return test_array [0]; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_lo=$ac_mid; break +else + as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + as_fn_arith 2 '*' $ac_mid && ac_mid=$as_val +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + ac_lo= ac_hi= +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +# Binary search between lo and hi bounds. +while test "x$ac_lo" != "x$ac_hi"; do + as_fn_arith '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo && ac_mid=$as_val + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +static int test_array [1 - 2 * !(($2) <= $ac_mid)]; +test_array [0] = 0; +return test_array [0]; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_hi=$ac_mid +else + as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +done +case $ac_lo in #(( +?*) eval "$3=\$ac_lo"; ac_retval=0 ;; +'') ac_retval=1 ;; +esac + else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +static long int longval () { return $2; } +static unsigned long int ulongval () { return $2; } +#include +#include +int +main () +{ + + FILE *f = fopen ("conftest.val", "w"); + if (! f) + return 1; + if (($2) < 0) + { + long int i = longval (); + if (i != ($2)) + return 1; + fprintf (f, "%ld", i); + } + else + { + unsigned long int i = ulongval (); + if (i != ($2)) + return 1; + fprintf (f, "%lu", i); + } + /* Do not output a trailing newline, as this causes \r\n confusion + on some platforms. */ + return ferror (f) || fclose (f) != 0; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + echo >>conftest.val; read $3 config.log <<_ACEOF +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. + +It was created by $as_me, which was +generated by GNU Autoconf 2.69. Invocation command line was + + $ $0 $@ + +_ACEOF +exec 5>>config.log +{ +cat <<_ASUNAME +## --------- ## +## Platform. ## +## --------- ## + +hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` + +/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` +/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` +/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` +/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` + +_ASUNAME + +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + $as_echo "PATH: $as_dir" + done +IFS=$as_save_IFS + +} >&5 + +cat >&5 <<_ACEOF + + +## ----------- ## +## Core tests. ## +## ----------- ## + +_ACEOF + + +# Keep a trace of the command line. +# Strip out --no-create and --no-recursion so they do not pile up. +# Strip out --silent because we don't want to record it for future runs. +# Also quote any args containing shell meta-characters. +# Make two passes to allow for proper duplicate-argument suppression. +ac_configure_args= +ac_configure_args0= +ac_configure_args1= +ac_must_keep_next=false +for ac_pass in 1 2 +do + for ac_arg + do + case $ac_arg in + -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + continue ;; + *\'*) + ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + case $ac_pass in + 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; + 2) + as_fn_append ac_configure_args1 " '$ac_arg'" + if test $ac_must_keep_next = true; then + ac_must_keep_next=false # Got value, back to normal. + else + case $ac_arg in + *=* | --config-cache | -C | -disable-* | --disable-* \ + | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ + | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ + | -with-* | --with-* | -without-* | --without-* | --x) + case "$ac_configure_args0 " in + "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; + esac + ;; + -* ) ac_must_keep_next=true ;; + esac + fi + as_fn_append ac_configure_args " '$ac_arg'" + ;; + esac + done +done +{ ac_configure_args0=; unset ac_configure_args0;} +{ ac_configure_args1=; unset ac_configure_args1;} + +# When interrupted or exit'd, cleanup temporary files, and complete +# config.log. We remove comments because anyway the quotes in there +# would cause problems or look ugly. +# WARNING: Use '\'' to represent an apostrophe within the trap. +# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. +trap 'exit_status=$? + # Save into config.log some information that might help in debugging. + { + echo + + $as_echo "## ---------------- ## +## Cache variables. ## +## ---------------- ##" + echo + # The following way of writing the cache mishandles newlines in values, +( + for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + (set) 2>&1 | + case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + sed -n \ + "s/'\''/'\''\\\\'\'''\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" + ;; #( + *) + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) + echo + + $as_echo "## ----------------- ## +## Output variables. ## +## ----------------- ##" + echo + for ac_var in $ac_subst_vars + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + + if test -n "$ac_subst_files"; then + $as_echo "## ------------------- ## +## File substitutions. ## +## ------------------- ##" + echo + for ac_var in $ac_subst_files + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + fi + + if test -s confdefs.h; then + $as_echo "## ----------- ## +## confdefs.h. ## +## ----------- ##" + echo + cat confdefs.h + echo + fi + test "$ac_signal" != 0 && + $as_echo "$as_me: caught signal $ac_signal" + $as_echo "$as_me: exit $exit_status" + } >&5 + rm -f core *.core core.conftest.* && + rm -f -r conftest* confdefs* conf$$* $ac_clean_files && + exit $exit_status +' 0 +for ac_signal in 1 2 13 15; do + trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal +done +ac_signal=0 + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -f -r conftest* confdefs.h + +$as_echo "/* confdefs.h */" > confdefs.h + +# Predefined preprocessor variables. + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_NAME "$PACKAGE_NAME" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_TARNAME "$PACKAGE_TARNAME" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_VERSION "$PACKAGE_VERSION" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_STRING "$PACKAGE_STRING" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_URL "$PACKAGE_URL" +_ACEOF + + +# Let the site file select an alternate cache file if it wants to. +# Prefer an explicitly selected file to automatically selected ones. +ac_site_file1=NONE +ac_site_file2=NONE +if test -n "$CONFIG_SITE"; then + # We do not want a PATH search for config.site. + case $CONFIG_SITE in #(( + -*) ac_site_file1=./$CONFIG_SITE;; + */*) ac_site_file1=$CONFIG_SITE;; + *) ac_site_file1=./$CONFIG_SITE;; + esac +elif test "x$prefix" != xNONE; then + ac_site_file1=$prefix/share/config.site + ac_site_file2=$prefix/etc/config.site +else + ac_site_file1=$ac_default_prefix/share/config.site + ac_site_file2=$ac_default_prefix/etc/config.site +fi +for ac_site_file in "$ac_site_file1" "$ac_site_file2" +do + test "x$ac_site_file" = xNONE && continue + if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 +$as_echo "$as_me: loading site script $ac_site_file" >&6;} + sed 's/^/| /' "$ac_site_file" >&5 + . "$ac_site_file" \ + || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "failed to load site script $ac_site_file +See \`config.log' for more details" "$LINENO" 5; } + fi +done + +if test -r "$cache_file"; then + # Some versions of bash will fail to source /dev/null (special files + # actually), so we avoid doing that. DJGPP emulates it as a regular file. + if test /dev/null != "$cache_file" && test -f "$cache_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 +$as_echo "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . "$cache_file";; + *) . "./$cache_file";; + esac + fi +else + { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 +$as_echo "$as_me: creating cache $cache_file" >&6;} + >$cache_file +fi + +# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in $ac_precious_vars; do + eval ac_old_set=\$ac_cv_env_${ac_var}_set + eval ac_new_set=\$ac_env_${ac_var}_set + eval ac_old_val=\$ac_cv_env_${ac_var}_value + eval ac_new_val=\$ac_env_${ac_var}_value + case $ac_old_set,$ac_new_set in + set,) + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,);; + *) + if test "x$ac_old_val" != "x$ac_new_val"; then + # differences in whitespace do not lead to failure. + ac_old_val_w=`echo x $ac_old_val` + ac_new_val_w=`echo x $ac_new_val` + if test "$ac_old_val_w" != "$ac_new_val_w"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 +$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + ac_cache_corrupted=: + else + { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 +$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} + eval $ac_var=\$ac_old_val + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 +$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 +$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} + fi;; + esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in + *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *) ac_arg=$ac_var=$ac_new_val ;; + esac + case " $ac_configure_args " in + *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. + *) as_fn_append ac_configure_args " '$ac_arg'" ;; + esac + fi +done +if $ac_cache_corrupted; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 +$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} + as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 +fi +## -------------------- ## +## Main body of script. ## +## -------------------- ## + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + +#These variable are initialized by JD init function +CONFIG_DIR=`pwd` +cd $srcdir +if test "`pwd`" != "$CONFIG_DIR" +then + as_fn_error $? "\"This software does not support configuring from another directory. See the INSTALL file\"" "$LINENO" 5 +fi +# Note: these will differ if one is a symbolic link +if test -f /usr/bin/dirname; then + JD_Above_Dir=`dirname $CONFIG_DIR` +else +# system is a loser + JD_Above_Dir=`cd ..;pwd` +fi +JD_Above_Dir2=`cd ..;pwd` + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. +set dummy ${ac_tool_prefix}gcc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +else + CC="$ac_cv_prog_CC" +fi + +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. +set dummy ${ac_tool_prefix}cc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + fi +fi +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_prog_rejected=no +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# != 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" + fi +fi +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl.exe + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl.exe +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_CC" && break +done + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +fi + +fi + + +test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "no acceptable C compiler found in \$PATH +See \`config.log' for more details" "$LINENO" 5; } + +# Provide some information about the compiler. +$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion; do + { { ac_try="$ac_compiler $ac_option >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done + +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" +# Try to create an executable without -o first, disregard a.out. +# It will help us diagnose broken compilers, and finding out an intuition +# of exeext. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 +$as_echo_n "checking whether the C compiler works... " >&6; } +ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` + +# The possible output files: +ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" + +ac_rmfiles= +for ac_file in $ac_files +do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + * ) ac_rmfiles="$ac_rmfiles $ac_file";; + esac +done +rm -f $ac_rmfiles + +if { { ac_try="$ac_link_default" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link_default") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. +# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' +# in a Makefile. We should not override ac_cv_exeext if it was cached, +# so that the user can short-circuit this test for compilers unknown to +# Autoconf. +for ac_file in $ac_files '' +do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) + ;; + [ab].out ) + # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) + if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; + then :; else + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + fi + # We set ac_cv_exeext here because the later test for it is not + # safe: cross compilers may not add the suffix if given an `-o' + # argument, so we may need to know it at that point already. + # Even if this section looks crufty: it has the advantage of + # actually working. + break;; + * ) + break;; + esac +done +test "$ac_cv_exeext" = no && ac_cv_exeext= + +else + ac_file='' +fi +if test -z "$ac_file"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +$as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "C compiler cannot create executables +See \`config.log' for more details" "$LINENO" 5; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 +$as_echo_n "checking for C compiler default output file name... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 +$as_echo "$ac_file" >&6; } +ac_exeext=$ac_cv_exeext + +rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out +ac_clean_files=$ac_clean_files_save +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 +$as_echo_n "checking for suffix of executables... " >&6; } +if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + # If both `conftest.exe' and `conftest' are `present' (well, observable) +# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will +# work properly (i.e., refer to `conftest.exe'), while it won't with +# `rm'. +for ac_file in conftest.exe conftest conftest.*; do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + break;; + * ) break;; + esac +done +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details" "$LINENO" 5; } +fi +rm -f conftest conftest$ac_cv_exeext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 +$as_echo "$ac_cv_exeext" >&6; } + +rm -f conftest.$ac_ext +EXEEXT=$ac_cv_exeext +ac_exeext=$EXEEXT +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +FILE *f = fopen ("conftest.out", "w"); + return ferror (f) || fclose (f) != 0; + + ; + return 0; +} +_ACEOF +ac_clean_files="$ac_clean_files conftest.out" +# Check that the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 +$as_echo_n "checking whether we are cross compiling... " >&6; } +if test "$cross_compiling" != yes; then + { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if { ac_try='./conftest$ac_cv_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then + cross_compiling=no + else + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details" "$LINENO" 5; } + fi + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 +$as_echo "$cross_compiling" >&6; } + +rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out +ac_clean_files=$ac_clean_files_save +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 +$as_echo_n "checking for suffix of object files... " >&6; } +if ${ac_cv_objext+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.o conftest.obj +if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + for ac_file in conftest.o conftest.obj conftest.*; do + test -f "$ac_file" || continue; + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; + *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` + break;; + esac +done +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot compute suffix of object files: cannot compile +See \`config.log' for more details" "$LINENO" 5; } +fi +rm -f conftest.$ac_cv_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 +$as_echo "$ac_cv_objext" >&6; } +OBJEXT=$ac_cv_objext +ac_objext=$OBJEXT +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 +$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } +if ${ac_cv_c_compiler_gnu+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_compiler_gnu=yes +else + ac_compiler_gnu=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 +$as_echo "$ac_cv_c_compiler_gnu" >&6; } +if test $ac_compiler_gnu = yes; then + GCC=yes +else + GCC= +fi +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 +$as_echo_n "checking whether $CC accepts -g... " >&6; } +if ${ac_cv_prog_cc_g+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + ac_cv_prog_cc_g=no + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +else + CFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +else + ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 +$as_echo "$ac_cv_prog_cc_g" >&6; } +if test "$ac_test_CFLAGS" = set; then + CFLAGS=$ac_save_CFLAGS +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 +$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } +if ${ac_cv_prog_cc_c89+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_prog_cc_c89=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +struct stat; +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not '\xHH' hex character constants. + These don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) 'x' +int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +int +main () +{ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; +} +_ACEOF +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ + -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_c89=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c89" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC + +fi +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c89" in + x) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +$as_echo "none needed" >&6; } ;; + xno) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +$as_echo "unsupported" >&6; } ;; + *) + CC="$CC $ac_cv_prog_cc_c89" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; +esac +if test "x$ac_cv_prog_cc_c89" != xno; then : + +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 +$as_echo_n "checking how to run the C preprocessor... " >&6; } +# On Suns, sometimes $CPP names a directory. +if test -n "$CPP" && test -d "$CPP"; then + CPP= +fi +if test -z "$CPP"; then + if ${ac_cv_prog_CPP+:} false; then : + $as_echo_n "(cached) " >&6 +else + # Double quotes because CPP needs to be expanded + for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" + do + ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + break +fi + + done + ac_cv_prog_CPP=$CPP + +fi + CPP=$ac_cv_prog_CPP +else + ac_cv_prog_CPP=$CPP +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 +$as_echo "$CPP" >&6; } +ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details" "$LINENO" 5; } +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 +$as_echo_n "checking for grep that handles long lines and -e... " >&6; } +if ${ac_cv_path_GREP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$GREP"; then + ac_path_GREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in grep ggrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_GREP" || continue +# Check for GNU ac_path_GREP and select it if it is found. + # Check for GNU $ac_path_GREP +case `"$ac_path_GREP" --version 2>&1` in +*GNU*) + ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'GREP' >> "conftest.nl" + "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_GREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_GREP="$ac_path_GREP" + ac_path_GREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_GREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_GREP"; then + as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_GREP=$GREP +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 +$as_echo "$ac_cv_path_GREP" >&6; } + GREP="$ac_cv_path_GREP" + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 +$as_echo_n "checking for egrep... " >&6; } +if ${ac_cv_path_EGREP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 + then ac_cv_path_EGREP="$GREP -E" + else + if test -z "$EGREP"; then + ac_path_EGREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in egrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_EGREP" || continue +# Check for GNU ac_path_EGREP and select it if it is found. + # Check for GNU $ac_path_EGREP +case `"$ac_path_EGREP" --version 2>&1` in +*GNU*) + ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'EGREP' >> "conftest.nl" + "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_EGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_EGREP="$ac_path_EGREP" + ac_path_EGREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_EGREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_EGREP"; then + as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_EGREP=$EGREP +fi + + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 +$as_echo "$ac_cv_path_EGREP" >&6; } + EGREP="$ac_cv_path_EGREP" + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 +$as_echo_n "checking for ANSI C header files... " >&6; } +if ${ac_cv_header_stdc+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#include +#include + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_header_stdc=yes +else + ac_cv_header_stdc=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "memchr" >/dev/null 2>&1; then : + +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "free" >/dev/null 2>&1; then : + +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. + if test "$cross_compiling" = yes; then : + : +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#if ((' ' & 0x0FF) == 0x020) +# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#else +# define ISLOWER(c) \ + (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) +# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) +#endif + +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int +main () +{ + int i; + for (i = 0; i < 256; i++) + if (XOR (islower (i), ISLOWER (i)) + || toupper (i) != TOUPPER (i)) + return 2; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + +else + ac_cv_header_stdc=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 +$as_echo "$ac_cv_header_stdc" >&6; } +if test $ac_cv_header_stdc = yes; then + +$as_echo "#define STDC_HEADERS 1" >>confdefs.h + +fi + +# On IRIX 5.3, sys/types and inttypes.h are conflicting. +for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ + inttypes.h stdint.h unistd.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default +" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + + + ac_fn_c_check_header_mongrel "$LINENO" "minix/config.h" "ac_cv_header_minix_config_h" "$ac_includes_default" +if test "x$ac_cv_header_minix_config_h" = xyes; then : + MINIX=yes +else + MINIX= +fi + + + if test "$MINIX" = yes; then + +$as_echo "#define _POSIX_SOURCE 1" >>confdefs.h + + +$as_echo "#define _POSIX_1_SOURCE 2" >>confdefs.h + + +$as_echo "#define _MINIX 1" >>confdefs.h + + fi + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether it is safe to define __EXTENSIONS__" >&5 +$as_echo_n "checking whether it is safe to define __EXTENSIONS__... " >&6; } +if ${ac_cv_safe_to_define___extensions__+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +# define __EXTENSIONS__ 1 + $ac_includes_default +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_safe_to_define___extensions__=yes +else + ac_cv_safe_to_define___extensions__=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_safe_to_define___extensions__" >&5 +$as_echo "$ac_cv_safe_to_define___extensions__" >&6; } + test $ac_cv_safe_to_define___extensions__ = yes && + $as_echo "#define __EXTENSIONS__ 1" >>confdefs.h + + $as_echo "#define _ALL_SOURCE 1" >>confdefs.h + + $as_echo "#define _GNU_SOURCE 1" >>confdefs.h + + $as_echo "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h + + $as_echo "#define _TANDEM_SOURCE 1" >>confdefs.h + + +if test $ac_cv_c_compiler_gnu = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC needs -traditional" >&5 +$as_echo_n "checking whether $CC needs -traditional... " >&6; } +if ${ac_cv_prog_gcc_traditional+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_pattern="Autoconf.*'x'" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +Autoconf TIOCGETP +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "$ac_pattern" >/dev/null 2>&1; then : + ac_cv_prog_gcc_traditional=yes +else + ac_cv_prog_gcc_traditional=no +fi +rm -f conftest* + + + if test $ac_cv_prog_gcc_traditional = no; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +Autoconf TCGETA +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "$ac_pattern" >/dev/null 2>&1; then : + ac_cv_prog_gcc_traditional=yes +fi +rm -f conftest* + + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_gcc_traditional" >&5 +$as_echo "$ac_cv_prog_gcc_traditional" >&6; } + if test $ac_cv_prog_gcc_traditional = yes; then + CC="$CC -traditional" + fi +fi + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing strerror" >&5 +$as_echo_n "checking for library containing strerror... " >&6; } +if ${ac_cv_search_strerror+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char strerror (); +int +main () +{ +return strerror (); + ; + return 0; +} +_ACEOF +for ac_lib in '' cposix; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_c_try_link "$LINENO"; then : + ac_cv_search_strerror=$ac_res +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext + if ${ac_cv_search_strerror+:} false; then : + break +fi +done +if ${ac_cv_search_strerror+:} false; then : + +else + ac_cv_search_strerror=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_strerror" >&5 +$as_echo "$ac_cv_search_strerror" >&6; } +ac_res=$ac_cv_search_strerror +if test "$ac_res" != no; then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + +fi + + +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef hpux + yes +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "yes" >/dev/null 2>&1; then : + + +$as_echo "#define _HPUX_SOURCE 1" >>confdefs.h + +if test "$CC" = cc; then CC="cc -Ae"; fi + +fi +rm -f conftest* +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking C compiler that understands ANSI prototypes" >&5 +$as_echo_n "checking C compiler that understands ANSI prototypes... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + extern int silly (int); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC looks ok. Good." >&5 +$as_echo "$CC looks ok. Good." >&6; } +else + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC is not a good enough compiler" >&5 +$as_echo "$CC is not a good enough compiler" >&6; } + as_fn_error $? "Set env variable CC to your ANSI compiler and rerun configure." "$LINENO" 5 + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +ac_aux_dir= +for ac_dir in autoconf "$srcdir"/autoconf; do + if test -f "$ac_dir/install-sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f "$ac_dir/install.sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + elif test -f "$ac_dir/shtool"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/shtool install -c" + break + fi +done +if test -z "$ac_aux_dir"; then + as_fn_error $? "cannot find install-sh, install.sh, or shtool in autoconf \"$srcdir\"/autoconf" "$LINENO" 5 +fi + +# These three variables are undocumented and unsupported, +# and are intended to be withdrawn in a future Autoconf release. +# They can cause serious problems if a builder's source tree is in a directory +# whose full name contains unusual characters. +ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. +ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. +ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } +set x ${MAKE-make} +ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat >conftest.make <<\_ACEOF +SHELL = /bin/sh +all: + @echo '@@@%%%=$(MAKE)=@@@%%%' +_ACEOF +# GNU make sometimes prints "make[1]: Entering ...", which would confuse us. +case `${MAKE-make} -f conftest.make 2>/dev/null` in + *@@@%%%=?*=@@@%%%*) + eval ac_cv_prog_make_${ac_make}_set=yes;; + *) + eval ac_cv_prog_make_${ac_make}_set=no;; +esac +rm -f conftest.make +fi +if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + SET_MAKE= +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + SET_MAKE="MAKE=${MAKE-make}" +fi + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AmigaOS /C/install, which installs bootblocks on floppy discs +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# OS/2's system install, which has a completely different semantic +# ./install, which can be erroneously created by make from ./install.sh. +# Reject install programs that cannot install multiple files. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 +$as_echo_n "checking for a BSD-compatible install... " >&6; } +if test -z "$INSTALL"; then +if ${ac_cv_path_install+:} false; then : + $as_echo_n "(cached) " >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + # Account for people who put trailing slashes in PATH elements. +case $as_dir/ in #(( + ./ | .// | /[cC]/* | \ + /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ + ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ + /usr/ucb/* ) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then + if test $ac_prog = install && + grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + elif test $ac_prog = install && + grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # program-specific install script used by HP pwplus--don't use. + : + else + rm -rf conftest.one conftest.two conftest.dir + echo one > conftest.one + echo two > conftest.two + mkdir conftest.dir + if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && + test -s conftest.one && test -s conftest.two && + test -s conftest.dir/conftest.one && + test -s conftest.dir/conftest.two + then + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi + fi + fi + done + done + ;; +esac + + done +IFS=$as_save_IFS + +rm -rf conftest.one conftest.two conftest.dir + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL=$ac_cv_path_install + else + # As a last resort, use the slow shell script. Don't cache a + # value for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + INSTALL=$ac_install_sh + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 +$as_echo "$INSTALL" >&6; } + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +# Make sure we can run config.sub. +$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || + as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 +$as_echo_n "checking build system type... " >&6; } +if ${ac_cv_build+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_build_alias=$build_alias +test "x$ac_build_alias" = x && + ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` +test "x$ac_build_alias" = x && + as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 +ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || + as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 +$as_echo "$ac_cv_build" >&6; } +case $ac_cv_build in +*-*-*) ;; +*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; +esac +build=$ac_cv_build +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_build +shift +build_cpu=$1 +build_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +build_os=$* +IFS=$ac_save_IFS +case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 +$as_echo_n "checking host system type... " >&6; } +if ${ac_cv_host+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "x$host_alias" = x; then + ac_cv_host=$ac_cv_build +else + ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || + as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 +$as_echo "$ac_cv_host" >&6; } +case $ac_cv_host in +*-*-*) ;; +*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; +esac +host=$ac_cv_host +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_host +shift +host_cpu=$1 +host_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +host_os=$* +IFS=$ac_save_IFS +case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac + + + + +DYNAMIC_LINK_LIB="" + + +ac_fn_c_check_header_mongrel "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default" +if test "x$ac_cv_header_dlfcn_h" = xyes; then : + + +$as_echo "#define HAVE_DLFCN_H 1" >>confdefs.h + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 +$as_echo_n "checking for dlopen in -ldl... " >&6; } +if ${ac_cv_lib_dl_dlopen+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dl_dlopen=yes +else + ac_cv_lib_dl_dlopen=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 +$as_echo "$ac_cv_lib_dl_dlopen" >&6; } +if test "x$ac_cv_lib_dl_dlopen" = xyes; then : + + DYNAMIC_LINK_LIB="-ldl" + +$as_echo "#define HAVE_DLOPEN 1" >>confdefs.h + + +else + + ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" +if test "x$ac_cv_func_dlopen" = xyes; then : + $as_echo "#define HAVE_DLOPEN Define if you have dlopen" >>confdefs.h + +fi + + if test "$ac_cv_func_dlopen" != yes + then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cannot perform dynamic linking" >&5 +$as_echo "$as_me: WARNING: cannot perform dynamic linking" >&2;} + fi + +fi + +fi + + + + +if test "$GCC" = yes +then + if test X"$CFLAGS" = X + then + CFLAGS="-O2" + fi +fi + +ELFLIB="lib\$(THIS_LIB).so" +ELFLIB_MAJOR="\$(ELFLIB).\$(ELF_MAJOR_VERSION)" +ELFLIB_MAJOR_MINOR="\$(ELFLIB_MAJOR).\$(ELF_MINOR_VERSION)" +ELFLIB_MAJOR_MINOR_MICRO="\$(ELFLIB_MAJOR_MINOR).\$(ELF_MICRO_VERSION)" + +INSTALL_ELFLIB_TARGET="install-elf-and-links" +ELFLIB_BUILD_NAME="\$(ELFLIB_MAJOR_MINOR_MICRO)" +INSTALL_MODULE="\$(INSTALL)" +SLANG_DLL_CFLAGS="" +M_LIB="-lm" + +case "$host_os" in + *linux*|*gnu*|k*bsd*-gnu ) + DYNAMIC_LINK_FLAGS="-Wl,-export-dynamic" + ELF_CC="\$(CC)" + ELF_CFLAGS="\$(CFLAGS) -fPIC" + ELF_LINK="\$(CC) \$(LDFLAGS) -shared -Wl,-O1 -Wl,--version-script,\$(VERSION_SCRIPT) -Wl,-soname,\$(ELFLIB_MAJOR)" + ELF_DEP_LIBS="\$(DL_LIB) -lm -lc" + CC_SHARED_FLAGS="-shared -fPIC" + CC_SHARED="\$(CC) $CC_SHARED_FLAGS \$(CFLAGS)" + ;; + *solaris* ) + if test "$GCC" = yes + then + DYNAMIC_LINK_FLAGS="" + ELF_CC="\$(CC)" + ELF_CFLAGS="\$(CFLAGS) -fPIC" + ELF_LINK="\$(CC) \$(LDFLAGS) -shared -Wl,-ztext -Wl,-h,\$(ELFLIB_MAJOR)" + ELF_DEP_LIBS="\$(DL_LIB) -lm -lc" + CC_SHARED_FLAGS="-G -fPIC" + CC_SHARED="\$(CC) $CC_SHARED_FLAGS \$(CFLAGS)" + else + DYNAMIC_LINK_FLAGS="" + ELF_CC="\$(CC)" + ELF_CFLAGS="\$(CFLAGS) -K PIC" + ELF_LINK="\$(CC) \$(LDFLAGS) -G -h\$(ELFLIB_MAJOR)" + ELF_DEP_LIBS="\$(DL_LIB) -lm -lc" + CC_SHARED_FLAGS="-G -K PIC" + CC_SHARED="\$(CC) $CC_SHARED_FLAGS \$(CFLAGS)" + fi + ;; + # osr5 or unixware7 with current or late autoconf + *sco3.2v5* | *unixware-5* | *sco-sysv5uw7*) + if test "$GCC" = yes + then + DYNAMIC_LINK_FLAGS="" + ELF_CC="\$(CC)" + ELF_CFLAGS="\$(CFLAGS) -fPIC" + ELF_LINK="\$(CC) \$(LDFLAGS) -shared -Wl,-h,\$(ELFLIB_MAJOR)" + ELF_DEP_LIBS= + CC_SHARED_FLAGS="-G -fPIC" + CC_SHARED="\$(CC) $CC_SHARED_FLAGS \$(CFLAGS)" + else + DYNAMIC_LINK_FLAGS="" + ELF_CC="\$(CC)" + ELF_CFLAGS="\$(CFLAGS) -K pic" + # ELF_LINK="ld -G -z text -h#" + ELF_LINK="\$(CC) \$(LDFLAGS) -G -z text -h\$(ELFLIB_MAJOR)" + ELF_DEP_LIBS= + CC_SHARED_FLAGS="-G -K pic" + CC_SHARED="\$(CC) $CC_SHARED_FLAGS \$(CFLAGS)" + fi + ;; + *irix6.5* ) + echo "Note: ELF compiler for host_os=$host_os may not be correct" + echo "double-check: 'mode_t', 'pid_t' may be wrong!" + if test "$GCC" = yes + then + # not tested + DYNAMIC_LINK_FLAGS="" + ELF_CC="\$(CC)" + ELF_CFLAGS="\$(CFLAGS) -fPIC" + ELF_LINK="\$(CC) \$(LDFLAGS) -shared -Wl,-h,\$(ELFLIB_MAJOR)" + ELF_DEP_LIBS= + CC_SHARED_FLAGS="-shared -fPIC" + CC_SHARED="\$(CC) $CC_SHARED_FLAGS \$(CFLAGS)" + else + DYNAMIC_LINK_FLAGS="" + ELF_CC="\$(CC)" + ELF_CFLAGS="\$(CFLAGS)" # default anyhow + ELF_LINK="\$(CC) \$(LDFLAGS) -shared -o \$(ELFLIB_MAJOR)" + ELF_DEP_LIBS= + CC_SHARED_FLAGS="-shared" + CC_SHARED="\$(CC) $CC_SHARED_FLAGS \$(CFLAGS)" + fi + ;; + *darwin* ) + DYNAMIC_LINK_FLAGS="" + ELF_CC="\$(CC)" + ELF_CFLAGS="\$(CFLAGS) -fno-common" + ELF_LINK="\$(CC) \$(LDFLAGS) -dynamiclib -install_name \$(install_lib_dir)/\$(ELFLIB_MAJOR) -compatibility_version \$(ELF_MAJOR_VERSION) -current_version \$(ELF_MAJOR_VERSION).\$(ELF_MINOR_VERSION)" + ELF_DEP_LIBS="\$(LDFLAGS) \$(DL_LIB)" + CC_SHARED_FLAGS="-bundle -flat_namespace -undefined suppress -fno-common" + CC_SHARED="\$(CC) $CC_SHARED_FLAGS \$(CFLAGS)" + ELFLIB="lib\$(THIS_LIB).dylib" + ELFLIB_MAJOR="lib\$(THIS_LIB).\$(ELF_MAJOR_VERSION).dylib" + ELFLIB_MAJOR_MINOR="lib\$(THIS_LIB).\$(ELF_MAJOR_VERSION).\$(ELF_MINOR_VERSION).dylib" + ELFLIB_MAJOR_MINOR_MICRO="lib\$(THIS_LIB).\$(ELF_MAJOR_VERSION).\$(ELF_MINOR_VERSION).\$(ELF_MICRO_VERSION).dylib" + ;; + *freebsd* ) + ELF_CC="\$(CC)" + ELF_CFLAGS="\$(CFLAGS) -fPIC" + #if test "X$PORTOBJFORMAT" = "Xelf" ; then + # ELF_LINK="\$(CC) \$(LDFLAGS) -shared -Wl,-soname,\$(ELFLIB_MAJOR)" + #else + # ELF_LINK="ld -Bshareable -x" + #fi + ELF_LINK="\$(CC) \$(LDFLAGS) -shared -Wl,-soname,\$(ELFLIB_MAJOR)" + ELF_DEP_LIBS="\$(DL_LIB) -lm" + CC_SHARED_FLAGS="-shared -fPIC" + CC_SHARED="\$(CC) $CC_SHARED_FLAGS \$(CFLAGS)" + ;; + *cygwin* ) + DYNAMIC_LINK_FLAGS="" + ELF_CC="\$(CC)" + SLANG_DLL_CFLAGS="-DSLANG_DLL=1" + ELF_CFLAGS="\$(CFLAGS) -DBUILD_DLL=1" + DLL_IMPLIB_NAME="lib\$(THIS_LIB)\$(ELFLIB_MAJOR_VERSION).dll.a" + #ELF_LINK="\$(CC) \$(LDFLAGS) -shared -Wl,-O1 -Wl,--version-script,\$(VERSION_SCRIPT) -Wl,-soname,\$(ELFLIB_MAJOR) -Wl,--out-implib=\$(DLL_IMPLIB_NAME) -Wl,-export-all-symbols -Wl,-enable-auto-import" + ELF_LINK="\$(CC) \$(LDFLAGS) -shared -Wl,-O1 -Wl,--version-script,\$(VERSION_SCRIPT) -Wl,-soname,\$(ELFLIB_MAJOR) -Wl,--out-implib=\$(DLL_IMPLIB_NAME)" + ELF_DEP_LIBS="\$(DL_LIB) -lm" + CC_SHARED_FLAGS="-shared -DSLANG_DLL=1" + CC_SHARED="\$(CC) $CC_SHARED_FLAGS \$(CFLAGS)" + SLANG_LIB_FOR_MODULES="-L\$(ELFDIR) -lslang" + INSTALL_MODULE="\$(INSTALL)" + INSTALL_ELFLIB_TARGET="install-elf-cygwin" + ELFLIB="lib\$(THIS_LIB).dll" + ELFLIB_MAJOR="cyg\$(THIS_LIB)-\$(ELF_MAJOR_VERSION).dll" + ELFLIB_MAJOR_MINOR="cyg\$(THIS_LIB)-\$(ELF_MAJOR_VERSION)_\$(ELF_MINOR_VERSION).dll" + ELFLIB_MAJOR_MINOR_MICRO="cyg\$(THIS_LIB)-\$(ELF_MAJOR_VERSION)_\$(ELF_MINOR_VERSION)_\$(ELF_MICRO_VERSION).dll" + ELFLIB_BUILD_NAME="\$(ELFLIB_MAJOR)" + ;; + *haiku* ) + M_LIB="" + DYNAMIC_LINK_FLAGS="-Wl,-export-dynamic" + ELF_CC="\$(CC)" + ELF_CFLAGS="\$(CFLAGS) -fPIC" + ELF_LINK="\$(CC) \$(LDFLAGS) -shared -Wl,-O1 -Wl,--version-script,\$(VERSION_SCRIPT) -Wl,-soname,\$(ELFLIB_MAJOR)" + ELF_DEP_LIBS="\$(DL_LIB)" + CC_SHARED_FLAGS="-shared -fPIC" + CC_SHARED="\$(CC) $CC_SHARED_FLAGS \$(CFLAGS)" + ;; + * ) + echo "Note: ELF compiler for host_os=$host_os may be wrong" + ELF_CC="\$(CC)" + ELF_CFLAGS="\$(CFLAGS) -fPIC" + ELF_LINK="\$(CC) \$(LDFLAGS) -shared" + ELF_DEP_LIBS="\$(DL_LIB) -lm -lc" + CC_SHARED_FLAGS="-shared -fPIC" + CC_SHARED="\$(CC) $CC_SHARED_FLAGS \$(CFLAGS)" +esac + + + + + + + + + + + + + + + + + + + + + + +# determine X include and needed libs +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for X" >&5 +$as_echo_n "checking for X... " >&6; } + + +# Check whether --with-x was given. +if test "${with_x+set}" = set; then : + withval=$with_x; +fi + +# $have_x is `yes', `no', `disabled', or empty when we do not yet know. +if test "x$with_x" = xno; then + # The user explicitly disabled X. + have_x=disabled +else + case $x_includes,$x_libraries in #( + *\'*) as_fn_error $? "cannot use X directory names containing '" "$LINENO" 5;; #( + *,NONE | NONE,*) if ${ac_cv_have_x+:} false; then : + $as_echo_n "(cached) " >&6 +else + # One or both of the vars are not set, and there is no cached value. +ac_x_includes=no ac_x_libraries=no +rm -f -r conftest.dir +if mkdir conftest.dir; then + cd conftest.dir + cat >Imakefile <<'_ACEOF' +incroot: + @echo incroot='${INCROOT}' +usrlibdir: + @echo usrlibdir='${USRLIBDIR}' +libdir: + @echo libdir='${LIBDIR}' +_ACEOF + if (export CC; ${XMKMF-xmkmf}) >/dev/null 2>/dev/null && test -f Makefile; then + # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. + for ac_var in incroot usrlibdir libdir; do + eval "ac_im_$ac_var=\`\${MAKE-make} $ac_var 2>/dev/null | sed -n 's/^$ac_var=//p'\`" + done + # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR. + for ac_extension in a so sl dylib la dll; do + if test ! -f "$ac_im_usrlibdir/libX11.$ac_extension" && + test -f "$ac_im_libdir/libX11.$ac_extension"; then + ac_im_usrlibdir=$ac_im_libdir; break + fi + done + # Screen out bogus values from the imake configuration. They are + # bogus both because they are the default anyway, and because + # using them would break gcc on systems where it needs fixed includes. + case $ac_im_incroot in + /usr/include) ac_x_includes= ;; + *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;; + esac + case $ac_im_usrlibdir in + /usr/lib | /usr/lib64 | /lib | /lib64) ;; + *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;; + esac + fi + cd .. + rm -f -r conftest.dir +fi + +# Standard set of common directories for X headers. +# Check X11 before X11Rn because it is often a symlink to the current release. +ac_x_header_dirs=' +/usr/X11/include +/usr/X11R7/include +/usr/X11R6/include +/usr/X11R5/include +/usr/X11R4/include + +/usr/include/X11 +/usr/include/X11R7 +/usr/include/X11R6 +/usr/include/X11R5 +/usr/include/X11R4 + +/usr/local/X11/include +/usr/local/X11R7/include +/usr/local/X11R6/include +/usr/local/X11R5/include +/usr/local/X11R4/include + +/usr/local/include/X11 +/usr/local/include/X11R7 +/usr/local/include/X11R6 +/usr/local/include/X11R5 +/usr/local/include/X11R4 + +/usr/X386/include +/usr/x386/include +/usr/XFree86/include/X11 + +/usr/include +/usr/local/include +/usr/unsupported/include +/usr/athena/include +/usr/local/x11r5/include +/usr/lpp/Xamples/include + +/usr/openwin/include +/usr/openwin/share/include' + +if test "$ac_x_includes" = no; then + # Guess where to find include files, by looking for Xlib.h. + # First, try using that file with no special directory specified. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + # We can compile using X headers with no special include directory. +ac_x_includes= +else + for ac_dir in $ac_x_header_dirs; do + if test -r "$ac_dir/X11/Xlib.h"; then + ac_x_includes=$ac_dir + break + fi +done +fi +rm -f conftest.err conftest.i conftest.$ac_ext +fi # $ac_x_includes = no + +if test "$ac_x_libraries" = no; then + # Check for the libraries. + # See if we find them without any special options. + # Don't add to $LIBS permanently. + ac_save_LIBS=$LIBS + LIBS="-lX11 $LIBS" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +XrmInitialize () + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + LIBS=$ac_save_LIBS +# We can link X programs with no special library path. +ac_x_libraries= +else + LIBS=$ac_save_LIBS +for ac_dir in `$as_echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g` +do + # Don't even attempt the hair of trying to link an X program! + for ac_extension in a so sl dylib la dll; do + if test -r "$ac_dir/libX11.$ac_extension"; then + ac_x_libraries=$ac_dir + break 2 + fi + done +done +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi # $ac_x_libraries = no + +case $ac_x_includes,$ac_x_libraries in #( + no,* | *,no | *\'*) + # Didn't find X, or a directory has "'" in its name. + ac_cv_have_x="have_x=no";; #( + *) + # Record where we found X for the cache. + ac_cv_have_x="have_x=yes\ + ac_x_includes='$ac_x_includes'\ + ac_x_libraries='$ac_x_libraries'" +esac +fi +;; #( + *) have_x=yes;; + esac + eval "$ac_cv_have_x" +fi # $with_x != no + +if test "$have_x" != yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_x" >&5 +$as_echo "$have_x" >&6; } + no_x=yes +else + # If each of the values was on the command line, it overrides each guess. + test "x$x_includes" = xNONE && x_includes=$ac_x_includes + test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries + # Update the cache value to reflect the command line values. + ac_cv_have_x="have_x=yes\ + ac_x_includes='$x_includes'\ + ac_x_libraries='$x_libraries'" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: libraries $x_libraries, headers $x_includes" >&5 +$as_echo "libraries $x_libraries, headers $x_includes" >&6; } +fi + +if test "$no_x" = yes; then + # Not all programs may use this symbol, but it does not hurt to define it. + +$as_echo "#define X_DISPLAY_MISSING 1" >>confdefs.h + + X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS= +else + if test -n "$x_includes"; then + X_CFLAGS="$X_CFLAGS -I$x_includes" + fi + + # It would also be nice to do this for all -L options, not just this one. + if test -n "$x_libraries"; then + X_LIBS="$X_LIBS -L$x_libraries" + # For Solaris; some versions of Sun CC require a space after -R and + # others require no space. Words are not sufficient . . . . + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -R must be followed by a space" >&5 +$as_echo_n "checking whether -R must be followed by a space... " >&6; } + ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries" + ac_xsave_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + X_LIBS="$X_LIBS -R$x_libraries" +else + LIBS="$ac_xsave_LIBS -R $x_libraries" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + X_LIBS="$X_LIBS -R $x_libraries" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: neither works" >&5 +$as_echo "neither works" >&6; } +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + ac_c_werror_flag=$ac_xsave_c_werror_flag + LIBS=$ac_xsave_LIBS + fi + + # Check for system-dependent libraries X programs must link with. + # Do this before checking for the system-independent R6 libraries + # (-lICE), since we may need -lsocket or whatever for X linking. + + if test "$ISC" = yes; then + X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet" + else + # Martyn Johnson says this is needed for Ultrix, if the X + # libraries were built with DECnet support. And Karl Berry says + # the Alpha needs dnet_stub (dnet does not exist). + ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char XOpenDisplay (); +int +main () +{ +return XOpenDisplay (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dnet_ntoa in -ldnet" >&5 +$as_echo_n "checking for dnet_ntoa in -ldnet... " >&6; } +if ${ac_cv_lib_dnet_dnet_ntoa+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldnet $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dnet_ntoa (); +int +main () +{ +return dnet_ntoa (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dnet_dnet_ntoa=yes +else + ac_cv_lib_dnet_dnet_ntoa=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dnet_dnet_ntoa" >&5 +$as_echo "$ac_cv_lib_dnet_dnet_ntoa" >&6; } +if test "x$ac_cv_lib_dnet_dnet_ntoa" = xyes; then : + X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet" +fi + + if test $ac_cv_lib_dnet_dnet_ntoa = no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dnet_ntoa in -ldnet_stub" >&5 +$as_echo_n "checking for dnet_ntoa in -ldnet_stub... " >&6; } +if ${ac_cv_lib_dnet_stub_dnet_ntoa+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldnet_stub $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dnet_ntoa (); +int +main () +{ +return dnet_ntoa (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dnet_stub_dnet_ntoa=yes +else + ac_cv_lib_dnet_stub_dnet_ntoa=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5 +$as_echo "$ac_cv_lib_dnet_stub_dnet_ntoa" >&6; } +if test "x$ac_cv_lib_dnet_stub_dnet_ntoa" = xyes; then : + X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub" +fi + + fi +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$ac_xsave_LIBS" + + # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT, + # to get the SysV transport functions. + # Chad R. Larson says the Pyramis MIS-ES running DC/OSx (SVR4) + # needs -lnsl. + # The nsl library prevents programs from opening the X display + # on Irix 5.2, according to T.E. Dickey. + # The functions gethostbyname, getservbyname, and inet_addr are + # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking. + ac_fn_c_check_func "$LINENO" "gethostbyname" "ac_cv_func_gethostbyname" +if test "x$ac_cv_func_gethostbyname" = xyes; then : + +fi + + if test $ac_cv_func_gethostbyname = no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lnsl" >&5 +$as_echo_n "checking for gethostbyname in -lnsl... " >&6; } +if ${ac_cv_lib_nsl_gethostbyname+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lnsl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char gethostbyname (); +int +main () +{ +return gethostbyname (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_nsl_gethostbyname=yes +else + ac_cv_lib_nsl_gethostbyname=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_gethostbyname" >&5 +$as_echo "$ac_cv_lib_nsl_gethostbyname" >&6; } +if test "x$ac_cv_lib_nsl_gethostbyname" = xyes; then : + X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl" +fi + + if test $ac_cv_lib_nsl_gethostbyname = no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lbsd" >&5 +$as_echo_n "checking for gethostbyname in -lbsd... " >&6; } +if ${ac_cv_lib_bsd_gethostbyname+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lbsd $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char gethostbyname (); +int +main () +{ +return gethostbyname (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_bsd_gethostbyname=yes +else + ac_cv_lib_bsd_gethostbyname=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bsd_gethostbyname" >&5 +$as_echo "$ac_cv_lib_bsd_gethostbyname" >&6; } +if test "x$ac_cv_lib_bsd_gethostbyname" = xyes; then : + X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd" +fi + + fi + fi + + # lieder@skyler.mavd.honeywell.com says without -lsocket, + # socket/setsockopt and other routines are undefined under SCO ODT + # 2.0. But -lsocket is broken on IRIX 5.2 (and is not necessary + # on later versions), says Simon Leinen: it contains gethostby* + # variants that don't use the name server (or something). -lsocket + # must be given before -lnsl if both are needed. We assume that + # if connect needs -lnsl, so does gethostbyname. + ac_fn_c_check_func "$LINENO" "connect" "ac_cv_func_connect" +if test "x$ac_cv_func_connect" = xyes; then : + +fi + + if test $ac_cv_func_connect = no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for connect in -lsocket" >&5 +$as_echo_n "checking for connect in -lsocket... " >&6; } +if ${ac_cv_lib_socket_connect+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lsocket $X_EXTRA_LIBS $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char connect (); +int +main () +{ +return connect (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_socket_connect=yes +else + ac_cv_lib_socket_connect=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_connect" >&5 +$as_echo "$ac_cv_lib_socket_connect" >&6; } +if test "x$ac_cv_lib_socket_connect" = xyes; then : + X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS" +fi + + fi + + # Guillermo Gomez says -lposix is necessary on A/UX. + ac_fn_c_check_func "$LINENO" "remove" "ac_cv_func_remove" +if test "x$ac_cv_func_remove" = xyes; then : + +fi + + if test $ac_cv_func_remove = no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for remove in -lposix" >&5 +$as_echo_n "checking for remove in -lposix... " >&6; } +if ${ac_cv_lib_posix_remove+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lposix $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char remove (); +int +main () +{ +return remove (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_posix_remove=yes +else + ac_cv_lib_posix_remove=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_posix_remove" >&5 +$as_echo "$ac_cv_lib_posix_remove" >&6; } +if test "x$ac_cv_lib_posix_remove" = xyes; then : + X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix" +fi + + fi + + # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay. + ac_fn_c_check_func "$LINENO" "shmat" "ac_cv_func_shmat" +if test "x$ac_cv_func_shmat" = xyes; then : + +fi + + if test $ac_cv_func_shmat = no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shmat in -lipc" >&5 +$as_echo_n "checking for shmat in -lipc... " >&6; } +if ${ac_cv_lib_ipc_shmat+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lipc $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char shmat (); +int +main () +{ +return shmat (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_ipc_shmat=yes +else + ac_cv_lib_ipc_shmat=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ipc_shmat" >&5 +$as_echo "$ac_cv_lib_ipc_shmat" >&6; } +if test "x$ac_cv_lib_ipc_shmat" = xyes; then : + X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc" +fi + + fi + fi + + # Check for libraries that X11R6 Xt/Xaw programs need. + ac_save_LDFLAGS=$LDFLAGS + test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries" + # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to + # check for ICE first), but we must link in the order -lSM -lICE or + # we get undefined symbols. So assume we have SM if we have ICE. + # These have to be linked with before -lX11, unlike the other + # libraries we check for below, so use a different variable. + # John Interrante, Karl Berry + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IceConnectionNumber in -lICE" >&5 +$as_echo_n "checking for IceConnectionNumber in -lICE... " >&6; } +if ${ac_cv_lib_ICE_IceConnectionNumber+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lICE $X_EXTRA_LIBS $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char IceConnectionNumber (); +int +main () +{ +return IceConnectionNumber (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_ICE_IceConnectionNumber=yes +else + ac_cv_lib_ICE_IceConnectionNumber=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5 +$as_echo "$ac_cv_lib_ICE_IceConnectionNumber" >&6; } +if test "x$ac_cv_lib_ICE_IceConnectionNumber" = xyes; then : + X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE" +fi + + LDFLAGS=$ac_save_LDFLAGS + +fi + + +# Implementation of the --disable-dev-random switch. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if you want to use mmap if available" >&5 +$as_echo_n "checking if you want to use mmap if available... " >&6; } +# Check whether --enable-mmap was given. +if test "${enable_mmap+set}" = set; then : + enableval=$enable_mmap; jd_use_mmap=$enableval +else + jd_use_mmap=yes +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $jd_use_mmap" >&5 +$as_echo "$jd_use_mmap" >&6; } +case "x$jd_use_mmap" in +xyes ) + $as_echo "#define USE_MMAP 1" >>confdefs.h + + ;; +esac + +#Check these header since they cause trouble +for ac_header in \ +stdlib.h \ +unistd.h \ +memory.h \ +malloc.h \ +termios.h \ +sys/mman.h \ + +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + +ac_header_dirent=no +for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do + as_ac_Header=`$as_echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh` +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_hdr that defines DIR" >&5 +$as_echo_n "checking for $ac_hdr that defines DIR... " >&6; } +if eval \${$as_ac_Header+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include <$ac_hdr> + +int +main () +{ +if ((DIR *) 0) +return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval "$as_ac_Header=yes" +else + eval "$as_ac_Header=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$as_ac_Header + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_hdr" | $as_tr_cpp` 1 +_ACEOF + +ac_header_dirent=$ac_hdr; break +fi + +done +# Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. +if test $ac_header_dirent = dirent.h; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5 +$as_echo_n "checking for library containing opendir... " >&6; } +if ${ac_cv_search_opendir+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char opendir (); +int +main () +{ +return opendir (); + ; + return 0; +} +_ACEOF +for ac_lib in '' dir; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_c_try_link "$LINENO"; then : + ac_cv_search_opendir=$ac_res +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext + if ${ac_cv_search_opendir+:} false; then : + break +fi +done +if ${ac_cv_search_opendir+:} false; then : + +else + ac_cv_search_opendir=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5 +$as_echo "$ac_cv_search_opendir" >&6; } +ac_res=$ac_cv_search_opendir +if test "$ac_res" != no; then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + +fi + +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5 +$as_echo_n "checking for library containing opendir... " >&6; } +if ${ac_cv_search_opendir+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char opendir (); +int +main () +{ +return opendir (); + ; + return 0; +} +_ACEOF +for ac_lib in '' x; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_c_try_link "$LINENO"; then : + ac_cv_search_opendir=$ac_res +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext + if ${ac_cv_search_opendir+:} false; then : + break +fi +done +if ${ac_cv_search_opendir+:} false; then : + +else + ac_cv_search_opendir=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5 +$as_echo "$ac_cv_search_opendir" >&6; } +ac_res=$ac_cv_search_opendir +if test "$ac_res" != no; then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + +fi + +fi + + +ac_fn_c_check_type "$LINENO" "mode_t" "ac_cv_type_mode_t" "$ac_includes_default" +if test "x$ac_cv_type_mode_t" = xyes; then : + +else + +cat >>confdefs.h <<_ACEOF +#define mode_t int +_ACEOF + +fi + +ac_fn_c_check_type "$LINENO" "pid_t" "ac_cv_type_pid_t" "$ac_includes_default" +if test "x$ac_cv_type_pid_t" = xyes; then : + +else + +cat >>confdefs.h <<_ACEOF +#define pid_t int +_ACEOF + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for uid_t in sys/types.h" >&5 +$as_echo_n "checking for uid_t in sys/types.h... " >&6; } +if ${ac_cv_type_uid_t+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "uid_t" >/dev/null 2>&1; then : + ac_cv_type_uid_t=yes +else + ac_cv_type_uid_t=no +fi +rm -f conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_uid_t" >&5 +$as_echo "$ac_cv_type_uid_t" >&6; } +if test $ac_cv_type_uid_t = no; then + +$as_echo "#define uid_t int" >>confdefs.h + + +$as_echo "#define gid_t int" >>confdefs.h + +fi + +ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" +if test "x$ac_cv_type_size_t" = xyes; then : + +else + +cat >>confdefs.h <<_ACEOF +#define size_t unsigned int +_ACEOF + +fi + + +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of short" >&5 +$as_echo_n "checking size of short... " >&6; } +if ${ac_cv_sizeof_short+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (short))" "ac_cv_sizeof_short" "$ac_includes_default"; then : + +else + if test "$ac_cv_type_short" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (short) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_short=0 + fi +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_short" >&5 +$as_echo "$ac_cv_sizeof_short" >&6; } + + + +cat >>confdefs.h <<_ACEOF +#define SIZEOF_SHORT $ac_cv_sizeof_short +_ACEOF + + +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of int" >&5 +$as_echo_n "checking size of int... " >&6; } +if ${ac_cv_sizeof_int+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (int))" "ac_cv_sizeof_int" "$ac_includes_default"; then : + +else + if test "$ac_cv_type_int" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (int) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_int=0 + fi +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_int" >&5 +$as_echo "$ac_cv_sizeof_int" >&6; } + + + +cat >>confdefs.h <<_ACEOF +#define SIZEOF_INT $ac_cv_sizeof_int +_ACEOF + + +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long" >&5 +$as_echo_n "checking size of long... " >&6; } +if ${ac_cv_sizeof_long+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long))" "ac_cv_sizeof_long" "$ac_includes_default"; then : + +else + if test "$ac_cv_type_long" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (long) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_long=0 + fi +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long" >&5 +$as_echo "$ac_cv_sizeof_long" >&6; } + + + +cat >>confdefs.h <<_ACEOF +#define SIZEOF_LONG $ac_cv_sizeof_long +_ACEOF + + +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of float" >&5 +$as_echo_n "checking size of float... " >&6; } +if ${ac_cv_sizeof_float+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (float))" "ac_cv_sizeof_float" "$ac_includes_default"; then : + +else + if test "$ac_cv_type_float" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (float) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_float=0 + fi +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_float" >&5 +$as_echo "$ac_cv_sizeof_float" >&6; } + + + +cat >>confdefs.h <<_ACEOF +#define SIZEOF_FLOAT $ac_cv_sizeof_float +_ACEOF + + +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of double" >&5 +$as_echo_n "checking size of double... " >&6; } +if ${ac_cv_sizeof_double+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (double))" "ac_cv_sizeof_double" "$ac_includes_default"; then : + +else + if test "$ac_cv_type_double" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (double) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_double=0 + fi +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_double" >&5 +$as_echo "$ac_cv_sizeof_double" >&6; } + + + +cat >>confdefs.h <<_ACEOF +#define SIZEOF_DOUBLE $ac_cv_sizeof_double +_ACEOF + + + + + ac_fn_c_check_type "$LINENO" "long long" "ac_cv_type_long_long" "$ac_includes_default" +if test "x$ac_cv_type_long_long" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_LONG_LONG 1 +_ACEOF + + +fi + + # The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long long" >&5 +$as_echo_n "checking size of long long... " >&6; } +if ${ac_cv_sizeof_long_long+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long long))" "ac_cv_sizeof_long_long" "$ac_includes_default"; then : + +else + if test "$ac_cv_type_long_long" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (long long) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_long_long=0 + fi +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long_long" >&5 +$as_echo "$ac_cv_sizeof_long_long" >&6; } + + + +cat >>confdefs.h <<_ACEOF +#define SIZEOF_LONG_LONG $ac_cv_sizeof_long_long +_ACEOF + + + + + # Check whether --enable-largefile was given. +if test "${enable_largefile+set}" = set; then : + enableval=$enable_largefile; +fi + +if test "$enable_largefile" != no; then + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for special C compiler options needed for large files" >&5 +$as_echo_n "checking for special C compiler options needed for large files... " >&6; } +if ${ac_cv_sys_largefile_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_sys_largefile_CC=no + if test "$GCC" != yes; then + ac_save_CC=$CC + while :; do + # IRIX 6.2 and later do not support large files by default, + # so use the C compiler's -n32 option if that helps. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +int +main () +{ + + ; + return 0; +} +_ACEOF + if ac_fn_c_try_compile "$LINENO"; then : + break +fi +rm -f core conftest.err conftest.$ac_objext + CC="$CC -n32" + if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_sys_largefile_CC=' -n32'; break +fi +rm -f core conftest.err conftest.$ac_objext + break + done + CC=$ac_save_CC + rm -f conftest.$ac_ext + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_CC" >&5 +$as_echo "$ac_cv_sys_largefile_CC" >&6; } + if test "$ac_cv_sys_largefile_CC" != no; then + CC=$CC$ac_cv_sys_largefile_CC + fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _FILE_OFFSET_BITS value needed for large files" >&5 +$as_echo_n "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; } +if ${ac_cv_sys_file_offset_bits+:} false; then : + $as_echo_n "(cached) " >&6 +else + while :; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_sys_file_offset_bits=no; break +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#define _FILE_OFFSET_BITS 64 +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_sys_file_offset_bits=64; break +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_cv_sys_file_offset_bits=unknown + break +done +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_file_offset_bits" >&5 +$as_echo "$ac_cv_sys_file_offset_bits" >&6; } +case $ac_cv_sys_file_offset_bits in #( + no | unknown) ;; + *) +cat >>confdefs.h <<_ACEOF +#define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits +_ACEOF +;; +esac +rm -rf conftest* + if test $ac_cv_sys_file_offset_bits = unknown; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGE_FILES value needed for large files" >&5 +$as_echo_n "checking for _LARGE_FILES value needed for large files... " >&6; } +if ${ac_cv_sys_large_files+:} false; then : + $as_echo_n "(cached) " >&6 +else + while :; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_sys_large_files=no; break +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#define _LARGE_FILES 1 +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_sys_large_files=1; break +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_cv_sys_large_files=unknown + break +done +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_large_files" >&5 +$as_echo "$ac_cv_sys_large_files" >&6; } +case $ac_cv_sys_large_files in #( + no | unknown) ;; + *) +cat >>confdefs.h <<_ACEOF +#define _LARGE_FILES $ac_cv_sys_large_files +_ACEOF +;; +esac +rm -rf conftest* + fi + + +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGEFILE_SOURCE value needed for large files" >&5 +$as_echo_n "checking for _LARGEFILE_SOURCE value needed for large files... " >&6; } +if ${ac_cv_sys_largefile_source+:} false; then : + $as_echo_n "(cached) " >&6 +else + while :; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include /* for off_t */ + #include +int +main () +{ +int (*fp) (FILE *, off_t, int) = fseeko; + return fseeko (stdin, 0, 0) && fp (stdin, 0, 0); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_sys_largefile_source=no; break +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#define _LARGEFILE_SOURCE 1 +#include /* for off_t */ + #include +int +main () +{ +int (*fp) (FILE *, off_t, int) = fseeko; + return fseeko (stdin, 0, 0) && fp (stdin, 0, 0); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_sys_largefile_source=1; break +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + ac_cv_sys_largefile_source=unknown + break +done +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_source" >&5 +$as_echo "$ac_cv_sys_largefile_source" >&6; } +case $ac_cv_sys_largefile_source in #( + no | unknown) ;; + *) +cat >>confdefs.h <<_ACEOF +#define _LARGEFILE_SOURCE $ac_cv_sys_largefile_source +_ACEOF +;; +esac +rm -rf conftest* + +# We used to try defining _XOPEN_SOURCE=500 too, to work around a bug +# in glibc 2.1.3, but that breaks too many other things. +# If you want fseeko and ftello with glibc, upgrade to a fixed glibc. +if test $ac_cv_sys_largefile_source != unknown; then + +$as_echo "#define HAVE_FSEEKO 1" >>confdefs.h + +fi + + ac_fn_c_check_type "$LINENO" "off_t" "ac_cv_type_off_t" "$ac_includes_default" +if test "x$ac_cv_type_off_t" = xyes; then : + +else + +cat >>confdefs.h <<_ACEOF +#define off_t long int +_ACEOF + +fi + + # The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of off_t" >&5 +$as_echo_n "checking size of off_t... " >&6; } +if ${ac_cv_sizeof_off_t+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (off_t))" "ac_cv_sizeof_off_t" "$ac_includes_default"; then : + +else + if test "$ac_cv_type_off_t" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (off_t) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_off_t=0 + fi +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_off_t" >&5 +$as_echo "$ac_cv_sizeof_off_t" >&6; } + + + +cat >>confdefs.h <<_ACEOF +#define SIZEOF_OFF_T $ac_cv_sizeof_off_t +_ACEOF + + + + +for ac_func in \ +memset \ +memcpy \ +putenv \ +getcwd \ +mmap \ +snprintf \ +getpgrp tcgetpgrp \ + +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + + +#--------------------------------------------------------------------------- +# Set the source directory and object directory. The makefile assumes an +# absolute path name. This is because src/Makefile cds to OBJDIR and compiles +# the src file which is in SRCDIR +#--------------------------------------------------------------------------- +SRCDIR=$CONFIG_DIR +if test "" != "." +then + if test -z "" + then + SRCDIR=$SRCDIR/src + else + SRCDIR=$SRCDIR/ + fi +fi + +OBJDIR=$SRCDIR/"\$(ARCH)"objs +ELFDIR=$SRCDIR/"\$(ARCH)"elfobjs + + +# Extract the first word of "ncurses5-config", so it can be a program name with args. +set dummy ncurses5-config; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_nc5config+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $nc5config in + [\\/]* | ?:[\\/]*) + ac_cv_path_nc5config="$nc5config" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_nc5config="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path_nc5config" && ac_cv_path_nc5config="no" + ;; +esac +fi +nc5config=$ac_cv_path_nc5config +if test -n "$nc5config"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $nc5config" >&5 +$as_echo "$nc5config" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +if test "$nc5config" = "no" +then + # Extract the first word of "ncursesw5-config", so it can be a program name with args. +set dummy ncursesw5-config; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_nc5config+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $nc5config in + [\\/]* | ?:[\\/]*) + ac_cv_path_nc5config="$nc5config" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_nc5config="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path_nc5config" && ac_cv_path_nc5config="no" + ;; +esac +fi +nc5config=$ac_cv_path_nc5config +if test -n "$nc5config"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $nc5config" >&5 +$as_echo "$nc5config" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for terminfo" >&5 +$as_echo_n "checking for terminfo... " >&6; } +if test "$nc5config" != "no" +then + MISC_TERMINFO_DIRS=`$nc5config --terminfo` +else + MISC_TERMINFO_DIRS="" +fi +JD_Terminfo_Dirs="$MISC_TERMINFO_DIRS \ + /usr/lib/terminfo \ + /usr/share/terminfo \ + /usr/share/lib/terminfo \ + /usr/local/lib/terminfo" +TERMCAP=-ltermcap + +for terminfo_dir in $JD_Terminfo_Dirs +do + if test -d $terminfo_dir + then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + TERMCAP="" + break + fi +done +if test "$TERMCAP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + +$as_echo "#define USE_TERMCAP 1" >>confdefs.h + +fi + + + if test "X$jd_prefix" = "X" + then + jd_prefix=$ac_default_prefix + if test "X$prefix" != "XNONE" + then + jd_prefix="$prefix" + fi + jd_exec_prefix="$jd_prefix" + if test "X$exec_prefix" != "XNONE" + then + jd_exec_prefix="$exec_prefix" + fi + + eval `sh <&5 +$as_echo_n "checking for the slang library and header files ... " >&6; } + if test X"$jd_with_slang_library" != Xno + then + jd_slang_inc_file= + + if test "X$jd_slang_inc_file" = "X" + then + jd_slang_inc_file=slang.h + fi + + if test X"$jd_slang_include_dir" = X + then + inc_and_lib_dirs="\ + $jd_prefix_incdir,$jd_prefix_libdir \ + /usr/local/slang/include,/usr/local/slang/lib \ + /usr/local/include/slang,/usr/local/lib \ + /usr/local/include,/usr/local/lib \ + $JD_SYS_INCLIBS \ + /usr/include/slang,/usr/lib \ + /usr/slang/include,/usr/slang/lib \ + /usr/include,/usr/lib \ + /opt/include/slang,/opt/lib \ + /opt/slang/include,/opt/slang/lib \ + /opt/include,/opt/lib" + + if test X != X + then + inc_and_lib_dirs="/include,/lib $inc_and_lib_dirs" + fi + + case "$host_os" in + *darwin* ) + exts="dylib so a" + ;; + *cygwin* ) + exts="dll.a so a" + ;; + * ) + exts="so a" + esac + + xincfile="$jd_slang_inc_file" + xlibfile="libslang" + jd_with_slang_library="no" + + for include_and_lib in $inc_and_lib_dirs + do + # Yuk. Is there a better way to set these variables?? + xincdir=`echo $include_and_lib | tr ',' ' ' | awk '{print $1}'` + xlibdir=`echo $include_and_lib | tr ',' ' ' | awk '{print $2}'` + found=0 + if test -r $xincdir/$xincfile + then + for E in $exts + do + if test -r "$xlibdir/$xlibfile.$E" + then + jd_slang_include_dir="$xincdir" + jd_slang_library_dir="$xlibdir" + jd_with_slang_library="yes" + found=1 + break + fi + done + fi + if test $found -eq 1 + then + break + fi + done + fi + fi + + if test X"$jd_slang_include_dir" != X -a X"$jd_slang_library_dir" != X + then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes: $jd_slang_library_dir and $jd_slang_include_dir" >&5 +$as_echo "yes: $jd_slang_library_dir and $jd_slang_include_dir" >&6; } + jd_with_slang_library="yes" + SLANG_LIB=-L$jd_slang_library_dir + SLANG_LIB_DIR=$jd_slang_library_dir + if test "X$jd_slang_library_dir" = "X/usr/lib" -o "X$jd_slang_include_dir" = "X/usr/include" + then + SLANG_LIB="" + else + +if test "X$jd_slang_library_dir" != "X" +then + if test "X$RPATH" = "X" + then + +case "$host_os" in + *linux*|*solaris* ) + if test "X$GCC" = Xyes + then + if test "X$ac_R_nospace" = "Xno" + then + RPATH="-Wl,-R," + else + RPATH="-Wl,-R" + fi + else + if test "X$ac_R_nospace" = "Xno" + then + RPATH="-R " + else + RPATH="-R" + fi + fi + ;; + *osf*|*openbsd*|*freebsd*) + if test "X$GCC" = Xyes + then + RPATH="-Wl,-rpath," + else + RPATH="-rpath " + fi + ;; + *netbsd*) + if test "X$GCC" = Xyes + then + RPATH="-Wl,-R" + fi + ;; +esac + + if test "X$RPATH" != "X" + then + RPATH="$RPATH$jd_slang_library_dir" + fi + else + _already_there=0 + for X in `echo $RPATH | sed 's/:/ /g'` + do + if test "$X" = "$jd_slang_library_dir" + then + _already_there=1 + break + fi + done + if test $_already_there = 0 + then + RPATH="$RPATH:$jd_slang_library_dir" + fi + fi +fi + + fi + + SLANG_INC=-I$jd_slang_include_dir + SLANG_INC_DIR=$jd_slang_include_dir + if test "X$jd_slang_include_dir" = "X/usr/include" + then + SLANG_INC="" + fi + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + jd_with_slang_library="no" + SLANG_INC="" + SLANG_LIB="" + SLANG_INC_DIR="" + SLANG_LIB_DIR="" + fi + + + + + + if test "$jd_with_slang_library" = "no" + then + as_fn_error $? "unable to find the slang library and header file $jd_slang_inc_file" "$LINENO" 5 + fi + + +# Check whether --enable-warnings was given. +if test "${enable_warnings+set}" = set; then : + enableval=$enable_warnings; gcc_warnings=$enableval +fi + +if test -n "$GCC" +then + #CFLAGS="$CFLAGS -fno-strength-reduce" + if test -n "$gcc_warnings" + then + CFLAGS="$CFLAGS -Wall -W -pedantic -Winline -Wmissing-prototypes \ + -Wnested-externs -Wpointer-arith -Wcast-align -Wshadow -Wstrict-prototypes \ + -Wformat=2" + # Now trim excess whitespace + CFLAGS=`echo $CFLAGS` + fi +fi + + + PROGRAM_HFILES="" + PROGRAM_OFILES="" + PROGRAM_CFILES="" + PROGRAM_OBJECTS="" + PROGRAM_ELFOBJECTS="" + PROGRAM_OBJECT_RULES="" + PROGRAM_ELF_ORULES="" + if test -z "src/modules.lis" + then + Program_Modules="" + else + comment_re="^#" + Program_Modules=`grep -v '$comment_re' src/modules.lis | awk '{print $1}'` + Program_H_Modules=`grep -v '$comment_re' src/modules.lis | awk '{print $2}'` + for program_module in $Program_H_Modules; do + PROGRAM_HFILES="$PROGRAM_HFILES $program_module" + done + fi + for program_module in $Program_Modules; do + PROGRAM_OFILES="$PROGRAM_OFILES $program_module.o" + PROGRAM_CFILES="$PROGRAM_CFILES $program_module.c" + PROGRAM_OBJECTS="$PROGRAM_OBJECTS \$(OBJDIR)/$program_module.o" + PROGRAM_ELFOBJECTS="$PROGRAM_ELFOBJECTS \$(ELFDIR)/$program_module.o" + done + + + for program_module in $Program_Modules; do + +PROGRAM_OBJECT_RULES="$PROGRAM_OBJECT_RULES +\$(OBJDIR)/$program_module.o : \$(SRCDIR)/$program_module.c \$(DOT_O_DEPS) \$(OBJ_O_DEPS) \$("$program_module"_O_DEP) + cd \$(OBJDIR) && \$(COMPILE_CMD) \$("$program_module"_C_FLAGS) \$(SRCDIR)/$program_module.c +" + + +PROGRAM_ELF_ORULES="$PROGRAM_ELF_ORULES +\$(ELFDIR)/$program_module.o : \$(SRCDIR)/$program_module.c \$(DOT_O_DEPS) \$(ELF_O_DEPS) \$("$program_module"_O_DEP) + cd \$(ELFDIR) && \$(ELFCOMPILE_CMD) \$("$program_module"_C_FLAGS) \$(SRCDIR)/$program_module.c +" + + done + + +ac_config_headers="$ac_config_headers src/sysconf.h:src/config.hin" + +ac_config_files="$ac_config_files Makefile:autoconf/Makefile.in src/Makefile" + +cat >confcache <<\_ACEOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs, see configure's option --config-cache. +# It is not useful on other systems. If it contains results you don't +# want to keep, you may remove or edit it. +# +# config.status only pays attention to the cache file if you give it +# the --recheck option to rerun configure. +# +# `ac_cv_env_foo' variables (set or unset) will be overridden when +# loading this file, other *unset* `ac_cv_foo' will be assigned the +# following values. + +_ACEOF + +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, we kill variables containing newlines. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +( + for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + + (set) 2>&1 | + case $as_nl`(ac_space=' '; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + # `set' does not quote correctly, so add quotes: double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \. + sed -n \ + "s/'/'\\\\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" + ;; #( + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) | + sed ' + /^ac_cv_env_/b end + t clear + :clear + s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + t end + s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + :end' >>confcache +if diff "$cache_file" confcache >/dev/null 2>&1; then :; else + if test -w "$cache_file"; then + if test "x$cache_file" != "x/dev/null"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 +$as_echo "$as_me: updating cache $cache_file" >&6;} + if test ! -f "$cache_file" || test -h "$cache_file"; then + cat confcache >"$cache_file" + else + case $cache_file in #( + */* | ?:*) + mv -f confcache "$cache_file"$$ && + mv -f "$cache_file"$$ "$cache_file" ;; #( + *) + mv -f confcache "$cache_file" ;; + esac + fi + fi + else + { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 +$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} + fi +fi +rm -f confcache + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +DEFS=-DHAVE_CONFIG_H + +ac_libobjs= +ac_ltlibobjs= +U= +for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue + # 1. Remove the extension, and $U if already installed. + ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' + ac_i=`$as_echo "$ac_i" | sed "$ac_script"` + # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR + # will be set to the directory where LIBOBJS objects are built. + as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" + as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' +done +LIBOBJS=$ac_libobjs + +LTLIBOBJS=$ac_ltlibobjs + + + +: "${CONFIG_STATUS=./config.status}" +ac_write_fail=0 +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files $CONFIG_STATUS" +{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 +$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} +as_write_fail=0 +cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 +#! $SHELL +# Generated by $as_me. +# Run this file to recreate the current configuration. +# Compiler output produced by configure, useful for debugging +# configure, is in config.log if it exists. + +debug=false +ac_cs_recheck=false +ac_cs_silent=false + +SHELL=\${CONFIG_SHELL-$SHELL} +export SHELL +_ASEOF +cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi + + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in #( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +case $0 in #(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + + +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error + + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -pR'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -pR' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -pR' + fi +else + as_ln_s='cp -pR' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} # as_fn_mkdir_p +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p +as_test_x='test -x' +as_executable_p=as_fn_executable_p + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +exec 6>&1 +## ----------------------------------- ## +## Main body of $CONFIG_STATUS script. ## +## ----------------------------------- ## +_ASEOF +test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# Save the log message, to keep $0 and so on meaningful, and to +# report actual input values of CONFIG_FILES etc. instead of their +# values after options handling. +ac_log=" +This file was extended by $as_me, which was +generated by GNU Autoconf 2.69. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + $ $0 $@ + +on `(hostname || uname -n) 2>/dev/null | sed 1q` +" + +_ACEOF + +case $ac_config_files in *" +"*) set x $ac_config_files; shift; ac_config_files=$*;; +esac + +case $ac_config_headers in *" +"*) set x $ac_config_headers; shift; ac_config_headers=$*;; +esac + + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# Files that config.status was made for. +config_files="$ac_config_files" +config_headers="$ac_config_headers" + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +ac_cs_usage="\ +\`$as_me' instantiates files and other configuration actions +from templates according to the current configuration. Unless the files +and actions are specified as TAGs, all are instantiated by default. + +Usage: $0 [OPTION]... [TAG]... + + -h, --help print this help, then exit + -V, --version print version number and configuration settings, then exit + --config print configuration, then exit + -q, --quiet, --silent + do not print progress messages + -d, --debug don't remove temporary files + --recheck update $as_me by reconfiguring in the same conditions + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + --header=FILE[:TEMPLATE] + instantiate the configuration header FILE + +Configuration files: +$config_files + +Configuration headers: +$config_headers + +Report bugs to the package provider." + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" +ac_cs_version="\\ +config.status +configured by $0, generated by GNU Autoconf 2.69, + with options \\"\$ac_cs_config\\" + +Copyright (C) 2012 Free Software Foundation, Inc. +This config.status script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it." + +ac_pwd='$ac_pwd' +srcdir='$srcdir' +INSTALL='$INSTALL' +test -n "\$AWK" || AWK=awk +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# The default lists apply if the user does not specify any file. +ac_need_defaults=: +while test $# != 0 +do + case $1 in + --*=?*) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` + ac_shift=: + ;; + --*=) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg= + ac_shift=: + ;; + *) + ac_option=$1 + ac_optarg=$2 + ac_shift=shift + ;; + esac + + case $ac_option in + # Handling of the options. + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + ac_cs_recheck=: ;; + --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) + $as_echo "$ac_cs_version"; exit ;; + --config | --confi | --conf | --con | --co | --c ) + $as_echo "$ac_cs_config"; exit ;; + --debug | --debu | --deb | --de | --d | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + '') as_fn_error $? "missing file argument" ;; + esac + as_fn_append CONFIG_FILES " '$ac_optarg'" + ac_need_defaults=false;; + --header | --heade | --head | --hea ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + as_fn_append CONFIG_HEADERS " '$ac_optarg'" + ac_need_defaults=false;; + --he | --h) + # Conflict between --help and --header + as_fn_error $? "ambiguous option: \`$1' +Try \`$0 --help' for more information.";; + --help | --hel | -h ) + $as_echo "$ac_cs_usage"; exit ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; + + # This is an error. + -*) as_fn_error $? "unrecognized option: \`$1' +Try \`$0 --help' for more information." ;; + + *) as_fn_append ac_config_targets " $1" + ac_need_defaults=false ;; + + esac + shift +done + +ac_configure_extra_args= + +if $ac_cs_silent; then + exec 6>/dev/null + ac_configure_extra_args="$ac_configure_extra_args --silent" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +if \$ac_cs_recheck; then + set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + shift + \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 + CONFIG_SHELL='$SHELL' + export CONFIG_SHELL + exec "\$@" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX + $as_echo "$ac_log" +} >&5 + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + +# Handling of arguments. +for ac_config_target in $ac_config_targets +do + case $ac_config_target in + "src/sysconf.h") CONFIG_HEADERS="$CONFIG_HEADERS src/sysconf.h:src/config.hin" ;; + "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile:autoconf/Makefile.in" ;; + "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; + + *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; + esac +done + + +# If the user did not use the arguments to specify the items to instantiate, +# then the envvar interface is used. Set only those that are not. +# We use the long form for the default assignment because of an extremely +# bizarre bug on SunOS 4.1.3. +if $ac_need_defaults; then + test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files + test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers +fi + +# Have a temporary directory for convenience. Make it in the build tree +# simply because there is no reason against having it here, and in addition, +# creating and moving files from /tmp can sometimes cause problems. +# Hook for its removal unless debugging. +# Note that there is a small window in which the directory will not be cleaned: +# after its creation but before its name has been assigned to `$tmp'. +$debug || +{ + tmp= ac_tmp= + trap 'exit_status=$? + : "${ac_tmp:=$tmp}" + { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status +' 0 + trap 'as_fn_exit 1' 1 2 13 15 +} +# Create a (secure) tmp directory for tmp files. + +{ + tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && + test -d "$tmp" +} || +{ + tmp=./conf$$-$RANDOM + (umask 077 && mkdir "$tmp") +} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 +ac_tmp=$tmp + +# Set up the scripts for CONFIG_FILES section. +# No need to generate them if there are no CONFIG_FILES. +# This happens for instance with `./config.status config.h'. +if test -n "$CONFIG_FILES"; then + + +ac_cr=`echo X | tr X '\015'` +# On cygwin, bash can eat \r inside `` if the user requested igncr. +# But we know of no other shell where ac_cr would be empty at this +# point, so we can use a bashism as a fallback. +if test "x$ac_cr" = x; then + eval ac_cr=\$\'\\r\' +fi +ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` +if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then + ac_cs_awk_cr='\\r' +else + ac_cs_awk_cr=$ac_cr +fi + +echo 'BEGIN {' >"$ac_tmp/subs1.awk" && +_ACEOF + + +{ + echo "cat >conf$$subs.awk <<_ACEOF" && + echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && + echo "_ACEOF" +} >conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 +ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + . ./conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + + ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` + if test $ac_delim_n = $ac_delim_num; then + break + elif $ac_last_try; then + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done +rm -f conf$$subs.sh + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && +_ACEOF +sed -n ' +h +s/^/S["/; s/!.*/"]=/ +p +g +s/^[^!]*!// +:repl +t repl +s/'"$ac_delim"'$// +t delim +:nl +h +s/\(.\{148\}\)..*/\1/ +t more1 +s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ +p +n +b repl +:more1 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t nl +:delim +h +s/\(.\{148\}\)..*/\1/ +t more2 +s/["\\]/\\&/g; s/^/"/; s/$/"/ +p +b +:more2 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t delim +' >$CONFIG_STATUS || ac_write_fail=1 +rm -f conf$$subs.awk +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +_ACAWK +cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && + for (key in S) S_is_set[key] = 1 + FS = "" + +} +{ + line = $ 0 + nfields = split(line, field, "@") + substed = 0 + len = length(field[1]) + for (i = 2; i < nfields; i++) { + key = field[i] + keylen = length(key) + if (S_is_set[key]) { + value = S[key] + line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) + len += length(value) + length(field[++i]) + substed = 1 + } else + len += 1 + keylen + } + + print line +} + +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then + sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" +else + cat +fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ + || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 +_ACEOF + +# VPATH may cause trouble with some makes, so we remove sole $(srcdir), +# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ +h +s/// +s/^/:/ +s/[ ]*$/:/ +s/:\$(srcdir):/:/g +s/:\${srcdir}:/:/g +s/:@srcdir@:/:/g +s/^:*// +s/:*$// +x +s/\(=[ ]*\).*/\1/ +G +s/\n// +s/^[^=]*=[ ]*$// +}' +fi + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +fi # test -n "$CONFIG_FILES" + +# Set up the scripts for CONFIG_HEADERS section. +# No need to generate them if there are no CONFIG_HEADERS. +# This happens for instance with `./config.status Makefile'. +if test -n "$CONFIG_HEADERS"; then +cat >"$ac_tmp/defines.awk" <<\_ACAWK || +BEGIN { +_ACEOF + +# Transform confdefs.h into an awk script `defines.awk', embedded as +# here-document in config.status, that substitutes the proper values into +# config.h.in to produce config.h. + +# Create a delimiter string that does not exist in confdefs.h, to ease +# handling of long lines. +ac_delim='%!_!# ' +for ac_last_try in false false :; do + ac_tt=`sed -n "/$ac_delim/p" confdefs.h` + if test -z "$ac_tt"; then + break + elif $ac_last_try; then + as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done + +# For the awk script, D is an array of macro values keyed by name, +# likewise P contains macro parameters if any. Preserve backslash +# newline sequences. + +ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* +sed -n ' +s/.\{148\}/&'"$ac_delim"'/g +t rset +:rset +s/^[ ]*#[ ]*define[ ][ ]*/ / +t def +d +:def +s/\\$// +t bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3"/p +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p +d +:bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3\\\\\\n"\\/p +t cont +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p +t cont +d +:cont +n +s/.\{148\}/&'"$ac_delim"'/g +t clear +:clear +s/\\$// +t bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/"/p +d +:bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p +b cont +' >$CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + for (key in D) D_is_set[key] = 1 + FS = "" +} +/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { + line = \$ 0 + split(line, arg, " ") + if (arg[1] == "#") { + defundef = arg[2] + mac1 = arg[3] + } else { + defundef = substr(arg[1], 2) + mac1 = arg[2] + } + split(mac1, mac2, "(") #) + macro = mac2[1] + prefix = substr(line, 1, index(line, defundef) - 1) + if (D_is_set[macro]) { + # Preserve the white space surrounding the "#". + print prefix "define", macro P[macro] D[macro] + next + } else { + # Replace #undef with comments. This is necessary, for example, + # in the case of _POSIX_SOURCE, which is predefined and required + # on some systems where configure will not decide to define it. + if (defundef == "undef") { + print "/*", prefix defundef, macro, "*/" + next + } + } +} +{ print } +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 +fi # test -n "$CONFIG_HEADERS" + + +eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS " +shift +for ac_tag +do + case $ac_tag in + :[FHLC]) ac_mode=$ac_tag; continue;; + esac + case $ac_mode$ac_tag in + :[FHL]*:*);; + :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; + :[FH]-) ac_tag=-:-;; + :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; + esac + ac_save_IFS=$IFS + IFS=: + set x $ac_tag + IFS=$ac_save_IFS + shift + ac_file=$1 + shift + + case $ac_mode in + :L) ac_source=$1;; + :[FH]) + ac_file_inputs= + for ac_f + do + case $ac_f in + -) ac_f="$ac_tmp/stdin";; + *) # Look for the file first in the build tree, then in the source tree + # (if the path is not absolute). The absolute path cannot be DOS-style, + # because $ac_f cannot contain `:'. + test -f "$ac_f" || + case $ac_f in + [\\/$]*) false;; + *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; + esac || + as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; + esac + case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac + as_fn_append ac_file_inputs " '$ac_f'" + done + + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + configure_input='Generated from '` + $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' + `' by configure.' + if test x"$ac_file" != x-; then + configure_input="$ac_file. $configure_input" + { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 +$as_echo "$as_me: creating $ac_file" >&6;} + fi + # Neutralize special characters interpreted by sed in replacement strings. + case $configure_input in #( + *\&* | *\|* | *\\* ) + ac_sed_conf_input=`$as_echo "$configure_input" | + sed 's/[\\\\&|]/\\\\&/g'`;; #( + *) ac_sed_conf_input=$configure_input;; + esac + + case $ac_tag in + *:-:* | *:-) cat >"$ac_tmp/stdin" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; + esac + ;; + esac + + ac_dir=`$as_dirname -- "$ac_file" || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + as_dir="$ac_dir"; as_fn_mkdir_p + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + + case $ac_mode in + :F) + # + # CONFIG_FILE + # + + case $INSTALL in + [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; + *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; + esac +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# If the template does not know about datarootdir, expand it. +# FIXME: This hack should be removed a few years after 2.60. +ac_datarootdir_hack=; ac_datarootdir_seen= +ac_sed_dataroot=' +/datarootdir/ { + p + q +} +/@datadir@/p +/@docdir@/p +/@infodir@/p +/@localedir@/p +/@mandir@/p' +case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in +*datarootdir*) ac_datarootdir_seen=yes;; +*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + ac_datarootdir_hack=' + s&@datadir@&$datadir&g + s&@docdir@&$docdir&g + s&@infodir@&$infodir&g + s&@localedir@&$localedir&g + s&@mandir@&$mandir&g + s&\\\${datarootdir}&$datarootdir&g' ;; +esac +_ACEOF + +# Neutralize VPATH when `$srcdir' = `.'. +# Shell code in configure.ac might set extrasub. +# FIXME: do we really want to maintain this feature? +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_sed_extra="$ac_vpsub +$extrasub +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s|@configure_input@|$ac_sed_conf_input|;t t +s&@top_builddir@&$ac_top_builddir_sub&;t t +s&@top_build_prefix@&$ac_top_build_prefix&;t t +s&@srcdir@&$ac_srcdir&;t t +s&@abs_srcdir@&$ac_abs_srcdir&;t t +s&@top_srcdir@&$ac_top_srcdir&;t t +s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t +s&@builddir@&$ac_builddir&;t t +s&@abs_builddir@&$ac_abs_builddir&;t t +s&@abs_top_builddir@&$ac_abs_top_builddir&;t t +s&@INSTALL@&$ac_INSTALL&;t t +$ac_datarootdir_hack +" +eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ + >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + +test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && + { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ + "$ac_tmp/out"`; test -z "$ac_out"; } && + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&5 +$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&2;} + + rm -f "$ac_tmp/stdin" + case $ac_file in + -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; + *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; + esac \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + ;; + :H) + # + # CONFIG_HEADER + # + if test x"$ac_file" != x-; then + { + $as_echo "/* $configure_input */" \ + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" + } >"$ac_tmp/config.h" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then + { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 +$as_echo "$as_me: $ac_file is unchanged" >&6;} + else + rm -f "$ac_file" + mv "$ac_tmp/config.h" "$ac_file" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + fi + else + $as_echo "/* $configure_input */" \ + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ + || as_fn_error $? "could not create -" "$LINENO" 5 + fi + ;; + + + esac + +done # for ac_tag + + +as_fn_exit 0 +_ACEOF +ac_clean_files=$ac_clean_files_save + +test $ac_write_fail = 0 || + as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 + + +# configure is writing to config.log, and then calls config.status. +# config.status does its own redirection, appending to config.log. +# Unfortunately, on DOS this fails, as config.log is still kept open +# by configure, so config.status won't be able to write to it; its +# output is simply discarded. So we exec the FD to /dev/null, +# effectively closing config.log, so it can be properly (re)opened and +# appended to by config.status. When coming back to configure, we +# need to make the FD available again. +if test "$no_create" != yes; then + ac_cs_success=: + ac_config_status_args= + test "$silent" = yes && + ac_config_status_args="$ac_config_status_args --quiet" + exec 5>/dev/null + $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false + exec 5>>config.log + # Use ||, not &&, to avoid exiting from the if with $? = 1, which + # would make configure fail if this is the last instruction. + $ac_cs_success || as_fn_exit 1 +fi +if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 +$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} +fi + + + +PROGRAM_OBJECT_RULES="$PROGRAM_OBJECT_RULES +\$(OBJDIR)/chkslang.o : \$(SRCDIR)/chkslang.c \$(DOT_O_DEPS) \$(OBJ_O_DEPS) \$("chkslang"_O_DEP) + cd \$(OBJDIR) && \$(COMPILE_CMD) \$("chkslang"_C_FLAGS) \$(SRCDIR)/chkslang.c +" + + + echo "$PROGRAM_OBJECT_RULES" >> src/Makefile + + diff --git a/vendor/most-5.1.0/doc/lesskeys.rc b/vendor/most-5.1.0/doc/lesskeys.rc new file mode 100644 index 0000000..5dc3c51 --- /dev/null +++ b/vendor/most-5.1.0/doc/lesskeys.rc @@ -0,0 +1,59 @@ +% This is an example configuration file that provides a `less' emulation +% for MOST. +% +% The format is simple: +% setkey +% unsetkey +% color +% +% Here must be enclosed in double quotes. '^' represents Ctrl. +% The function name is not in double quotes. +% +% +% When MOST starts up, it looks for a keymap file given by the environment +% variable MOST_INITFILE. If that environment variable does not exist, +% MOST will look in the users HOME directory for .mostrc on Unix systems +% and MOST.RC on VMS systems. +% +% The file `most.rc' contains a listing of the default MOST keybindings. + +% Color settings + +color normal lightgray black +color status yellow blue +color underline brightgreen black +color overstrike brightred black + +% Keybindings + +unsetkey "^K" +setkey up "^K" + +unsetkey ":" +setkey next_file ":n" +setkey find_file ":e" +setkey next_file ":p" +setkey toggle_options ":o" +setkey toggle_case ":c" +setkey delete_file ":d" +setkey exit ":q" + +setkey down "e" +setkey down "E" +setkey down "j" +setkey down "^N" +setkey up "y" +setkey up "^Y" +setkey up "k" +setkey up "^P" +setkey page_down "f" +setkey page_down "^F" +setkey page_up "b" +setkey page_up "^B" +setkey other_window "z" +setkey other_window "w" +setkey search_backward "?" +setkey bob "p" +setkey goto_mark "'" +setkey find_file "E" +setkey edit "v" diff --git a/vendor/most-5.1.0/doc/most-fun.txt b/vendor/most-5.1.0/doc/most-fun.txt new file mode 100644 index 0000000..89d2c47 --- /dev/null +++ b/vendor/most-5.1.0/doc/most-fun.txt @@ -0,0 +1,45 @@ +The following functions may be used in custom keymaps: + +edit +suspend +toggle_lock +next_file +toggle_options +extended_key +toggle_case +delete_file +bob +delete_window +digit_arg +down +edt_backward +edt_find +edt_find_next +edt_forward +edt_line +edt_page +eob +exit +find_file +find_next +goto_line +goto_mark +goto_percent +help +one_window +other_window +page_down +page_left +page_right +column_right +column_left +page_up +redraw +search_backward +search_forward +set_mark +show_time +tail_mode +toggle_width +two_windows +up diff --git a/vendor/most-5.1.0/doc/most.1 b/vendor/most-5.1.0/doc/most.1 new file mode 100644 index 0000000..6063f02 --- /dev/null +++ b/vendor/most-5.1.0/doc/most.1 @@ -0,0 +1,432 @@ +.\" This manpage has been automatically generated by docbook2man +.\" from a DocBook document. This tool can be found at: +.\" +.\" Please send any bug reports, improvements, comments, patches, +.\" etc. to Steve Cheng . +.TH "MOST" "1" "17 February 2019" "" "" + +.SH NAME +most \- browse or page through a text file +.SH SYNOPSIS + +\fBmost\fR [ \fB-1\fR ] [ \fB-b\fR ] [ \fB-C\fR ] [ \fB-c\fR ] [ \fB-d\fR ] [ \fB-M\fR ] [ \fB-r\fR ] [ \fB-s\fR ] [ \fB-t\fR ] [ \fB-u\fR ] [ \fB-v\fR ] [ \fB-w\fR ] [ \fB-z\fR ] [ \fB+/\fIstring\fB\fR ] [ \fB+\fIline-number\fB\fR ] [ \fB+d\fR ] [ \fB+s\fR ] [ \fB+u\fR ] [ \fB\fIfile...\fB\fR ] + +.SH "DESCRIPTION" +.PP +\fBmost\fR is a paging program that displays, one windowful at a time, +the contents of a file on a terminal. It pauses after each +windowful and prints on the window status line the screen the file +name, current line number, and the percentage of the file so far +displayed. +.PP +Unlike other paging programs, \fBmost\fR is capable of displaying an +arbitrary number of windows as long as each window occupies at least +two screen lines. Each window may contain the same file or a +different file. In addition, each window has its own mode. For +example, one window may display a file with its lines wrapped while +another may be truncating the lines. Windows may be `locked' +together in the sense that if one of the locked windows scrolls, all +locked windows will scroll. \fBmost\fR is also capable of ignoring lines +that are indented beyond a user specified value. This is useful +when viewing computer programs to pick out gross features of the +code. See the `:o' command for a description of this feature. +.PP +In addition to displaying ordinary text files, \fBmost\fR can also +display binary files as well as files with arbitrary ascii +characters. When a file is read into a buffer, \fBmost\fR examines the +first 32 bytes of the file to determine if the file is a binary file +and then switches to the appropriate mode. However, this feature +may be disabled with the -k option. See the description of the -b, +-k, -v, and -t options for further details. +.PP +Text files may contain combinations of underscore and backspace +characters causing a printer to underline or overstrike. When \fBmost\fR +recognizes this, it inserts the appropriate escape sequences to +achieve the desired effect. In addition, some files cause the +printer to overstrike some characters by embedding carriage return +characters in the middle of a line. When this occurs, \fBmost\fR displays +the overstruck character with a bold attribute. This feature +facilitates the reading of UNIX man pages or a document produced by +runoff. In particular, viewing this document with \fBmost\fR should +illustrate this behavior provided that the underline characters +have not been stripped. This may be turned off with the -v option. +.PP +By default, lines with more characters than the terminal width are +not wrapped but are instead truncated. When truncation occurs, this +is indicated by a `$' in the far right column of the terminal +screen. The RIGHT and LEFT arrow keys may be used to view lines +which extend past the margins of the screen. The -w option may be +used to override this feature. When a window is wrapped, the +character `\\' will appear at the right edge of the window. +.PP +Commands are listed below. +.SH "OPTIONS" +.TP +\fB-1\fR +VT100 mode. This is meaningful only +on VMS systems. This option should be used if the terminal is +strictly a VT100. This implies that the terminal does not have the +ability to delete and insert multiple lines. VT102s and above have +this ability. +.TP +\fB-b\fR +Binary mode. Use this switch when +you want to view files containing 8 bit characters. \fBmost\fR will +display the file 16 bytes per line in hexadecimal notation. A +typical line looks like: + +.nf + 01000000 40001575 9C23A020 4000168D ....@..u.#. @... +.fi + +When used with the -v option, the same line looks like: + +.nf + ^A^@^@^@ @^@^U u 9C #A0 @^@^V8D ....@..u.#. @... +.fi +.TP +\fB-C\fR +Disable color support. +.TP +\fB-c\fR +Make searches case-sensitive +.TP +\fB-d\fR +Omit the backslash mark used to denote a wrapped line. +.TP +\fB-M\fR +Disable the use of mmap. +.TP +\fB-r\fR +Default to using regexp searches +.TP +\fB-s\fR +Squeeze-mode. Replace multiple blank +lines with a single blank line. +.TP +\fB-t\fR +Display tabs as ^I. If this option +is immediately followed by an integer, the integer sets the tab +width, e.g., -t4 +.TP +\fB-u\fR +Disable UTF-8 mode even if the +locale dictates it +.TP +\fB+u\fR +Force UTF-8 mode. By default \fBmost\fR +will use the current locale to determine if UTF-8 mode should be +used. The +u and -u switches allow the behavior to be overridden +.TP +\fB-v\fR +Display control characters as in +`^A' for control A. Normally \fBmost\fR does not interpret control +characters. +.TP +\fB-w\fR +Wrap lines +.TP +\fB-z\fR +Disable gunzip-on-the-fly +.TP +\fB+/\fIstring\fB\fR +Start up at the +line containing the first occurrence of string +.TP +\fB+\fIlineno\fB\fR +Start up at the +specified line-number +.TP +\fB+d\fR +This switch should only be used if +you want the option to delete a file while viewing it. This makes +it easier to clean unwanted files out of a directory. The file is +deleted with the interactive key sequence `:D' and then confirming +with `y'. +.TP +\fB+s\fR +Secure Mode-- no edit, cd, shell, +and reading files not already listed on the command line. +.SH "COMMAND USAGE" +.PP +The commands take effect immediately; it is not necessary to type a +carriage return. In the following commands, \fBi\fR is a numerical +argument (1 by default). +.TP +\fBSPACE, CTRL-D, NEXT_SCREEN\fR +Display another windowful, or jump \fBi\fR windowfuls if \fBi\fR is specified. +.TP +\fBRETURN, DOWN_ARROW, V, CTRL-N\fR +Display another line, or \fBi\fR more lines, if specified. +.TP +\fBUP_ARROW, ^, CTRL-P\fR +Display previous line, or \fBi\fR previous +lines, if specified. +.TP +\fBT, ESCAPE<\fR +Move to top of buffer. +.TP +\fBB, ESCAPE>\fR +Move to bottom of buffer. +.TP +\fBRIGHT_ARROW, TAB, >\fR +Scroll window left 60\fBi\fR columns to view +lines that are beyond the right margin of the window. +.TP +\fBLEFT_ARROW, CTRL-B, <\fR +Scroll window right 60\fBi\fR columns to +view lines that are beyond the left margin of the window. +.TP +\fBU, CTRL-U, DELETE, PREV_SCREEN\fR +Skip back \fBi\fR windowfuls and +then print a windowful. +.TP +\fBR, CTRL-R\fR +Redraw the window. +.TP +\fBJ, G\fR +If \fBi\fR is not specified, then prompt for a line +number then jump to that line otherwise just jump to line i. +.TP +\fB%\fR +If \fBi\fR is not specified, then prompt for a percent number +then jump to that percent of the file otherwise just jump to \fBi\fR percent +of the file. +.TP +\fBW, w\fR +If the current screen width is 80, make it 132 and +vice-versa. For other values, this command is ignored. +.TP +\fBQ, CTRL-X CTRL-C, CTRL-K E\fR +Exit from \fBmost\fR\&. On VMS, ^Z also +exits. +.TP +\fBh, CTRL-H, HELP, PF2\fR +Help. Give a description of all the +\fBmost\fR commands. The \fBmost\fR environment variable MOST_HELP must be set +for this to be meaningful. +.TP +\fBf, /, CTRL-F, FIND, GOLD PF3\fR +Prompt for a string and +search forward from the current line for ith distinct line containing +the string. CTRL-G aborts. +.TP +\fB?\fR +Prompt for a string and search backward for the ith +distinct line containing the string. CTRL-G aborts. +.TP +\fBn\fR +Search for the next \fBi\fR lines containing an occurrence of +the last search string in the direction of the previous search. +.TP +\fBm, SELECT, CTRL-@, CTRL-K M, PERIOD\fR +Set a mark on the +current line for later reference. +.TP +\fBINSERT_HERE, CTRL-X CTRL-X, COMMA, CTRL-K RETURN, GOLD PERIOD\fR +Set a mark on the current line but return to previous mark. +This allows the user to toggle back and forth between two positions in +the file. +.TP +\fBl, L\fR +Toggle locking for this window. The window is locked +if there is a `*' at the left edge of the status line. Windows locked +together, scroll together. +.TP +\fBCTRL-X 2, CTRL-W 2, GOLD X\fR +Split this window in half. +.TP +\fBCTRL-X o, CTRL-W o, o, GOLDUP, GOLDDOWN\fR +Move to other window. +.TP +\fBCTRL-X 0, CTRL-W 0, GOLD V\fR +Delete this window. +.TP +\fBCTRL-X 1, CTRL-W 1, GOLD O\fR +Delete all other windows, leaving +only one window. +.TP +\fBE, e\fR +Edit this file. +.TP +\fB$, ESC $\fR +This is system dependent. On VMS, this causes \fBmost\fR +to spawn a subprocess. When the user exits the process, \fBmost\fR is +resumed. On UNIX systems, \fBmost\fR simply suspends itself. +.TP +\fB:n\fR +Skip to the next filename given in the command line. Use +the arrow keys to scroll forward or backward through the file list. +`Q' quits \fBmost\fR and any other key selects the given file. +.TP +\fB:c\fR +Toggle case sensitive search. +.TP +\fB:D\fR +Delete current file. This command is only meaningful +with the +d switch. +.TP +\fB:o, :O\fR +Toggle various options. With this key sequence, \fBmost\fR +displays a prompt asking the user to hit one of: bdtvw. The `b', `t', +`v', and `w' options have the same meaning as the command line +switches. For example, the `w' option will toggle wrapping on and off +for the current window. + +The `d' option must be used with a prefix integer i. All lines +indented beyond \fBi\fR columns will not be displayed. For example, +consider the fragment: +.TP +\fB\fR + +.nf + int main(int argc, char **argv) + { + int i; + for (i = 0; i < argc, i++) + { + fprintf(stdout,"%i: %s\\n",i,argv[i]); + } + return 0; + } +.fi +The key sequence `1:od' will cause \fBmost\fR to display the file ignoring +all lines indented beyond the first column. So for the example above, +\fBmost\fR would display: + +.nf + int main(int argc, char **argv)... + } +.fi +where the `...' indicates lines that follow are not displayed. +.SH "HINTS" +.PP +CTRL-G aborts the commands requiring the user to type something in +at a prompt. The back-quote key has a special meaning here. It is +used to quote certain characters. This is useful when search for +the occurrence of a string with a control character or a string at +the beginning of a line. In the latter case, to find the occurrence +of `The' at the beginning of a line, enter `^JThe where ` quotes the +CTRL-J. +.SH "ENVIRONMENT" +.PP +\fBmost\fR uses the following environment variables: +.TP +\fBMOST_SWITCHES\fR +This variable sets commonly used switches. +For example, some people prefer to use \fBmost\fR with the -s option so that +excess blank lines are not displayed. On VMS this is normally done +done in the login.com through the line: +.TP +\fB\fR + +.nf + $ define MOST_SWITCHES "-s" +.fi +.TP +\fBMOST_EDITOR, SLANG_EDITOR\fR +Either of these environment +variables specify an editor for \fBmost\fR to invoke to edit a file. The +value can contain %s and %d formatting descriptors that represent the +file name and line number, respectively. For example, if JED is +your editor, then set MOST_EDITOR to 'jed %s -g %d'. +.TP +\fBMOST_HELP\fR +This variable may be used to specify an alternate +help file. +.TP +\fBMOST_INITFILE\fR +Set this variable to specify the +initialization file to load during startup. The default action is to +load the system configuration file and then a personal configuration +file called .mostrc on Unix, and most.rc on other systems. +.SH "CONFIGURATION FILE SYNTAX" +.PP +When \fBmost\fR starts up, it tries to read a system configuration file and +then a personal configuration file. These files may be used to specify +key-bindings and colors. +.PP +To bind a key to a particular function use the syntax: + +.nf + setkey function-name key-sequence +.fi +.PP +The setkey command requires two arguments. The function-name argument +specifies the function that is to be executed as a response to the +keys specified by the key-sequence argument are pressed. For example, + +.nf + setkey "up" "^P" +.fi +.PP +indicates that when Ctrl-P is pressed then the function up is to be executed. +.PP +Sometimes, it is necessary to first unbind a key-sequence before +rebinding it in order via the unsetkey function: + +.nf + unsetkey "^F" +.fi +.PP +Colors may be defined through the use of the color keyword in the the +configuration file using the syntax: + +.nf + color OBJECT-NAME FOREGROUND-COLOR BACKGROUND-COLOR +.fi +.PP +Here, OBJECT-NAME can be any one of the following items: + +.nf + status -- the status line + underline -- underlined text + overstrike -- overstruck text + normal -- anything else +.fi +.PP +See the sample configuration files for more information. +.SH "BUGS" +.PP +Almost all of the known bugs or limitations of \fBmost\fR are due to a +desire to read and interpret control characters in files. One +problem concerns the use of backspace characters to underscore or +overstrike other characters. \fBmost\fR makes an attempt to use terminal +escape sequences to simulate this behavior. One side effect is the +one does not always get what one expects when scrolling right and left +through a file. When in doubt, use the -v and -b options of \fBmost\fR\&. +.PP +The regular-expression searches may fail to find strings that involve +backspace/underscore used for highlighting. The regular-expression +syntax is described in the S-Lang Library documentation. +.SH "AUTHOR" +.PP +John E. Davis +.SH "ACKNOWLEDGEMENTS" +.PP +Over the years, many people have contributed to \fBmost\fR in one way or +another, e.g., via code patches, bug-fixes, comments, or criticisms. +I am particularly grateful to the very early adopters of the program +who took a chance with a fledgling software project headed by someone +learning the underlying language. These include: +.PP +Mats Akerberg, Henk D. Davids, Rex O. Livingston, and Mark Pizzolato +contributed to the early VMS versions of \fBmost\fR\&. In particular, Mark +worked on it to get it ready for DECUS. +.PP +Foteos Macrides adapted \fBmost\fR for use in cswing and gopher. A few +features of the present version of \fBmost\fR was inspired from his work. +.PP +I am grateful to Robert Mills for re-writing the search routines to +use regular expressions. +.PP +Sven Oliver Moll came up with the idea of automatic detection of +zipped files. +.PP +I would also like to thank Shinichi Hama for his valuable criticisms +of \fBmost\fR\&. +.PP +Javier Kohen was instrumental in the support for UTF-8. +.PP +Thanks to David W. Sanderson for adapting the early documentation to +nroff man page source format. diff --git a/vendor/most-5.1.0/doc/most.hlp b/vendor/most-5.1.0/doc/most.hlp new file mode 100644 index 0000000..eaa0528 --- /dev/null +++ b/vendor/most-5.1.0/doc/most.hlp @@ -0,0 +1,347 @@ +1 MOST + browse or page through a text file + +2 Synopsis + most [-Cbstvwz] [+lineno] [+c] [+d] [+/string] [filename...] + +2 Description + most is a paging program that displays, one windowful at a time, the + contents of a file on a terminal. It pauses after each windowful and + prints on the window status line the screen the file name, current + line number, and the percentage of the file so far displayed. + + Unlike other paging programs, most is capable of displaying an + arbitrary number of windows as long as each window occupies at least + two screen lines. Each window may contain the same file or a + different file. In addition, each window has its own mode. For + example, one window may display a file with its lines wrapped while + another may be truncating the lines. Windows may be `locked' together + in the sense that if one of the locked windows scrolls, all locked + windows will scroll. most is also capable of ignoring lines that are + indented beyond a user specified value. This is useful when viewing + computer programs to pick out gross features of the code. See the + `:o' command for a description of this feature. + + In addition to displaying ordinary text files, most can also display + binary files as well as files with arbitrary ascii characters. When a + file is read into a buffer, most examines the first 32 bytes of the + file to determine if the file is a binary file and then switches to + the appropriate mode. However, this feature may be disabled with the + -k option. See the description of the -b, -k, -v, and -t options for + further details. + + Text files may contain combinations of underscore and backspace + characters causing a printer to underline or overstrike. When most + recognizes this, it inserts the appropriate escape sequences to + achieve the desired effect. In addition, some files cause the printer + to overstrike some characters by embedding carriage return characters + in the middle of a line. When this occurs, most displays the + overstruck character with a bold attribute. This feature facilitates + the reading of UNIX man pages or a document produced by runoff. In + particular, viewing this document with most should illustrate this + behavior provided that the underline characters have not been + stripped. This may be turned off with the -v option. + + By default, lines with more characters than the terminal width are not + wrapped but are instead truncated. When truncation occurs, this is + indicated by a `$' in the far right column of the terminal screen. + The RIGHT and LEFT arrow keys may be used to view lines which extend + past the margins of the screen. The -w option may be used to override + this feature. When a window is wrapped, the character `\' will appear + at the right edge of the window. + + Commands are listed below. + +2 Options + + -1 VT100 mode. This is meaningful only on VMS systems. This option + should be used if the terminal is strictly a VT100. This implies + that the terminal does not have the ability to delete and insert + multiple lines. VT102s and above have this ability. + + -b Binary mode. Use this switch when you want to view files + containing 8 bit characters. most will display the file 16 bytes + per line in hexidecimal notation. A typical line looks like: + + + 01000000 40001575 9C23A020 4000168D ....@..u.#. @... + + When used with the -v option, the same line looks like: + + + ^A^@^@^@ @^@^U u 9C #A0 @^@^V8D ....@..u.#. @... + + -k `Kanji' option. Ordinarily, most will go into binary mode if the + file consists of non-ascii characters. Sometimes this feature is + not desirable since some terminals have a special interpretation + for eight bit characters. The -k option turns off the automatic + sensing. + + -C Disable color support. + + -s Squeeze. Replace multiple blank lines with a single blank line. + + -z option turns off gunzip-on-the-fly. + + -v Display control characters as in `^A' for control A. Normally + most does not interpret control characters. + + -t Display tabs as `^I'. This option is meaningful only when used + with the -v option. +lineno Start up at lineno. + + +c Make search case sensitive. By default, they are not. + + +d This switch should only be used if you want the option to delete + a file while viewing it. This makes it easier to clean unwanted + files out of a directory. The file is deleted with the + interactive key sequence `:D' and then confirming with `y'. + + +/string + Start up at the line containing the first occurrence of string. + +2 Command_usage + The commands take effect immediately; it is not necessary to type a + carriage return. + + In the following commands, i is a numerical argument (1 by default). + + SPACE, CTRL-D, NEXT_SCREEN + Display another windowful, or jump i windowfuls if i is specified. + + RETURN, DOWN_ARROW, V, CTRL-N + Display another line, or i more lines, if specified. + + UP_ARROW, ^, CTRL-P + Display previous line, or i previous lines, if specified. + + T, ESCAPE< + Move to top of buffer. + + B, ESCAPE> + Move to bottom of buffer. + + RIGHT_ARROW, TAB, > + Scroll window left 60i columns to view lines that are beyond the + right margin of the window. + + LEFT_ARROW, CTRL-B, < + Scroll window right 60i columns to view lines that are beyond the + left margin of the window. + + U, CTRL-U, DELETE, PREV_SCREEN + Skip back i windowfuls and then print a windowful. + + R, CTRL-R + Redraw the window. + + J, G If i is not specified, then prompt for a line number then jump to + that line otherwise just jump to line i. + + % If i is not specified, then prompt for a percent number then jump + to that percent of the file otherwise just jump to i percent of + the file. + + W, w If the current screen width is 80, make it 132 and vice-versa. + For other values, this command is ignored. + + Q, CTRL-X CTRL-C, CTRL-K E + Exit from most. On VMS, ^Z also exits. + + h, CTRL-H, HELP, + Help. Give a description of all the most commands. The most + environment variable MOST_HELP must be set for this to be + meaningful. + + f, /, CTRL-F, FIND, GOLD PF3 + Prompt for a string and search forward from the current line for + ith distinct line containing the string. CTRL-G aborts. + + ? Prompt for a string and search backward for the ith distinct line + containing the string. CTRL-G aborts. + + n Search for the next i lines containing an occurrence of the last + search string in the direction of the previous search. + + m, SELECT, CTRL-@, CTRL-K M, PERIOD + Set a mark on the current line for later reference. + + INSERT_HERE, CTRL-X CTRL-X, COMMA, CTRL-K RETURN, GOLD PERIOD + Set a mark on the current line but return to previous mark. This + allows the user to toggle back and forth between two positions in + the file. + + l, L Toggle locking for this window. The window is locked if there is + a `*' at the left edge of the status line. Windows locked + together, scroll together. + + CTRL-X 2, CTRL-W 2, GOLD X + Split this window in half. + + CTRL-X o, CTRL-W o, o, + Move to other window. + + CTRL-X 0, CTRL-W 0, GOLD V + Delete this window. + + CTRL-X 1, CTRL-W 1, GOLD O + Delete all other windows, leaving only one window. + + E, e Edit this file. + + $, ESC $ + This is system dependent. On VMS, this causes most to spawn a + subprocess. When the user exits the process, most is resumed. + On UNIX systems, most simply suspends itself. + + :n Skip to the next filename given in the command line. Use the + arrow keys to scroll forward or backward through the file list. + `Q' quits most and any other key selects the given file. + + :c Toggle case sensitive search. + + :D Delete current file. This command is only meaningful with the +d + switch. + + :o, :O + Toggle various options. With this key sequence, most displays a + prompt asking the user to hit one of: bdtvw. The `b', `t', `v', + and `w' options have the same meaning as the command line + switches. For example, the `w' option will toggle wrapping on + and off for the current window. + + The `d' option must be used with a prefix integer i. All lines + indented beyond i columns will not be displayed. For example, + consider the fragment: + + + int main(int argc, char **argv) + { + int i; + + for (i = 0; i < argc, i++) + { + fprintf(stdout,"%i: %s\n",i,argv[i]); + } + return 0; + } + + The key sequence `1:od' will cause most to display the file + ignoring all lines indented beyond the first column. So for the + example above, most would display: + + + int main(int argc, char **argv)... + } + + where the `...' indicates lines follow are not displayed. + +2 Hints + CTRL-G aborts the commands requiring the user to type something in at + a prompt. The backquote key has a special meaning here. It is used + to quote certain characters. This is useful when search for the + occurrence of a string with a control character or a string at the + beginning of a line. In the latter case, to find the occurrence of + `The' at the beginning of a line, enter `^JThe where ` quotes the + CTRL-J. + +2 Environment + most uses the following environment variables: + + MOST_SWITCHES + This variable sets commonly used switches. For example, some + people prefer to use most with the -s option so that excess blank + lines are not displayed. On VMS this is normally done done in + the login.com through the line: + + $ define MOST_SWITCHES "-s" + + MOST_EDITOR, SLANG_EDITOR + Either of these environment variables specify an editor for most + to invoke to edit a file. The value can contain %s and %d + formatting descriptors that represent the file name and line + number, respectively. For example, if JED is your editor, then + set MOST_EDITOR to 'jed %s -g %d'. + + MOST_HELP + This variable may be used to specify an alternate help file. + + MOST_INITFILE + Set this variable to specify the initialization file to load + during startup. The default action is to load the system + configuration file and then a personal configuration file called + .mostrc on Unix, and most.rc on other systems. + +2 Configuration_file_syntax + When most starts up, it tries to read a system confiuration file and + then a personal configuration file. These files may be used to + specify keybind ings and colors. + + To bind a key to a particular function use the syntax: + + setkey function-name key-sequence + + The setkey command requires two arguments. The function-name argument + specifies the function that is to be executed as a response to the + keys specified by the key-sequence argument are pressed. For example, + + setkey "up" "^P" + + indicates that when Ctrl-P is pressed then the function up is to be + executed. + + Sometimes, it is necessary to first unbind a key-sequence before + rebinding it in order via the unsetkey function: + + unsetkey "^F" + + Colors may be defined through the use of the color keyword in the the + configuration file using the syntax: + + color OBJECT-NAME FOREGROUND-COLOR BACKGROUND-COLOR + + Here, OBJECT-NAME can be any one of the following items: + + status -- the status line + underline -- underlined text + overstrike -- overstriked text + normal -- anything else + + See the sample configuration files for more information. + +2 Bugs + Almost all of the known bugs or limitations of most are due to a + desire to read and interpret control characters in files. One problem + concerns the use of backspace characters to underscore or overstrike + other characters. most makes an attempt to use terminal escape + sequences to simulate this behavior. One side effect is the one does + not always get what one expects when scrolling right and left through + a file. When in doubt, use the -v and -b options of most. + +2 Author + John E. Davis + davis@space.mit.edu + +2 Acknowledgements + I would like to thank the users of most for valuable comments and + criticisms. I would especially like to thank those individuals who + have contributed code to most. + + Mats Akerberg, Henk D. Davids, Rex O. Livingston, and Mark Pizzolato + contributed to the early VMS versions of most. In particular, Mark + worked on it to get it ready for DECUS. + + Foteos Macrides adapted most for use in cswing + and gopher. A few features of the present version of most was + inspired from his work. + + I am grateful to Robert Mills for re-writing the + search routines to use regular expressions. + + Sven Oliver Moll came up with the idea + of automatic detection of zipped files. + + I would also like to thank Shinichi Hama for his valuable criticisms + of most. + + Thanks to David W. Sanderson (dws@cs.wisc.edu) for adapting the + documentation to nroff man page source format. diff --git a/vendor/most-5.1.0/doc/most.rc b/vendor/most-5.1.0/doc/most.rc new file mode 100644 index 0000000..1c32db5 --- /dev/null +++ b/vendor/most-5.1.0/doc/most.rc @@ -0,0 +1,129 @@ +% Color settings + +color normal lightgray black +color status yellow blue +color underline brightgreen black +color overstrike brightred black + +% Keybindings + +%setkey digit_arg dig +%setkey digit_arg esc dig +%setkey digit_arg gold dig +%setkey column_left < Not Set > +%setkey column_right < Not Set > +setkey page_down " " +setkey suspend "$" +setkey goto_percent "%" +setkey goto_mark "," +setkey search_forward "/" +setkey extended_key ":" +setkey page_left "<" +setkey page_right ">" +setkey search_backward "?" +setkey eob "B" +setkey page_down "D" +setkey edit "E" +setkey search_forward "F" +setkey goto_line "G" +setkey help "H" +setkey goto_line "J" +setkey toggle_lock "L" +setkey set_mark "M" +setkey find_next "N" +setkey other_window "O" +setkey exit "Q" +setkey redraw "R" +setkey search_forward "S" +setkey bob "T" +setkey page_up "U" +setkey down "V" +setkey toggle_width "W" +setkey exit "X" +setkey suspend "\033$" +setkey bob "\033<" +setkey eob "\033>" +setkey up "\033OA" +setkey down "\033OB" +setkey page_right "\033OC" +setkey page_left "\033OD" +setkey exit "\033OPE" +setkey one_window "\033OPO" +setkey exit "\033OPQ" +setkey suspend "\033OPS" +setkey delete_window "\033OPV" +setkey two_windows "\033OPX" +setkey edt_find "\033OP\033OR" +setkey goto_mark "\033OP\033On" +setkey eob "\033OP\033Ot" +setkey bob "\033OP\033Ou" +setkey other_window "\033OP\033[A" +setkey other_window "\033OP\033[B" +setkey page_right "\033OP\033[C" +setkey page_left "\033OP\033[D" +setkey help "\033OQ" +setkey edt_find_next "\033OR" +setkey set_mark "\033On" +setkey edt_line "\033Op" +setkey edt_forward "\033Ot" +setkey edt_backward "\033Ou" +setkey edt_page "\033Ox" +setkey page_up "\033V" +setkey search_forward "\033[1~" +setkey goto_mark "\033[2~" +setkey help "\033[28~" +setkey set_mark "\033[4~" +setkey page_up "\033[5~" +setkey page_down "\033[6~" +setkey up "\033[A" +setkey down "\033[B" +setkey page_right "\033[C" +setkey page_left "\033[D" +setkey page_right "\t" +setkey up "^" +setkey page_up "^?" +setkey set_mark "^@" +setkey page_down "^D" +setkey search_forward "^F" +setkey help "^H" +setkey exit "^KE" +setkey find_file "^KG" +setkey set_mark "^K^B" +setkey goto_mark "^K^J" +setkey goto_mark "^K^M" +setkey redraw "^L" +setkey down "^M" +setkey down "^N" +setkey up "^P" +setkey redraw "^R" +setkey show_time "^T" +setkey page_up "^U" +setkey page_down "^V" +setkey delete_window "^W0" +setkey one_window "^W1" +setkey two_windows "^W2" +setkey other_window "^WO" +setkey delete_window "^X0" +setkey one_window "^X1" +setkey two_windows "^X2" +setkey other_window "^XO" +setkey exit "^X^C" +setkey find_file "^X^F" +setkey suspend "^Z" +setkey eob "b" +setkey page_down "d" +setkey edit "e" +setkey search_forward "f" +setkey goto_line "g" +setkey goto_line "j" +setkey toggle_lock "l" +setkey set_mark "m" +setkey find_next "n" +setkey other_window "o" +setkey exit "q" +setkey redraw "r" +setkey search_forward "s" +setkey bob "t" +setkey down "v" +setkey toggle_width "w" +setkey exit "x" diff --git a/vendor/most-5.1.0/doc/most.txt b/vendor/most-5.1.0/doc/most.txt new file mode 100644 index 0000000..808a01c --- /dev/null +++ b/vendor/most-5.1.0/doc/most.txt @@ -0,0 +1,421 @@ + most + +Name + + most -- browse or page through a text file + +Synopsis + + most [-1] [-b] [-C] [-c] [-d] [-M] [-r] [-s] [-t] [-u] [-v] + [-w] [-z] [+/string] [+line-number] [+d] [+s] [+u] [file...] + +DESCRIPTION + + most is a paging program that displays, one windowful at a + time, the contents of a file on a terminal. It pauses after + each windowful and prints on the window status line the screen + the file name, current line number, and the percentage of the + file so far displayed. + + Unlike other paging programs, most is capable of displaying an + arbitrary number of windows as long as each window occupies at + least two screen lines. Each window may contain the same file + or a different file. In addition, each window has its own mode. + For example, one window may display a file with its lines + wrapped while another may be truncating the lines. Windows may + be `locked' together in the sense that if one of the locked + windows scrolls, all locked windows will scroll. most is also + capable of ignoring lines that are indented beyond a user + specified value. This is useful when viewing computer programs + to pick out gross features of the code. See the `:o' command + for a description of this feature. + + In addition to displaying ordinary text files, most can also + display binary files as well as files with arbitrary ascii + characters. When a file is read into a buffer, most examines + the first 32 bytes of the file to determine if the file is a + binary file and then switches to the appropriate mode. However, + this feature may be disabled with the -k option. See the + description of the -b, -k, -v, and -t options for further + details. + + Text files may contain combinations of underscore and backspace + characters causing a printer to underline or overstrike. When + most recognizes this, it inserts the appropriate escape + sequences to achieve the desired effect. In addition, some + files cause the printer to overstrike some characters by + embedding carriage return characters in the middle of a line. + When this occurs, most displays the overstruck character with a + bold attribute. This feature facilitates the reading of UNIX + man pages or a document produced by runoff. In particular, + viewing this document with most should illustrate this behavior + provided that the underline characters have not been stripped. + This may be turned off with the -v option. + + By default, lines with more characters than the terminal width + are not wrapped but are instead truncated. When truncation + occurs, this is indicated by a `$' in the far right column of + the terminal screen. The RIGHT and LEFT arrow keys may be used + to view lines which extend past the margins of the screen. The + -w option may be used to override this feature. When a window + is wrapped, the character `\' will appear at the right edge of + the window. + + Commands are listed below. + +OPTIONS + + -1 + VT100 mode. This is meaningful only on VMS systems. This + option should be used if the terminal is strictly a + VT100. This implies that the terminal does not have the + ability to delete and insert multiple lines. VT102s and + above have this ability. + + -b + Binary mode. Use this switch when you want to view files + containing 8 bit characters. most will display the file + 16 bytes per line in hexadecimal notation. A typical + line looks like: + + 01000000 40001575 9C23A020 4000168D ....@..u.#. @... + + When used with the -v option, the same line looks like: + + ^A^@^@^@ @^@^U u 9C #A0 @^@^V8D ....@..u.#. @... + + -C + Disable color support. + + -c + Make searches case-sensitive + + -d + Omit the backslash mark used to denote a wrapped line. + + -M + Disable the use of mmap. + + -r + Default to using regexp searches + + -s + Squeeze-mode. Replace multiple blank lines with a single + blank line. + + -t + Display tabs as ^I. If this option is immediately + followed by an integer, the integer sets the tab width, + e.g., -t4 + + -u + Disable UTF-8 mode even if the locale dictates it + + +u + Force UTF-8 mode. By default most will use the current + locale to determine if UTF-8 mode should be used. The +u + and -u switches allow the behavior to be overridden + + -v + Display control characters as in `^A' for control A. + Normally most does not interpret control characters. + + -w + Wrap lines + + -z + Disable gunzip-on-the-fly + + +/string + Start up at the line containing the first occurrence of + string + + +lineno + Start up at the specified line-number + + +d + This switch should only be used if you want the option + to delete a file while viewing it. This makes it easier + to clean unwanted files out of a directory. The file is + deleted with the interactive key sequence `:D' and then + confirming with `y'. + + +s + Secure Mode-- no edit, cd, shell, and reading files not + already listed on the command line. + +COMMAND USAGE + + The commands take effect immediately; it is not necessary to + type a carriage return. In the following commands, i is a + numerical argument (1 by default). + + SPACE, CTRL-D, NEXT_SCREEN + Display another windowful, or jump i windowfuls if i is + specified. + + RETURN, DOWN_ARROW, V, CTRL-N + Display another line, or i more lines, if specified. + + UP_ARROW, ^, CTRL-P + Display previous line, or i previous lines, if + specified. + + T, ESCAPE< + Move to top of buffer. + + B, ESCAPE> + Move to bottom of buffer. + + RIGHT_ARROW, TAB, > + Scroll window left 60i columns to view lines that are + beyond the right margin of the window. + + LEFT_ARROW, CTRL-B, < + Scroll window right 60i columns to view lines that are + beyond the left margin of the window. + + U, CTRL-U, DELETE, PREV_SCREEN + Skip back i windowfuls and then print a windowful. + + R, CTRL-R + Redraw the window. + + J, G + If i is not specified, then prompt for a line number + then jump to that line otherwise just jump to line i. + + % + If i is not specified, then prompt for a percent number + then jump to that percent of the file otherwise just + jump to i percent of the file. + + W, w + If the current screen width is 80, make it 132 and + vice-versa. For other values, this command is ignored. + + Q, CTRL-X CTRL-C, CTRL-K E + Exit from most. On VMS, ^Z also exits. + + h, CTRL-H, HELP, PF2 + Help. Give a description of all the most commands. The + most environment variable MOST_HELP must be set for this + to be meaningful. + + f, /, CTRL-F, FIND, GOLD PF3 + Prompt for a string and search forward from the current + line for ith distinct line containing the string. CTRL-G + aborts. + + ? + Prompt for a string and search backward for the ith + distinct line containing the string. CTRL-G aborts. + + n + Search for the next i lines containing an occurrence of + the last search string in the direction of the previous + search. + + m, SELECT, CTRL-@, CTRL-K M, PERIOD + Set a mark on the current line for later reference. + + INSERT_HERE, CTRL-X CTRL-X, COMMA, CTRL-K RETURN, GOLD PERIOD + Set a mark on the current line but return to previous + mark. This allows the user to toggle back and forth + between two positions in the file. + + l, L + Toggle locking for this window. The window is locked if + there is a `*' at the left edge of the status line. + Windows locked together, scroll together. + + CTRL-X 2, CTRL-W 2, GOLD X + Split this window in half. + + CTRL-X o, CTRL-W o, o, GOLDUP, GOLDDOWN + Move to other window. + + CTRL-X 0, CTRL-W 0, GOLD V + Delete this window. + + CTRL-X 1, CTRL-W 1, GOLD O + Delete all other windows, leaving only one window. + + E, e + Edit this file. + + $, ESC $ + This is system dependent. On VMS, this causes most to + spawn a subprocess. When the user exits the process, + most is resumed. On UNIX systems, most simply suspends + itself. + + :n + Skip to the next filename given in the command line. Use + the arrow keys to scroll forward or backward through the + file list. `Q' quits most and any other key selects the + given file. + + :c + Toggle case sensitive search. + + :D + Delete current file. This command is only meaningful + with the +d switch. + + :o, :O + Toggle various options. With this key sequence, most + displays a prompt asking the user to hit one of: bdtvw. + The `b', `t', `v', and `w' options have the same meaning + as the command line switches. For example, the `w' + option will toggle wrapping on and off for the current + window. + + The `d' option must be used with a prefix integer i. All + lines indented beyond i columns will not be displayed. + For example, consider the fragment: + + int main(int argc, char **argv) + { + int i; + for (i = 0; i < argc, i++) + { + fprintf(stdout,"%i: %s\n",i,argv[i]); + } + return 0; + } + + The key sequence `1:od' will cause most to display the + file ignoring all lines indented beyond the first + column. So for the example above, most would display: + + int main(int argc, char **argv)... + } + + where the `...' indicates lines that follow are not + displayed. + +HINTS + + CTRL-G aborts the commands requiring the user to type something + in at a prompt. The back-quote key has a special meaning here. + It is used to quote certain characters. This is useful when + search for the occurrence of a string with a control character + or a string at the beginning of a line. In the latter case, to + find the occurrence of `The' at the beginning of a line, enter + `^JThe where ` quotes the CTRL-J. + +ENVIRONMENT + + most uses the following environment variables: + + MOST_SWITCHES + This variable sets commonly used switches. For example, + some people prefer to use most with the -s option so + that excess blank lines are not displayed. On VMS this + is normally done done in the login.com through the line: + + $ define MOST_SWITCHES "-s" + + MOST_EDITOR, SLANG_EDITOR + Either of these environment variables specify an editor + for most to invoke to edit a file. The value can contain + %s and %d formatting descriptors that represent the file + name and line number, respectively. For example, if JED + is your editor, then set MOST_EDITOR to 'jed %s -g %d'. + + MOST_HELP + This variable may be used to specify an alternate help + file. + + MOST_INITFILE + Set this variable to specify the initialization file to + load during startup. The default action is to load the + system configuration file and then a personal + configuration file called .mostrc on Unix, and most.rc + on other systems. + +CONFIGURATION FILE SYNTAX + + When most starts up, it tries to read a system configuration + file and then a personal configuration file. These files may be + used to specify key-bindings and colors. + + To bind a key to a particular function use the syntax: + setkey function-name key-sequence + + The setkey command requires two arguments. The function-name + argument specifies the function that is to be executed as a + response to the keys specified by the key-sequence argument are + pressed. For example, + setkey "up" "^P" + + indicates that when Ctrl-P is pressed then the function up is + to be executed. + + Sometimes, it is necessary to first unbind a key-sequence + before rebinding it in order via the unsetkey function: + unsetkey "^F" + + Colors may be defined through the use of the color keyword in + the the configuration file using the syntax: + color OBJECT-NAME FOREGROUND-COLOR BACKGROUND-COLOR + + Here, OBJECT-NAME can be any one of the following items: + status -- the status line + underline -- underlined text + overstrike -- overstruck text + normal -- anything else + + See the sample configuration files for more information. + +BUGS + + Almost all of the known bugs or limitations of most are due to + a desire to read and interpret control characters in files. One + problem concerns the use of backspace characters to underscore + or overstrike other characters. most makes an attempt to use + terminal escape sequences to simulate this behavior. One side + effect is the one does not always get what one expects when + scrolling right and left through a file. When in doubt, use the + -v and -b options of most. + + The regular-expression searches may fail to find strings that + involve backspace/underscore used for highlighting. The + regular-expression syntax is described in the S-Lang Library + documentation. + +AUTHOR + + John E. Davis + +ACKNOWLEDGEMENTS + + Over the years, many people have contributed to most in one way + or another, e.g., via code patches, bug-fixes, comments, or + criticisms. I am particularly grateful to the very early + adopters of the program who took a chance with a fledgling + software project headed by someone learning the underlying + language. These include: + + Mats Akerberg, Henk D. Davids, Rex O. Livingston, and Mark + Pizzolato contributed to the early VMS versions of most. In + particular, Mark worked on it to get it ready for DECUS. + + Foteos Macrides adapted most for use in cswing and gopher. A + few features of the present version of most was inspired from + his work. + + I am grateful to Robert Mills for re-writing the search + routines to use regular expressions. + + Sven Oliver Moll came up with the idea of automatic detection + of zipped files. + + I would also like to thank Shinichi Hama for his valuable + criticisms of most. + + Javier Kohen was instrumental in the support for UTF-8. + + Thanks to David W. Sanderson for adapting the early + documentation to nroff man page source format. diff --git a/vendor/most-5.1.0/doc/tm/Makefile b/vendor/most-5.1.0/doc/tm/Makefile new file mode 100644 index 0000000..f2b0f9c --- /dev/null +++ b/vendor/most-5.1.0/doc/tm/Makefile @@ -0,0 +1,27 @@ +# -*- sh -*- +# +# To create the SGML files, you will need to install the tmexpand +# package. See http://www.jedsoft.org/ for more information. +# +TM2SGML = tmexpand +SGML2HTML = sgml2html +DOCBOOK2MAN = docbook2man +DOCBOOK2TXT = docbook2txt + +all: most.1 most.txt + +most.1: most.sgml + $(DOCBOOK2MAN) most.sgml +most.sgml: most.tm + $(TM2SGML) most.tm most.sgml +most.txt: most.sgml + $(DOCBOOK2TXT) most.sgml +view: most.1 + nroff -man most.1 | most +#---------------------------------------------------------------------------- +clean: + -rm -f *~ *-error manpage.refs manpage.links +distclean: clean + -rm -f most.1 most.sgml +install: most.1 most.txt + mv most.1 most.txt .. diff --git a/vendor/most-5.1.0/doc/tm/most.tm b/vendor/most-5.1.0/doc/tm/most.tm new file mode 100644 index 0000000..77318ba --- /dev/null +++ b/vendor/most-5.1.0/doc/tm/most.tm @@ -0,0 +1,427 @@ +#i docbook_man.tm + +#d man_options_entry#2 \varlistentry{\term{$1}}{\p $2 \p-end}\__newline__ + +#d arg#1 $1\__newline__ +#d desc-list \variablelist +#d desc-item#2 \varlistentry{\term{$1}}{\p $2 \p-end}\__newline__ +#d desc-item-continue \p +#d desc-item-continue-end +#d desc-list-end \variablelist-end + +#d envdesc#2 \varlistentry{\term{$1}}{\p $2 \p-end}\__newline__ +#d envdesc-begin \variablelist +#d envdesc-end \variablelist-end +#d envdesc-verb-begin +#d envdesc-verb-end + +#d most \command{most} +#d slang \literal{S-Lang} +#d lit#1 \literal{$1} +#d underline#1 $1 +#d i \underline{i} + +\manpage{most}{1}{browse or page through a text file} +\mansynopsis{most}{ + \arg{\option{-1}} + \arg{\option{-b}} + \arg{\option{-C}} + \arg{\option{-c}} + \arg{\option{-d}} + \arg{\option{-M}} + \arg{\option{-r}} + \arg{\option{-s}} + \arg{\option{-t}} + \arg{\option{-u}} + \arg{\option{-v}} + \arg{\option{-w}} + \arg{\option{-z}} + \arg{\option{+/\replaceable{string}}} + \arg{\option{+\replaceable{line-number}}} + \arg{\option{+d}} + \arg{\option{+s}} + \arg{\option{+u}} + \arg{\option{\replaceable{file...}}} +} + +\refsect1{DESCRIPTION} + \p + \most is a paging program that displays, one windowful at a time, + the contents of a file on a terminal. It pauses after each + windowful and prints on the window status line the screen the file + name, current line number, and the percentage of the file so far + displayed. + \pp + Unlike other paging programs, \most is capable of displaying an + arbitrary number of windows as long as each window occupies at least + two screen lines. Each window may contain the same file or a + different file. In addition, each window has its own mode. For + example, one window may display a file with its lines wrapped while + another may be truncating the lines. Windows may be `locked' + together in the sense that if one of the locked windows scrolls, all + locked windows will scroll. \most is also capable of ignoring lines + that are indented beyond a user specified value. This is useful + when viewing computer programs to pick out gross features of the + code. See the `:o' command for a description of this feature. +\pp + In addition to displaying ordinary text files, \most can also + display binary files as well as files with arbitrary ascii + characters. When a file is read into a buffer, \most examines the + first 32 bytes of the file to determine if the file is a binary file + and then switches to the appropriate mode. However, this feature + may be disabled with the -k option. See the description of the -b, + -k, -v, and -t options for further details. +\pp + Text files may contain combinations of underscore and backspace + characters causing a printer to underline or overstrike. When \most + recognizes this, it inserts the appropriate escape sequences to + achieve the desired effect. In addition, some files cause the + printer to overstrike some characters by embedding carriage return + characters in the middle of a line. When this occurs, \most displays + the overstruck character with a bold attribute. This feature + facilitates the reading of UNIX man pages or a document produced by + runoff. In particular, viewing this document with \most should + illustrate this behavior provided that the underline characters + have not been stripped. This may be turned off with the -v option. +\pp + By default, lines with more characters than the terminal width are + not wrapped but are instead truncated. When truncation occurs, this + is indicated by a `$' in the far right column of the terminal + screen. The RIGHT and LEFT arrow keys may be used to view lines + which extend past the margins of the screen. The -w option may be + used to override this feature. When a window is wrapped, the + character `\\' will appear at the right edge of the window. +\pp + Commands are listed below. +\p-end +\refsect1-end + +\refsect1{OPTIONS} + \variablelist + + \man_options_entry{\option{-1}}{VT100 mode. This is meaningful only + on VMS systems. This option should be used if the terminal is + strictly a VT100. This implies that the terminal does not have the + ability to delete and insert multiple lines. VT102s and above have + this ability.} + + \man_options_entry{\option{-b}}{ Binary mode. Use this switch when + you want to view files containing 8 bit characters. \most will + display the file 16 bytes per line in hexadecimal notation. A + typical line looks like: +#v+ + 01000000 40001575 9C23A020 4000168D ....@..u.#. @... +#v- + \pp + When used with the -v option, the same line looks like: +#v+ + ^A^@^@^@ @^@^U u 9C #A0 @^@^V8D ....@..u.#. @... +#v- + } + + \man_options_entry{\option{-C}}{Disable color support.} + \man_options_entry{\option{-c}}{Make searches case-sensitive} + \man_options_entry{\option{-d}}{Omit the backslash mark used to denote a wrapped line.} + \man_options_entry{\option{-M}}{Disable the use of mmap.} + \man_options_entry{\option{-r}}{Default to using regexp searches} + \man_options_entry{\option{-s}}{Squeeze-mode. Replace multiple blank + lines with a single blank line.} + + \man_options_entry{\option{-t}}{Display tabs as ^I. If this option + is immediately followed by an integer, the integer sets the tab + width, e.g., -t4} + + \man_options_entry{\option{-u}}{Disable UTF-8 mode even if the + locale dictates it} + + \man_options_entry{\option{+u}}{Force UTF-8 mode. By default \most + will use the current locale to determine if UTF-8 mode should be + used. The +u and -u switches allow the behavior to be overridden} + + \man_options_entry{\option{-v}}{Display control characters as in + `^A' for control A. Normally \most does not interpret control + characters.} + \man_options_entry{\option{-w}}{Wrap lines} + \man_options_entry{\option{-z}}{Disable gunzip-on-the-fly} + + \man_options_entry{\option{+/\replaceable{string}}}{Start up at the + line containing the first occurrence of string} + + \man_options_entry{\option{+\replaceable{lineno}}}{Start up at the + specified line-number} + + \man_options_entry{\option{+d}}{This switch should only be used if + you want the option to delete a file while viewing it. This makes + it easier to clean unwanted files out of a directory. The file is + deleted with the interactive key sequence `:D' and then confirming + with `y'.} + + \man_options_entry{\option{+s}}{Secure Mode-- no edit, cd, shell, + and reading files not already listed on the command line.} + + \variablelist-end +\refsect1-end + +\refsect1{COMMAND USAGE} +\p + The commands take effect immediately; it is not necessary to type a + carriage return. In the following commands, \i is a numerical + argument (1 by default). +\desc-list +\desc-item{SPACE, CTRL-D, NEXT_SCREEN}{ + Display another windowful, or jump \i windowfuls if \i is specified.} +\desc-item{RETURN, DOWN_ARROW, V, CTRL-N}{ +Display another line, or \i more lines, if specified.} + +\desc-item{UP_ARROW, ^, CTRL-P}{Display previous line, or \i previous +lines, if specified.} + +\desc-item{T, ESCAPE<}{Move to top of buffer.} + +\desc-item{B, ESCAPE>}{Move to bottom of buffer.} + +\desc-item{RIGHT_ARROW, TAB, >}{Scroll window left 60\i columns to view +lines that are beyond the right margin of the window.} + +\desc-item{LEFT_ARROW, CTRL-B, <}{Scroll window right 60\i columns to +view lines that are beyond the left margin of the window.} + +\desc-item{U, CTRL-U, DELETE, PREV_SCREEN}{Skip back \i windowfuls and +then print a windowful.} + +\desc-item{R, CTRL-R}{Redraw the window.} + +\desc-item{J, G}{If \i is not specified, then prompt for a line +number then jump to that line otherwise just jump to line i.} + +\desc-item{%}{If \i is not specified, then prompt for a percent number +then jump to that percent of the file otherwise just jump to \i percent +of the file.} + +\desc-item{W, w}{If the current screen width is 80, make it 132 and +vice-versa. For other values, this command is ignored.} + +\desc-item{Q, CTRL-X CTRL-C, CTRL-K E}{Exit from \most. On VMS, ^Z also +exits.} + +\desc-item{h, CTRL-H, HELP, PF2}{Help. Give a description of all the +\most commands. The \most environment variable MOST_HELP must be set +for this to be meaningful.} + +\desc-item{f, /, CTRL-F, FIND, GOLD PF3}{Prompt for a string and +search forward from the current line for ith distinct line containing +the string. CTRL-G aborts.} + +\desc-item{?}{Prompt for a string and search backward for the ith +distinct line containing the string. CTRL-G aborts.} + +\desc-item{n}{Search for the next \i lines containing an occurrence of +the last search string in the direction of the previous search.} + +\desc-item{m, SELECT, CTRL-@, CTRL-K M, PERIOD}{Set a mark on the +current line for later reference.} + +\desc-item{INSERT_HERE, CTRL-X CTRL-X, COMMA, CTRL-K RETURN, GOLD +PERIOD}{Set a mark on the current line but return to previous mark. +This allows the user to toggle back and forth between two positions in +the file.} + +\desc-item{l, L}{Toggle locking for this window. The window is locked +if there is a `*' at the left edge of the status line. Windows locked +together, scroll together.} + +\desc-item{CTRL-X 2, CTRL-W 2, GOLD X}{Split this window in half.} + +\desc-item{CTRL-X o, CTRL-W o, o, GOLDUP, GOLDDOWN}{Move to other window.} + +\desc-item{CTRL-X 0, CTRL-W 0, GOLD V}{Delete this window.} + +\desc-item{CTRL-X 1, CTRL-W 1, GOLD O}{Delete all other windows, leaving +only one window.} + +\desc-item{E, e}{Edit this file.} + +\desc-item{$, ESC $}{This is system dependent. On VMS, this causes \most +to spawn a subprocess. When the user exits the process, \most is +resumed. On UNIX systems, \most simply suspends itself.} + +\desc-item{:n}{Skip to the next filename given in the command line. Use +the arrow keys to scroll forward or backward through the file list. +`Q' quits \most and any other key selects the given file.} + +\desc-item{:c}{Toggle case sensitive search.} + +\desc-item{:D}{Delete current file. This command is only meaningful +with the +d switch.} + +\desc-item{:o, :O}{Toggle various options. With this key sequence, \most +displays a prompt asking the user to hit one of: bdtvw. The `b', `t', +`v', and `w' options have the same meaning as the command line +switches. For example, the `w' option will toggle wrapping on and off +for the current window. +\p +The `d' option must be used with a prefix integer i. All lines +indented beyond \i columns will not be displayed. For example, +consider the fragment:} +\desc-item-continue +#v+ + int main(int argc, char **argv) + { + int i; + for (i = 0; i < argc, i++) + { + fprintf(stdout,"%i: %s\n",i,argv[i]); + } + return 0; + } +#v- +The key sequence `1:od' will cause \most to display the file ignoring +all lines indented beyond the first column. So for the example above, +\most would display: +#v+ + int main(int argc, char **argv)... + } +#v- +where the `...' indicates lines that follow are not displayed. +\desc-item-continue-end +\desc-list-end +\p-end +\refsect1-end + +\refsect1{HINTS} +\p + CTRL-G aborts the commands requiring the user to type something in + at a prompt. The back-quote key has a special meaning here. It is + used to quote certain characters. This is useful when search for + the occurrence of a string with a control character or a string at + the beginning of a line. In the latter case, to find the occurrence + of `The' at the beginning of a line, enter `^JThe where ` quotes the + CTRL-J. +\p-end +\refsect1-end + +\refsect1{ENVIRONMENT} +\p + \most uses the following environment variables: +\desc-list +\desc-item{MOST_SWITCHES}{This variable sets commonly used switches. +For example, some people prefer to use \most with the -s option so that +excess blank lines are not displayed. On VMS this is normally done +done in the login.com through the line:} +\desc-item-continue +#v+ + $ define MOST_SWITCHES "-s" +#v- +\desc-item-continue-end + +\desc-item{MOST_EDITOR, SLANG_EDITOR}{Either of these environment +variables specify an editor for \most to invoke to edit a file. The +value can contain %s and %d formatting descriptors that represent the +file name and line number, respectively. For example, if JED is +your editor, then set MOST_EDITOR to 'jed %s -g %d'.} + +\desc-item{MOST_HELP}{This variable may be used to specify an alternate +help file.} + +\desc-item{MOST_INITFILE}{Set this variable to specify the +initialization file to load during startup. The default action is to +load the system configuration file and then a personal configuration +file called .mostrc on Unix, and most.rc on other systems.} +\desc-list-end +\refsect1-end + +\refsect1{CONFIGURATION FILE SYNTAX} +\p +When \most starts up, it tries to read a system configuration file and +then a personal configuration file. These files may be used to specify +key-bindings and colors. +\pp +To bind a key to a particular function use the syntax: +#v+ + setkey function-name key-sequence +#v- +\pp +The setkey command requires two arguments. The function-name argument +specifies the function that is to be executed as a response to the +keys specified by the key-sequence argument are pressed. For example, +#v+ + setkey "up" "^P" +#v- +\pp +indicates that when Ctrl-P is pressed then the function up is to be executed. +\pp +Sometimes, it is necessary to first unbind a key-sequence before +rebinding it in order via the unsetkey function: +#v+ + unsetkey "^F" +#v- +\pp +Colors may be defined through the use of the color keyword in the the +configuration file using the syntax: +#v+ + color OBJECT-NAME FOREGROUND-COLOR BACKGROUND-COLOR +#v- +\pp +Here, OBJECT-NAME can be any one of the following items: +#v+ + status -- the status line + underline -- underlined text + overstrike -- overstruck text + normal -- anything else +#v- +\pp +See the sample configuration files for more information. +\p-end +\refsect1-end + +\refsect1{BUGS} +\p +Almost all of the known bugs or limitations of \most are due to a +desire to read and interpret control characters in files. One +problem concerns the use of backspace characters to underscore or +overstrike other characters. \most makes an attempt to use terminal +escape sequences to simulate this behavior. One side effect is the +one does not always get what one expects when scrolling right and left +through a file. When in doubt, use the -v and -b options of \most. +\pp +The regular-expression searches may fail to find strings that involve +backspace/underscore used for highlighting. The regular-expression +syntax is described in the S-Lang Library documentation. +\p-end +\refsect1-end + +\refsect1{AUTHOR} +\p + John E. Davis \email{jed@jedsoft.org} +\p-end +\refsect1{ACKNOWLEDGEMENTS} +\p +Over the years, many people have contributed to \most in one way or +another, e.g., via code patches, bug-fixes, comments, or criticisms. +I am particularly grateful to the very early adopters of the program +who took a chance with a fledgling software project headed by someone +learning the underlying language. These include: +\pp + Mats Akerberg, Henk D. Davids, Rex O. Livingston, and Mark Pizzolato + contributed to the early VMS versions of \most. In particular, Mark + worked on it to get it ready for DECUS. +\pp + Foteos Macrides adapted \most for use in cswing and gopher. A few + features of the present version of \most was inspired from his work. +\pp + I am grateful to Robert Mills for re-writing the search routines to + use regular expressions. +\pp + Sven Oliver Moll came up with the idea of automatic detection of + zipped files. +\pp + I would also like to thank Shinichi Hama for his valuable criticisms + of \most. +\pp + Javier Kohen was instrumental in the support for UTF-8. +\pp + Thanks to David W. Sanderson for adapting the early documentation to + nroff man page source format. +\p-end +\refsect1-end +\manpage-end diff --git a/vendor/most-5.1.0/most.lis b/vendor/most-5.1.0/most.lis new file mode 100644 index 0000000..faabf55 --- /dev/null +++ b/vendor/most-5.1.0/most.lis @@ -0,0 +1,63 @@ +@configure 0755 +@most.lis +@README +@COPYRIGHT +@COPYING +@NEWS +@changes.txt + +@doc/lesskeys.rc +@doc/most.rc +@doc/most-fun.txt +@doc/most.1 +@doc/most.txt +@doc/most.hlp +@doc/tm/most.tm +@doc/tm/Makefile + +@autoconf/Makefile.in +@autoconf/aclocal.m4 +@autoconf/configure.ac +@autoconf/mkinsdir.sh 0755 +@autoconf/install.sh 0755 +@autoconf/config.guess 0755 +@autoconf/config.sub 0755 + +@src/DESCRIP.MMS +@src/VMSMAKE.COM +@src/RTL.OPT +@src/Makefile.in +@src/Makefile.w32 +@src/sysconf.h +@src/config.hin +@src/mostconf.h +@src/modules.lis +@src/w32conf.h +@src/jdmacros.h +@src/main.c +@src/buffer.c +@src/file.c +@src/window.c +@src/line.c +@src/display.c +@src/sysdep.c +@src/keym.c +@src/most.c +@src/search.c +@src/help.c +@src/cmd.c +@src/edit.c +@src/edit.h +@src/buffer.h +@src/file.h +@src/window.h +@src/line.h +@src/display.h +@src/sysdep.h +@src/keym.h +@src/most.h +@src/search.h +@src/keyparse.c +@src/keyparse.h +@src/chkslang.c +@src/version.h diff --git a/vendor/most-5.1.0/src/DESCRIP.MMS b/vendor/most-5.1.0/src/DESCRIP.MMS new file mode 100644 index 0000000..ec8641c --- /dev/null +++ b/vendor/most-5.1.0/src/DESCRIP.MMS @@ -0,0 +1,68 @@ +# +# MMS file to build MOST. +# +# Written by Hunter Goatley ( 4-OCT-1993 15:41) +# Removed reference to DIR.C, Michael Lemke ( 3-NOV-1995 17:25:44.05) +# Moved CC =.. into if clause. New MMS doesn't like redefinition of macros. +# 6-AUG-1997 14:43:25.04 Michael Lemke ( 3-NOV-1995 17:25:44.05) +# +.IFDEF __MATTS_MMS__ +.ELSE +EXE = .EXE +OBJ = .OBJ +.ENDIF + + +.IFDEF __ALPHA__ +CC = CC/STANDARD=VAXC +OPTFILE = +OPTIONS = +NATIVE = /NONATIVE_ONLY +.ELSE +CC = CC/STANDARD/VAXC +OPTFILE = ,VAXCRTL.OPT +OPTIONS = $(OPTFILE)/OPTIONS +NATIVE = +.ENDIF + +.IFDEF SLANG_OLB +.ELSE +SLANG_DIR = [-.SLANG.SRC] +SLANG_OLB = $(SLANG_DIR)SLANG$(OLB) +.ENDIF + +CFLAGS = $(CFLAGS)/DEFINE=(USE_SLANG)/INCLUDE=$(SLANG_DIR) +LINKFLAGS = $(LINKFLAGS)$(NATIVE)/NOTRACE + +OBJS = MAIN$(OBJ),- + BUFFER$(OBJ),- + FILE$(OBJ),- + WINDOW$(OBJ),- + LINE$(OBJ),- + DISPLAY$(OBJ),- + SYSDEP$(OBJ),- + KEYM$(OBJ),- + MOST$(OBJ),- + SEARCH$(OBJ),- + HELP$(OBJ),- + CMD$(OBJ),- + EDIT$(OBJ),- + KEYPARSE$(OBJ) +# DIR$(OBJ),- + +MOST$(EXE) : config.h $(OBJS)$(OPTFILE) + $(LINK)$(LINKFLAGS) $(OBJS)$(OPTIONS),$(SLANG_OLB)/LIBRARY + +config.h : mostconf.h + copy mostconf.h config.h + +# +# Build the linker options file for OpenVMS VAX and VAX C. +# +VAXCRTL.OPT : + @ open/write tmp vaxcrtl.opt + @ write tmp "SYS$SHARE:VAXCRTL.EXE/SHARE" + @ close tmp + + + diff --git a/vendor/most-5.1.0/src/Makefile b/vendor/most-5.1.0/src/Makefile new file mode 100644 index 0000000..4ad566c --- /dev/null +++ b/vendor/most-5.1.0/src/Makefile @@ -0,0 +1,150 @@ +CC = gcc +CFLAGS = -g -O2 +LDFLAGS = +SLANG_INC = +SLANG_LIB = -lslang +MISCLIBS = +RPATH = + +#----------------------------------------------------------------------------- +# Location where object files are placed (Absolute path) +#----------------------------------------------------------------------------- +SRCDIR = /home/greg/code/most-5.1.0/src +OBJDIR = /home/greg/code/most-5.1.0/src/$(ARCH)objs + +#---------------------------------------------------------------------------- +# 5. Install location +#---------------------------------------------------------------------------- +INSTALL = /usr/bin/install -c +INSTALL_DATA = ${INSTALL} -m 644 +DESTDIR = +prefix = /usr/local +exec_prefix = ${prefix} +datarootdir = ${prefix}/share +BIN_DIR = $(prefix)/bin +MAN_DIR = $(datarootdir)/man +DOC_DIR = $(datarootdir)/doc/most +SYS_INITFILE = ${prefix}/etc/most.conf +MKINSDIR = ../autoconf/mkinsdir.sh + +DOC_FILES = ../doc/most.txt ../README ../doc/most-fun.txt ../doc/lesskeys.rc ../doc/most.rc ../changes.txt + +#---------------------------------------------------------------------------- +# Nothing below here should require changing. +#---------------------------------------------------------------------------- +DEST_DOCDIR = $(DESTDIR)$(DOC_DIR) +DEST_MANDIR = $(DESTDIR)$(MAN_DIR) +DEST_BINDIR = $(DESTDIR)$(BIN_DIR) +# +SHELL = /bin/sh +OBJS = $(OBJDIR)/buffer.o $(OBJDIR)/cmd.o $(OBJDIR)/display.o $(OBJDIR)/edit.o $(OBJDIR)/file.o $(OBJDIR)/help.o $(OBJDIR)/keym.o $(OBJDIR)/keyparse.o $(OBJDIR)/line.o $(OBJDIR)/main.o $(OBJDIR)/most.o $(OBJDIR)/search.o $(OBJDIR)/sysdep.o $(OBJDIR)/window.o +OFILES = buffer.o cmd.o display.o edit.o file.o help.o keym.o keyparse.o line.o main.o most.o search.o sysdep.o window.o + +EXEC = most +CONFIG_H = config.h +INCS = $(SLANG_INC) +ALL_CFLAGS = $(CFLAGS) -Dunix $(INCS) +EXECLIBS = $(RPATH) $(SLANG_LIB) $(MISCLIBS) -lm +# +most_O_DEP = $(SRCDIR)/version.h +UPDATE_VERSION_SCRIPT = $(HOME)/bin/update_changes_version + +COMPILE_CMD = $(CC) -c $(ALL_CFLAGS) -DMOST_SYSTEM_INITFILE='"$(SYS_INITFILE)"' +# +all: $(EXEC) +$(EXEC): $(OBJDIR) $(CONFIG_H) slangversion $(OBJDIR)/$(EXEC) + @echo $(EXEC) created in $(OBJDIR) +$(OBJDIR)/$(EXEC): $(OBJS) + cd $(OBJDIR); $(CC) $(OFILES) -o $(EXEC) $(LDFLAGS) $(EXECLIBS) +# +$(OBJDIR): + -mkdir $(OBJDIR) +# +$(CONFIG_H) : $(SRCDIR)/sysconf.h + /bin/cp $(SRCDIR)/sysconf.h $(CONFIG_H) +# +slangversion: $(OBJDIR)/chkslang + $(OBJDIR)/chkslang $(EXEC) 20000 +# +$(OBJDIR)/chkslang: $(OBJDIR)/chkslang.o + $(CC) $(OBJDIR)/chkslang.o -o $(OBJDIR)/chkslang $(LDFLAGS) $(EXECLIBS) +# +$(SRCDIR)/version.h: $(SRCDIR)/../changes.txt + if [ -x $(UPDATE_VERSION_SCRIPT) ]; then \ + $(UPDATE_VERSION_SCRIPT) $(SRCDIR)/../changes.txt $(SRCDIR)/version.h; \ + fi +# +clean: + /bin/rm -f $(OBJDIR)/* *~ +distclean: clean + /bin/rm -rf $(OBJDIR) Makefile sysconf.h +installdirs: + $(MKINSDIR) $(DEST_DOCDIR) + $(MKINSDIR) $(DEST_MANDIR)/man1 + $(MKINSDIR) $(DEST_BINDIR) +install: all installdirs + $(INSTALL) -s $(OBJDIR)/most $(DEST_BINDIR) + $(INSTALL_DATA) ../doc/most.1 $(DEST_MANDIR)/man1 + @for i in $(DOC_FILES); \ + do \ + echo $(INSTALL_DATA) $$i $(DEST_DOCDIR)/; \ + $(INSTALL_DATA) $$i $(DEST_DOCDIR)/; \ + if [ "$$?" != "0" ]; then \ + exit 1; \ + fi; \ + done +# The symlinks target is for my own private use. It simply creates the object +# directory as a symbolic link to a local disk instead of an NFS mounted one. +symlinks: + -/bin/rm -f $(ARCH)objs + mkdir -p $(HOME)/sys/$(ARCH)/objs/most/src + ln -s $(HOME)/sys/$(ARCH)/objs/most/src $(ARCH)objs +#--------------------------------------------------------------------------- +# Rules (automatically generated) +#--------------------------------------------------------------------------- + +$(OBJDIR)/buffer.o : $(SRCDIR)/buffer.c $(DOT_O_DEPS) $(OBJ_O_DEPS) $(buffer_O_DEP) + cd $(OBJDIR) && $(COMPILE_CMD) $(buffer_C_FLAGS) $(SRCDIR)/buffer.c + +$(OBJDIR)/cmd.o : $(SRCDIR)/cmd.c $(DOT_O_DEPS) $(OBJ_O_DEPS) $(cmd_O_DEP) + cd $(OBJDIR) && $(COMPILE_CMD) $(cmd_C_FLAGS) $(SRCDIR)/cmd.c + +$(OBJDIR)/display.o : $(SRCDIR)/display.c $(DOT_O_DEPS) $(OBJ_O_DEPS) $(display_O_DEP) + cd $(OBJDIR) && $(COMPILE_CMD) $(display_C_FLAGS) $(SRCDIR)/display.c + +$(OBJDIR)/edit.o : $(SRCDIR)/edit.c $(DOT_O_DEPS) $(OBJ_O_DEPS) $(edit_O_DEP) + cd $(OBJDIR) && $(COMPILE_CMD) $(edit_C_FLAGS) $(SRCDIR)/edit.c + +$(OBJDIR)/file.o : $(SRCDIR)/file.c $(DOT_O_DEPS) $(OBJ_O_DEPS) $(file_O_DEP) + cd $(OBJDIR) && $(COMPILE_CMD) $(file_C_FLAGS) $(SRCDIR)/file.c + +$(OBJDIR)/help.o : $(SRCDIR)/help.c $(DOT_O_DEPS) $(OBJ_O_DEPS) $(help_O_DEP) + cd $(OBJDIR) && $(COMPILE_CMD) $(help_C_FLAGS) $(SRCDIR)/help.c + +$(OBJDIR)/keym.o : $(SRCDIR)/keym.c $(DOT_O_DEPS) $(OBJ_O_DEPS) $(keym_O_DEP) + cd $(OBJDIR) && $(COMPILE_CMD) $(keym_C_FLAGS) $(SRCDIR)/keym.c + +$(OBJDIR)/keyparse.o : $(SRCDIR)/keyparse.c $(DOT_O_DEPS) $(OBJ_O_DEPS) $(keyparse_O_DEP) + cd $(OBJDIR) && $(COMPILE_CMD) $(keyparse_C_FLAGS) $(SRCDIR)/keyparse.c + +$(OBJDIR)/line.o : $(SRCDIR)/line.c $(DOT_O_DEPS) $(OBJ_O_DEPS) $(line_O_DEP) + cd $(OBJDIR) && $(COMPILE_CMD) $(line_C_FLAGS) $(SRCDIR)/line.c + +$(OBJDIR)/main.o : $(SRCDIR)/main.c $(DOT_O_DEPS) $(OBJ_O_DEPS) $(main_O_DEP) + cd $(OBJDIR) && $(COMPILE_CMD) $(main_C_FLAGS) $(SRCDIR)/main.c + +$(OBJDIR)/most.o : $(SRCDIR)/most.c $(DOT_O_DEPS) $(OBJ_O_DEPS) $(most_O_DEP) + cd $(OBJDIR) && $(COMPILE_CMD) $(most_C_FLAGS) $(SRCDIR)/most.c + +$(OBJDIR)/search.o : $(SRCDIR)/search.c $(DOT_O_DEPS) $(OBJ_O_DEPS) $(search_O_DEP) + cd $(OBJDIR) && $(COMPILE_CMD) $(search_C_FLAGS) $(SRCDIR)/search.c + +$(OBJDIR)/sysdep.o : $(SRCDIR)/sysdep.c $(DOT_O_DEPS) $(OBJ_O_DEPS) $(sysdep_O_DEP) + cd $(OBJDIR) && $(COMPILE_CMD) $(sysdep_C_FLAGS) $(SRCDIR)/sysdep.c + +$(OBJDIR)/window.o : $(SRCDIR)/window.c $(DOT_O_DEPS) $(OBJ_O_DEPS) $(window_O_DEP) + cd $(OBJDIR) && $(COMPILE_CMD) $(window_C_FLAGS) $(SRCDIR)/window.c + +$(OBJDIR)/chkslang.o : $(SRCDIR)/chkslang.c $(DOT_O_DEPS) $(OBJ_O_DEPS) $(chkslang_O_DEP) + cd $(OBJDIR) && $(COMPILE_CMD) $(chkslang_C_FLAGS) $(SRCDIR)/chkslang.c + diff --git a/vendor/most-5.1.0/src/Makefile.in b/vendor/most-5.1.0/src/Makefile.in new file mode 100644 index 0000000..b63a2ee --- /dev/null +++ b/vendor/most-5.1.0/src/Makefile.in @@ -0,0 +1,104 @@ +CC = @CC@ +CFLAGS = @CFLAGS@ @SLANG_DLL_CFLAGS@ +LDFLAGS = @LDFLAGS@ +SLANG_INC = @SLANG_INC@ +SLANG_LIB = @SLANG_LIB@ -lslang +MISCLIBS = @TERMCAP@ +RPATH = @RPATH@ + +#----------------------------------------------------------------------------- +# Location where object files are placed (Absolute path) +#----------------------------------------------------------------------------- +SRCDIR = @CONFIG_DIR@/src +OBJDIR = @CONFIG_DIR@/src/$(ARCH)objs + +#---------------------------------------------------------------------------- +# 5. Install location +#---------------------------------------------------------------------------- +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +DESTDIR = +prefix = @prefix@ +exec_prefix = @exec_prefix@ +datarootdir = @datarootdir@ +BIN_DIR = $(prefix)/bin +MAN_DIR = $(datarootdir)/man +DOC_DIR = $(datarootdir)/doc/most +SYS_INITFILE = @sysconfdir@/most.conf +MKINSDIR = ../autoconf/mkinsdir.sh + +DOC_FILES = ../doc/most.txt ../README ../doc/most-fun.txt ../doc/lesskeys.rc ../doc/most.rc ../changes.txt + +#---------------------------------------------------------------------------- +# Nothing below here should require changing. +#---------------------------------------------------------------------------- +DEST_DOCDIR = $(DESTDIR)$(DOC_DIR) +DEST_MANDIR = $(DESTDIR)$(MAN_DIR) +DEST_BINDIR = $(DESTDIR)$(BIN_DIR) +# +SHELL = /bin/sh +OBJS = @PROGRAM_OBJECTS@ +OFILES = @PROGRAM_OFILES@ + +EXEC = most +CONFIG_H = config.h +INCS = $(SLANG_INC) +ALL_CFLAGS = $(CFLAGS) -Dunix $(INCS) +EXECLIBS = $(RPATH) $(SLANG_LIB) $(MISCLIBS) -lm +# +most_O_DEP = $(SRCDIR)/version.h +UPDATE_VERSION_SCRIPT = $(HOME)/bin/update_changes_version + +COMPILE_CMD = $(CC) -c $(ALL_CFLAGS) -DMOST_SYSTEM_INITFILE='"$(SYS_INITFILE)"' +# +all: $(EXEC) +$(EXEC): $(OBJDIR) $(CONFIG_H) slangversion $(OBJDIR)/$(EXEC) + @echo $(EXEC) created in $(OBJDIR) +$(OBJDIR)/$(EXEC): $(OBJS) + cd $(OBJDIR); $(CC) $(OFILES) -o $(EXEC) $(LDFLAGS) $(EXECLIBS) +# +$(OBJDIR): + -mkdir $(OBJDIR) +# +$(CONFIG_H) : $(SRCDIR)/sysconf.h + /bin/cp $(SRCDIR)/sysconf.h $(CONFIG_H) +# +slangversion: $(OBJDIR)/chkslang + $(OBJDIR)/chkslang $(EXEC) 20000 +# +$(OBJDIR)/chkslang: $(OBJDIR)/chkslang.o + $(CC) $(OBJDIR)/chkslang.o -o $(OBJDIR)/chkslang $(LDFLAGS) $(EXECLIBS) +# +$(SRCDIR)/version.h: $(SRCDIR)/../changes.txt + if [ -x $(UPDATE_VERSION_SCRIPT) ]; then \ + $(UPDATE_VERSION_SCRIPT) $(SRCDIR)/../changes.txt $(SRCDIR)/version.h; \ + fi +# +clean: + /bin/rm -f $(OBJDIR)/* *~ +distclean: clean + /bin/rm -rf $(OBJDIR) Makefile sysconf.h +installdirs: + $(MKINSDIR) $(DEST_DOCDIR) + $(MKINSDIR) $(DEST_MANDIR)/man1 + $(MKINSDIR) $(DEST_BINDIR) +install: all installdirs + $(INSTALL) -s $(OBJDIR)/most $(DEST_BINDIR) + $(INSTALL_DATA) ../doc/most.1 $(DEST_MANDIR)/man1 + @for i in $(DOC_FILES); \ + do \ + echo $(INSTALL_DATA) $$i $(DEST_DOCDIR)/; \ + $(INSTALL_DATA) $$i $(DEST_DOCDIR)/; \ + if [ "$$?" != "0" ]; then \ + exit 1; \ + fi; \ + done +# The symlinks target is for my own private use. It simply creates the object +# directory as a symbolic link to a local disk instead of an NFS mounted one. +symlinks: + -/bin/rm -f $(ARCH)objs + mkdir -p $(HOME)/sys/$(ARCH)/objs/most/src + ln -s $(HOME)/sys/$(ARCH)/objs/most/src $(ARCH)objs +#--------------------------------------------------------------------------- +# Rules (automatically generated) +#--------------------------------------------------------------------------- diff --git a/vendor/most-5.1.0/src/Makefile.w32 b/vendor/most-5.1.0/src/Makefile.w32 new file mode 100644 index 0000000..ebb2082 --- /dev/null +++ b/vendor/most-5.1.0/src/Makefile.w32 @@ -0,0 +1,90 @@ +# DJGPP and MINGW32 Makefile for most -*- sh -*- +#--------------------------------------------------------------------------- +# 1. Choose a C compiler. It must understand prototypes. +#----------------------------------------------------------------------------- +CC = gcc +CFLAGS = -Wall -W -O2 -fno-strength-reduce +LDFLAGS = + +# If using DJGPP, set ARCH to djg. Use gw32 for MINGW32 +#ARCH=djg +ARCH=gw32 + +SLANGINC = ../../slang/src# Location of slang.h +SLANGLIB = $(SLANGINC)/$(ARCH)objs# Location of libslang.a + + +#----------------------------------------------------------------------------- +# 4. Location where object files are placed +#----------------------------------------------------------------------------- +OBJDIR = $(ARCH)objs +SRCDIR = . + +#---------------------------------------------------------------------------- +# Nothing below here should require changing. +#---------------------------------------------------------------------------- +OBJS = $(OBJDIR)/buffer.o $(OBJDIR)/cmd.o $(OBJDIR)/display.o $(OBJDIR)/edit.o $(OBJDIR)/file.o $(OBJDIR)/help.o $(OBJDIR)/keym.o $(OBJDIR)/keyparse.o $(OBJDIR)/line.o $(OBJDIR)/main.o $(OBJDIR)/most.o $(OBJDIR)/search.o $(OBJDIR)/sysdep.o $(OBJDIR)/window.o +OFILES = buffer.o cmd.o display.o edit.o file.o help.o keym.o keyparse.o line.o main.o most.o search.o sysdep.o window.o + +EXEC = most +CONFIG_H = config.h +ALL_CFLAGS = $(CFLAGS) -I$(SLANGINC) +EXECLIBS = -L../$(SLANGLIB) -lslang +# +COMPILE_CMD = $(CC) -c $(ALL_CFLAGS) +# +all: $(EXEC) +$(EXEC): $(OBJDIR) $(CONFIG_H) $(OBJDIR)/$(EXEC) + @echo $(EXEC) created in $(OBJDIR) +$(OBJDIR)/$(EXEC): $(OBJS) + cd $(OBJDIR); $(CC) *.o -o $(EXEC) $(LDFLAGS) $(EXECLIBS) +# +$(OBJDIR): + -mkdir $(OBJDIR) +# +$(CONFIG_H) : $(SRCDIR)/w32conf.h + cp $(SRCDIR)/w32conf.h $(CONFIG_H) +clean: + rm -f $(OBJDIR)/* *~ + +$(OBJDIR)/buffer.o : $(SRCDIR)/buffer.c $(DOT_O_DEPS) $(buffer_O_DEP) + $(COMPILE_CMD) $(SRCDIR)/buffer.c -o $(OBJDIR)/buffer.o + +$(OBJDIR)/cmd.o : $(SRCDIR)/cmd.c $(DOT_O_DEPS) $(cmd_O_DEP) + $(COMPILE_CMD) $(SRCDIR)/cmd.c -o $(OBJDIR)/cmd.o + +$(OBJDIR)/display.o : $(SRCDIR)/display.c $(DOT_O_DEPS) $(display_O_DEP) + $(COMPILE_CMD) $(SRCDIR)/display.c -o $(OBJDIR)/display.o + +$(OBJDIR)/edit.o : $(SRCDIR)/edit.c $(DOT_O_DEPS) $(edit_O_DEP) + $(COMPILE_CMD) $(SRCDIR)/edit.c -o $(OBJDIR)/edit.o + +$(OBJDIR)/file.o : $(SRCDIR)/file.c $(DOT_O_DEPS) $(file_O_DEP) + $(COMPILE_CMD) $(SRCDIR)/file.c -o $(OBJDIR)/file.o + +$(OBJDIR)/help.o : $(SRCDIR)/help.c $(DOT_O_DEPS) $(help_O_DEP) + $(COMPILE_CMD) $(SRCDIR)/help.c -o $(OBJDIR)/help.o + +$(OBJDIR)/keym.o : $(SRCDIR)/keym.c $(DOT_O_DEPS) $(keym_O_DEP) + $(COMPILE_CMD) $(SRCDIR)/keym.c -o $(OBJDIR)/keym.o + +$(OBJDIR)/keyparse.o : $(SRCDIR)/keyparse.c $(DOT_O_DEPS) $(keyparse_O_DEP) + $(COMPILE_CMD) $(SRCDIR)/keyparse.c -o $(OBJDIR)/keyparse.o + +$(OBJDIR)/line.o : $(SRCDIR)/line.c $(DOT_O_DEPS) $(line_O_DEP) + $(COMPILE_CMD) $(SRCDIR)/line.c -o $(OBJDIR)/line.o + +$(OBJDIR)/main.o : $(SRCDIR)/main.c $(DOT_O_DEPS) $(main_O_DEP) + $(COMPILE_CMD) $(SRCDIR)/main.c -o $(OBJDIR)/main.o + +$(OBJDIR)/most.o : $(SRCDIR)/most.c $(DOT_O_DEPS) $(most_O_DEP) + $(COMPILE_CMD) $(SRCDIR)/most.c -o $(OBJDIR)/most.o + +$(OBJDIR)/search.o : $(SRCDIR)/search.c $(DOT_O_DEPS) $(search_O_DEP) + $(COMPILE_CMD) $(SRCDIR)/search.c -o $(OBJDIR)/search.o + +$(OBJDIR)/sysdep.o : $(SRCDIR)/sysdep.c $(DOT_O_DEPS) $(sysdep_O_DEP) + $(COMPILE_CMD) $(SRCDIR)/sysdep.c -o $(OBJDIR)/sysdep.o + +$(OBJDIR)/window.o : $(SRCDIR)/window.c $(DOT_O_DEPS) $(window_O_DEP) + $(COMPILE_CMD) $(SRCDIR)/window.c -o $(OBJDIR)/window.o diff --git a/vendor/most-5.1.0/src/RTL.OPT b/vendor/most-5.1.0/src/RTL.OPT new file mode 100644 index 0000000..144d2a1 --- /dev/null +++ b/vendor/most-5.1.0/src/RTL.OPT @@ -0,0 +1,2 @@ +SYS$LIBRARY:VAXCRTL/SHARE + diff --git a/vendor/most-5.1.0/src/VMSMAKE.COM b/vendor/most-5.1.0/src/VMSMAKE.COM new file mode 100644 index 0000000..b614de6 --- /dev/null +++ b/vendor/most-5.1.0/src/VMSMAKE.COM @@ -0,0 +1,65 @@ +$! Most Makefile for VMS +$! +$! S-Lang Include directory (where slang.olb is located) +$! +$ Link_Flags = "" +$ Link_Libs = "" +$ slang_dir = "[-.-.slang.src]" +$ slang_lib = ",''slang_dir'slang/LIBR" +$ defs = "" +$ include = slang_dir +$! +$! If compiling with GCC, uncomment next line +$! goto has_gcc +$ if (p1 .eqs. "GCC") then goto has_gcc +$! +$! There should be no need to change anything below here +$! +$ C_C = "cc/standard=vaxc" +$ goto start +$ has_gcc: +$ C_C = "gcc/warnings/nocase_hack" +$ link_libs = "GNU_CC:[000000]GCCLIB/LIB" +$! +$ start: +$ copy mostconf.h config.h +$ axp = 0 +$ axp = f$getsyi("HW_MODEL").ge.1024 +$ exec_name = "most.exe" +$ files = "main,buffer,file,window,line,display,sysdep," +$ files = files + "keym,most,search,help,cmd,edit,keyparse" +$! +$ if (p1 .eqs. "LINK") then goto do_link +$! +$! simple make +$! +$ if (defs .nes. "") then defs = "/define=(" + defs + ")" +$ if (include .nes. "") then include = "/include=(" + include + ")" +$ count = 0 +$ next_file: +$ f = f$element(count, ",", files) +$ count = count + 1 +$ if (f .eqs. ",") then goto do_link +$ objf = f$search("''f'.obj") +$ if (objf .eqs. "") then goto compile_it +$ tobj = f$file_attr(objf, "RDT") +$ tc = f$file_attr("''f'.c", "RDT") +$ if (f$cvtime(tc) .lts. f$cvtime(tobj)) then goto next_file +$ compile_it: +$ write sys$output "''C_C' ''defs' ''include' ''f'.c" +$ 'C_C' 'defs' 'include' 'f'.c +$ goto next_file +$ do_link: +$ if axp +$ then +$ set verify +$ link/exec=most.exe 'Link_Flags' 'files', 'slang_dir'slang/LIBR 'Link_Libs' +$ set noverify +$ else +$ set verify +$ link/exec=most.exe 'Link_Flags' 'files', 'slang_dir'slang/LIB 'Link_Libs', - + sys$input/opt + SYS$LIBRARY:VAXCRTL/SHARE +$ set noverify +$ endif +$exit diff --git a/vendor/most-5.1.0/src/buffer.c b/vendor/most-5.1.0/src/buffer.c new file mode 100644 index 0000000..dc2cf62 --- /dev/null +++ b/vendor/most-5.1.0/src/buffer.c @@ -0,0 +1,579 @@ +/* + This file is part of MOST. + + Copyright (c) 1991, 1999, 2002, 2005-2018, 2019 John E. Davis + + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the Free + Software Foundation; either version 2 of the License, or (at your option) + any later version. + + This program is distributed in the hope that 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. +*/ +#include "config.h" + +#include + +#ifdef HAVE_STDLIB_H +# include +#endif + +#include + +#include +#include "jdmacros.h" + +#include "most.h" +#include "buffer.h" +#include "display.h" +#include "window.h" +#include "line.h" +#include "file.h" + +int Most_W_Opt = 0; + +unsigned char *Most_Beg; /* beginning of current buffer */ +unsigned char *Most_Eob; /* end of current buffer */ + +Most_Buffer_Type *Most_Buf; + +MOST_INT Most_Num_Lines; + +MOST_UINT Most_C_Offset; +MOST_INT Most_C_Line; + +/* p>p0 assumed */ +#define BSKIP_CHAR(p,p0) \ + (((Most_UTF8_Mode == 0) || (0 == ((*(p-1)) & 0x80))) \ + ? ((p)--) \ + : ((p) = SLutf8_bskip_char ((p0), (p)))) + +static unsigned char *beg_of_line1(void) +{ + unsigned char *pos; + unsigned char *cpos; + + cpos = pos = Most_Beg + Most_C_Offset; + if (pos == Most_Beg) return pos; + + if (pos != Most_Eob) + { + if (*pos == '\n') + { + pos--;/* Skip back over the new-line. */ + while ((pos > Most_Beg) + && (*pos != '\n')) + pos--; + + if (*pos != '\n') return pos; + if (pos + 1 != cpos) + return pos + 1; + } + } + else BSKIP_CHAR (pos, Most_Beg); + + if (*pos != '\n') + { + while ((pos > Most_Beg) + && (*pos != '\n')) + pos--; + if (*pos != '\n') return Most_Beg; + return pos + 1; + } + + /* from here on *pos == '\n' */ + + if (Most_S_Opt == 0) return pos + 1; + + while ((pos > Most_Beg) + && (*pos == '\n')) pos--; + pos += 2; + if (pos > cpos) pos = cpos; + return pos; +} + +/* does not move point */ +static unsigned char *end_of_line1(void) +{ + register unsigned char *pos, *pmax; + int n, n2; + + pos = Most_Beg + Most_C_Offset; + pmax = Most_Eob; + if (pos >= pmax) return pmax; + + /* find the first '\n'. If we are wrapping lines, then do not go more + * than 3 times the display width. + */ + if (Most_W_Opt && SLtt_Screen_Cols) + { + pmax = pos + 3 * SLtt_Screen_Cols; + if (pmax > Most_Eob) + pmax = Most_Eob; + } + + if (*pos != '\n') + { + /* This block is UTF-8 safe, because it only scans the buffer + * for a new-line, and doesn't count characters. + */ + n = pmax - pos; + n2 = n % 8; + pmax = pos + (n - 8); + + while (pos <= pmax) + { + if (*pos == '\n') return pos; + if (*(pos + 1) == '\n') return pos + 1; + if (*(pos + 2) == '\n') return pos + 2; + if (*(pos + 3) == '\n') return pos + 3; + if (*(pos + 4) == '\n') return pos + 4; + if (*(pos + 5) == '\n') return pos + 5; + if (*(pos + 6) == '\n') return pos + 6; + if (*(pos + 7) == '\n') return pos + 7; + pos += 8; + } + pmax = pos + n2; + while ((pos < pmax) && (*pos != '\n')) pos++; + return(pos); + } + + if (!Most_S_Opt) return (pos); + /* file */ + /* if Most_Beg = "....abc\n\n\n\n\ndef..." then we are at some first \n. We + want to return the last '\n' unless we wre at the first '\n'. */ + + /* Here we are on a \n and NOT at the end of the buffer */ + + if ((pos > Most_Beg) && (*(pos - 1) != '\n')) return (pos); + + while ((pos < Most_Eob) && (*pos == '\n')) pos++; + if (pos == Most_Eob) return pos; + if (pos != Most_Beg) pos--; + return pos; + /* if (pos == Most_Eob) return (pos - 1); + return pos; */ +} + +unsigned char *most_beg_of_line(void) +{ + unsigned char *b; + unsigned int ncols; + unsigned char *e; + + if (Most_W_Opt == 0) return beg_of_line1(); + + b = beg_of_line1 (); + e = end_of_line1 (); + ncols = SLtt_Screen_Cols; + if (Most_Show_Wrap_Marker) + ncols--; + while (1) + { + unsigned char *next_b = most_forward_columns (b, e, ncols); + if ((next_b == e) || (next_b == b)) + break; + + if (next_b >= Most_Beg + Most_C_Offset) + break; + + b = next_b; + } + + return b; +} + +static unsigned char *end_of_line (unsigned char *b) +{ + unsigned char *e, *b1; + int ncols; + + e = end_of_line1(); + if (Most_W_Opt == 0) + return e; + + if (b == NULL) b = most_beg_of_line (); + + ncols = SLtt_Screen_Cols; + if (Most_Show_Wrap_Marker) + ncols--; + + b = most_forward_columns (b, e, ncols); + + /* Do not wrap the line if the last character falls on the last column + * of the display. + */ + if (Most_Show_Wrap_Marker) + { + if ((Most_UTF8_Mode == 0) || ((*b & 0x80) == 0)) + b1 = b + 1; + else + b1 = SLutf8_skip_char (b, Most_Eob); + + if ((b1 <= e) + && (b1 < Most_Eob)) + { + if (*b1 == '\n') + b = b1; + else if ((*b1 == 033) && (Most_V_Opt == 0)) + { + unsigned char ch = 033; + b1++; + while ((ch == 033) && (b1 < e) && (b1 < Most_Eob) + && (0 == most_parse_color_escape (&b1, e, NULL))) + { + b = b1; + ch = *b1++; + } + } + } + } + + return b; +} + +MOST_INT most_forward_line (MOST_INT save) +{ + MOST_INT m, n; + unsigned char *p; + unsigned char *pmax; + + n = save; + pmax = Most_Eob; + + if (n > 0) + { + if (Most_B_Opt) + { + m = (Most_Eob - (Most_Beg + Most_C_Offset)) / 16; + if (n > m) n = m; + Most_C_Offset += n * 16; + Most_C_Line += n; + return n; + } + + p = NULL; + while (n--) + { + p = end_of_line (p); + Most_C_Offset = p - Most_Beg; + if (p == Most_Eob) return (save - (n + 1)); + Most_C_Line++; Most_C_Offset++; + + if (Most_Selective_Display) + { + /* Skip past lines with too much indentation to the start + * of a valid one. + */ + p = Most_Beg + Most_C_Offset; + while (p < pmax) + { + while ((p < pmax) && (*p <= ' ')) p++; + if (most_apparant_distance(p) < Most_Selective_Display) + break; + Most_C_Offset = (p - Most_Beg); + p = end_of_line (p); + if (p < pmax) p++; + } + Most_C_Offset = (p - Most_Beg); + } + p = Most_Beg + Most_C_Offset; + } + } + else + { + if (Most_B_Opt) + { + m = Most_C_Offset / 16; + if (n < m) n = m; + Most_C_Offset += n * 16; + Most_C_Line += n; + return n; + } + else while (n++) + { + p = most_beg_of_line(); + Most_C_Offset = (p - Most_Beg); + if (Most_C_Offset == 0) return (n - (save + 1)); + Most_C_Line--; + Most_C_Offset--; + + if (Most_Selective_Display) + { + /* Skip past lines with too much indentation to the start + * of a valid one. + */ + p = Most_Beg + Most_C_Offset; + while (p > Most_Beg) + { + /* skip all blank lines */ + while ((p > Most_Beg) && (*p <= ' ')) p--; + pmax = p; + Most_C_Offset = pmax - Most_Beg; + p = most_beg_of_line (); + Most_C_Offset = p - Most_Beg; + while ((p < pmax) && (*p <= ' ')) p++; + if (most_apparant_distance(p) < Most_Selective_Display) + break; + Most_C_Offset = p - Most_Beg; + p = most_beg_of_line (); + if (p > Most_Beg) p--; + Most_C_Offset = p - Most_Beg; + } + Most_C_Offset = p - Most_Beg; + } + } + } + return(save); +} + +/* Count lines in the region. A half line counts as 1 */ +MOST_INT most_count_lines(unsigned char *beg, unsigned char *end) +{ + MOST_INT save_line, n; + unsigned char *save_beg, *save_eob; + MOST_UINT save_pos; + int dn = 1000; + + if (Most_B_Opt) return(1 + (MOST_INT)(end - beg) / 16); + + save_line = Most_C_Line; save_beg = Most_Beg; save_eob = Most_Eob; + save_pos = Most_C_Offset; + + Most_Beg = beg; Most_Eob = end; + Most_C_Offset = 0; + + n = 1; + while((dn = most_forward_line(dn)) != 0) n += dn; + + Most_C_Offset = save_pos; + Most_Eob = save_eob; + Most_Beg = save_beg; + Most_C_Line = save_line; + return(n); +} + +void most_goto_line (MOST_INT line) +{ + MOST_INT dif_c, dif_b, dif_t; + + if (line < 1) line = 1; + most_read_to_line(line); + if (line > Most_Num_Lines) line = Most_Num_Lines; + + if (Most_B_Opt) + { + Most_C_Offset = (16 * (line - 1)); + Most_C_Line = line; + return; + } + + dif_c = line - Most_C_Line; + dif_b = line - Most_Num_Lines; + dif_t = line - 1; + + /* 4 possibilites */ + if (dif_c <= 0) + { + if (dif_t < -dif_c) /* go from top */ + { + Most_C_Line = 1; + Most_C_Offset = 0; + (void) most_forward_line(dif_t); + } + else /* from curr back */ + { + (void) most_forward_line(dif_c); + } + } + else if (dif_c > 0) + { + if ((dif_c + dif_b) < 0) /* go from curr */ + { + (void) most_forward_line(dif_c); + } + else + { + Most_C_Line = Most_Num_Lines; + Most_C_Offset = (Most_Eob - Most_Beg); + (void) most_forward_line(dif_b); + } + } +} + +/* return line the point is on without the final '\n's */ +int most_extract_line(unsigned char **beg, unsigned char **end) +{ + *beg = most_beg_of_line(); + *end = end_of_line (*beg); + + return 0; +} + +MOST_INT most_what_line(unsigned char *pos) +{ + unsigned int save_pos; + MOST_INT save_line, dir; + MOST_INT dif_c, dif_b,dif_t; + int ret; + + if (Most_B_Opt) + { + return (1 + (pos - Most_Beg)/16); + } + + if (Most_Selective_Display) + { + return most_count_lines (Most_Beg, pos); + } + + save_pos = Most_C_Offset; + save_line = Most_C_Line; + + dif_c = pos - (Most_Beg + Most_C_Offset); + dif_b = pos - Most_Eob; + dif_t = pos - Most_Beg; + + /* 4 possibilites */ + if (dif_c <= 0) + { + if (dif_t < -dif_c) /* go from top */ + { + Most_C_Line = 1; + Most_C_Offset = 0; + dir = 1; + } + else /* from curr back */ + { + dir = -1; + } + } + else /* (dif_c > 0) */ + { + if ((dif_c + dif_b) < 0) /* go from curr */ + { + dir = 1; + } + else + { + Most_C_Line = Most_Num_Lines; + Most_C_Offset = Most_Eob - Most_Beg; + dir = -1; + } + } + if (dir == 1) + { + while (1) + { + unsigned char *cpos; + + cpos = end_of_line (NULL); + Most_C_Offset = cpos - Most_Beg; + + if (cpos >= pos) + break; + + Most_C_Offset++; + Most_C_Line++; + } + } + else + { + while (1) + { + unsigned char *cpos; + + cpos = most_beg_of_line (); + Most_C_Offset = cpos - Most_Beg; + if (pos >= cpos) + break; + Most_C_Line--; + Most_C_Offset--; + } + } + + ret = Most_C_Line; + Most_C_Offset = save_pos; + Most_C_Line = save_line; + return(ret); +} + +/* given a buffer position, find the line and column */ +void most_find_row_column(unsigned char *pos, MOST_INT *r, MOST_INT *c) +{ + unsigned int save_offset; + MOST_INT save_line; + + if (pos <= Most_Beg) + { + *r = 1; + *c = 1; + return; + } + + save_line = Most_C_Line; + save_offset = Most_C_Offset; + *r = most_what_line(pos); + + if (Most_B_Opt) + { + *c = (int) (pos - Most_Beg) - (*r - 1) * 16 + 1; + return; + } + Most_C_Line = *r; + Most_C_Offset = pos - Most_Beg; + + /* Now we have found the line it is on so.... */ + (void) most_beg_of_line(); + *c = 1 + most_apparant_distance (pos); + + Most_C_Line = save_line; + Most_C_Offset = save_offset; +} + +Most_Buffer_Type *most_switch_to_buffer(Most_Buffer_Type *nnew) +{ + Most_Buffer_Type *old; + old = Most_Buf; + Most_Buf = nnew; + Most_Beg = Most_Buf->beg; + Most_Eob = Most_Buf->end; + return old; +} + +Most_Buffer_Type *most_create_buffer(char *file) +{ + Most_Buffer_Type *buf; + + buf = (Most_Buffer_Type *) MOSTMALLOC(sizeof(Most_Buffer_Type)); + memset ((char *) buf, 0, sizeof(Most_Buffer_Type)); + strcpy(buf->file,file); + return(buf); +} + +unsigned char *most_malloc(unsigned int n) +{ + unsigned char *b = (unsigned char *) SLMALLOC(n); + if (b == NULL) + { + most_exit_error("malloc: Memory Allocation Error."); + } + return b; +} + +unsigned char *most_realloc(unsigned char *p, unsigned int n) +{ + unsigned char *b = (unsigned char *) SLREALLOC(p, n); + if (b == NULL) + { + most_exit_error("malloc: Memory Allocation Error."); + } + return b; +} diff --git a/vendor/most-5.1.0/src/buffer.h b/vendor/most-5.1.0/src/buffer.h new file mode 100644 index 0000000..c14ee35 --- /dev/null +++ b/vendor/most-5.1.0/src/buffer.h @@ -0,0 +1,81 @@ +/* + This file is part of MOST. + + Copyright (c) 1991, 1999, 2002, 2005-2018, 2019 John E. Davis + + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the Free + Software Foundation; either version 2 of the License, or (at your option) + any later version. + + This program is distributed in the hope that 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. +*/ +#ifndef _DAVIS_BUFFER_H_ +# define _DAVIS_BUFFER_H_ + +typedef struct +{ + char file[MAX_PATHLEN]; /* filename */ + unsigned char *beg; /* beginning of buffer */ + unsigned char *end; /* end of buffer */ + int mark; /* marked line in buffer */ + unsigned int flags; + int fd; /* file descriptor--- -1 if closed */ + FILE *fp; /* use pclose when EOF is reached */ + int size; +# ifdef VMS + int rec; /* record size for reads */ +# endif +# if MOST_HAS_MMAP + int is_mmaped; + unsigned int mmap_size; +# endif +} +Most_Buffer_Type; + +extern Most_Buffer_Type *Most_Buf; +extern unsigned char *Most_Beg, *Most_Eob; +extern MOST_INT Most_Num_Lines; + +/* Offset of current position from beginning of buffer */ +extern MOST_UINT Most_C_Offset; + +extern MOST_INT Most_C_Line; +/* + * Current line number. If at the beginning of the buffer, it is 1. If + * we are at the last point of the buffer it is the number of lines. + */ + +/* This routine does not move the point */ +extern unsigned char *most_beg_of_line(void); + +extern MOST_INT most_forward_line(MOST_INT); +/* This routine moves the point forward n lines. n can be negative. + It returns the number moved. */ + +extern void most_goto_line (MOST_INT); +/* Move the point somewhere on the nth line of the buffer returning + C_POS */ + +extern MOST_INT most_what_line (unsigned char *); +/* return the line number of position 'argument'. Does not move point */ + +/* count the number of lines in the region delimited by beg and end. + Counts lines from beg up to end but does not count end. + Does not move point. */ +extern MOST_INT most_count_lines(unsigned char *, unsigned char *); +extern int most_extract_line(unsigned char **, unsigned char **); + +extern Most_Buffer_Type *most_switch_to_buffer(Most_Buffer_Type *); +extern Most_Buffer_Type *most_create_buffer(char *); +extern void most_find_row_column(unsigned char *, MOST_INT *, MOST_INT *); + +#endif + diff --git a/vendor/most-5.1.0/src/chkslang.c b/vendor/most-5.1.0/src/chkslang.c new file mode 100644 index 0000000..1db5513 --- /dev/null +++ b/vendor/most-5.1.0/src/chkslang.c @@ -0,0 +1,89 @@ +/* + This file is part of MOST. + + Copyright (c) 1991, 1999, 2002, 2005-2018, 2019 John E. Davis + + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the Free + Software Foundation; either version 2 of the License, or (at your option) + any later version. + + This program is distributed in the hope that 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. +*/ +/* It is too bad that this cannot be done at the preprocessor level. + * Unfortunately, C is not completely portable yet. Basically the #error + * directive is the problem. + */ +#include "config.h" + +#include +#ifdef VMS +# include +#endif +#include +#include "jdmacros.h" + +static char *make_version (unsigned int v) +{ + static char v_string[16]; + unsigned int a, b, c; + + a = v/10000; + b = (v - a * 10000) / 100; + c = v - (a * 10000) - (b * 100); + sprintf (v_string, "%u.%u.%u", a, b, c); + return v_string; +} + +int main (int argc, char **argv) +{ + unsigned int min_version, sl_version; + unsigned int sug_version; + int ret; + + if ((argc < 3) || (argc > 4)) + { + fprintf (stderr, "Usage: %s \n", argv[0]); + return 1; + } +#ifndef SLANG_VERSION + sl_version = 0; +#else + sl_version = SLANG_VERSION; +#endif + + sscanf (argv[2], "%u", &min_version); + if (argc == 4) sscanf (argv[3], "%u", &sug_version); + else sug_version = sl_version; + + ret = 0; + if (sl_version < min_version) + { + fprintf (stderr, "This version of %s requires slang version %s.\n", + argv[1], make_version(min_version)); +#ifdef VMS + ret = SS$_ABORT; +#else + ret = 1; +#endif + } + + if (sl_version < sug_version) + { + fprintf (stderr, "Your slang version is %s.\n", make_version(sl_version)); + fprintf (stderr, "To fully utilize this program, you should upgrade the slang library to\n"); + fprintf (stderr, " version %s\n", make_version(sug_version)); + fprintf (stderr, "This library is available via anonymous ftp from\n\ +space.mit.edu in pub/davis/slang.\n"); + } + + return ret; +} + diff --git a/vendor/most-5.1.0/src/cmd.c b/vendor/most-5.1.0/src/cmd.c new file mode 100644 index 0000000..2c75e53 --- /dev/null +++ b/vendor/most-5.1.0/src/cmd.c @@ -0,0 +1,287 @@ +/* + This file is part of MOST. + + Copyright (c) 1991, 1999, 2002, 2005-2018, 2019 John E. Davis + + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the Free + Software Foundation; either version 2 of the License, or (at your option) + any later version. + + This program is distributed in the hope that 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. +*/ +#include "config.h" + +#include +#include + +#ifdef HAVE_STDLIB_H +# include +#endif + +#include +#include "jdmacros.h" + +#include "most.h" +#include "search.h" +#include "window.h" +#include "file.h" +#include "keym.h" +#include "display.h" +#include "sysdep.h" + +static char getkey_nocase (void) +{ + char ch = most_getkey (); + if ((ch >= 'a') && (ch <= 'z')) ch = ch - ' '; + + SLang_flush_input (); + + return ch; +} + +void most_next_file (void) +{ + static int next = 1; + char *msg = NULL; + + if (!Most_Num_Files) msg = "File ring is empty."; + else if (Most_Num_Files == 1) msg = "There is only one file!"; + else + { + most_do_next_file(&next); + } + if (msg != NULL) most_message (msg, 1); +} + +void most_toggle_case (void) +{ + char *msg; + Most_Case_Sensitive = !Most_Case_Sensitive; + if (Most_Case_Sensitive) + msg = "Searches now respect case."; + else + msg = "Searches nolonger respect case."; + + most_message (msg, 0); +} + +void most_toggle_research (void) +{ + char *msg; + + Most_Do_Regexp_Search = !Most_Do_Regexp_Search; + + if (Most_Do_Regexp_Search) + msg = "Regexp search enabled"; + else + msg = "Regexp search disabled"; + + most_message (msg, 0); +} + +void most_delete_file_cmd (void) +{ + int bell = 0; + char ch; + char *msg; + + if ('*' == *Most_Buf->file) return; + + if (Most_Secure_Mode) Most_D_Opt = 0; + if (Most_D_Opt == 0) return; + + most_select_minibuffer (); + SLsmg_printf ("Delete %s? [n]", Most_Buf->file); + SLsmg_refresh (); + + ch = getkey_nocase (); + if (ch == 'Y') + { + if (!most_delete_file(Most_Buf->file)) + { + msg = "File could not be deleted."; + bell = 1; + } + else + msg = "File deleted."; + } + else + msg = "File not deleted."; + most_exit_minibuffer (); + most_message(msg, bell); +} + +void most_toggle_options (void) +{ + char ch; + char *msg = NULL; + int n; + unsigned int save; + + most_select_minibuffer(); + SLsmg_write_string("Toggle: b(binary) t(tab) v(verbose) w(wrap) d(selective display) "); + SLsmg_gotorc (SLtt_Screen_Rows - 1, 0); + SLsmg_refresh (); + + ch = getkey_nocase(); + switch (ch) + { + default: + msg = "\007Invalid option!"; + break; + + case 'B': + Most_B_Opt = !Most_B_Opt; + Most_Num_Lines = most_count_lines(Most_Beg,Most_Eob); + break; + + case 'D': + if (Most_W_Opt) + { + msg = "\007Selective Display illegal in wrap mode."; + break; + } + + if (Most_Digit_Arg == NULL) + { + msg = "Selective Display off. Prefix with integer to set."; + n = 0; + } + else + { + msg = "Selective Display is set."; + n = abs( *Most_Digit_Arg ); + } + + if (Most_Selective_Display != n) + { + Most_Selective_Display = n; + Most_Num_Lines = most_count_lines(Most_Beg,Most_Eob); + most_forward_line (-1); + + /* This is duplicated below */ + /* Most_C_Line = most_count_lines (Most_Beg, Most_C_Pos); */ + } + + break; + + case 'S': + + if (Most_B_Opt) msg = "\007Squeezing not available in Binary mode."; + else + { + Most_S_Opt = !Most_S_Opt; + Most_Num_Lines = most_count_lines(Most_Beg,Most_Eob); + if (Most_S_Opt) msg = "Lines are now squeezed."; + else msg = "Line squeezing is turned off"; + } + + break; + + case 'W': + if (Most_Selective_Display) + { + msg = "\007Wrap mode cannot be enabled while selective display is on."; + break; + } + Most_W_Opt = !Most_W_Opt; + Most_Num_Lines = most_count_lines(Most_Beg, Most_Eob); + if (Most_W_Opt) msg = "Wrap turned on."; + else msg = "Wrap turned off."; + break; + + case 'V': + Most_V_Opt = !Most_V_Opt; + if (Most_V_Opt) msg = "Control char display is turned on."; + else msg = "Control char display is turned off."; + break; + + case 'T': + if (Most_Digit_Arg == NULL) Most_T_Opt = !Most_T_Opt; + else + { + Most_Tab_Width = abs( *Most_Digit_Arg ); + if (Most_Tab_Width == 0) Most_T_Opt = 1; + else Most_T_Opt = 0; + } + if (Most_T_Opt) msg = "Tabs are nolonger expanded."; + else msg = "Tabs are now expanded."; + break; + } + + SLsmg_erase_eol (); + most_exit_minibuffer(); + + if ((msg != NULL) && (*msg == '\007')) + { + most_message (msg + 1, 1); + return; + } + + if (!Most_Num_Lines) Most_Num_Lines = 1; + most_save_win_flags(Most_Win); + + save = Most_C_Offset; + Most_C_Offset = 0; + Most_C_Line = 1; + Most_C_Line = most_what_line (Most_Beg + save); + Most_C_Offset = save; + Most_Win->beg_line = Most_C_Line; + most_redraw_window(); + most_update_status(); + + if (msg != NULL) most_message (msg, 0); +} + +/* ----------------------------------------------------------------------*/ + +void most_extended_key_cmd (void) +{ + char ch; + + if (Most_Secure_Mode) Most_D_Opt = 0; + + most_select_minibuffer(); + SLsmg_write_string ("Choose: N (next file), C(toggle case), R(toggle re-search) O(toggle options)"); + if (Most_D_Opt) SLsmg_write_string (" ,D (delete file)"); + SLsmg_gotorc (SLtt_Screen_Rows - 1, 0); + SLsmg_refresh (); + ch = getkey_nocase(); + SLsmg_erase_eol (); + + most_exit_minibuffer (); + + switch (ch) + { + case 'N': + most_next_file (); + break; + case 'C': + most_toggle_case (); + break; + case 'R': + most_toggle_research (); + break; + case 'O': + most_toggle_options (); + break; + case 'D': + if (Most_D_Opt) + { + most_delete_file_cmd (); + break; + } + /* drop */ + default: + most_message ("Invalid option.", 1); + } +} + diff --git a/vendor/most-5.1.0/src/config.h b/vendor/most-5.1.0/src/config.h new file mode 100644 index 0000000..15d7577 --- /dev/null +++ b/vendor/most-5.1.0/src/config.h @@ -0,0 +1,107 @@ +/* src/sysconf.h. Generated from config.hin by configure. */ +/* -*- C -*- */ + +/* Note: this is for authentic unix systems only. + * See mostconf.h for other systems. + */ + +#ifndef MOST_CONFIG_H +#define MOST_CONFIG_H + +/* Define if you want the MMAP support */ +#define USE_MMAP 1 + +/* define if you have long long type */ +#define HAVE_LONG_LONG 1 + +/* #undef off_t */ +/* #undef size_t */ +#define SIZEOF_OFF_T 8 +#define SIZEOF_SHORT 2 +#define SIZEOF_INT 4 +#define SIZEOF_LONG 8 +#define SIZEOF_FLOAT 4 +#define SIZEOF_DOUBLE 8 +#define SIZEOF_LONG_LONG 8 + +/* The following set defines may be necessary to activate long file support */ +/* #undef _FILE_OFFSET_BITS */ +/* #undef _LARGE_FILES */ +/* #undef _LARGEFILE_SOURCE */ + +/* define if you have stdlib.h */ +#define HAVE_STDLIB_H 1 + +/* define if you have unistd.h */ +#define HAVE_UNISTD_H 1 + +/* define if you have memory.h */ +#define HAVE_MEMORY_H 1 + +/* define if you have malloc.h */ +#define HAVE_MALLOC_H 1 + +/* define if you have memset */ +#define HAVE_MEMSET 1 + +/* define if you have memcpy */ +#define HAVE_MEMCPY 1 + +/* define if you have this. */ +#define HAVE_GETCWD 1 + +#define HAVE_MMAP 1 + +#define HAVE_TCGETPGRP 1 +#define HAVE_GETPGRP 1 + +#define HAVE_DIRENT_H 1 +/* #undef HAVE_SYS_NDIR_H */ +/* #undef HAVE_SYS_DIR_H */ +/* #undef HAVE_NDIR_H */ + +#define HAVE_SNPRINTF 1 +#define HAVE_SYS_MMAN_H 1 + +/* #undef mode_t */ +/* #undef pid_t */ +/* #undef uid_t */ +/* #undef pid_t */ + + +#ifdef _AIX +# ifndef _POSIX_SOURCE +# define _POSIX_SOURCE +# endif +# ifndef _ALL_SOURCE +# define _ALL_SOURCE 1 +# endif +/* This may generate warnings but the fact is that without it, xlc will + * INCORRECTLY inline many str* functions. */ +/* # undef __STR__ */ +#endif + +#define MAX_PATHLEN 1024 +#if defined(USE_MMAP) && defined(HAVE_MMAP) && defined(HAVE_SYS_MMAN_H) +# define MOST_HAS_MMAP 1 +#else +# define MOST_HAS_MMAP 0 +#endif + +#if defined(HAVE_LONG_LONG) && (SIZEOF_OFF_T == SIZEOF_LONG_LONG) && (SIZEOF_LONG_LONG > SIZEOF_LONG) +typedef long long MOST_INT; +typedef unsigned long long MOST_UINT; +# define MOST_INT_D_FMT "%lld" +#else +# if (SIZEOF_OFF_T == SIZEOF_INT) +typedef int MOST_INT; +typedef unsigned int MOST_UINT; +# define MOST_INT_D_FMT "%d" +# else +typedef long MOST_INT; +typedef unsigned long MOST_UINT; +# define MOST_INT_D_FMT "%ld" +# endif +#endif + +#endif /* MOST_CONFIG_H */ diff --git a/vendor/most-5.1.0/src/config.hin b/vendor/most-5.1.0/src/config.hin new file mode 100644 index 0000000..8146561 --- /dev/null +++ b/vendor/most-5.1.0/src/config.hin @@ -0,0 +1,106 @@ +/* -*- C -*- */ + +/* Note: this is for authentic unix systems only. + * See mostconf.h for other systems. + */ + +#ifndef MOST_CONFIG_H +#define MOST_CONFIG_H + +/* Define if you want the MMAP support */ +#undef USE_MMAP + +/* define if you have long long type */ +#undef HAVE_LONG_LONG + +#undef off_t +#undef size_t +#undef SIZEOF_OFF_T +#undef SIZEOF_SHORT +#undef SIZEOF_INT +#undef SIZEOF_LONG +#undef SIZEOF_FLOAT +#undef SIZEOF_DOUBLE +#undef SIZEOF_LONG_LONG + +/* The following set defines may be necessary to activate long file support */ +#undef _FILE_OFFSET_BITS +#undef _LARGE_FILES +#undef _LARGEFILE_SOURCE + +/* define if you have stdlib.h */ +#undef HAVE_STDLIB_H + +/* define if you have unistd.h */ +#undef HAVE_UNISTD_H + +/* define if you have memory.h */ +#undef HAVE_MEMORY_H + +/* define if you have malloc.h */ +#undef HAVE_MALLOC_H + +/* define if you have memset */ +#undef HAVE_MEMSET + +/* define if you have memcpy */ +#undef HAVE_MEMCPY + +/* define if you have this. */ +#undef HAVE_GETCWD + +#undef HAVE_MMAP + +#undef HAVE_TCGETPGRP +#undef HAVE_GETPGRP + +#undef HAVE_DIRENT_H +#undef HAVE_SYS_NDIR_H +#undef HAVE_SYS_DIR_H +#undef HAVE_NDIR_H + +#undef HAVE_SNPRINTF +#undef HAVE_SYS_MMAN_H + +#undef mode_t +#undef pid_t +#undef uid_t +#undef pid_t + + +#ifdef _AIX +# ifndef _POSIX_SOURCE +# define _POSIX_SOURCE +# endif +# ifndef _ALL_SOURCE +# define _ALL_SOURCE +# endif +/* This may generate warnings but the fact is that without it, xlc will + * INCORRECTLY inline many str* functions. */ +# undef __STR__ +#endif + +#define MAX_PATHLEN 1024 +#if defined(USE_MMAP) && defined(HAVE_MMAP) && defined(HAVE_SYS_MMAN_H) +# define MOST_HAS_MMAP 1 +#else +# define MOST_HAS_MMAP 0 +#endif + +#if defined(HAVE_LONG_LONG) && (SIZEOF_OFF_T == SIZEOF_LONG_LONG) && (SIZEOF_LONG_LONG > SIZEOF_LONG) +typedef long long MOST_INT; +typedef unsigned long long MOST_UINT; +# define MOST_INT_D_FMT "%lld" +#else +# if (SIZEOF_OFF_T == SIZEOF_INT) +typedef int MOST_INT; +typedef unsigned int MOST_UINT; +# define MOST_INT_D_FMT "%d" +# else +typedef long MOST_INT; +typedef unsigned long MOST_UINT; +# define MOST_INT_D_FMT "%ld" +# endif +#endif + +#endif /* MOST_CONFIG_H */ diff --git a/vendor/most-5.1.0/src/display.c b/vendor/most-5.1.0/src/display.c new file mode 100644 index 0000000..318ce2a --- /dev/null +++ b/vendor/most-5.1.0/src/display.c @@ -0,0 +1,67 @@ +/* + This file is part of MOST. + + Copyright (c) 1991, 1999, 2002, 2005-2018, 2019 John E. Davis + + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the Free + Software Foundation; either version 2 of the License, or (at your option) + any later version. + + This program is distributed in the hope that 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. +*/ +#include +#include +#include "jdmacros.h" + +#include "display.h" + +void most_narrow_width(void) +{ + SLsmg_refresh (); + SLtt_write_string ("\033[?3l"); +} + +void most_wide_width(void) +{ + SLsmg_refresh (); + SLtt_write_string ("\033[?3h"); +} + +void most_tt_set_color (int color) +{ + SLsmg_set_color (color); +} + +void most_tt_bold_video (void) +{ + SLsmg_set_color (MOST_BOLD_COLOR); +} + +void most_tt_normal_video (void) +{ + SLsmg_set_color (0); +} + +void most_tt_underline_video (void) +{ + SLsmg_set_color (MOST_ULINE_COLOR); +} + +void most_tt_reverse_video (void) +{ + SLsmg_set_color (MOST_STATUS_COLOR); +} + +void most_goto_rc (int r, int c) +{ + SLsmg_gotorc (r - 1, c - 1); +} + diff --git a/vendor/most-5.1.0/src/display.h b/vendor/most-5.1.0/src/display.h new file mode 100644 index 0000000..2662a8b --- /dev/null +++ b/vendor/most-5.1.0/src/display.h @@ -0,0 +1,38 @@ +/* + This file is part of MOST. + + Copyright (c) 1991, 1999, 2002, 2005-2018, 2019 John E. Davis + + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the Free + Software Foundation; either version 2 of the License, or (at your option) + any later version. + + This program is distributed in the hope that 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. +*/ + +/* These numbers match ANSI escape sequences of form ESC [ x m */ +#define MOST_BOLD_COLOR 1 +#define MOST_ULINE_COLOR 4 +#define MOST_STATUS_COLOR 7 + +#define MOST_EMBEDDED_COLOR_OFFSET 32 + +extern void most_tt_set_color (int color); +extern void most_tt_reverse_video(void); +extern void most_tt_bold_video(void); +extern void most_tt_underline_video(void); +extern void most_tt_normal_video(void); +extern void most_wide_width(void); +extern void most_narrow_width(void); +extern void most_enable_cursor_keys(void); + +extern void most_goto_rc (int, int); +extern void most_setup_colors (void); diff --git a/vendor/most-5.1.0/src/edit.c b/vendor/most-5.1.0/src/edit.c new file mode 100644 index 0000000..72688a3 --- /dev/null +++ b/vendor/most-5.1.0/src/edit.c @@ -0,0 +1,277 @@ +/* + This file is part of MOST. + + Copyright (c) 1991, 1999, 2002, 2005-2018, 2019 John E. Davis + + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the Free + Software Foundation; either version 2 of the License, or (at your option) + any later version. + + This program is distributed in the hope that 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. +*/ +#include "config.h" + +/* editor functions */ +#include +#include + +#ifdef VMS +# include +# include +# include +# include +/* #include */ +# include +# include +# include +#endif + +#ifdef HAVE_STDLIB_H +# include +#endif + +#include + +#include "most.h" +#include "edit.h" +#include "window.h" +#include "file.h" +#include "sysdep.h" + +/* quote_char is one of: 0, ", or '. It represents the character + * that will be used to quote the filename. + */ +char *most_escape_filename (char *file, char quote_char) +{ + char *efile, *e; + + if (NULL == (efile = SLmalloc (5 + 2*strlen(file)))) + return NULL; + + e = efile; + +#ifndef VMS + if (quote_char == 0) + { + /* No quote char was used for the filename command. Add it here. */ + *e++ = '"'; + } + else if (quote_char == '\'') + { + /* Suppose the file is Bob's Notes. With ' as the quote, when passed + * to the shell, it would look like 'Bob's Notes'. Unfortunately, this + * would produce an unmatched single quote when processed by the shell. + * So, the following escaped form will be used: + * ''"Bob's Notes"'' + */ + *e++ = '\''; + *e++ = '"'; + } +#endif + + while (1) + { + char ch = *file++; + switch (ch) + { + case 0: +#ifndef VMS + if (quote_char == 0) + *e++ = '"'; + else if (quote_char == '\'') + { + *e++ = '"'; + *e++ = '\''; + } +#endif + *e = 0; + return efile; +#ifndef VMS + /* For a double-quoted string, only the following characters + * may be escaped with a backslash. Unfortunately, escaping + * others such as &, *, |, etc will not work. + */ + case '\\': case '$': case '"': case '`': case '\n': + *e++ = '\\'; + *e++ = ch; + break; +#endif + default: + *e++ = ch; + } + } +} + +static int create_edit_command (char *edit, char *cmd, unsigned int sizeof_cmd, char *file) +{ + int d, s; + char ch, *p = edit; + char *efile; + char quote_char = '"'; + /* Look for %d and %s */ + + d = s = 0; + + while (0 != (ch = *p++)) + { + char q = 0; + + if (((ch == '\'') || (ch == '"')) + && (*p == '%')) + { + q = ch; + ch = '%'; + p++; + } + if (ch != '%') continue; + + ch = *p++; + if (!d && (ch == 'd')) + { + if (s == 0) d = 1; else d = 2; + } + else if (!s && (ch == 's')) + { + if (d == 0) s = 1; else s = 2; + if (q && (q != *p)) + { + most_message ("Unmatched quote character in editor definition", 1); + return -1; + } + quote_char = q; + } + else + { + most_message ("Invalid editor definition.", 1); + return -1; + } + } + + if (NULL == (efile = most_escape_filename (file, quote_char))) + return -1; + + if ((d == 0) && (s == 0)) + { + /* No %d, %s */ + _pSLsnprintf (cmd, sizeof_cmd, "%s \"%s\"", edit, efile); + SLfree (efile); + return 0; + } + + if (d == 0) + { + (void) _pSLsnprintf (cmd, sizeof_cmd, edit, efile); + SLfree (efile); + return 0; + } + + if (d && s) + { + if (d == 1) + (void) _pSLsnprintf (cmd, sizeof_cmd, edit, Most_C_Line, efile); + else + (void) _pSLsnprintf (cmd, sizeof_cmd, edit, efile, Most_C_Line); + + SLfree (efile); + return 0; + } + + most_message ("Unsupported Editor definition", 1); + SLfree (efile); + return -1; +} + +#ifdef VMS +int call_edt_tpu(int tpu, char *file) +{ + char the_file[MAX_PATHLEN], *strp; + extern void edt$edit(); + extern void tpu$tpu(); + struct dsc$descriptor_s file_desc; + + if (tpu == 1) /* tpu */ + _pSLsnprintf (the_file, sizeof(the_file), "TPU /START=%d ", Most_C_Line); + else + the_file[0] = '\0'; + + strcat(the_file, file); + + /* lose the version number */ + strp = the_file; + while((*strp != '\0') && (*strp != ';')) strp++; + *strp = '\0'; + + file_desc.dsc$w_length = strlen(the_file); + file_desc.dsc$a_pointer = the_file; + file_desc.dsc$b_class = DSC$K_CLASS_S; /* scalar, string type */ + file_desc.dsc$b_dtype = DSC$K_DTYPE_T; /* ascii string */ + + if (tpu == 1) + tpu$tpu(&file_desc); + else + edt$edit(&file_desc); + + return 1; +} +#endif + +void most_edit_cmd(void) +{ + char *editor; + char cmd[2*MAX_PATHLEN + 30]; +#ifdef VMS + int tpu = -1; +#endif + char *file; + + file = Most_Buf->file; + + if ((0 == *file) || ('*' == *file)) + return; + + if (Most_Secure_Mode) + { + most_message ("Editing not permitted in secure mode.", 1); + return; + } + + if ((NULL == (editor = getenv("MOST_EDITOR"))) + && (NULL == (editor = getenv("SLANG_EDITOR"))) + && (NULL == (editor = getenv("EDITOR")))) +#ifdef VMS + editor = "EDT"; +#else + editor = "vi"; +#endif + +#ifdef VMS + if (!strcmp(editor,"EDT")) tpu = 0; + else if (!strcmp(editor,"TPU")) tpu = 1; + else +#endif + if (-1 == create_edit_command(editor, cmd, sizeof(cmd), file)) + return; + + most_reset_tty (); + most_reset_display (); + +#ifdef VMS + if (tpu != -1) (void) call_edt_tpu(tpu, file); + else +#endif + SLsystem (cmd); + + most_reread_file (); + most_init_tty (); + most_init_display (); + most_redraw_display (); +} + diff --git a/vendor/most-5.1.0/src/edit.h b/vendor/most-5.1.0/src/edit.h new file mode 100644 index 0000000..e462468 --- /dev/null +++ b/vendor/most-5.1.0/src/edit.h @@ -0,0 +1,22 @@ +/* + This file is part of MOST. + + Copyright (c) 1991, 1999, 2002, 2005-2018, 2019 John E. Davis + + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the Free + Software Foundation; either version 2 of the License, or (at your option) + any later version. + + This program is distributed in the hope that 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. +*/ +extern void most_edit_cmd (void); +extern char *most_escape_filename (char *file, char quote_char); + diff --git a/vendor/most-5.1.0/src/file.c b/vendor/most-5.1.0/src/file.c new file mode 100644 index 0000000..6fbbe11 --- /dev/null +++ b/vendor/most-5.1.0/src/file.c @@ -0,0 +1,846 @@ +/* + This file is part of MOST. + + Copyright (c) 1991, 1999, 2002, 2005-2018, 2019 John E. Davis + + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the Free + Software Foundation; either version 2 of the License, or (at your option) + any later version. + + This program is distributed in the hope that 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. +*/ +#include "config.h" +#include +#include +#include + +#include + +#ifndef VMS +# include +# include +# include +# ifdef HAVE_UNISTD_H +# include +# endif +#else +# include +# include +#endif /* NOT VMS */ + +#ifdef HAVE_STDLIB_H +# include +#endif + +#include +#include "jdmacros.h" + +#ifndef O_RDONLY +# define O_RDONLY 0 +#endif + +#include "window.h" +#include "file.h" +#include "most.h" +#include "buffer.h" +#include "display.h" +#include "sysdep.h" +#include "edit.h" + +char *Most_File_Ring[MOST_MAX_FILES]; +char Most_C_Dir[MAX_PATHLEN]; /* current working dir */ +int Most_Num_Files; +int Most_Tail_Mode = 1; + +#if !defined(VMS) + +static int create_gunzip_cmd (char *cmd, char *file, char *buf, unsigned int sizeof_buf) +{ + char *efile; + + if (NULL == (efile = most_escape_filename (file, '"'))) + return -1; + + (void) _pSLsnprintf (buf, sizeof_buf, cmd, efile); + SLfree (efile); + return 0; +} + +static int open_compressed_file(char *file, int mode, int *size) +{ + int fd; + char buf[4], cmdbuf[2*MAX_PATHLEN]; + struct stat st; + +# ifdef O_BINARY + mode |= O_BINARY; +# endif +# ifdef IBMPC_SYSTEM + Most_Z_Opt = 1; +# endif + + if (Most_Z_Opt) + { + if (stat(file, &st)) return(-1); + *size = st.st_size; + return (open(file,mode)); + } + fd = open(file, O_RDONLY); + + if (fd < 0) return fd; + + if (4 == read(fd, buf, 4)) + { + char *cmd = NULL; + + if ((buf[0] == (char) 0x1f) + && (buf[1] == (char) 0x8b) + && (buf[2] == (char) 0x08) + && ((buf[3] == (char) 0x08) || (buf[3] == (char)0x00))) + { + cmd = MOST_GUNZIP_POPEN_FORMAT; + } + else if ((buf[0] == 'B') && (buf[1] == 'Z') && (buf[2] == 'h') + && (buf[3] > 47)) + { + cmd = MOST_BZIP2_POPEN_FORMAT; + } + + if (cmd != NULL) + { + FILE *fp; + + close (fd); + most_flush_message ("Uncompressing file..."); + + if (-1 == create_gunzip_cmd (cmd, file, cmdbuf, sizeof(cmdbuf))) + return -1; + fp = popen (cmdbuf, "r"); /* GLIBC doe not support "rb" */ + if (fp == NULL) + return -1; + *size = 0; + fd = fileno (fp); + Most_Buf->fp = fp; + /* pclose (fp); */ + return fd; + } + } + + close (fd); + if (stat(file, &st)) return(-1); + *size = st.st_size; + return (open(file,mode)); +} +#endif /* VMS */ + +#if MOST_HAS_MMAP +#ifdef HAVE_SYS_MMAN_H +# include +#endif + +#ifndef MAP_FAILED +# define MAP_FAILED -1 +#endif +static int try_mmap_buffer (int fd) +{ + unsigned char *addr; + struct stat st; + + Most_Buf->is_mmaped = 0; + + if (Most_Disable_MMap) + return -1; + + if (-1 == fstat (fd, &st)) + return -1; + + addr = (unsigned char *)mmap (NULL,st.st_size,PROT_READ,MAP_SHARED,fd,0); + if (addr == (unsigned char *)MAP_FAILED) + return -1; + + Most_Buf->fd = fd; + Most_Eob = Most_Beg = Most_Buf->end = Most_Buf->beg = addr; + Most_Buf->size = 0; + Most_Buf->mmap_size = st.st_size; + Most_Buf->is_mmaped = 1; + + return 0; +} + +static int unmmap_buffer (Most_Buffer_Type *b) +{ + if (b->is_mmaped == 0) + return 0; + + if (b->beg != NULL) + munmap ((char *)b->beg, b->size); + + b->end = b->beg = NULL; + if (b == Most_Buf) + { + Most_Beg = Most_Eob = NULL; + Most_C_Line = 0; + Most_Num_Lines = Most_C_Line = 0; + } + return 0; +} + +static int resync_mmap (void) +{ + struct stat st; + int line = Most_C_Line; + + if (Most_Buf->fd == -1) + return 0; + if (-1 == fstat (Most_Buf->fd, &st)) + return -1; + + if ((unsigned int) st.st_size == Most_Buf->mmap_size) + return 0; + + (void) unmmap_buffer (Most_Buf); + if (-1 == try_mmap_buffer (Most_Buf->fd)) + return -1; + + most_goto_line (line); + return 0; +} + +#endif /* MOST_HAS_MMAP */ + +int most_close_buffer_file (Most_Buffer_Type *b) +{ + if (b->fd != -1) + { +#if !defined(VMS) + if (b->fp != NULL) pclose (b->fp); + else +#endif + close(b->fd); + } +#if MOST_HAS_MMAP + unmmap_buffer (b); +#endif + if (b->beg != NULL) + SLFREE(b->beg); + b->beg = NULL; + b->fd = -1; + + return 0; +} + +/* If file[0] == 0, the file represents stdin */ +static int insert_file(char *file) +{ + int size = 0, fd; + /* int mode; */ +#ifdef VMS + struct stat st; + unsigned recsz = 512; + /* extern int stat(char *, struct stat *); */ +#endif + + if (file[0] == '\0') /* assume stdin */ + { + fd = 0; + strcpy (Most_Buf->file, "*stdin*"); + } + else + { +#ifdef VMS + if (stat(file, &st)) return(-1); + /* mode = st.st_mode & S_IFMT; */ + size = st.st_size; + recsz = st.st_fab_mrs; + if (recsz <= 255) recsz = 255; + /* VMS share options (shr=put) suggested by Henk D. Davids */ + /* VMS share options (shr=upi,get,put) suggested by Mark Pizzolato */ + fd = open(file,O_RDONLY,"ctx=rec","mbf=8","mbc=16","rop=RAH","shr=upi,get,put"); + /* if (fd < 0) fd = open(file,O_RDONLY); */ +#else + fd = open_compressed_file(file, O_RDONLY, &size); +# if MOST_HAS_MMAP + if (0 == try_mmap_buffer (fd)) + return most_read_file_dsc (1, 1); +# endif +#endif + } + + if (fd < 0) return(-1); + + if (!fd || (size <= 0)) size = 0x7FFF; +#ifdef VMS + Most_Buf->rec = recsz; +#endif + Most_Buf->fd = fd; + + /* This will fail on really large files. */ + Most_Eob = Most_Beg = Most_Buf->beg = (unsigned char *) MOSTMALLOC(size); + Most_Buf->size = size; + + return most_read_file_dsc (1, 1); +} + +static void update_buffer_windows (Most_Buffer_Type *b) +{ + Most_Window_Type *w; + + if (NULL == (w = Most_Win)) + return; + do + { + if (w->buf == b) w->dirty_flag = 1; + w = w->next; + } + while (w != Most_Win); +} + +static void examine_file_contents (void) +{ + unsigned char *pos, *pos_max; + + if (Most_B_Opt || Most_K_Opt) + return; + + pos = Most_Beg; + pos_max = pos + 512; + if (pos_max > Most_Eob) + pos_max = Most_Eob; + + while (pos < pos_max) + { + if (0 == *pos) + { + Most_B_Opt = 1; + break; + } + pos++; + } + + /* Check for a FITS file. The header looks like ASCII. */ + if (Most_B_Opt == 0) + { + pos = Most_Beg; + pos_max = Most_Eob; + if ((pos_max > pos + 80) + && (0 == strncmp ((char *) pos, "SIMPLE =", 9))) + { + Most_V_Opt = 1; + Most_W_Opt = 1; + } + } +} + +static int First_Time_Hack = 0; /* true if reading file for first time */ + +#if MOST_HAS_MMAP +static int read_mmap_file_dsc (int many, int count_lines) +{ + unsigned int size; + + size = Most_Buf->size; + + if (many == -1) + { + if (-1 == resync_mmap ()) + return -1; + } + + if (size == Most_Buf->mmap_size) + return 0; + + if (many < 0) + size = Most_Buf->mmap_size; + else + { + size += many * 0xFFFF; + if (size > Most_Buf->mmap_size) + size = Most_Buf->mmap_size; + } + + Most_Eob = Most_Buf->end = Most_Buf->beg + size; + Most_Buf->size = size; + + most_flush_message ("Mapping file..."); + + if (First_Time_Hack) + examine_file_contents (); + + if (count_lines) + Most_Num_Lines = most_count_lines (Most_Beg, Most_Eob); + + most_message(Most_Global_Msg, 0); + return 1; +} + +#endif + +/* if read something, return non zero (1) */ +int most_read_file_dsc (int many, int count_lines) +{ + int fd = Most_Buf->fd, n = 0, i; + int dsize, size, passes = 0; + unsigned char *pos; +#ifdef VMS + int recsz = Most_Buf->rec; +#endif + + if (fd < 0) return 0; + +#if MOST_HAS_MMAP + if (Most_Buf->is_mmaped) + { + int ret = read_mmap_file_dsc (many, count_lines); + if (-1 != ret) + return ret; + + if (Most_Buf->is_mmaped) + return -1; + /* No longer mapped..... */ + } +#endif + + dsize = 0x3FFF; + + while (many--) + { + passes++; + most_flush_message ("Reading..."); + + size = (Most_Eob - Most_Beg) + dsize; + + if (Most_Buf->size > size) pos = Most_Beg; + else + { + size = Most_Buf->size + 0xFFFF; + pos = (unsigned char *) MOSTREALLOC(Most_Beg, (unsigned) size); + Most_Buf->size = size; + } + + Most_Eob = pos + (unsigned int) (Most_Eob - Most_Beg); + Most_Beg = pos; + + pos = Most_Eob; + n = 0; + + while (1) + { +#ifdef VMS + i = read (fd, (char *) pos, recsz); +#else + i = read (fd, (char *) pos, dsize - n); +#endif + if (i == -1) + { +#ifdef EINTR + if ((errno == EINTR) && (SLKeyBoard_Quit == 0)) continue; +#endif + break; + } + + if (i == 0) + { + /* EOF */ + /* Under linux, for some reason bash when invoked by + * man will reset the terminal. Apparantly this is a + * result of most being orphaned. + */ +#ifdef __unix__ + if (fd == 0) + (void) most_reinit_terminal (); +#endif + break; + } + n += i; + pos += i; + if (n >= dsize) + break; + } + + Most_Eob = Most_Buf->end = pos; + Most_Buf->beg = Most_Beg; + + if (n != 0) n = 1; + + if ((i <= 0) + || SLKeyBoard_Quit) + { + break; + } + } + + if (First_Time_Hack) + examine_file_contents (); + + if (count_lines + && (n || First_Time_Hack)) + Most_Num_Lines = most_count_lines (Most_Beg, Most_Eob); + + update_buffer_windows (Most_Buf); + + most_message("reading...done", 0); + most_put_message(); + most_message(Most_Global_Msg, 0); + + return n; +} + +/* This routines makes sure line n is read in. */ +void most_read_to_line(int n) +{ + int dn; + long nbytes; + + if (Most_Buf->fd == -1) return; + + n += 2 * SLtt_Screen_Rows; + dn = n - Most_Num_Lines; + if (dn < 0) return; + + nbytes = 0; + if (Most_Num_Lines) + nbytes = dn * ((Most_Eob - Most_Beg) / Most_Num_Lines); + if (nbytes < 0x3FFF) nbytes = 0x3FFF; + + while ((Most_Buf->fd != -1) + && (n >= Most_Num_Lines) + && (0 != most_read_file_dsc (nbytes / 0x3FFF, 1)) + && (SLKeyBoard_Quit == 0)) + { + nbytes = 0; + if (Most_Num_Lines) + nbytes = dn * ((Most_Eob - Most_Beg) / Most_Num_Lines); + if (nbytes < 0x3FFF) nbytes = 0x3FFF; + } +} + +int most_find_file(char *file) +{ + Most_Buffer_Type *new_buf; + int n; + char msg[MAX_PATHLEN+20], *msgp; + int ret = 0; + + new_buf = most_create_buffer(file); + (void) most_switch_to_buffer(new_buf); + + First_Time_Hack = 1; + if (insert_file(file) < 0) + { + sprintf (msg, "%s failed to open.", file); + n = strlen (msg); + msgp = (char *) MOSTMALLOC((unsigned int) (n + 1)); + strcpy (msgp, msg); + Most_Buf->beg = (unsigned char *) msgp; + Most_Buf->end = Most_Buf->beg + n; + Most_Buf->fd = -1; + Most_Num_Lines = 1; + ret = -1; + } + First_Time_Hack = 0; + + Most_Beg = Most_Buf->beg; + Most_Eob = Most_Buf->end; + Most_C_Offset = 0; + Most_C_Line = 1; + Most_Column = 1; + return ret; +} + +/* if the file is visible in a window, move to the window and return 1 + else return 0 */ +Most_Window_Type *most_file_visible(char *file) +{ + Most_Window_Type *w; + w = Most_Win; + Most_Win = Most_Top_Win; + do + { + if (!strcmp(Most_Win->buf->file,file)) + { + most_set_window(Most_Win); + return(Most_Win); + } + Most_Win = Most_Win->next; + } + while (Most_Win != Most_Top_Win); + Most_Win = w; + return(NULL); +} + +void most_reread_file (void) +{ + char file[MAX_PATHLEN]; + int line = Most_C_Line; + + if (-1 == access(Most_Buf->file, 0)) /* does it exist? */ + { + most_message("File not found.",1); + return; + } + + most_one_window (); + + strcpy (file, Most_Buf->file); + most_free_window_buffer (); + (void) most_find_file (file); + most_goto_line (line); + most_window_buffer (); +} + +static int find_file_in_window(char *file) +{ + if (NULL != most_file_visible(file)) + { + most_message ("File is already visible.", 1); + return -2; + } + + if (-1 == access(file, 0)) /* does it exist? */ + { + most_message("File not found.",1); + return -1; + } + most_free_window_buffer(); + (void) most_find_file(file); + + most_window_buffer(); + + most_redraw_window(); + most_update_status(); + return 0; +} + +static void format_next_file (char *mbuf, int j, char *file) +{ + int len, max_len; + + len = strlen (file); + max_len = SLtt_Screen_Cols - 25; + if (len > max_len) + { + sprintf(mbuf, "Next File (%d): ...%s", j, file + (len - max_len)); + } + else sprintf(mbuf, "Next File (%d): %s", j, file); +} + +void most_do_next_file(int *j) +{ + char mbuf[256], *curr_file; + unsigned char ch; + + most_select_minibuffer(); + + if (*j >= Most_Num_Files) *j = 0; + curr_file = Most_File_Ring[*j]; + + while (1) + { + format_next_file (mbuf, *j, curr_file); + + SLsmg_write_string (mbuf); + SLsmg_erase_eol (); + SLsmg_gotorc (SLtt_Screen_Rows - 1, 0); + + SLsmg_refresh (); + + ch = most_getkey(); +#ifndef IBMPC_SYSTEM + if (ch != '\033') break; + if (ch = most_getkey(), (ch != 'O') && (ch != '[')) continue; + if (ch = most_getkey(), (ch != 'A') && (ch != 'B')) continue; +#else + if ((ch != 0) && (ch != 0xE0)) + break; + + ch = most_getkey (); + if (ch != 'H') ch = 'B'; else ch = 'A'; + +#endif + if (ch == 'B') + { + if (*j == 0) *j = Most_Num_Files; + (*j)--; + } + else /* ch == 'A' */ + { + (*j)++; + if (*j == Most_Num_Files) *j = 0; + } + curr_file = Most_File_Ring[*j]; + } + + most_exit_minibuffer(); + + (*j)++; + if ((ch == 'Q') || (ch == 'q')) + { + most_exit_most (); + } + else find_file_in_window(curr_file); +} + +/* extracts directory from file string, returns false if no dir */ +int most_head(char *file, char *dir) +{ + int n; + + if (file == NULL) return 0; + + (void) strcpy(dir,file); + n = strlen(file) - 1; +#ifdef VMS + while((n > -1) && (file[n] != ']') && (file[n] != ':')) n--; +#else + while((n > -1) && file[n] != '/') n--; +#endif + n++; + dir[n] = '\0'; + return(n); +} + +/* returns a pointer to the tail of file */ +static int tail(char *filed, char **filep) +{ + int n; + n = strlen(filed) - 1; +#ifdef VMS + while((n > -1) && ((filed[n] != ']') && (filed[n] != ':'))) n--; +#else + while((n > -1) && (filed[n] != '/')) n--; +#endif + n++; + *filep = (filed + n); + return(n); +} + +/* assume path is big enough to hold new expanded version */ +static int expand_path(char *path) +{ +#ifndef VMS + int n; +#endif + /* really cheat here-- let system do it. The path must exist!! */ + if (chdir(path)) + { + most_message(path,1); + return(0); + } + else + { + most_get_cdir(path); + (void) chdir(Most_C_Dir); +#ifndef VMS + n = strlen(path); + if (path[n-1] == '/') return(1); + path[n++] = '/'; path[n] = 0; +#endif + } + return(1); +} + +#if 0 +static void most_cd (void) +{ + char tmp_dir[MAX_PATHLEN]; + int n; + + if (Most_Secure_Mode) + { + most_message ("CD disabled in secure mode.", 1); + return; + } + + strcpy(tmp_dir,Most_C_Dir); + if (most_read_from_minibuffer("cd ",Most_C_Dir) == -1) return; + if (!chdir(Most_C_Dir)) + { + most_get_cdir(Most_C_Dir); /* expands ../ etc... */ + n = strlen(Most_C_Dir); +# ifndef VMS + if (Most_C_Dir[n-1] == '/') return; + Most_C_Dir[n++] = '/'; Most_C_Dir[n] = 0; +# endif + return; + } + strcpy(Most_C_Dir,tmp_dir); + (void) chdir(Most_C_Dir); + most_message("Unable to change directory.",1); +} +#endif + +void most_user_get_file() +{ + char path[MAX_PATHLEN], file[MAX_PATHLEN], *name; +#ifdef VMS + unsigned int i, imax; +#endif + + if (Most_Secure_Mode) + { + most_message ("Getting a file is not permitted in secure mode.", 1); + return; + } + + if (!most_head(Most_Win->buf->file,file)) + strcpy(file,Most_C_Dir); + + if (most_read_from_minibuffer("Find File: ", file, file, sizeof(file)) == -1) + return; + + if (most_head(file,path)) + { + expand_path(path); + tail(file,&name); + strcat(path,name); + name = path; + } + else name = file; +#ifdef VMS + imax = strlen (name); + for (i = 0; i < imax; i++) + name [i] = toupper (name[i]); +#endif + + if (find_file_in_window(name) < 0) return; + + /* + ** add to file ring if successful + */ + if ((NULL != most_file_visible(name)) + && (Most_Num_Files < MOST_MAX_FILES)) + { + Most_File_Ring[Most_Num_Files] = (char*) MOSTMALLOC(strlen(name) + 1); + strcpy(Most_File_Ring[Most_Num_Files++],name); + } +} + +void most_get_cdir(char *dir) +{ +#ifdef sequent + getwd(dir); +#else +# ifdef HAVE_GETCWD + getcwd(dir, MAX_PATHLEN); +# else + getwd(dir); +# endif +#endif + +#ifndef VMS + { + int i; + i = strlen(dir); + if (i && (dir[i - 1] != '/')) dir[i++] = '/'; + dir[i] = 0; + } +#endif +} diff --git a/vendor/most-5.1.0/src/file.h b/vendor/most-5.1.0/src/file.h new file mode 100644 index 0000000..2a7a1d7 --- /dev/null +++ b/vendor/most-5.1.0/src/file.h @@ -0,0 +1,41 @@ +/* + This file is part of MOST. + + Copyright (c) 1991, 1999, 2002, 2005-2018, 2019 John E. Davis + + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the Free + Software Foundation; either version 2 of the License, or (at your option) + any later version. + + This program is distributed in the hope that 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. +*/ +#include "config.h" +#define MOST_MAX_FILES 4096 +#define MOST_MAX_FILES 4096 +#define MOST_GUNZIP_POPEN_FORMAT "gzip -dc \"%s\"" +#define MOST_BZIP2_POPEN_FORMAT "bzip2 -dc \"%s\"" + +extern void most_reread_file (void); +extern void most_read_to_line (int); +extern Most_Window_Type *most_file_visible (char *); +extern void most_user_get_file(void); +extern int most_read_file_dsc(int many, int count_lines); +extern void most_get_cdir(char *); +extern int most_get_dir(char *); +extern void most_do_next_file(int *); +extern int most_find_file(char *); +extern int most_head(char *, char *); + +extern char *Most_File_Ring[MOST_MAX_FILES]; +extern int Most_Num_Files; +extern char Most_C_Dir[MAX_PATHLEN]; +extern int Most_Tail_Mode; +extern int most_close_buffer_file (Most_Buffer_Type *); diff --git a/vendor/most-5.1.0/src/help.c b/vendor/most-5.1.0/src/help.c new file mode 100644 index 0000000..b8a7e6a --- /dev/null +++ b/vendor/most-5.1.0/src/help.c @@ -0,0 +1,206 @@ +/* + This file is part of MOST. + + Copyright (c) 1991, 1999, 2002, 2005-2018, 2019 John E. Davis + + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the Free + Software Foundation; either version 2 of the License, or (at your option) + any later version. + + This program is distributed in the hope that 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. +*/ +#include "config.h" +#include +#include + +#ifdef VMS +# include +#else +# include +# include +#endif + +#ifdef HAVE_STDLIB_H +# include +#endif + +#include +#include "jdmacros.h" + +#include "most.h" +#include "window.h" +#include "file.h" +#include "display.h" +#include "line.h" +#include "keym.h" +#include "sysdep.h" + +/* This section provided by Mats Akerberg (mats@efd.lth.se) */ + +static char *help[] = +{ + "Quitting:", + " Q Quit MOST.", + " :N,:n Quit this file and view next. ", + " (Use UP/DOWN arrow keys to select next file.)", + "Movement:", + " SPACE, D *Scroll down one Screen.", + " U, BACKSPACE *Scroll Up one screen.", + " RETURN, DOWN *Move Down one line.", + " UP *Move Up one line.", + " T Goto Top of File.", + " B Goto Bottom of file.", + " > , TAB Scroll Window right", + " < Scroll Window left", + " RIGHT Scroll Window left by 1 column", + " LEFT Scroll Window right by 1 column", + " J, G Goto line.", + " % Goto percent.", + "Window Commands:", + " Ctrl-X 2, Ctrl-W 2 Split window.", + " Ctrl-X 1, Ctrl-W 1 Make only one window.", + " O, Ctrl-X O Move to other window.", + " Ctrl-X 0 Delete Window.", + "Searching:", + " S, f, / *Search forward", + " ? *Search Backward", + " N *Find next in current search direction.", + "Miscellaneous:", + " W Toggle width between 80 and 132 char mode.", + " Ctrl-X Ctrl-F Read a file from disk", + " R, Ctrl-R Redraw Screen.", + " F Simulate tail -f mode", + " :o Toggle options: b-binary, w-wrap, t-tab", + " E Edit file. Uses MOST_EDITOR and EDITOR", + " environment variables.", + "*Note: This command may be repeated `n' times By entering a number then", + " the command key, e.g., '5 SPACE' moves 5 screens forward.", + NULL +}; + +static void most_do_help_text (void) +{ + char **p = help, *sect = NULL; + int r; + + while (*p != NULL) + { + SLsmg_cls (); + + r = 0; + SLsmg_gotorc (0, 0); + + if ((sect != NULL) && (**p == ' ')) + { + most_tt_bold_video (); + SLsmg_gotorc (r, 0); + SLsmg_write_string (sect); + most_tt_normal_video (); + SLsmg_write_string (" (continued)"); + r += 2; + } + else sect = NULL; + + while (r < SLtt_Screen_Rows - 1) + { + if (*p == NULL) break; + + if (**p != ' ') + { + if (((r + 5) > SLtt_Screen_Rows) + && (**p != '*')) + { + sect = NULL; + break; + } + + if (sect != NULL) + { + r++; + } + + if (**p != '*') + { + sect = *p; + most_tt_bold_video (); + } + else sect = NULL; + } + SLsmg_gotorc (r, 0); + SLsmg_write_string (*p); + + if ((**p != ' ') && (**p != '*')) + { + most_tt_normal_video (); + r++; + } + p++; + r++; + } + + SLsmg_gotorc (r, 0); + + most_tt_reverse_video(); + SLsmg_write_string("Press any key to continue."); + most_tt_normal_video(); + + SLsmg_refresh (); + + most_getkey (); + } + + most_redraw_display(); +} + +static void most_do_help_file (char *helpfile) +{ + char *buf_name; + FILE *fp; + + buf_name = "*help*"; + +#ifdef MOST_HELPFILE + if (helpfile == NULL) helpfile = MOST_HELPFILE; +#endif + + if (helpfile != NULL) + { + if (most_file_visible(buf_name)) return; + + /* See if we can open it */ + if (NULL != (fp = fopen (helpfile, "r"))) + { + fclose (fp); + if (!most_split_window()) + { + most_message("Two many windows.",1); + return; + } + most_update_status(); /* create status line of prev. window */ + most_other_window(1); + (void) most_find_file(helpfile); + strcpy(Most_Buf->file, buf_name); + Most_B_Opt = 0; + most_window_buffer (); + most_redraw_window (); + most_update_status (); + return; + } + } + + most_do_help_text (); +} + +void most_do_help_command(void) +{ + most_do_help_file (getenv ("MOST_HELP")); +} + diff --git a/vendor/most-5.1.0/src/jdmacros.h b/vendor/most-5.1.0/src/jdmacros.h new file mode 100644 index 0000000..319f8b4 --- /dev/null +++ b/vendor/most-5.1.0/src/jdmacros.h @@ -0,0 +1,72 @@ +#ifndef _JD_MACROS_H_ +# define _JD_MACROS_H_ + +/* This file defines some macros that I use with programs that link to + * the slang library. + */ + +# ifdef HAVE_MALLOC_H +# include +# endif + +# ifdef HAVE_MEMORY_H +# include +# endif + +# ifndef SLMEMSET +# ifdef HAVE_MEMSET +# define SLMEMSET memset +# else +# define SLMEMSET SLmemset +# endif +# endif + +# ifndef SLMEMCHR +# ifdef HAVE_MEMCHR +# define SLMEMCHR memchr +# else +# define SLMEMCHR SLmemchr +# endif +# endif + +# ifndef SLMEMCPY +# ifdef HAVE_MEMCPY +# define SLMEMCPY memcpy +# else +# define SLMEMCPY SLmemcpy +# endif +# endif + +/* Note: HAVE_MEMCMP requires an unsigned memory comparison!!! */ +# ifndef SLMEMCMP +# ifdef HAVE_MEMCMP +# define SLMEMCMP memcmp +# else +# define SLMEMCMP SLmemcmp +# endif +# endif + +# if SLANG_VERSION < 9934 +# define SLmemcmp jed_memcmp +# define SLmemcpy jed_memcpy +# define SLmemset jed_memset +# define SLmemchr jed_memchr +# endif + +# ifndef SLFREE +# define SLFREE free +# endif + +# ifndef SLMALLOC +# define SLMALLOC malloc +# endif + +# ifndef SLCALLOC +# define SLCALLOC calloc +# endif + +# ifndef SLREALLOC +# define SLREALLOC realloc +# endif + +#endif /* _JD_MACROS_H_ */ diff --git a/vendor/most-5.1.0/src/keym.c b/vendor/most-5.1.0/src/keym.c new file mode 100644 index 0000000..1a7138c --- /dev/null +++ b/vendor/most-5.1.0/src/keym.c @@ -0,0 +1,734 @@ +/* + This file is part of MOST. + + Copyright (c) 1991, 1999, 2002, 2005-2018, 2019 John E. Davis + + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the Free + Software Foundation; either version 2 of the License, or (at your option) + any later version. + + This program is distributed in the hope that 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. +*/ +#include "config.h" +#include +#include + +#include +#include "jdmacros.h" + +#include "most.h" +#include "keym.h" +#include "display.h" +#include "window.h" +#include "search.h" +#include "edit.h" +#include "sysdep.h" +#include "file.h" +#include "keyparse.h" + +int *Most_Digit_Arg; +static char Last_Char; +static int Edt_Direction = 1; + +static void digit_arg_cmd(void); + +static void page_down_cmd (void) +{ + int n = 1; + + if (Most_Digit_Arg != (int *) NULL) n = *Most_Digit_Arg; + if (n < 0) n = 1; + n = Most_C_Line + n * (Most_Win->bot - Most_Win->top + 1); + most_read_to_line (n + 50); + most_update_windows (n); +} + +static void page_up_cmd (void) +{ + int n = 1; + if (Most_Digit_Arg != (int *) NULL) n = *Most_Digit_Arg; + n = Most_C_Line - n * (Most_Win->bot - Most_Win->top + 1); + if (n < 1) n = 1; + + most_update_windows (n); +} + +static void page_right_cmd (void) +{ + int n = 1; + if (Most_Digit_Arg != (int *) NULL) n = *Most_Digit_Arg; + Most_Column = Most_Column + n * 59; + most_update_windows(Most_C_Line); +} + +static void page_left_cmd(void) +{ + int n = 1; + if (Most_Digit_Arg != (int *) NULL) n = *Most_Digit_Arg; + Most_Column = Most_Column - n * 59; + most_update_windows(Most_C_Line); +} + +static void column_right_cmd (void) +{ + int n = 1; + if (Most_Digit_Arg != (int *) NULL) n = *Most_Digit_Arg; + Most_Column = Most_Column + n; + most_update_windows(Most_C_Line); +} + +static void column_left_cmd(void) +{ + int n = 1; + if (Most_Digit_Arg != (int *) NULL) n = *Most_Digit_Arg; + Most_Column = Most_Column - n; + most_update_windows(Most_C_Line); +} + +static void next_line_cmd(void) +{ + int n = 1; + if (Most_Digit_Arg != (int *) NULL) n = *Most_Digit_Arg; + + most_read_to_line (Most_C_Line + n + 50); + most_update_windows(Most_C_Line + n); +} + +static void previous_line_cmd(void) +{ + int n = 1; + if (Most_Digit_Arg != (int *) NULL) n = *Most_Digit_Arg; + + most_update_windows(Most_C_Line - n); +} + +static void tail_mode_cmd (void) +{ + Most_Tail_Mode = 1; + + do + { + if (0 != most_read_file_dsc (-1, 1)) + most_update_windows (-1); + + most_message ("Most Tail Mode-- MOST keys are still active.", 0); + most_put_message (); + + most_point_cursor (); + SLsmg_refresh (); + } + while (0 == SLang_input_pending (15)); + Most_Tail_Mode = 0; +} + +static void top_of_buffer_cmd(void) +{ + most_update_windows(1); +} + +static void end_of_buffer_cmd(void) +{ + unsigned int count = 0; + /* This will loop forever if the file is changing too fast. */ + while ((Most_Buf->fd != -1) + && (count < 5) + && (0 != most_read_file_dsc(-1, 1))) + count++; + most_update_windows (-1); + Most_Curs_Offset = (Most_Eob - Most_Beg); +} +#ifdef unix +# include +#endif +static void sys_spawn_cmd(void) +{ +#ifdef IBMPC_SYSTEM + most_message ("Not implemented.", 1); +#else + int update = 0; +# ifndef VMS + static int can_suspend = -1; + + if (can_suspend == -1) + { + can_suspend = 0; +# ifdef SIGTSTP + if (SIG_DFL == SLsignal (SIGTSTP, SIG_DFL)) + can_suspend = 1; +# endif + } + if (can_suspend == 0) + { + most_message ("Shell forbids suspension.", 1); + return; + } +# endif + + if (Most_Secure_Mode || Most_Captive_Mode) + { + most_message ("Operation not permitted by this account.", 1); + return; + } + most_reset_tty(); + most_reset_display(); +# ifdef VMS + if (Last_Char == '\032') exit(0); + if (most_do_shell_command()) update = 1; /* scroll region reset by message facility */ +# else +# ifdef SIGTSTP + kill(0, SIGTSTP); +# endif + update = 1; +# endif + most_init_tty(); + most_init_display (); + if (update) most_redraw_display(); +#endif /* IBMPC_SYSTEM */ +} + +static void redraw_cmd(void) +{ + most_redraw_display(); +} + +static int read_integer (char *prompt, MOST_INT *n) +{ + int status; + Most_Mini_Buf[0] = 0; + + status = most_read_from_minibuffer(prompt, NULL, (char *) Most_Mini_Buf, MOST_MINI_BUF_LEN); + if (status < 0) + return -1; + + if (1 != sscanf((char *) Most_Mini_Buf, MOST_INT_D_FMT, n)) + { + most_message ("Expecting an integer", 1); + return -1; + } + + Most_Mini_Buf[0] = 0; + return 0; +} + +static void goto_line_cmd(void) +{ + MOST_INT n; + + if (Most_Digit_Arg != (int *) NULL) n = *Most_Digit_Arg; + else + { + if (-1 == read_integer ("Goto Line: ", &n)) + return; + } + most_update_windows ((int)n); +} + +static void goto_percent_cmd(void) +{ + unsigned char *pos; + MOST_INT n; + + if (Most_Digit_Arg != NULL) n = *Most_Digit_Arg; + else + { + if (-1 == read_integer ("Goto Percent: ", &n)) + return; + } + + if (n < 0) n = 0; else if (n > 100) n = 100; + if (Most_Buf->fd != -1) most_read_file_dsc(-1, 1); + pos = Most_Beg + (n * (Most_Eob - Most_Beg))/100; + n = most_what_line(pos); + most_update_windows (n); +} + +static void set_mark_cmd(void) +{ + Most_Buf->mark = Most_C_Line; + most_message("Mark Set.",0); +} + +static void goto_mark_cmd(void) +{ + int mark = Most_Buf->mark; + Most_Buf->mark = Most_C_Line; + most_update_window(mark); + most_message("Mark Set.",0); +} + +static void one_window_cmd(void) +{ + most_one_window(); +} + +static void two_window_cmd(void) +{ + most_two_windows(); +} + +static void del_window_cmd(void) +{ + most_delete_window(); +} + +static void other_window_cmd(void) +{ + int n = 1; + if (Most_Digit_Arg != (int *) NULL) n = *Most_Digit_Arg; + most_other_window(n); +} + +static void find_next_cmd(void) +{ + MOST_INT col, line, n = 1; + unsigned long ofs; + + if (Most_Digit_Arg != NULL) n = *Most_Digit_Arg; + line = most_search ((Most_Beg + Most_Curs_Offset) + Most_Search_Dir, n, &col); + if (line < 1) return; + + ofs = Most_Curs_Offset; + + if ((line < Most_Win->beg_line) || (line > Most_Win->beg_line + Most_Win->bot - Most_Win->top)) + most_update_window(line); + + Most_Curs_Offset = ofs; + + Most_Curs_Row = line - Most_C_Line + 1; + Most_Curs_Col = col; +} + +static void find_next_opposite_dir_cmd (void) +{ + Most_Search_Dir = -Most_Search_Dir; + find_next_cmd (); + Most_Search_Dir = -Most_Search_Dir; +} + +static void search_cmd_dir (char *prompt, int dir) +{ + char buf[MOST_SEARCH_BUF_LEN]; + + if (-1 == most_read_from_minibuffer(prompt, NULL, buf, MOST_SEARCH_BUF_LEN)) + return; + + Most_Search_Dir = dir; + if (*buf) + strcpy (Most_Search_Str, buf); /* no buffer overflow here */ + Most_Curs_Offset = Most_C_Offset; + find_next_cmd (); +} + +static void search_cmd(void) +{ + char *prompt = "Regexp-Search: "; + if (Most_Do_Regexp_Search == 0) + prompt += 7; + search_cmd_dir (prompt,1); +} + +static void search_back_cmd(void) +{ + char *prompt = "Regexp-Search Backwards: "; + if (Most_Do_Regexp_Search == 0) + prompt += 7; + search_cmd_dir (prompt, -1); +} + +static void help_cmd(void) +{ + most_do_help_command(); +} + +static void find_file_cmd(void) +{ + most_user_get_file(); +} + +static void time_cmd(void) +{ + most_message(most_get_time(),0); +} + +static void toggle_width_cmd(void) +{ + if (SLtt_Screen_Cols == 80) + { + if (!Most_Restore_Width_To) Most_Restore_Width_To = 80; + most_set_width(132, 1); + } + else if (SLtt_Screen_Cols == 132) + { + if (!Most_Restore_Width_To) Most_Restore_Width_To = 132; + most_set_width(80, 1); + } +} + +static void edt_forward_cmd(void) +{ + Edt_Direction = 1; +} + +static void edt_back_cmd(void) +{ + Edt_Direction = 0; +} + +static void edt_page_cmd(void) +{ + if (Edt_Direction == 0) + { + page_up_cmd(); + } + else + { + page_down_cmd(); + } +} + +static void edt_line_cmd(void) +{ + if (Edt_Direction == 0) + { + previous_line_cmd(); + } + else + { + next_line_cmd(); + } +} + +static void edt_find_cmd(void) +{ + if (Edt_Direction == 0) + { + search_back_cmd(); + } + else + { + search_cmd(); + } +} + +static void edt_find_next_cmd(void) +{ + if (Edt_Direction == 0) + { + Most_Search_Dir = -1; + } + else + { + Most_Search_Dir = 1; + } + find_next_cmd(); +} + +#define A_KEY(s, f) {s, (int (*)(void)) f} +SLKeymap_Function_Type Most_Functions [] = +{ + A_KEY("edit", most_edit_cmd), + A_KEY("suspend", sys_spawn_cmd), + A_KEY("next_file", most_next_file), + A_KEY("toggle_options", most_toggle_options), + A_KEY("toggle_lock", most_toggle_lock), + A_KEY("extended_key", most_extended_key_cmd), + A_KEY("toggle_case", most_toggle_case), + A_KEY("delete_file", most_delete_file_cmd), + A_KEY("bob", top_of_buffer_cmd), + A_KEY("delete_window", del_window_cmd), + A_KEY("digit_arg", digit_arg_cmd), + A_KEY("down", next_line_cmd), + A_KEY("edt_backward", edt_back_cmd), + A_KEY("edt_find", edt_find_cmd), + A_KEY("edt_find_next", edt_find_next_cmd), + A_KEY("edt_forward", edt_forward_cmd), + A_KEY("edt_line", edt_line_cmd), + A_KEY("edt_page", edt_page_cmd), + A_KEY("eob", end_of_buffer_cmd), + A_KEY("exit", most_exit_most), + A_KEY("find_file", find_file_cmd), + A_KEY("find_next", find_next_cmd), + A_KEY("find_next_other_dir", find_next_opposite_dir_cmd), + A_KEY("goto_line", goto_line_cmd), + A_KEY("goto_mark", goto_mark_cmd), + A_KEY("goto_percent", goto_percent_cmd), + A_KEY("help", help_cmd), + A_KEY("one_window", one_window_cmd), + A_KEY("other_window", other_window_cmd), + A_KEY("page_down", page_down_cmd ), + A_KEY("page_left", page_left_cmd), + A_KEY("page_right", page_right_cmd ), + A_KEY("page_up", page_up_cmd ), + A_KEY("column_left", column_left_cmd ), + A_KEY("column_right", column_right_cmd ), + A_KEY("redraw", redraw_cmd), + A_KEY("search_backward", search_back_cmd), + A_KEY("search_forward", search_cmd), + A_KEY("set_mark", set_mark_cmd), + A_KEY("show_time", time_cmd), + A_KEY("tail_mode", tail_mode_cmd), + A_KEY("toggle_width", toggle_width_cmd), + A_KEY("two_windows", two_window_cmd), + A_KEY("up", previous_line_cmd), + {(char *) NULL, NULL} +}; + +SLKeyMap_List_Type *Most_Keymap; + +#ifdef IBMPC_SYSTEM +static void gobble_mouse_cmd(void) +{ + SLang_flush_input (); +} +#endif + +void most_init_keymaps (void) +{ + char *err = "Unable to create keymaps!"; + char esc[3], gold[5], dig[2]; + int i; + + if (NULL == (Most_Keymap = SLang_create_keymap ("Most", NULL))) + most_exit_error (err); + + Most_Keymap->functions = Most_Functions; + + esc[0] = 27; esc[2] = 0; + gold[0] = 27; gold[1] = 'O'; gold[2] = 'P'; gold[4] = 0; + dig[1] = 0; + + for (i = '0'; i <= '9'; i++) + { + dig[0] = (char) i; + esc[1] = (char) i; + gold[3] = (char) i; + SLkm_define_key (dig, (FVOID_STAR) digit_arg_cmd, Most_Keymap); + SLkm_define_key (esc, (FVOID_STAR) digit_arg_cmd, Most_Keymap); + SLkm_define_key (gold, (FVOID_STAR) digit_arg_cmd, Most_Keymap); + } + + dig[0] = '-'; esc[1] = '-'; gold[3] = '-'; + SLkm_define_key (dig, (FVOID_STAR) digit_arg_cmd, Most_Keymap); + SLkm_define_key (esc, (FVOID_STAR) digit_arg_cmd, Most_Keymap); + SLkm_define_key (gold, (FVOID_STAR) digit_arg_cmd, Most_Keymap); + + SLkm_define_key (" ", (FVOID_STAR) page_down_cmd, Most_Keymap); + SLkm_define_key ("$", (FVOID_STAR) sys_spawn_cmd, Most_Keymap); + SLkm_define_key ("%", (FVOID_STAR) goto_percent_cmd, Most_Keymap); + SLkm_define_key (",", (FVOID_STAR) goto_mark_cmd, Most_Keymap); + SLkm_define_key ("/", (FVOID_STAR) search_cmd, Most_Keymap); + SLkm_define_key (":", (FVOID_STAR) most_extended_key_cmd, Most_Keymap); + SLkm_define_key ("<", (FVOID_STAR) page_left_cmd, Most_Keymap); + SLkm_define_key (">", (FVOID_STAR) page_right_cmd, Most_Keymap); + SLkm_define_key ("?", (FVOID_STAR) search_back_cmd, Most_Keymap); + SLkm_define_key ("B", (FVOID_STAR) end_of_buffer_cmd, Most_Keymap); + SLkm_define_key ("D", (FVOID_STAR) page_down_cmd, Most_Keymap); + SLkm_define_key ("E", (FVOID_STAR) most_edit_cmd, Most_Keymap); + SLkm_define_key ("F", (FVOID_STAR) tail_mode_cmd, Most_Keymap); + SLkm_define_key ("G", (FVOID_STAR) goto_line_cmd, Most_Keymap); + SLkm_define_key ("H", (FVOID_STAR) help_cmd, Most_Keymap); + SLkm_define_key ("J", (FVOID_STAR) goto_line_cmd, Most_Keymap); + SLkm_define_key ("L", (FVOID_STAR) most_toggle_lock, Most_Keymap); + SLkm_define_key ("M", (FVOID_STAR) set_mark_cmd, Most_Keymap); + SLkm_define_key ("n", (FVOID_STAR) find_next_cmd, Most_Keymap); + SLkm_define_key ("N", (FVOID_STAR) find_next_opposite_dir_cmd, Most_Keymap); + SLkm_define_key ("O", (FVOID_STAR) other_window_cmd, Most_Keymap); + SLkm_define_key ("Q", (FVOID_STAR) most_exit_most, Most_Keymap); + SLkm_define_key ("R", (FVOID_STAR) redraw_cmd, Most_Keymap); + SLkm_define_key ("S", (FVOID_STAR) search_cmd, Most_Keymap); + SLkm_define_key ("T", (FVOID_STAR) top_of_buffer_cmd, Most_Keymap); + SLkm_define_key ("U", (FVOID_STAR) page_up_cmd , Most_Keymap); + SLkm_define_key ("V", (FVOID_STAR) next_line_cmd, Most_Keymap); + SLkm_define_key ("W", (FVOID_STAR) toggle_width_cmd, Most_Keymap); + SLkm_define_key ("X", (FVOID_STAR) most_exit_most, Most_Keymap); + SLkm_define_key ("\033$", (FVOID_STAR) sys_spawn_cmd, Most_Keymap); + SLkm_define_key ("\033<", (FVOID_STAR) top_of_buffer_cmd, Most_Keymap); + SLkm_define_key ("\033>", (FVOID_STAR) end_of_buffer_cmd, Most_Keymap); +#if !defined(IBMPC_SYSTEM) + SLkm_define_key ("\033OA", (FVOID_STAR) previous_line_cmd, Most_Keymap); + SLkm_define_key ("\033OB", (FVOID_STAR) next_line_cmd, Most_Keymap); + SLkm_define_key ("\033OC", (FVOID_STAR) column_right_cmd, Most_Keymap); + SLkm_define_key ("\033OD", (FVOID_STAR) column_left_cmd, Most_Keymap); + SLkm_define_key ("\033OPE", (FVOID_STAR) most_exit_most, Most_Keymap); + SLkm_define_key ("\033OPO", (FVOID_STAR) one_window_cmd, Most_Keymap); + SLkm_define_key ("\033OPQ", (FVOID_STAR) most_exit_most, Most_Keymap); + SLkm_define_key ("\033OPS", (FVOID_STAR) sys_spawn_cmd, Most_Keymap); + SLkm_define_key ("\033OPV", (FVOID_STAR) del_window_cmd, Most_Keymap); + SLkm_define_key ("\033OPX", (FVOID_STAR) two_window_cmd, Most_Keymap); + SLkm_define_key ("\033OP\033OR", (FVOID_STAR) edt_find_cmd, Most_Keymap); + SLkm_define_key ("\033OP\033On", (FVOID_STAR) goto_mark_cmd, Most_Keymap); + SLkm_define_key ("\033OP\033Ot", (FVOID_STAR) end_of_buffer_cmd, Most_Keymap); + SLkm_define_key ("\033OP\033Ou", (FVOID_STAR) top_of_buffer_cmd, Most_Keymap); + SLkm_define_key ("\033OP\033[A", (FVOID_STAR) other_window_cmd, Most_Keymap); + SLkm_define_key ("\033OP\033[B", (FVOID_STAR) other_window_cmd, Most_Keymap); + SLkm_define_key ("\033OP\033[C", (FVOID_STAR) page_right_cmd, Most_Keymap); + SLkm_define_key ("\033OP\033[D", (FVOID_STAR) page_left_cmd, Most_Keymap); + SLkm_define_key ("\033OQ", (FVOID_STAR) help_cmd, Most_Keymap); + SLkm_define_key ("\033OR", (FVOID_STAR) edt_find_next_cmd, Most_Keymap); + SLkm_define_key ("\033On", (FVOID_STAR) set_mark_cmd, Most_Keymap); + SLkm_define_key ("\033Op", (FVOID_STAR) edt_line_cmd, Most_Keymap); + SLkm_define_key ("\033Ot", (FVOID_STAR) edt_forward_cmd, Most_Keymap); + SLkm_define_key ("\033Ou", (FVOID_STAR) edt_back_cmd, Most_Keymap); + SLkm_define_key ("\033Ox", (FVOID_STAR) edt_page_cmd, Most_Keymap); + SLkm_define_key ("\033V", (FVOID_STAR) page_up_cmd , Most_Keymap); + SLkm_define_key ("\033[1~", (FVOID_STAR) search_cmd, Most_Keymap); + SLkm_define_key ("\033[2~", (FVOID_STAR) goto_mark_cmd, Most_Keymap); + SLkm_define_key ("\033[28~", (FVOID_STAR) help_cmd, Most_Keymap); + SLkm_define_key ("\033[4~", (FVOID_STAR) set_mark_cmd, Most_Keymap); + SLkm_define_key ("\033[5~", (FVOID_STAR) page_up_cmd , Most_Keymap); + SLkm_define_key ("\033[6~", (FVOID_STAR) page_down_cmd, Most_Keymap); + SLkm_define_key ("\033[A", (FVOID_STAR) previous_line_cmd, Most_Keymap); + SLkm_define_key ("\033[B", (FVOID_STAR) next_line_cmd, Most_Keymap); + SLkm_define_key ("\033[C", (FVOID_STAR) column_right_cmd, Most_Keymap); + SLkm_define_key ("\033[D", (FVOID_STAR) column_left_cmd, Most_Keymap); + SLkm_define_key ("\033[7~", (FVOID_STAR) top_of_buffer_cmd, Most_Keymap); + SLkm_define_key ("\033[8~", (FVOID_STAR) end_of_buffer_cmd, Most_Keymap); + SLkm_define_key ("^@", (FVOID_STAR) set_mark_cmd, Most_Keymap); +#else + SLkm_define_key ("^@H", (FVOID_STAR) previous_line_cmd, Most_Keymap); + SLkm_define_key ("^@P", (FVOID_STAR) next_line_cmd, Most_Keymap); + SLkm_define_key ("^@M", (FVOID_STAR) column_right_cmd, Most_Keymap); + SLkm_define_key ("^@K", (FVOID_STAR) column_left_cmd, Most_Keymap); + SLkm_define_key ("^@Q", (FVOID_STAR) page_down_cmd, Most_Keymap); + SLkm_define_key ("^@I", (FVOID_STAR) page_up_cmd, Most_Keymap); + SLkm_define_key ("^@G", (FVOID_STAR) top_of_buffer_cmd, Most_Keymap); + SLkm_define_key ("^@O", (FVOID_STAR) end_of_buffer_cmd, Most_Keymap); + + SLkm_define_key ("\xE0H", (FVOID_STAR) previous_line_cmd, Most_Keymap); + SLkm_define_key ("\xE0P", (FVOID_STAR) next_line_cmd, Most_Keymap); + SLkm_define_key ("\xE0M", (FVOID_STAR) column_right_cmd, Most_Keymap); + SLkm_define_key ("\xE0K", (FVOID_STAR) column_left_cmd, Most_Keymap); + SLkm_define_key ("\xE0Q", (FVOID_STAR) page_down_cmd, Most_Keymap); + SLkm_define_key ("\xE0I", (FVOID_STAR) page_up_cmd, Most_Keymap); + SLkm_define_key ("\xE0G", (FVOID_STAR) top_of_buffer_cmd, Most_Keymap); + SLkm_define_key ("\xE0O", (FVOID_STAR) end_of_buffer_cmd, Most_Keymap); + SLkm_define_key ("\033[M", (FVOID_STAR) gobble_mouse_cmd, Most_Keymap); +#endif + SLkm_define_key ("\t", (FVOID_STAR) page_right_cmd, Most_Keymap); + SLkm_define_key ("^", (FVOID_STAR) previous_line_cmd, Most_Keymap); + SLkm_define_key ("^?", (FVOID_STAR) page_up_cmd , Most_Keymap); + SLkm_define_key ("^D", (FVOID_STAR) page_down_cmd, Most_Keymap); + SLkm_define_key ("^F", (FVOID_STAR) search_cmd, Most_Keymap); + SLkm_define_key ("^H", (FVOID_STAR) help_cmd, Most_Keymap); + SLkm_define_key ("^KE", (FVOID_STAR) most_exit_most, Most_Keymap); + SLkm_define_key ("^KG", (FVOID_STAR) find_file_cmd, Most_Keymap); + SLkm_define_key ("^K^B", (FVOID_STAR) set_mark_cmd, Most_Keymap); + SLkm_define_key ("^K^J", (FVOID_STAR) goto_mark_cmd, Most_Keymap); + SLkm_define_key ("^K^M", (FVOID_STAR) goto_mark_cmd, Most_Keymap); + SLkm_define_key ("^L", (FVOID_STAR) redraw_cmd, Most_Keymap); + SLkm_define_key ("^M", (FVOID_STAR) next_line_cmd, Most_Keymap); + SLkm_define_key ("^N", (FVOID_STAR) next_line_cmd, Most_Keymap); + SLkm_define_key ("^P", (FVOID_STAR) previous_line_cmd, Most_Keymap); + SLkm_define_key ("^R", (FVOID_STAR) redraw_cmd, Most_Keymap); + SLkm_define_key ("^T", (FVOID_STAR) time_cmd, Most_Keymap); + SLkm_define_key ("^U", (FVOID_STAR) page_up_cmd , Most_Keymap); + SLkm_define_key ("^V", (FVOID_STAR) page_down_cmd, Most_Keymap); + SLkm_define_key ("^W0", (FVOID_STAR) del_window_cmd, Most_Keymap); + SLkm_define_key ("^W1", (FVOID_STAR) one_window_cmd, Most_Keymap); + SLkm_define_key ("^W2", (FVOID_STAR) two_window_cmd, Most_Keymap); + SLkm_define_key ("^WO", (FVOID_STAR) other_window_cmd, Most_Keymap); + SLkm_define_key ("^X0", (FVOID_STAR) del_window_cmd, Most_Keymap); + SLkm_define_key ("^X1", (FVOID_STAR) one_window_cmd, Most_Keymap); + SLkm_define_key ("^X2", (FVOID_STAR) two_window_cmd, Most_Keymap); + SLkm_define_key ("^XO", (FVOID_STAR) other_window_cmd, Most_Keymap); + SLkm_define_key ("^X^C", (FVOID_STAR) most_exit_most, Most_Keymap); + SLkm_define_key ("^X^F", (FVOID_STAR) find_file_cmd, Most_Keymap); + SLkm_define_key ("^Z", (FVOID_STAR) sys_spawn_cmd, Most_Keymap); + SLkm_define_key ("b", (FVOID_STAR) end_of_buffer_cmd, Most_Keymap); + SLkm_define_key ("d", (FVOID_STAR) page_down_cmd, Most_Keymap); + SLkm_define_key ("e", (FVOID_STAR) most_edit_cmd, Most_Keymap); + SLkm_define_key ("f", (FVOID_STAR) search_cmd, Most_Keymap); + SLkm_define_key ("g", (FVOID_STAR) goto_line_cmd, Most_Keymap); + SLkm_define_key ("j", (FVOID_STAR) goto_line_cmd, Most_Keymap); + SLkm_define_key ("l", (FVOID_STAR) most_toggle_lock, Most_Keymap); + SLkm_define_key ("m", (FVOID_STAR) set_mark_cmd, Most_Keymap); + SLkm_define_key ("n", (FVOID_STAR) find_next_cmd, Most_Keymap); + SLkm_define_key ("o", (FVOID_STAR) other_window_cmd, Most_Keymap); + SLkm_define_key ("q", (FVOID_STAR) most_exit_most, Most_Keymap); + SLkm_define_key ("r", (FVOID_STAR) redraw_cmd, Most_Keymap); + SLkm_define_key ("s", (FVOID_STAR) search_cmd, Most_Keymap); + SLkm_define_key ("t", (FVOID_STAR) top_of_buffer_cmd, Most_Keymap); + SLkm_define_key ("v", (FVOID_STAR) next_line_cmd, Most_Keymap); + SLkm_define_key ("w", (FVOID_STAR) toggle_width_cmd, Most_Keymap); + SLkm_define_key ("x", (FVOID_STAR) most_exit_most, Most_Keymap); + if (SLang_get_error()) most_exit_error (err); + + (void) most_load_user_keymaps (); +} + +static void sldo_key (void) +{ + SLang_Key_Type *key; + + key = SLang_do_key (Most_Keymap, most_getkey); + SLKeyBoard_Quit = 0; + SLang_set_error (0); + Last_Char = SLang_Last_Key_Char; + + if ((key == NULL) || (key->f.f == NULL) || (key->type != SLKEY_F_INTRINSIC)) + { + SLtt_beep (); + } + else (((void (*)(void))(key->f.f)) ()); +} + +static void digit_arg_cmd(void) +{ + char num[15], ch; + int j = 0; + static int digits; + + num[j++] = Last_Char; + ch = most_getkey(); + while ((ch >= '0') && (ch <= '9')) + { + if (j == 15) return; + + num[j++] = ch; + ch = most_getkey(); + } + + if (((j == 1) && (Last_Char != '-')) || (j > 1)) + { + num[j] = '\0'; + sscanf(num,"%d",&digits); + Most_Digit_Arg = &digits; + } + Last_Char = ch; + SLang_ungetkey (ch); + sldo_key (); +} + +void most_execute_key (void) +{ + static int refresh_pending = 0; + + if (Most_Want_Exit) return; + + most_check_minibuffer (); + if (Most_Mini_Buf[0] != '\0') most_put_message (); + Most_Digit_Arg = (int *) NULL; + + most_point_cursor (); + + if (SLang_input_pending (0)) + refresh_pending++; + else + refresh_pending = 0; + + if ((refresh_pending == 0) || (refresh_pending > 4)) + { + refresh_pending = 0; + SLsmg_refresh (); + } + + sldo_key (); +} diff --git a/vendor/most-5.1.0/src/keym.h b/vendor/most-5.1.0/src/keym.h new file mode 100644 index 0000000..72d788c --- /dev/null +++ b/vendor/most-5.1.0/src/keym.h @@ -0,0 +1,84 @@ +/* + This file is part of MOST. + + Copyright (c) 1991, 1999, 2002, 2005-2018, 2019 John E. Davis + + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the Free + Software Foundation; either version 2 of the License, or (at your option) + any later version. + + This program is distributed in the hope that 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. +*/ +extern void most_init_keymaps (void); +extern void most_execute_key (void); +extern int *Most_Digit_Arg; +extern void most_do_help_command (void); + +/* These are in cmd.c */ +extern void most_extended_key_cmd(void); +extern void most_next_file (void); +extern void most_toggle_case (void); +extern void most_delete_file_cmd (void); +extern void most_toggle_options (void); +extern void most_toggle_research (void); + +#if 0 +extern void ctrl_x_map_cmd(void); +extern void ctrl_k_map_cmd(void); +extern void ctrl_w_map_cmd(void); +extern void pf1_map_cmd(void); +extern void pf1_esc_map_cmd(void); +extern void dec_extended_map_cmd(void); +extern void esc_map_cmd(void); +extern void page_down_cmd(void); +extern void search_cmd(void); +extern void next_line_cmd(void); +extern void previous_line_cmd(void); +extern void extended_cmd_cmd(void); +extern void redraw_cmd(void); +extern void goto_line_cmd(void); +extern void time_cmd(void); +extern void page_up_cmd(void); +extern void page_up_cmd(void); +extern void column_left_cmd(void); +extern void column_right_cmd(void); +extern void page_right_cmd(void); +extern void sys_spawn_cmd(void); +extern void set_mark_cmd(void); +extern void top_of_buffer_cmd(void); +extern void goto_mark_cmd(void); +extern void search_back_cmd(void); +extern void find_next_cmd(void); +extern void end_of_buffer_cmd(void); +extern void exit_cmd(void); +extern void one_window_cmd(void); +extern void two_window_cmd(void); +extern void del_window_cmd(void); +extern void other_window_cmd(void); +extern void O_map_cmd(void); +extern void find_file_cmd(void); +extern void digit_arg_cmd(void); +extern void edit_cmd(void); +extern void toggle_width_cmd(void); +extern void goto_percent_cmd(void); +extern void edt_page_cmd(void); +extern void edt_forward_cmd(void); +extern void edt_back_cmd(void); +extern void edt_line_cmd(void); +extern void edt_find_cmd(void); +extern void edt_find_next_cmd(void); + +extern int do_extended_key(void); +extern int do_extended_cmd(void); +extern void do_help_command(void); +extern void execute_key(void); + +#endif diff --git a/vendor/most-5.1.0/src/keyparse.c b/vendor/most-5.1.0/src/keyparse.c new file mode 100644 index 0000000..71cd479 --- /dev/null +++ b/vendor/most-5.1.0/src/keyparse.c @@ -0,0 +1,320 @@ +/* + This file is part of MOST. + + Copyright (c) 1991, 1999, 2002, 2005-2018, 2019 John E. Davis + + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the Free + Software Foundation; either version 2 of the License, or (at your option) + any later version. + + This program is distributed in the hope that 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. +*/ +#include "config.h" + +#include +#include + +#ifdef HAVE_STDLIB_H +# include +#endif + +#ifdef __unix__ +# ifndef MOST_SYSTEM_INITFILE +# define MOST_SYSTEM_INITFILE "/etc/most.conf" +# endif +#endif + +/* parses user key definition file */ + +/* The file is assumed to have a simple format: + * + * set "keyname" function + * unset "keyname" + * + * For example: + * + * unsetkey "^K" + * setkey exit "^Kx" + * + * Comments extend from the first '%' character to the end of the line. + */ + +#include +#include "jdmacros.h" +#include "most.h" +#include "keyparse.h" +#include "display.h" + +static unsigned int Line_Num; + +static void parse_error (char *s) +{ + fprintf(stderr, "Most: Error reading config file on line %u.\n%s\n", + Line_Num, s); + + most_exit_error (NULL); +} + +static int unsetkey_fun (int, SLcmd_Cmd_Table_Type *); +static int setkey_fun (int, SLcmd_Cmd_Table_Type *); +static int color_fun (int, SLcmd_Cmd_Table_Type *); +static int mono_fun (int, SLcmd_Cmd_Table_Type *); + +static SLcmd_Cmd_Type Startup_File_Cmds[] = +{ + {unsetkey_fun, "unsetkey", "S"}, + {setkey_fun, "setkey", "SS"}, + {color_fun, "color", "SSS"}, + {mono_fun, "mono", "SSsss"}, + {NULL, "", ""} +}; +static SLcmd_Cmd_Table_Type Cmd_Table; + +static int setkey_fun (int argc, SLcmd_Cmd_Table_Type *table) /*{{{*/ +{ + char *fun = table->string_args[1]; + char *key = table->string_args[2]; + + (void) argc; + if (NULL == SLang_find_key_function(fun, Most_Keymap)) + { + parse_error ("Undefined function"); + } + + if (0 != SLang_define_key (key, fun, Most_Keymap)) + parse_error ("Error setting key"); + + return 0; +} + +static int unsetkey_fun (int argc, SLcmd_Cmd_Table_Type *table) /*{{{*/ +{ + char *key = table->string_args[1]; + + (void) argc; + + SLang_undefine_key (key, Most_Keymap); + return 0; +} + +static int parse_file (char *file) +{ + char buf[512]; + FILE *fp; + + if (NULL == (fp = fopen (file, "r"))) + return 1; + + Cmd_Table.table = Startup_File_Cmds; + + Line_Num = 0; + while (NULL != fgets (buf, sizeof (buf), fp)) + { + Line_Num++; + (void) SLcmd_execute_string (buf, &Cmd_Table); + if (SLang_get_error()) + parse_error ("Undefined keyword"); + } + + fclose (fp); + if (SLang_get_error ()) + { + SLang_set_error(0); + return -1; + } + return 0; +} + +int most_load_user_keymaps (void) +{ +#ifndef VMS + char filebuf[MAX_PATHLEN]; + unsigned int len; +#endif + char *file; + +#ifdef MOST_SYSTEM_INITFILE + if (MOST_SYSTEM_INITFILE != NULL) + { + int status; + status = parse_file (MOST_SYSTEM_INITFILE); + if (status == -1) + return -1; + } +#endif + + if (NULL == (file = getenv ("MOST_INITFILE"))) + { +#ifdef VMS + file = "SYS$LOGIN:MOST.RC"; +#else + *filebuf = 0; + file = getenv ("HOME"); + if (file == NULL) + return -1; + + len = strlen (file); + if (len + 8 >= sizeof (filebuf)) /* 8 for strlen("/.mostrc") */ + return -1; + + strcpy (filebuf, file); + file = filebuf; + + if (len && (file[len - 1] == '/')) + len--; + strcpy (file + len, "/.mostrc"); +#endif + } + return parse_file (file); +} + +/* The following code was borrowed from slrn */ +/*{{{ Setting Color/Mono Attributes */ + +typedef struct /*{{{*/ +{ + char *name; + int value; + char *fg, *bg; + SLtt_Char_Type mono; +} + +/*}}}*/ +Color_Handle_Type; + +/* default colors -- suitable for a color xterm */ + +static Color_Handle_Type Color_Handles[] = /*{{{*/ +{ + {"normal", 0, "default", "default", 0}, + {"status", MOST_STATUS_COLOR, "yellow", "blue", SLTT_REV_MASK}, + {"underline", MOST_ULINE_COLOR, "brightgreen", "default", SLTT_ULINE_MASK}, + {"overstrike", MOST_BOLD_COLOR, "brightred", "default", SLTT_BOLD_MASK}, + + {NULL, -1, NULL, NULL, 0} +}; + +static int set_object_color (char *name, char *fg, char *bg) +{ + Color_Handle_Type *ct = Color_Handles; + + while (ct->name != NULL) + { + if (!strcmp (ct->name, name)) + { + SLtt_set_color (ct->value, name, fg, bg); + return 0; + } + ct++; + } + + parse_error ("Undefined color object"); + return -1; +} + +static int color_fun (int argc, SLcmd_Cmd_Table_Type *table) +{ + char *what = table->string_args[1]; + char *fg = table->string_args[2]; + char *bg = table->string_args[3]; + + (void) argc; + return set_object_color (what, fg, bg); +} + +static int mono_fun (int argc, SLcmd_Cmd_Table_Type *table) +{ + char *what = table->string_args[1]; + char *attr; + int i; + + Color_Handle_Type *ct = Color_Handles; + + while (ct->name != NULL) + { + if (!strcmp (ct->name, what)) + { + SLtt_Char_Type mono_attr = 0; + for (i = 2; i < argc; i++) + { + attr = table->string_args[i]; + if (!strcmp (attr, "bold")) mono_attr |= SLTT_BOLD_MASK; + else if (!strcmp (attr, "blink")) mono_attr |= SLTT_BLINK_MASK; + else if (!strcmp (attr, "underline")) mono_attr |= SLTT_ULINE_MASK; + else if (!strcmp (attr, "reverse")) mono_attr |= SLTT_REV_MASK; + else if (!strcmp (attr, "none")) mono_attr = 0; + else + { + parse_error ("Undefined mono attribute"); + return -1; + } + } + SLtt_set_mono (ct->value, NULL, mono_attr); + return 0; + } + ct++; + } + parse_error ("Undefined color object"); + return -1; +} + +static char *Ansi_Color_Map[9] = +{ + "black", + "red", + "green", + "yellow", + "blue", + "magenta", + "cyan", + "white", + "default" +}; + +void most_setup_colors (void) +{ + Color_Handle_Type *h; + int i; + int fg, bg, at; + + for (i = 1; i < 128; i++) + { + SLtt_set_color (i, NULL, "default", "default"); + SLtt_set_mono (i, NULL, 0); + } + + for (at = 0; at < 9; at++) + { + for (fg = 0; fg < 9; fg++) + { + for (bg = 0; bg < 9; bg++) + { + i = fg + 9*(bg + 9*at); + if (i == 0) + continue; + i += MOST_EMBEDDED_COLOR_OFFSET; + SLtt_set_color (i, NULL, Ansi_Color_Map[fg], Ansi_Color_Map[bg]); + } + } + } + + h = Color_Handles; + while (h->name != NULL) + { + /* if (h->value != 0)*/ /* Let COLORFGBG apply to initial color */ + SLtt_set_color (h->value, NULL, h->fg, h->bg); + SLtt_set_color (h->value+MOST_EMBEDDED_COLOR_OFFSET, NULL, h->fg, h->bg); + SLtt_set_mono (h->value, NULL, h->mono); + SLtt_set_mono (h->value+MOST_EMBEDDED_COLOR_OFFSET, NULL, h->mono); + + h++; + } +} diff --git a/vendor/most-5.1.0/src/keyparse.h b/vendor/most-5.1.0/src/keyparse.h new file mode 100644 index 0000000..01697a3 --- /dev/null +++ b/vendor/most-5.1.0/src/keyparse.h @@ -0,0 +1,21 @@ +/* + This file is part of MOST. + + Copyright (c) 1991, 1999, 2002, 2005-2018, 2019 John E. Davis + + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the Free + Software Foundation; either version 2 of the License, or (at your option) + any later version. + + This program is distributed in the hope that 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. +*/ +extern SLKeyMap_List_Type *Most_Keymap; +extern int most_load_user_keymaps (void); diff --git a/vendor/most-5.1.0/src/line.c b/vendor/most-5.1.0/src/line.c new file mode 100644 index 0000000..ce4226d --- /dev/null +++ b/vendor/most-5.1.0/src/line.c @@ -0,0 +1,687 @@ +/* + This file is part of MOST. + + Copyright (c) 1991, 1999, 2002, 2005-2018, 2019 John E. Davis + + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the Free + Software Foundation; either version 2 of the License, or (at your option) + any later version. + + This program is distributed in the hope that 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. +*/ +#include "config.h" + +#include +#include + +#include +#include +#include "jdmacros.h" + +#include "most.h" +#include "line.h" +#include "window.h" +#include "display.h" + +int Most_Tab_Width = 8; + +int Most_Selective_Display = 0; +int Most_Show_Wrap_Marker = 1; + +#define IS_BYTE_PRINTABLE(b) \ + ((((b) >= ' ') && ((b) < 0x7F)) \ + || ((Most_UTF8_Mode == 0) && ((b) >= SLsmg_Display_Eight_Bit))) + +/* take 16 binary characters and put them in displayable form */ +static void binary_format_line (unsigned char *beg, unsigned char *end, + char *buf) +{ + unsigned char *b; + char *s, *s1; + unsigned char ch; + int count; + + count = 0; + b = beg; + s = buf; + + while (b < end) + { + if (count == 4) + { + *s++ = ' '; + count = 0; + } + count++; + + ch = *b++; + + if ((Most_V_Opt == 0) + || (ch & 0x80)) + { + sprintf (s, "%02X", ch); + s += 2; + continue; + } + + if ((ch >= ' ') && (ch < 0x7F)) + { + *s++ = ' '; + *s++ = (char) ch; + continue; + } + + *s++ = '^'; + if (ch < ' ') ch += '@'; + else ch = '?'; + *s++ = ch; + } + + s1 = buf + (9 * 4) + 4; + while (s < s1) + *s++ = ' '; + + b = beg; + while (b < end) + { + ch = *b++; + if (IS_BYTE_PRINTABLE(ch)) + { + *s++ = ch; + continue; + } + *s++ = '.'; + } + *s = 0; +} + +static void output_binary_formatted_line (void) +{ + unsigned char *beg, *end; + char buf[256]; + + beg = Most_Beg + Most_C_Offset; + end = beg + 16; + + if (end > Most_Eob) end = Most_Eob; + + sprintf (buf, "0x%08lX: ", (unsigned long) Most_C_Offset); + binary_format_line (beg, end, buf + 12); + SLsmg_write_string (buf); + SLsmg_erase_eol (); +} + +/* Here *begp points to the char after \e. + * The general escape sequence parsed here is assumed to look like: + * \e[ XX ; ... m + * If 30 <= XX <= 37, then it specifies the foreground color + * If 40 <= XX <= 47, then a background color is specified + * If 0 <= XX <= 8, then an attribute (e.g, 8) is specified. + * These numbers will be encoded as: + * offset + (FG-30 + 8*(BG-40 + 9*attribute)) + */ +int most_parse_color_escape (unsigned char **begp, unsigned char *end, int *colorp) +{ + unsigned char *beg = *begp; + int fg = 38, bg = 48, at = 0; + int xx; + + if ((beg >= end) || (*beg != '[')) + return -1; + + beg++; /* skip [ */ +#if 1 + if ((beg < end) && (*beg == 'K')) + { + if (colorp != NULL) *colorp = -1; + *begp = beg + 1; + return 0; + } +#endif + + while (1) + { + xx = 0; + while ((beg < end) && isdigit (*beg)) + { + xx = xx*10 + (*beg - '0'); + beg++; + } + if ((xx >= 0) && (xx <= 8)) + at = xx; + else if ((xx >= 20) && (xx <= 28)) + xx = 0; + else if ((xx >= 30) && (xx <= 37)) + fg = xx; + else if ((xx >= 40) && (xx <= 47)) + bg = xx; + else return -1; + + if ((beg < end) && (*beg == ';')) + { + beg++; + continue; + } + + if ((beg < end) && ((*beg == 'm') || (*beg == ']'))) + { + *begp = beg + 1; + if (colorp != NULL) + { + if ((fg != 38) || (bg != 48)) + xx = ((fg-30) + 9*((bg-40) + 9*at)); + if (xx != 0) + xx += MOST_EMBEDDED_COLOR_OFFSET; + *colorp = xx; + } + return 0; + } + return -1; + } +} + +typedef struct +{ + unsigned char *bytes; + unsigned char byte; /* used if bytes is NULL */ + unsigned int len; + int color; +} +Multibyte_Cell_Type; + +static int most_analyse_line (unsigned char *begg, unsigned char *endd, + Multibyte_Cell_Type *cells, unsigned int num_cols, int *start_colorp) +{ + unsigned char *beg, *end; + unsigned int min_col, max_col, prev_width; + unsigned int col, max_col_reached; + int default_attr; + Multibyte_Cell_Type *cell, *max_cell; + + beg = begg; + end = endd; + col = max_col_reached = 0; + cell = cells; + max_cell = cell; + min_col = Most_Column - 1; + max_col = min_col + num_cols; + + default_attr = *start_colorp; + prev_width = 1; + while (beg < end) + { + int attr = default_attr; + unsigned char ch; + unsigned char *pch = beg++; + char buf[16]; + + if ('\n' == (ch = *pch)) + break; + + if ((ch == '\r') && (Most_V_Opt == 0)) + { + if (col > max_col_reached) max_col_reached = col; + col = 0; + prev_width = 1; + continue; + } + + if ((ch == '\b') && (Most_V_Opt == 0)) + { + if (col > max_col_reached) max_col_reached = col; + if (col < prev_width) + col = 0; + else + col -= prev_width; + continue; + } + + if (col < max_col_reached) /* overstrike */ + { + attr = MOST_BOLD_COLOR; + if ((col >= min_col) && (col < max_col)) + { + cell = cells + (col-min_col); + if (cell->bytes[0] == '_') + attr = MOST_ULINE_COLOR; + else if (ch == '_') + { + cell->color = MOST_ULINE_COLOR; + col++; + continue; + } + } + /* drop */ + } + + if (IS_BYTE_PRINTABLE(ch)) + { + if ((col >= min_col) && (col < max_col)) + { + cell = cells + (col-min_col); + cell->bytes = pch; + cell->len = 1; + cell->color = attr; + if (cell >= max_cell) + max_cell = cell + 1; + } + col++; + prev_width = 1; + continue; + } + + if ((ch == '\t') && (Most_T_Opt == 0) && (Most_Tab_Width)) + { + int nspaces = Most_Tab_Width * (col/Most_Tab_Width + 1) - col; + prev_width = nspaces; + while (nspaces > 0) + { + if ((col >= min_col) && (col < max_col)) + { + cell = cells + (col-min_col); + cell->bytes = &cell->byte; + cell->byte = ' '; + cell->color = attr; + cell->len = 1; + if (cell >= max_cell) + max_cell = cell + 1; + } + col++; + nspaces--; + } + continue; + } +#if 1 + if ((ch == 033) && (Most_V_Opt == 0)) + { + int color; + if (0 == most_parse_color_escape (&beg, end, &color)) + { + if (color != -1) default_attr = color; + continue; + } + /* drop */ + } +#endif + + if (ch & 0x80) + { + SLwchar_Type wch; + if ((Most_UTF8_Mode) + && (NULL != SLutf8_decode (pch, end, &wch, NULL))) + { + int width = SLwchar_wcwidth (wch); + beg = SLutf8_skip_chars (pch, end, 1, NULL, 1); + + prev_width = width; + if (width == 0) + { + col--; + if ((col >= min_col) && (col < max_col)) + { + cell = cells + (col-min_col); + cell->len += beg-pch; + } + col++; + continue; + } + + if ((col >= min_col) && (col < max_col)) + { + cell = cells + (col-min_col); + cell->bytes = pch; + cell->color = attr; + cell->len = beg - pch; + if (cell >= max_cell) + max_cell = cell + 1; + } + col++; + if (width > 1) + { + if ((col >= min_col) && (col < max_col)) + { + cell = cells + (col-min_col); + cell->bytes = pch; + cell->color = attr; + cell->len = 0; + if (cell >= max_cell) + max_cell = cell + 1; + } + col++; + } + continue; + } + + /* Otherwise, this displays as and takes up 4 character cells */ + sprintf (buf, "<%02X>", (unsigned int) ch); + prev_width = 4; + /* drop */ + } + else + { + /* Otherwise we have a Ctrl-char displayed as ^X */ + if (ch == 0x7F) ch = '?'; + else ch += '@'; + + sprintf (buf, "^%c", ch); + prev_width = 2; + } + + pch = (unsigned char *)buf; + while (*pch) + { + if ((col >= min_col) && (col < max_col)) + { + cell = cells + (col-min_col); + cell->bytes = &cell->byte; + cell->byte = *pch; + cell->color = attr; + cell->len = 1; + if (cell >= max_cell) + max_cell = cell + 1; + } + col++; + pch++; + } + } + + if (col < max_col_reached) + col = max_col_reached; + else + max_col_reached = col; + + /* Now add "..." if selective display. To do that, the next line needs to + * be dealt with to determine whether or not it will be hidden. + */ + if (Most_Selective_Display + && (Most_W_Opt == 0) + && (beg < Most_Eob) + && ((col >= min_col) && (col < max_col))) + { + if (*beg == '\n') beg++; + + while ((beg < Most_Eob) + && ((*beg == ' ') || (*beg == '\t') || (*beg == '\r'))) + beg++; + + if ((beg >= Most_Eob) || (*beg == '\n') + || (most_apparant_distance(beg) >= Most_Selective_Display)) + { + max_col_reached = col + 3; + while (col < max_col_reached) + { + if (col < max_col) + { + cell = cells + (col-min_col); + cell->bytes = &cell->byte; + cell->byte = '.'; + cell->color = 0; + cell->len = 1; + if (cell >= max_cell) + max_cell = cell + 1; + } + col++; + } + } + } + *start_colorp = default_attr; + return max_cell - cells; +} + +static void display_cells (Multibyte_Cell_Type *cell, unsigned int n, char dollar) +{ + Multibyte_Cell_Type *cell_max; + int last_color = -1; + + cell_max = cell + n; + while (cell < cell_max) + { + if (last_color != cell->color) + { + last_color = cell->color; + SLsmg_set_color (last_color); + } + SLsmg_write_chars (cell->bytes, cell->bytes + cell->len); + cell++; + } + + if (last_color != 0) + SLsmg_set_color (0); + + SLsmg_erase_eol (); + if (dollar) + { + SLsmg_gotorc (SLsmg_get_row (), SLtt_Screen_Cols-1); + SLsmg_write_nchars (&dollar, 1); + } +} + +void most_display_line (int reset) +{ + unsigned char *beg, *end; + unsigned char dollar; + static Multibyte_Cell_Type *cells; + static unsigned int num_cells; + unsigned int screen_cols; + unsigned int num_cells_set; + static int last_color = 0; /* used for a line that wrapped */ + + if (Most_B_Opt) + { + output_binary_formatted_line (); + return; + } + + screen_cols = SLtt_Screen_Cols; + if (num_cells != screen_cols + 1) + { + num_cells = screen_cols + 1; + + SLfree ((char *) cells); + if (NULL == (cells = (Multibyte_Cell_Type *)SLcalloc (num_cells, sizeof (Multibyte_Cell_Type)))) + most_exit_error ("Out of memory"); + } + + (void) most_extract_line (&beg, &end); + + if (reset || (Most_W_Opt == 0)) + last_color = 0; + num_cells_set = most_analyse_line (beg, end, cells, num_cells, &last_color); + + dollar = 0; + if (Most_W_Opt) + { + if (Most_Show_Wrap_Marker + && (end < Most_Eob) + && (*end != '\n')) + dollar = '\\'; + } + else if (num_cells_set > screen_cols) + dollar = '$'; + + display_cells (cells, num_cells_set, dollar); +} + +/* given a position in a line, return apparent distance from bol + expanding tabs, etc... up to pos */ +int most_apparant_distance (unsigned char *pos) +{ + int i, prev_width; + unsigned char *save_pos, ch; + unsigned int save_offset; + + save_offset = Most_C_Offset; + save_pos = pos; + Most_C_Offset = (unsigned int) (pos - Most_Beg); + pos = most_beg_of_line(); + Most_C_Offset = save_offset; + + i = 0; + prev_width = 1; + while (pos < save_pos) + { + ch = *pos++; + if (IS_BYTE_PRINTABLE(ch)) + { + i++; + prev_width = 1; + continue; + } + + if ((ch == '\b') && (Most_V_Opt == 0)) + { + i -= prev_width; + if (i < 0) i = 0; + continue; + } + if ((ch == '\r') && (Most_V_Opt == 0)) + { + if (i != 1) i = 0; + prev_width = 1; + continue; + } + if ((ch == '\t') && (Most_T_Opt == 0)) + { + prev_width = Most_Tab_Width * (i/Most_Tab_Width + 1) - i; /* Most_Tab_Width column tabs */ + i += prev_width; + continue; + } + + if ((ch == 033) && (Most_V_Opt == 0) + && (0 == most_parse_color_escape (&pos, save_pos, NULL))) + continue; + + if (ch & 0x80) + { + SLwchar_Type wch; + if ((Most_UTF8_Mode) + && (NULL != SLutf8_decode (pos-1, save_pos, &wch, NULL))) + { + prev_width = SLwchar_wcwidth (wch); + pos = SLutf8_skip_chars (pos-1, save_pos, 1, NULL, 1); + i += prev_width; + continue; + } + prev_width = 4; + i += prev_width; /* */ + continue; + } + + prev_width = 2; + i += prev_width; /* ^X */ + } + return i; +} + +/* + * Returns a pointer to the num_cols'th character after the one + * pointed at b. Invisible character runs are not counted toward this + * limit, i.e. strings that represent attributes, such as "_\b" for + * underlines. + * + * If multi_column is non-zero, characters spanning more than one + * column will add their extra width to the column count. + * + * If there the end of the buffer is reached, as delimited by argument + * e, then e is returned. + */ +unsigned char *most_forward_columns (unsigned char *b, unsigned char *e, unsigned int num_cols) +{ + unsigned int col = 0; + unsigned int prev_width = 1; + + while (b < e) + { + unsigned char ch = *b++; + + if (col >=num_cols) + { + if ((ch == 033) && (Most_V_Opt == 0)) + { + while ((ch == 033) + && (0 == most_parse_color_escape (&b, e, NULL)) + && (b < e)) + ch = *b++; + } + b--; + break; + } + + if (IS_BYTE_PRINTABLE(ch)) + { + col++; + prev_width = 1; + continue; + } + + if (ch & 0x80) + { + SLwchar_Type wch; + + if ((Most_UTF8_Mode) + && (NULL != SLutf8_decode (b-1, e, &wch, NULL))) + { + b = SLutf8_skip_chars (b-1, e, 1, NULL, 1); + prev_width = SLwchar_wcwidth (wch); + col += prev_width; + continue; + } + prev_width = 4; + col += prev_width; /* */ + continue; + } + + if (ch == '\b') + { + if (Most_V_Opt == 0) + { + if (col < prev_width) + col = 0; + else + col -= prev_width; + } + else col += 2; /* ^H */ + continue; + } + + if (ch == '\r') + { + if (Most_V_Opt == 0) + { + prev_width = 1; + col = 0; + } + else col += 2; /* ^M */ + continue; + } + + if (ch == '\t') + { + if (Most_T_Opt == 0) + { + prev_width = Most_Tab_Width * (col/Most_Tab_Width + 1) - col; + col += prev_width; + } + else + col += 2; /* ^I */ + continue; + } + + if ((ch == 033) && (Most_V_Opt == 0) + && (0 == most_parse_color_escape (&b, e, NULL))) + continue; + + /* Ctrl-char ^X */ + prev_width = 2; + col += prev_width; + } + return b; +} diff --git a/vendor/most-5.1.0/src/line.h b/vendor/most-5.1.0/src/line.h new file mode 100644 index 0000000..062a59c --- /dev/null +++ b/vendor/most-5.1.0/src/line.h @@ -0,0 +1,35 @@ +/* + This file is part of MOST. + + Copyright (c) 1991, 1999, 2002, 2005-2018, 2019 John E. Davis + + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the Free + Software Foundation; either version 2 of the License, or (at your option) + any later version. + + This program is distributed in the hope that 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. +*/ +#ifndef _DAVIS_LINE_H_ +# define _DAVIS_LINE_H_ +#if 0 +extern int most_analyse_line(unsigned char *, unsigned char *, char *, char *); +extern void most_output(unsigned char *, unsigned int, unsigned char *, unsigned char); +#endif + +extern void most_display_line(int); +extern int most_apparant_distance(unsigned char *); +extern unsigned char *most_forward_columns (unsigned char *b, unsigned char *e, unsigned int num_cols); +extern int most_parse_color_escape (unsigned char **begp, unsigned char *end, int *colorp); + +extern int Most_Show_Wrap_Marker; + +#endif + diff --git a/vendor/most-5.1.0/src/main.c b/vendor/most-5.1.0/src/main.c new file mode 100644 index 0000000..d2bc5e2 --- /dev/null +++ b/vendor/most-5.1.0/src/main.c @@ -0,0 +1,54 @@ +/* + This file is part of MOST. + + Copyright (c) 1991, 1999, 2002, 2005-2018, 2019 John E. Davis + + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the Free + Software Foundation; either version 2 of the License, or (at your option) + any later version. + + This program is distributed in the hope that 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. +*/ +#include "config.h" + +#include +#include + +#ifdef HAVE_STDLIB_H +# include +#endif + +#include +#include "most.h" + +int main(int argc, char *argv[]) +{ +#if 0 + static volatile int debug_me = 1; + while (debug_me == 1) + { + sleep (1); + } +#endif + if (argc > 1) + { + if ((0 == strcmp (argv[1], "--version")) + || (0 == strcmp (argv[1], "--help"))) + { + most_usage (); + exit (1); + } + } + + most_initialize_most (); + return most (argc, argv); +} + diff --git a/vendor/most-5.1.0/src/modules.lis b/vendor/most-5.1.0/src/modules.lis new file mode 100644 index 0000000..631fda6 --- /dev/null +++ b/vendor/most-5.1.0/src/modules.lis @@ -0,0 +1,14 @@ +buffer +cmd +display +edit +file +help +keym +keyparse +line +main +most +search +sysdep +window diff --git a/vendor/most-5.1.0/src/most.c b/vendor/most-5.1.0/src/most.c new file mode 100644 index 0000000..be98f60 --- /dev/null +++ b/vendor/most-5.1.0/src/most.c @@ -0,0 +1,565 @@ +/* + This file is part of MOST. + + Copyright (c) 1991, 1999, 2002, 2005-2018, 2019 John E. Davis + + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the Free + Software Foundation; either version 2 of the License, or (at your option) + any later version. + + This program is distributed in the hope that 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. +*/ +#include "config.h" + +#include +#include + +#ifdef HAVE_STDLIB_H +# include +#endif + +#ifdef HAVE_UNISTD_H +# include +#endif + +#ifdef VMS +# include +#endif + +#include +#include + +#include +#include "version.h" + +#include "jdmacros.h" + +#include "most.h" +#include "search.h" +#include "window.h" +#include "file.h" +#include "sysdep.h" +#include "keym.h" +#include "display.h" +#include "line.h" + +int Most_S_Opt = 0; /* squeeze liness */ +int Most_A_Opt = 1; /* automatically choose -b if necessary */ +int Most_V_Opt = 0; /* display control chars */ +int Most_B_Opt = 0; /* display Binary File */ +int Most_T_Opt = 0; /* display tab as ^I-- valid only with V option */ +int Most_D_Opt = 0; /* delete file mode (see ':D') */ +int Most_K_Opt = 0; /* Display 8 bit unformatted (Kanji) */ +int Most_Z_Opt = 0; /* Gunzip on the fly */ +int Most_Want_Exit; +int Most_Secure_Mode; +int Most_Captive_Mode; +#if MOST_HAS_MMAP +int Most_Disable_MMap = 0; +#endif +int Most_Do_Regexp_Search = 0; + +int Most_UTF8_Mode = -1; /* -1:auto, 0:off, 1:on */ + +static int Most_Starting_Line; +char *Most_Program; /* Program Name (argv[0]) */ + +static char *Most_Version = MOST_VERSION_STR; + +#ifdef VMS +# ifndef isalpha +# define isalpha(x) \ + (((x >= 'A') && (x <= 'Z'))||((x >= 'a') && (x <= 'z')) ? 1 : 0) +# endif +#endif + +void most_usage (void) +{ + fprintf(stderr,"MOST version %s (S-Lang version %s)\n", + Most_Version, SLang_Version_String); + if (SLang_Version != SLANG_VERSION) + fprintf (stderr, " *Note: This executable was compiled against S-Lang %s\n", SLANG_VERSION_STRING); + + fprintf (stderr, "Usage:\n"); + fprintf(stderr, "most [-1Cbcdkrstvw] [+/string] [+line number] [+s] [+d] file...\n"); + fputs(" where: -1: assume VT100 terminal. (VMS only)\n", stderr); + fputs(" -b: Startup in binary mode.\n", stderr); + fputs(" -C: disable color support\n", stderr); + fputs(" -c: Make searches case sensitive.\n", stderr); + fputs(" -d: Do not display the \\ wrap marker when wrapping lines.\n", stderr); + /* fputs(" -k: Kanji mode.\n", stderr); */ +#if MOST_HAS_MMAP + fputs(" -M: Do not attempt to mmap files.\n", stderr); +#endif + fputs(" -r: Default to regexp search\n", stderr); + fputs(" -s: Squeeze out excess blank lines.\n", stderr); + fputs(" -t: Display tabs as ^I. If this option is immediately followed\n", stderr); + fputs(" by an integer, the integer sets the tab width.\n", stderr); + fputs(" -u: Disable UTF-8 mode\n", stderr); + fputs(" -v: Do not interpret backspace formatting characters.\n", stderr); + fputs(" -w: Wrap lines.\n", stderr); + fputs(" -z: No gunzip-on-the-fly.\n", stderr); + fputs(" +/string:\n", stderr); + fputs(" Search for string\n", stderr); + fputs(" +line number\n", stderr); + fputs(" Start up at specified line number.\n", stderr); + fputs(" +d: Allow file deletion.\n", stderr); + fputs(" +s: Secure Mode-- no edit, cd, shell, and reading files not\n", stderr); + fputs(" already listed on the command line.\n", stderr); + fputs(" +u: Enable UTF-8 mode.\n", stderr); + fprintf(stderr, "\nExample: most -ct4 +82 keymap.c\n"); + fputs(" makes searches case sensitive, sets tabwidth to 4, and displays the file\n", stderr); + fputs(" keymap.c starting at line 82.\n", stderr); +} + +static void do_switches(char *str); + +static void do_extended_switches(char *str) +{ + int i; + char ch; + char numstr [256]; + + i = 0; + ch = *(++str); + if ( ch == '/') + { + strcpy (Most_Search_Str,++str); + return; + } + + if (ch >= '0' && ch <= '9') + { + while ((ch >= '0' && ch <= '9') && (i < 10)) + { + numstr[i++] = ch; + ch = *(++str); + } + numstr[i] = '\0'; + if (1 == sscanf (numstr,"%d", &i)) + Most_Starting_Line = i; + return; + } + + if (isalpha(ch)) + { + while (1) + { + switch (ch) + { + case 0: + return; + case ' ': + case '+': + break; + case '-': + do_switches (str); + return; + + case 'D': + case 'd': + Most_D_Opt = 1; /* delete file mode */ + break; + case 'S': + case 's': + Most_Secure_Mode = 1; + break; + + case 'U': + case 'u': + Most_UTF8_Mode = 1; /* +u */ + break; + + default: + fprintf(stderr,"%s invalid extended option %c ignored.\n", + Most_Program, ch); + } + ch = *(++str); + } + } + + fprintf(stderr,"%s: switch '+%s' not valid.\n", Most_Program, str); + exit (1); +} + +/* if non-zero, assume terminal is only a generic vt100 */ +static int assume_vt100 = 0; +static int No_Colors = 0; + +static void do_switches(char *str) +{ + char ch; + if (*str == '-') str++; + while ((ch = *str++) != '\0') + { + switch (ch) + { + default: + fprintf(stderr,"%s: invalid switch %c ignored.\n", + Most_Program, ch); + break; + + case 'C': + No_Colors = 1; + break; + case 'c': + Most_Case_Sensitive = 1; + break; + case 'd': + case 'D': + Most_Show_Wrap_Marker = 0; + break; + case 'r': + Most_Do_Regexp_Search = 1; + break; + case 's': + case 'S': + Most_S_Opt = 1; break; + case 'V': + case 'v': + Most_V_Opt = 1; /* verbose-- convert control chars to '^' 'ch' */ + break; + case 'W': + case 'w': Most_W_Opt = 1; break; + + case 'K': /* Kanji option */ + case 'k': + /* Most_K_Opt = 1; break; */ + break; + + case 'B': + case 'b': + Most_B_Opt = 1; /* Binary display 8 bit */ + break; + + case 'M': +#if MOST_HAS_MMAP + Most_Disable_MMap = 1; +#endif + break; + + case 'z': + case 'Z': + Most_Z_Opt = 1; /* NO Gunzip-on-the-fly */ + break; + + case 't': + case 'T': /* expand tabs to '^I'; meaningful only with 'v' */ + ch = *str; + if ((ch <= '9') && (ch >= '0')) + { + str++; + Most_Tab_Width = (int) ch - '0'; + if (Most_Tab_Width == 0) Most_T_Opt = 1; + } + else Most_T_Opt = 1; + break; + + case 'n': case 'N': + /* could be the Gopher Naive user switch --- ignored. */ + break; + case '1': assume_vt100 = 1; + break; + + case 'u': + case 'U': + Most_UTF8_Mode = 0; /* -u */ + break; + + /* Allow MOST_SWITCHES environment variable to contain + forms, + * e.g., "-sn+d" or "-s -n +d" + */ + case ' ': + case '-': + break; + case '+': + do_extended_switches (str - 1); /* include '+' */ + return; + } + } +} + +void most_exit_error(char *fmt,...) +{ + va_list ap; + + most_reset_tty (); + most_reset_display(); + if (fmt != NULL) + { + va_start (ap, fmt); + vfprintf(stderr, fmt, ap); + va_end (ap); + putc ('\n', stderr); + } +#ifdef MALLOC_DEBUG + SLmalloc_dump_statistics (); +#endif + exit(1); +} + +static void play_cat(char *file) +{ + char buf[4096 * 4]; + int n; + FILE *fp; + + if (file == NULL) fp = stdin; + else + { + fp = fopen(file, "r"); + if (fp == NULL) return; + } + + while ((n = fread(buf, 1, 4096 * 4, fp)) > 0) + { + int m; + m = fwrite (buf, 1, n, stdout); + if (m != n) + { + fprintf (stderr, "fwrite returned %d, errno = %d\n", + m, errno); + (void) fclose (fp); + exit (1); + } + } + (void) fclose (fp); +} + +void most_initialize_most (void) +{ + Most_S_Opt = 0; + Most_A_Opt = 1; + Most_V_Opt = 0; + Most_B_Opt = 0; + Most_T_Opt = 0; + Most_D_Opt = 0; + Most_K_Opt = 0; + Most_W_Opt = 0; + + Most_Selective_Display = 0; + *Most_Search_Str = 0; Most_Search_Dir = 1; + Most_Top_Win = Most_Win = NULL; + Most_Buf = NULL; + Most_Eob = NULL; + Most_Beg = NULL; + Most_Captive_Mode = Most_Secure_Mode = 0; + Most_Want_Exit = 0; +} + +static void do_most (char *file, int start) +{ + MOST_INT row, col; + + most_get_cdir(Most_C_Dir); + + row = col = 0; + + if ((-1 == most_find_file (file)) + && (Most_Num_Files == 1)) + most_exit_error ("%s: failed to open for reading.", file); + + most_init_display (); + + most_goto_line(start); + + Most_Curs_Offset = Most_C_Offset; + + if (*Most_Search_Str + && ((row = most_search (Most_Beg + Most_C_Offset, 1, &col)) > 0)) + most_goto_line(row); + else + { + row = Most_C_Line; + col = 1; + } + + most_window_buffer(); + Most_Curs_Row = Most_Win->curs_line = row - Most_C_Line + 1; + Most_Win->curs_offset = Most_Curs_Offset; + Most_Curs_Col = Most_Win->curs_col = col; + most_redraw_window(); + most_update_status(); + + while (Most_Want_Exit == 0) + { + most_execute_key(); + } +} + +void most_exit_most (void) +{ + if (Most_Want_Exit) return; + Most_Want_Exit = 1; + most_clear_minibuffer (); + most_reset_tty (); + most_reset_display (); + most_free_windows (); +#ifdef MALLOC_DEBUG + SLmalloc_dump_statistics (); +#endif +} + +static void utf8_config (void) +{ + int utf8_mode = Most_UTF8_Mode; + + utf8_mode = SLutf8_enable (-1); /* returns 0 or 1 */ + if (Most_UTF8_Mode == -1) + Most_UTF8_Mode = utf8_mode; + else if (utf8_mode != Most_UTF8_Mode) + { + if (utf8_mode == 1) + (void) SLsmg_utf8_enable (0); /* locale is UTF-8, but -u passed */ + else + (void) SLsmg_utf8_enable (1); /* locale not UTF-8, but +u passed */ + } +} + +int most (int argc, char **argv) +{ + char file[MAX_PATHLEN], *switches; + int file_i = 0, quit,i,piped; + int status = 0; + +#ifdef VMS + char filename[256]; +#else + int j; +#endif + + Most_Program = argv[0]; + piped = 0; + + switches = getenv ("MOST_PROMPT"); + if ((switches != NULL) && (*switches != 0)) Most_Global_Msg = switches; + + switches = getenv("MOST_SWITCHES"); + if (switches != NULL) do_switches(switches); + + i = 1; + if (argc > 1) + { + quit = 0; + while ((!quit) && (i < argc)) + { + if (argv[i][0] == '-') + do_switches(argv[i++]); + else if (argv[i][0] == '+') + do_extended_switches(argv[i++]); + else quit = 1; + } + } + +#if MOST_HAS_MMAP + /* if (Most_D_Opt) */ + /* Most_Disable_MMap = 1; */ +#endif + + if (i == argc) + { + if (isatty(0)) /* 1 if stdin is a terminal, 0 otherwise */ + { + most_usage (); + return 0; + } + /* assume input is from stdin */ + file[0] = '\0'; /* tells most this is stdin */ + piped = 1; + if (!isatty(fileno(stdout))) + { + play_cat(NULL); + return 0; + } + } + else + { + strncpy (file, argv[i], sizeof(file)); + file[sizeof(file)-1] = 0; + } + + if (!isatty(fileno(stdout))) + { + while (i < argc) play_cat(argv[i++]); + exit(0); + } + + Most_Num_Files = 0; + + SLtt_get_terminfo(); + utf8_config (); + SLtt_Ignore_Beep = 1; + if (No_Colors) + SLtt_Use_Ansi_Colors = 0; + + most_setup_colors (); + most_init_tty (); + most_init_keymaps (); + + if (Most_B_Opt) Most_A_Opt = 0; /* explicit b overrides a */ + + if (!piped) + { + file_i = i; +#ifdef VMS + while(i < argc) + { + if (Most_Num_Files >= MOST_MAX_FILES) break; + if (argv[i][0] == '.') strcpy(file,"*"); else *file = 0; + strcat(file, most_unix2vms(argv[i++])); + while (RMS$_NORMAL == (status = most_expand_file_name(file,filename))) + { + Most_File_Ring[Most_Num_Files] = (char*) MOSTMALLOC(strlen(filename) + 1); + strcpy(Most_File_Ring[Most_Num_Files++], filename); + } + if (status == RMS$_NMF) status = RMS$_NORMAL; /* avoid spurious warning message */ + } + + if (Most_Num_Files) strcpy(file,Most_File_Ring[0]); + else fputs("%%MOST-W-NOFILES, no files found\n", stderr); +#else + Most_Num_Files = argc - i; + if (Most_Num_Files > MOST_MAX_FILES) + { + Most_Num_Files = MOST_MAX_FILES; + argc = Most_Num_Files + i; + } + + j = 0; + while (i < argc) + { + Most_File_Ring[j++] = argv[i++]; + } +#endif + } + + if (Most_Num_Files || piped) do_most(file, Most_Starting_Line); + else if (Most_Num_Files == 0) + fprintf(stderr,"File %s not found\n", argv[file_i]); + + most_exit_most (); + return status; +} + +#if SLANG_VERSION <= 10409 + +int SLang_set_error (int x) +{ + SLang_Error = x; + return 0; +} + +int SLang_get_error (void) +{ + return SLang_Error; +} + +#endif diff --git a/vendor/most-5.1.0/src/most.h b/vendor/most-5.1.0/src/most.h new file mode 100644 index 0000000..2a55864 --- /dev/null +++ b/vendor/most-5.1.0/src/most.h @@ -0,0 +1,79 @@ +/* + This file is part of MOST. + + Copyright (c) 1991, 1999, 2002, 2005-2018, 2019 John E. Davis + + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the Free + Software Foundation; either version 2 of the License, or (at your option) + any later version. + + This program is distributed in the hope that 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. +*/ +#include "config.h" +extern int Most_S_Opt; +extern int Most_A_Opt; /* automatically choose -b if necessary */ +extern int Most_V_Opt; /* display control chars */ +extern int Most_B_Opt; /* display Binary File */ +extern int Most_T_Opt; /* display tab as ^I-- valid only with V option */ +extern int Most_D_Opt; /* delete file mode (see ':D') */ +extern int Most_L_Opt; /* use ^L (formfeed) to clear screen */ +extern int Most_W_Opt; /* Wrap mode */ +extern int Most_K_Opt; /* Kanji mode */ +extern int Most_Z_Opt; /* gunzip-on-the-fly */ + +#if MOST_HAS_MMAP +extern int Most_Disable_MMap; +#endif + +extern int Most_UTF8_Mode; + +extern int Most_Secure_Mode; +extern int Most_Captive_Mode; +extern char *Most_Program; + +extern int most(int, char **); +extern char *Most_Global_Msg; +extern int Most_Want_Exit; +extern void most_initialize_most(void); +extern void most_exit_most (void); +extern void most_exit_error (char *, ...); + +extern void most_usage (void); +#define MOSTMALLOC most_malloc +#define MOSTREALLOC most_realloc +extern unsigned char *most_malloc(unsigned int); +extern unsigned char *most_realloc(unsigned char *, unsigned int); +extern int Most_Tab_Width; + +#ifdef VMS +# ifndef isdigit +# define isdigit(x) \ + (((x >= '0') && (x <= '9')) ? 1 : 0) +# endif +#endif + +#ifdef HAVE_SNPRINTF +# define _pSLsnprintf snprintf +#else +# if SLANG_VERSION < 20000 +# define _pSLsnprintf _SLsnprintf +extern int _pSLsnprintf (char *, unsigned int, char *, ...); +# else +# define _pSLsnprintf SLsnprintf +# endif +#endif + +#if SLANG_VERSION <= 10409 +extern int SLang_get_error (void); +extern int SLang_set_error (int); +#endif + +#define SLANG_REGEX 1 diff --git a/vendor/most-5.1.0/src/mostconf.h b/vendor/most-5.1.0/src/mostconf.h new file mode 100644 index 0000000..a8e8e93 --- /dev/null +++ b/vendor/most-5.1.0/src/mostconf.h @@ -0,0 +1,46 @@ +/* + * Use sysconf.h for unix!!! This file is for NON-unix systems. + * + * This file is used to indicate capabilities of the C compiler and + * operating system. + */ + +/* Basic include files. */ + +#if defined(__os2__) || defined (__DECC) || defined(VAXC) +# define HAVE_STDLIB_H 1 +#else +# define HAVE_MALLOC_H 1 +#endif + +#if defined (__os2__) +# define HAVE_UNISTD_H 1 +# define HAVE_MEMORY_H 1 +#endif + +/* + * Basic C library functions. + */ + +#if defined(__os2__) +# define HAVE_PUTENV 1 +#endif + +#define HAVE_GETCWD 1 +#define HAVE_MEMSET 1 +#define HAVE_MEMCPY 1 +#define HAVE_MEMCHR 1 + +#ifdef VMS +# ifndef __GNUC__ +# include +# endif +#endif + +#define MAX_PATHLEN 256 + +#define MOST_INT long +#define MOST_UINT unsigned long +#define MOST_INT_D_FMT "%ld" + +#define MOST_HAS_MMAP 0 diff --git a/vendor/most-5.1.0/src/objs/buffer.o b/vendor/most-5.1.0/src/objs/buffer.o new file mode 100644 index 0000000..c3d9df1 Binary files /dev/null and b/vendor/most-5.1.0/src/objs/buffer.o differ diff --git a/vendor/most-5.1.0/src/objs/chkslang b/vendor/most-5.1.0/src/objs/chkslang new file mode 100755 index 0000000..2d51a58 Binary files /dev/null and b/vendor/most-5.1.0/src/objs/chkslang differ diff --git a/vendor/most-5.1.0/src/objs/chkslang.o b/vendor/most-5.1.0/src/objs/chkslang.o new file mode 100644 index 0000000..e10bb19 Binary files /dev/null and b/vendor/most-5.1.0/src/objs/chkslang.o differ diff --git a/vendor/most-5.1.0/src/objs/cmd.o b/vendor/most-5.1.0/src/objs/cmd.o new file mode 100644 index 0000000..aa792a9 Binary files /dev/null and b/vendor/most-5.1.0/src/objs/cmd.o differ diff --git a/vendor/most-5.1.0/src/objs/display.o b/vendor/most-5.1.0/src/objs/display.o new file mode 100644 index 0000000..d4b53ff Binary files /dev/null and b/vendor/most-5.1.0/src/objs/display.o differ diff --git a/vendor/most-5.1.0/src/objs/edit.o b/vendor/most-5.1.0/src/objs/edit.o new file mode 100644 index 0000000..8a0d6ce Binary files /dev/null and b/vendor/most-5.1.0/src/objs/edit.o differ diff --git a/vendor/most-5.1.0/src/objs/file.o b/vendor/most-5.1.0/src/objs/file.o new file mode 100644 index 0000000..2625438 Binary files /dev/null and b/vendor/most-5.1.0/src/objs/file.o differ diff --git a/vendor/most-5.1.0/src/objs/help.o b/vendor/most-5.1.0/src/objs/help.o new file mode 100644 index 0000000..293d7fd Binary files /dev/null and b/vendor/most-5.1.0/src/objs/help.o differ diff --git a/vendor/most-5.1.0/src/objs/keym.o b/vendor/most-5.1.0/src/objs/keym.o new file mode 100644 index 0000000..8e6a83b Binary files /dev/null and b/vendor/most-5.1.0/src/objs/keym.o differ diff --git a/vendor/most-5.1.0/src/objs/keyparse.o b/vendor/most-5.1.0/src/objs/keyparse.o new file mode 100644 index 0000000..51dde70 Binary files /dev/null and b/vendor/most-5.1.0/src/objs/keyparse.o differ diff --git a/vendor/most-5.1.0/src/objs/line.o b/vendor/most-5.1.0/src/objs/line.o new file mode 100644 index 0000000..ce97058 Binary files /dev/null and b/vendor/most-5.1.0/src/objs/line.o differ diff --git a/vendor/most-5.1.0/src/objs/main.o b/vendor/most-5.1.0/src/objs/main.o new file mode 100644 index 0000000..9d37fe3 Binary files /dev/null and b/vendor/most-5.1.0/src/objs/main.o differ diff --git a/vendor/most-5.1.0/src/objs/most b/vendor/most-5.1.0/src/objs/most new file mode 100755 index 0000000..1e99ddf Binary files /dev/null and b/vendor/most-5.1.0/src/objs/most differ diff --git a/vendor/most-5.1.0/src/objs/most.o b/vendor/most-5.1.0/src/objs/most.o new file mode 100644 index 0000000..99c50b9 Binary files /dev/null and b/vendor/most-5.1.0/src/objs/most.o differ diff --git a/vendor/most-5.1.0/src/objs/search.o b/vendor/most-5.1.0/src/objs/search.o new file mode 100644 index 0000000..8d2c24b Binary files /dev/null and b/vendor/most-5.1.0/src/objs/search.o differ diff --git a/vendor/most-5.1.0/src/objs/sysdep.o b/vendor/most-5.1.0/src/objs/sysdep.o new file mode 100644 index 0000000..19bc79c Binary files /dev/null and b/vendor/most-5.1.0/src/objs/sysdep.o differ diff --git a/vendor/most-5.1.0/src/objs/window.o b/vendor/most-5.1.0/src/objs/window.o new file mode 100644 index 0000000..56c9c29 Binary files /dev/null and b/vendor/most-5.1.0/src/objs/window.o differ diff --git a/vendor/most-5.1.0/src/search.c b/vendor/most-5.1.0/src/search.c new file mode 100644 index 0000000..404ee70 --- /dev/null +++ b/vendor/most-5.1.0/src/search.c @@ -0,0 +1,667 @@ +/* -*- mode: C; mode: fold -*- */ +/* + This file is part of MOST. + + Copyright (c) 1991, 1999, 2002, 2005-2018, 2019 John E. Davis + + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the Free + Software Foundation; either version 2 of the License, or (at your option) + any later version. + + This program is distributed in the hope that 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. +*/ +#include "config.h" + +#include +#include +#include +#include + +#include "most.h" +#include "window.h" +#include "line.h" +#include "file.h" +#include "display.h" +#include "search.h" + +/* Note!!! The regular expression searches may not work. I have not + * tested them. + * FIXME!!! This whole thing needs to be rewritten. It is a mess. + */ + +int Most_Case_Sensitive = 0; +char Most_Search_Str[256]; +int Most_Search_Dir = 1; + +#include "jdmacros.h" + +typedef struct Search_Type_ Search_Type; +struct Search_Type_ +{ + void *cd; + unsigned char *(*fsearch_method) (Search_Type *, unsigned char *, unsigned char *, unsigned char *); + unsigned char *(*bsearch_method) (Search_Type *, unsigned char *, unsigned char *, unsigned char *); + void (*close_method)(Search_Type *); +}; + + +static unsigned char Ascii_Upper[256]; + +static void bs_search_init (void) +{ + static int inited = 0; + unsigned int i; + + if (inited) return; + for (i = 0; i < 256; i++) Ascii_Upper[i] = i; + for (i = 'a'; i <= 'z'; i++) Ascii_Upper[i] = (i - 32); + inited = 1; +} + +#define UPCASE(ch) (Ascii_Upper[(ch)]) + +#define CHAR_EQS(a,b) \ + (((a) == (b)) || (!Most_Case_Sensitive && (UPCASE(a) == UPCASE(b)))) + +static int is_ansi_escape (unsigned char **begp, unsigned char *end) +{ + unsigned char *p, ch; + + p = *begp; + if ((p == end) || (*p++ != '[')) return 0; + + /* Look for "ESC X m", where X is one of: + * X = "" + * X = digit + * X = digit ; digit ... + */ + ch = *p++; + while (isdigit (ch)) + { + while ((p < end) && isdigit (*p)) + p++; + + if (p == end) + return 0; + + ch = *p++; + if (ch == 'm') + break; + + if ((ch != ';') || (p == end)) + return 0; + + ch = *p++; + } + if (ch != 'm') + return 0; + + *begp = p; + return 1; +} + +static int is_rev_ansi_escape (unsigned char *beg, unsigned char **endp) +{ + unsigned char *p, ch; + + p = *endp; + if (p == beg) + return 0; + + ch = *p--; + while (isdigit (ch)) + { + while ((p > beg) && isdigit (*p)) + p--; + + if (p == beg) + return 0; + + ch = *p--; + + if (ch == '[') + break; + + if ((ch != ';') || (p == beg)) + return 0; + + ch = *p--; + } + + if ((ch != '[') || (p < beg) || (*p != 033)) + return 0; + + *endp = p-1; + return 1; +} + +/* These routines have special processing for ANSI escape sequence and backspace handling. + * For example, "hello world" may occur as: + * plain: hello world + * underlined: h_e_l_l_o_ world + * underlined: _h_e_l_l_o world + * bold: hheelllloo world + * ansi: hello world + * ansi: hello world + */ + +/* This routine returns the 1 + position of first match of key in str. + * searches from beg up to but not including end. Handles backspace, etc + */ +static unsigned char * +bs_fsearch (Search_Type *st, + unsigned char *beg, unsigned char *end, + unsigned char *key) +{ + unsigned char ch, ch1, ch1up; + unsigned char *pos; + int cis, key_len, j, str_len; + + (void) st; + key_len = strlen ((char *)key); + if (key_len == 0) + return Most_Eob; + + str_len = (int) (end - beg); + if (str_len < key_len) return (Most_Eob); + + cis = (Most_Case_Sensitive == 0); + ch1 = key[0]; + ch1up = UPCASE(ch1); + + while (1) + { + /* Find first character that matches */ + while (1) + { + if (beg == end) return Most_Eob; + + ch = *beg++; + if ((ch == ch1) + || (cis && (ch1up == UPCASE(ch)))) + break; + } + + /* so we have a position of possible match */ + j = 1; + + pos = beg; /* save this position so we start from here again */ + + while (1) + { + if (j == key_len) + return pos - 1; + + if (beg == end) + break; + + ch = *beg++; + + /* FIXME: This only works for x^Hx but not x^Hx^Hx... + * It is probably better to skip all the ^H characters + * until the end. That is, regard "a^Hb^Hc" as 'c'. + */ + if ((ch == 8) + && (beg + 1 < end) + && (CHAR_EQS(key[j - 1], *beg) + || (*beg == '_'))) + { + ch = *(beg + 1); + beg += 2; + } + else if ((ch == '_') && (beg + 1 < end)) + { + ch = *beg++; + if (ch == 8) ch = *beg++; + else + { + ch = '_'; + beg--; + } + } + else if ((ch == 033) && is_ansi_escape (&beg, end)) + continue; + + if (!CHAR_EQS(ch, key[j])) + break; + + j++; + } + + beg = pos; + } +} + +/* + * Search backwards in the buffer "beg" up to, but not including "end" for + * pattern "key". It handles backspaces, etc + */ +static unsigned char * +bs_bsearch (Search_Type *st, + unsigned char *beg, unsigned char *end, + unsigned char *key) +{ + unsigned char ch, ch1, ch1up; + unsigned char *pos; + int key_len,j, str_len; + int cis; + + (void) st; + key_len = strlen ((char *)key); + if (key_len == 0) return Most_Eob; + + str_len = (int) (end - beg); + if (str_len < key_len) return Most_Eob; + + ch1 = key[key_len-1]; + ch1up = UPCASE(ch1); + cis = (Most_Case_Sensitive == 0); + + while (1) + { + while (1) + { + if (end < beg) + return Most_Eob; + + ch = *end--; + if ((ch == ch1) + || (cis && (ch1up == UPCASE(ch)))) + break; + } + + pos = end; /* save this position so we start from here again */ + + j = key_len - 2; + + while (1) + { + if (j < 0) + return end + 1; + if (end < beg) + break; + + ch = *end--; + + if ((ch == 8) + && (end >= beg + 1) + && (CHAR_EQS(key[j + 1], *end) + || (*end == '_'))) + { + ch = *(end - 1); + end -= 2; + } + else if ((ch == '_') + && (end >= beg + 1)) + { + ch = *end--; + if (ch == 8) ch = *end--; + else + { + ch = '_'; + end++; + } + } + else if ((ch == 'm') && is_rev_ansi_escape (beg, &end)) + continue; + + if (!CHAR_EQS(ch, key[j])) + break; + + j--; + } + end = pos; + } +} + +static int bs_open_search (Search_Type *st, char *key) +{ + (void) key; + + bs_search_init (); + st->fsearch_method = bs_fsearch; + st->bsearch_method = bs_bsearch; + st->close_method = NULL; + st->cd = NULL; + return 0; +} + +static unsigned char *sl_fsearch (Search_Type *st, + unsigned char *beg, unsigned char *end, + unsigned char *key) +{ + unsigned char *p; + + (void) key; + if (NULL == (p = SLsearch_forward ((SLsearch_Type *)st->cd, beg, end))) + p = Most_Eob; + return p; +} + +static unsigned char *sl_bsearch (Search_Type *st, + unsigned char *beg, unsigned char *end, + unsigned char *key) +{ + unsigned char *p; + + (void) key; + if (NULL == (p = SLsearch_backward ((SLsearch_Type *)st->cd, beg, end, end))) + p = Most_Eob; + return p; +} + +static void sl_search_close (Search_Type *st) +{ + if (st->cd != NULL) + SLsearch_delete ((SLsearch_Type *) st->cd); +} + +static int sl_open_search (Search_Type *st, char *key) +{ + unsigned int flags = 0; + + if (Most_Case_Sensitive == 0) flags |= SLSEARCH_CASELESS; + if (Most_UTF8_Mode) flags |= SLSEARCH_UTF8; + + if (NULL == (st->cd = SLsearch_new ((SLuchar_Type *) key, flags))) + return -1; + + st->fsearch_method = sl_fsearch; + st->bsearch_method = sl_bsearch; + st->close_method = sl_search_close; + return 0; +} + +static int +do_search_internal (Search_Type *st, + unsigned char *from, int repeat, MOST_INT *col) +{ + /* return the line match was found as well as line number, + * search from i on; assume that line_array match the i so we need + * no initial lookup */ + + int test; + MOST_INT save_line, the_col, row, s_len; + char string[300]; + unsigned char *pos, *eob; + unsigned int save_ofs; + unsigned int found_ofs; + + if (*Most_Search_Str == 0) + { + most_message("Search string not specified.",1); + return -1; + } + + if ((from < Most_Beg) || (from > Most_Eob)) return -1; + + save_ofs = Most_C_Offset; + save_line = Most_C_Line; + found_ofs = Most_Eob - Most_Beg; + *col = 0; + s_len = strlen (Most_Search_Str); + pos = from; + + eob = Most_Eob; + + test = repeat && (pos < Most_Eob) && (pos >= Most_Beg); + while(test) + { + if (Most_Search_Dir == 1) + { + while (1) + { + unsigned int pos_ofs; + + pos = (*st->fsearch_method)(st, pos, Most_Eob, (unsigned char*) Most_Search_Str); + pos_ofs = (unsigned int) (Most_Eob - Most_Beg); + + if (pos < Most_Eob) + break; + + if (0 == most_read_file_dsc (10, 0)) + { + /* Pointer may be invalid after this call */ + pos = Most_Beg + pos_ofs; + break; + } + + /* This might need an adjustment */ + pos = Most_Beg + (pos_ofs - s_len); + if (pos < Most_Beg) pos = Most_Beg; + } + } + else + pos = (*st->bsearch_method)(st, Most_Beg, pos, (unsigned char *) Most_Search_Str); + + if (pos < Most_Eob) + { + repeat--; + found_ofs = pos - Most_Beg; + if (Most_Search_Dir == 1) + pos += s_len; + else pos--; + } + test = repeat && (pos < Most_Eob) && (pos >= Most_Beg); + if (SLKeyBoard_Quit) + { + most_message ("Search Interrupted.", 1); + break; + } + } + + if (eob != Most_Eob) + Most_Num_Lines = most_count_lines (Most_Beg, Most_Eob); + + if (repeat) /* not found */ + { + *col = 0; + + (void) sprintf(string,"Search failed: %s",Most_Search_Str); + most_message(string,1); + row = -1; + } + else /* if ( !Most_T_Opt && !Most_B_Opt) */ /* expand tabs to get col correct */ + { + most_find_row_column(Most_Beg + found_ofs, &row, &the_col); + if (Most_B_Opt) *col = the_col + 52; + else + *col = 1 + most_apparant_distance(Most_Beg + found_ofs); + } + + Most_C_Offset = save_ofs; + Most_C_Line = save_line; + if (row > 0) Most_Curs_Offset = found_ofs; + + return row; +} + +static int search_internal (Search_Type *st, unsigned char *from, int repeat, MOST_INT *colp) +{ + int status; + + status = do_search_internal (st, from, repeat, colp); + + if (st->close_method != NULL) + (st->close_method)(st); + + return status; +} + +static int simple_search (unsigned char *from, int repeat, MOST_INT *colp) +{ + Search_Type st; + + if (Most_V_Opt || Most_B_Opt) + { + /* Nothing special about the ^H and _ chars. User faster SLsearch */ + if (-1 == sl_open_search (&st, Most_Search_Str)) + return -1; + } + else if (-1 == bs_open_search (&st, Most_Search_Str)) + return -1; + + return search_internal (&st, from, repeat, colp); +} + + +static void re_search_close (Search_Type *st) +{ + if (st->cd != NULL) + SLregexp_free ((SLRegexp_Type *) st->cd); +} + +static unsigned char * +re_fsearch (Search_Type *st, + unsigned char *beg, unsigned char *end, + unsigned char *key) +{ + SLRegexp_Type *re; + unsigned char *p; + unsigned int flags; + + (void) key; + + re = (SLRegexp_Type *)st->cd; + (void) SLregexp_get_hints (re, &flags); + + while (beg < end) + { + unsigned char *line_end = beg; + + while (line_end < end) + { + unsigned char ch = *line_end++; + if (ch == '\n') break; + } + + p = (unsigned char *)SLregexp_match (re, (char *)beg, (line_end - beg)); + if (p != NULL) + { + if ((0 == (flags & SLREGEXP_HINT_BOL)) + || (p != beg) + || (beg == Most_Beg) + || (*(beg - 1) == '\n')) + return p; + } + beg = line_end; + } + + return Most_Eob; +} + +static unsigned char * +re_bsearch (Search_Type *st, + unsigned char *beg, unsigned char *end, + unsigned char *key) +{ + SLRegexp_Type *re; + unsigned char *line_end, *eob; + unsigned int flags; + + (void) key; + re = (SLRegexp_Type *)st->cd; + (void) SLregexp_get_hints (re, &flags); + + line_end = end; + eob = Most_Eob; + while (line_end < eob) + { + if (*line_end == '\n') + break; + line_end++; + } + + while (end > beg) + { + unsigned char *p, *match; + unsigned char *line = end; + while (line > beg) + { + line--; + if (*line == '\n') + { + line++; + break; + } + } + + /* line is now at the start of a line */ + if (NULL != (match = (unsigned char *)SLregexp_match (re, (char *)line, line_end-line))) + { + if (match >= end) + { + /* Match occurs to right of boundary. Try previous line */ + end = line_end = line-1; + continue; + } + + if (flags & SLREGEXP_HINT_BOL) + return match; + + /* t tt z t t t z */ + /* Find match closest to end */ + while ((line < end) + && (NULL != (p = (unsigned char *)SLregexp_match (re, (char *)line, (line_end - line)))) + && (p < end)) + { + match = p; + line++; + } + return match; + } + + end = line-1; + line_end = end; + } + + return Most_Eob; +} + + +static int regexp_search (unsigned char *from, int repeat, MOST_INT *colp) +{ + Search_Type st; + SLRegexp_Type *re; + char *pattern; + unsigned int flags; + + pattern = Most_Search_Str; + + flags = 0; + if (Most_Case_Sensitive == 0) flags |= SLREGEXP_CASELESS; + + re = SLregexp_compile (pattern, flags); + if (re == NULL) + return -1; + + (void) SLregexp_get_hints (re, &flags); + if (flags & SLREGEXP_HINT_OSEARCH) + { + SLregexp_free (re); + return simple_search (from, repeat, colp); + } + + st.cd = (void *)re; + st.fsearch_method = re_fsearch; + st.bsearch_method = re_bsearch; + st.close_method = re_search_close; + + return search_internal (&st, from, repeat, colp); +} + +int most_search (unsigned char *from, int repeat, MOST_INT *colp) +{ + if (Most_Do_Regexp_Search) + return regexp_search (from, repeat, colp); + + return simple_search (from, repeat, colp); +} diff --git a/vendor/most-5.1.0/src/search.h b/vendor/most-5.1.0/src/search.h new file mode 100644 index 0000000..38b6975 --- /dev/null +++ b/vendor/most-5.1.0/src/search.h @@ -0,0 +1,32 @@ +#ifndef _DAVIS_SEARCH_H_ +# define _DAVIS_SEARCH_H_ +/* + This file is part of MOST. + + Copyright (c) 1991, 1999, 2002, 2005-2018, 2019 John E. Davis + + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the Free + Software Foundation; either version 2 of the License, or (at your option) + any later version. + + This program is distributed in the hope that 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. +*/ +# include +# include + +extern int Most_Case_Sensitive; +extern int Most_Do_Regexp_Search; +extern int Most_Search_Dir; +#define MOST_SEARCH_BUF_LEN 256 +extern char Most_Search_Str[MOST_SEARCH_BUF_LEN]; +extern int most_search(unsigned char *, int, MOST_INT *); +#endif + diff --git a/vendor/most-5.1.0/src/sysconf.h b/vendor/most-5.1.0/src/sysconf.h new file mode 100644 index 0000000..15d7577 --- /dev/null +++ b/vendor/most-5.1.0/src/sysconf.h @@ -0,0 +1,107 @@ +/* src/sysconf.h. Generated from config.hin by configure. */ +/* -*- C -*- */ + +/* Note: this is for authentic unix systems only. + * See mostconf.h for other systems. + */ + +#ifndef MOST_CONFIG_H +#define MOST_CONFIG_H + +/* Define if you want the MMAP support */ +#define USE_MMAP 1 + +/* define if you have long long type */ +#define HAVE_LONG_LONG 1 + +/* #undef off_t */ +/* #undef size_t */ +#define SIZEOF_OFF_T 8 +#define SIZEOF_SHORT 2 +#define SIZEOF_INT 4 +#define SIZEOF_LONG 8 +#define SIZEOF_FLOAT 4 +#define SIZEOF_DOUBLE 8 +#define SIZEOF_LONG_LONG 8 + +/* The following set defines may be necessary to activate long file support */ +/* #undef _FILE_OFFSET_BITS */ +/* #undef _LARGE_FILES */ +/* #undef _LARGEFILE_SOURCE */ + +/* define if you have stdlib.h */ +#define HAVE_STDLIB_H 1 + +/* define if you have unistd.h */ +#define HAVE_UNISTD_H 1 + +/* define if you have memory.h */ +#define HAVE_MEMORY_H 1 + +/* define if you have malloc.h */ +#define HAVE_MALLOC_H 1 + +/* define if you have memset */ +#define HAVE_MEMSET 1 + +/* define if you have memcpy */ +#define HAVE_MEMCPY 1 + +/* define if you have this. */ +#define HAVE_GETCWD 1 + +#define HAVE_MMAP 1 + +#define HAVE_TCGETPGRP 1 +#define HAVE_GETPGRP 1 + +#define HAVE_DIRENT_H 1 +/* #undef HAVE_SYS_NDIR_H */ +/* #undef HAVE_SYS_DIR_H */ +/* #undef HAVE_NDIR_H */ + +#define HAVE_SNPRINTF 1 +#define HAVE_SYS_MMAN_H 1 + +/* #undef mode_t */ +/* #undef pid_t */ +/* #undef uid_t */ +/* #undef pid_t */ + + +#ifdef _AIX +# ifndef _POSIX_SOURCE +# define _POSIX_SOURCE +# endif +# ifndef _ALL_SOURCE +# define _ALL_SOURCE 1 +# endif +/* This may generate warnings but the fact is that without it, xlc will + * INCORRECTLY inline many str* functions. */ +/* # undef __STR__ */ +#endif + +#define MAX_PATHLEN 1024 +#if defined(USE_MMAP) && defined(HAVE_MMAP) && defined(HAVE_SYS_MMAN_H) +# define MOST_HAS_MMAP 1 +#else +# define MOST_HAS_MMAP 0 +#endif + +#if defined(HAVE_LONG_LONG) && (SIZEOF_OFF_T == SIZEOF_LONG_LONG) && (SIZEOF_LONG_LONG > SIZEOF_LONG) +typedef long long MOST_INT; +typedef unsigned long long MOST_UINT; +# define MOST_INT_D_FMT "%lld" +#else +# if (SIZEOF_OFF_T == SIZEOF_INT) +typedef int MOST_INT; +typedef unsigned int MOST_UINT; +# define MOST_INT_D_FMT "%d" +# else +typedef long MOST_INT; +typedef unsigned long MOST_UINT; +# define MOST_INT_D_FMT "%ld" +# endif +#endif + +#endif /* MOST_CONFIG_H */ diff --git a/vendor/most-5.1.0/src/sysdep.c b/vendor/most-5.1.0/src/sysdep.c new file mode 100644 index 0000000..88a9d55 --- /dev/null +++ b/vendor/most-5.1.0/src/sysdep.c @@ -0,0 +1,773 @@ +/* + This file is part of MOST. + + Copyright (c) 1991, 1999, 2002, 2005-2018, 2019 John E. Davis + + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the Free + Software Foundation; either version 2 of the License, or (at your option) + any later version. + + This program is distributed in the hope that 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. +*/ +#include "config.h" +/* + * HISTORY + * {1} 19-Mar-91 Henk D. Davids + * History started. Added default input file name so you do not + * have to specify name or type if you want it to be *. + * Changes indicated by "-hdd" in comment. + * + * 2. 4/4/91 John E. Davis + * I added code to read the teminal size for unix systems-- at least it + * works on a sun4 (BSD ?). In addition I have also recently added file + * deletion code for both unix and vms. + */ +#ifdef VMS +# include +# include +# include +# include +# include +# include +# include +# include +# include + +/* #include */ + +#endif /* VMS */ + +#ifdef HAVE_STDLIB_H +# include +#endif + +#include +#include "jdmacros.h" + +#ifdef unix +# include +# ifdef SYSV +# include +# include +# endif +# include +#endif + +#ifdef __os2__ +# include +#endif + +#ifdef __WIN32__ +#include +/* Sleep is defined badly in MSVC... */ +# ifdef _MSC_VER +# define sleep(n) _sleep((n)*1000) +# else +# ifdef sleep +# undef sleep +# endif +# define sleep(x) if(x)Sleep((x)*1000) +# endif +#endif + +#include + +#include "sysdep.h" +#include "display.h" +#include "window.h" +#include "most.h" + +#ifdef VMS +typedef struct +{ + /* I/O status block */ + short i_cond; /* Condition value */ + short i_xfer; /* Transfer count */ + long i_info; /* Device information */ +} +iosb; + +typedef struct +{ + /* Terminal characteristics */ + char t_class; /* Terminal class */ + char t_type; /* Terminal type */ + short t_width; /* Terminal width in characters */ + long t_mandl; /* Terminal's mode and length */ + long t_extend; /* Extended terminal characteristics */ +} +termchar; + +static short TTY_CHANNEL_GLOBAL; +static int zero = 0; + +#else +int TTY_DESCR; +#endif /* VMS */ + +/* + * + * + * SHELL COMMANDS + * + */ + +#ifdef VMS + +/* these two from emacs source */ +# if 0 +static define_logical_name (char *varname, char *string) +{ + static char sstring[200], svarname[200]; + + struct dsc$descriptor_s strdsc = + {strlen (string), DSC$K_DTYPE_T, DSC$K_CLASS_S, sstring}; + struct dsc$descriptor_s envdsc = + {strlen (varname), DSC$K_DTYPE_T, DSC$K_CLASS_S, svarname}; + struct dsc$descriptor_s lnmdsc = + {7, DSC$K_DTYPE_T, DSC$K_CLASS_S, "LNM$JOB"}; + + strcpy(sstring, string); strcpy(svarname, varname); + + LIB$SET_LOGICAL (&envdsc, &strdsc, &lnmdsc, 0, 0); +} + +static delete_logical_name (char *varname) +{ + struct dsc$descriptor_s envdsc = + {strlen (varname), DSC$K_DTYPE_T, DSC$K_CLASS_S, varname}; + struct dsc$descriptor_s lnmdsc = + {7, DSC$K_DTYPE_T, DSC$K_CLASS_S, "LNM$JOB"}; + + LIB$DELETE_LOGICAL (&envdsc, &lnmdsc); +} + +int most_do_emacs_command() +{ + unsigned long pid; + char *pidstr; + + if((pidstr = getenv("EMACS_PID")) != NULL) + { + (void) sscanf(pidstr,"%X",&pid); + if (lib$attach(&pid) == SS$_NORMAL) /* we attach to emacs */ + return(1); + else + return(0); + /* printf("Can't attach to pid %X\n",pid); */ + } + else return(0); +} +# endif /* if 0 */ + +static unsigned long SHELL_PID = 0; + +/* returns 0 on success */ +int most_do_shell_command() +{ + /* here we try to attach to the parent otherwise just spawn a new one */ + unsigned long parent_pid; + unsigned long status = 0; + char str[80]; + + $DESCRIPTOR(MOST_$_descr, "MOST > "); + + if (Most_Secure_Mode) + { + most_message ("Spawning not permitted in secure mode.", 1); + return 0; + } + + parent_pid = getppid(); + + if (parent_pid && (parent_pid != 0xffffffffU)) + /* we attach to parent */ + status = lib$attach(&parent_pid); + + else if (SHELL_PID && (SHELL_PID != 0xffffffffU)) + /* try to attach to previous shell */ + status = lib$attach (&SHELL_PID); + + if (status != SS$_NORMAL) /* others fail so spawn a new shell */ + { + status = 0; + SLtt_write_string("Spawning MOST DCL SUBPROCESS (Logout when finished)..."); + lib$spawn(0,0,0,0,0,&SHELL_PID,&status,0,0,0,&MOST_$_descr); + /* if we attach back, status may come back unchanged */ + if ((status != 0) && (status != SS$_NORMAL)) + { + sprintf(str,"Unable to spawn subprocess. Error = %X", status); + most_message(str,1); + return(0); + } + } + most_message(" ",0); /* make sure message window is restored */ + return(1); +} + +#endif /* VMS */ + +/* + * FILE IO + * + */ + +#ifdef VMS +int most_expand_file_name(char *file,char *expanded_file) +{ + unsigned long status; + static int context = 0, len = 0; + static char inputname[MAX_PATHLEN] = ""; + $DESCRIPTOR(file_desc,inputname); + $DESCRIPTOR(default_dsc,"SYS$DISK:[]*.*;"); + static struct dsc$descriptor_s result = + {0, DSC$K_DTYPE_T, DSC$K_CLASS_D, NULL}; + + if (strcmp(inputname, file)) + { + if (context) + { + lib$find_file_end(&context); + } + context = 0; + strcpy(inputname, file); + len = strlen(inputname); + } + file_desc.dsc$w_length = len; + + status = lib$find_file(&file_desc,&result,&context, + &default_dsc,0,0,&zero); + + if (status == RMS$_NORMAL) + { + memcpy(expanded_file, result.dsc$a_pointer, result.dsc$w_length); + expanded_file[result.dsc$w_length] = '\0'; + } + else + expanded_file[0] = '\0'; /* so file comes back as zero width */ + + return status; +} +#endif /* VMS */ + +/* + * + * + * Terminal IO + * + */ + +#ifdef VMS +/* + * Exit Handler Control Block + */ +static struct argument_block +{ + int forward_link; + int (*exit_routine)(); + int arg_count; + int *status_address; + int exit_status; +} +Exit_Block = +{ + 0, + NULL, + 1, + &Exit_Block.exit_status, + 0 +}; + +#endif /* VMS */ + +#ifdef unix + +# include + +# if !defined(sun) +# include +# endif + +# ifndef NO_UNISTD_H +# include +# endif + +# if HAS_TERMIOS +# include +# endif +# ifdef SYSV +# include +# include +# include +# include +# endif +# include +# include +# include + +#if defined(SIGHUP) && !defined(IBMPC_SYSTEM) +static void unix_hangup(int sig) +{ + most_exit_error ("most: Exiting on signal %d.", sig); +} + +#endif + +#endif /* unix */ + +static int Want_Window_Size_Change; +static int Most_TTY_Inited = 0; + +#ifdef REAL_UNIX_SYSTEM +static int handle_interrupts (void) +{ + if (Want_Window_Size_Change) + most_resize_display (); + + return 0; +} +#endif + +#ifdef SIGWINCH +static void sigwinch_handler (int sig) +{ + (void) sig; + Want_Window_Size_Change = 1; + (void) SLsignal_intr (SIGWINCH, sigwinch_handler); +} +#endif + +#if defined(SIGBUS) && MOST_HAS_MMAP +static void sigbus_handler (int sig) +{ + (void) sig; + most_reset_tty (); + most_reset_display (); + + fprintf (stderr, "SIGBUS caught--- fatal error\n"); + if ((Most_Buf != NULL) + && Most_Buf->is_mmaped) + fprintf (stderr, "This may be due to a modified memory mapped file\n"); + + exit (1); +} +#endif + +void most_resize_display (void) +{ + Want_Window_Size_Change = 0; + + if (Most_Display_Inited == 0) + return; + + most_get_term_dimensions(&SLtt_Screen_Cols, &SLtt_Screen_Rows); + + if (Most_Win != NULL) + most_one_window (); +#if SLANG_VERSION > 10305 + SLsmg_reinit_smg (); +#else + SLsmg_reset_smg (); + SLsmg_init_smg (); +#endif + most_redraw_display (); +} + +static int init_tty (void) +{ +#if defined(REAL_UNIX_SYSTEM) + SLsig_block_signals (); +#endif + + if (-1 == SLang_init_tty (7, 0, 1)) + { + fprintf (stderr, "most: failed to init terminal.\n"); + exit (1); + } +#if !defined(IBMPC_SYSTEM) + SLtt_enable_cursor_keys (); +#endif +#if defined(REAL_UNIX_SYSTEM) + SLsig_unblock_signals (); + SLang_getkey_intr_hook = handle_interrupts; +#endif + return 0; +} + +void most_init_tty (void) +{ + int i; + if (Most_TTY_Inited) return; + + (void) init_tty (); +#if !defined(IBMPC_SYSTEM) + SLsig_block_signals (); +#endif + + for (i = 1; i < 32; i++) + { + switch (i) + { +#ifdef SIGHUP + case SIGHUP: +#endif +#ifdef SIGQUIT + case SIGQUIT: +#endif +#ifdef SIGTERM + case SIGTERM: +# ifdef REAL_UNIX_SYSTEM + SLsignal_intr (i, unix_hangup); +# else + (void) i; +# endif + break; +#endif + +#ifdef SIGWINCH + case SIGWINCH: + (void) SLsignal_intr (SIGWINCH, sigwinch_handler); + break; +#endif + +#if defined(SIGBUS) && MOST_HAS_MMAP + case SIGBUS: + (void) SLsignal_intr (SIGBUS, sigbus_handler); + break; +#endif + +#ifdef SIGCONT + case SIGCONT: +#endif +#ifdef SIGTSTP + case SIGTSTP: +#endif +#ifdef SIGINT + case SIGINT: +#endif +#ifdef SIGCHLD + case SIGCHLD: +#endif + default: + break; +#ifdef SIGPIPE + case SIGPIPE: + (void) SLsignal_intr (SIGPIPE, SIG_IGN); + break; +#endif + } + } + + SLang_set_abort_signal (NULL); + + Most_TTY_Inited = 1; +#if !defined(IBMPC_SYSTEM) + SLsig_unblock_signals (); +#endif +} + +void most_reset_tty (void) +{ + if (Most_TTY_Inited == 0) return; + SLang_reset_tty (); + Most_TTY_Inited = 0; +} + +int most_reinit_terminal (void) +{ + if (Most_TTY_Inited == 0) + return 0; + most_reset_tty (); + (void) init_tty (); + Most_TTY_Inited = 1; + return 0; +} + +/* slang uses select to wait for terminal input. If SIGINT is + * generated, then slang returns ^G and sets SLKeyBoard_Quit + * to 1 bypassing the read altogether. If most was used in + * conjunction with xargs (find . -print | xargs most) and ^G + * is pressed, a SIGINT will be generated killing xargs and + * leaving most an orphan unable to access the terminal. + * Unfortunately, the select call will continue to time-out + * causing most continue running in the background. To + * workaround this problem, exit if the terminal is not in the + * same process group as most. + */ +static void check_if_foreground (void) +{ +#if defined(HAVE_GETPGRP) && defined(HAVE_TCGETPGRP) + pid_t pgid = getpgrp (); + + if ((SLang_TT_Read_FD != -1) + && (pgid != tcgetpgrp (SLang_TT_Read_FD))) + { + most_exit_error ("\007Fatal Error: Most is not in the terminal's process group."); + } +#endif +} + +int most_getkey() +{ + unsigned int ch; + static int last_was_sigint; + + /* This non-sense involving last_was_sigint is to handle a race condition. + * The shell may not have had time to change the pgids, so sleep a bit + * here. Yea, its ugly and does not really solve the problem... + */ + if (last_was_sigint) + { + sleep (1); + check_if_foreground (); + last_was_sigint = 0; + } + + ch = SLang_getkey (); + if (ch == SLANG_GETKEY_ERROR) + most_exit_error ("most: getkey error."); + + if (SLKeyBoard_Quit) + { + check_if_foreground (); + last_was_sigint = 1; + } + SLKeyBoard_Quit = 0; + SLang_set_error (0); + return (int) ch; +} + +/* + * + * Misc Termial stuff + * + * + */ + +/* This is to get the size of the terminal */ +void most_get_term_dimensions(int *cols, int *rows) +{ + SLtt_get_screen_size (); + *rows = SLtt_Screen_Rows; + *cols = SLtt_Screen_Cols; +} + +/* returns 0 on failure, 1 on sucess */ +int most_delete_file(char *filename) +{ +#ifdef VMS + return (1 + delete(filename)); /* 0: sucess; -1 failure */ +#else + return(1 + remove(filename)); +#endif +} + +/* This routine converts unix type names to vms names */ +#ifdef VMS +static int locate(char ch, char *string) +{ + int i; + char c; + + i = 0; + while (c = string[i++], (c != ch) && (c != '\0')); + if (c == ch) return(i); else return (0); +} + +char *most_unix2vms(char *file) +{ + int i,device,j,first,last; + static char vms_name[MAX_PATHLEN]; + char ch; + + if (locate('[',file)) return(file); /* vms_name syntax */ + if (!locate('/',file)) return(file); /* vms_name syntax */ + + /* search for the ':' which means a device is present */ + device = locate(':',file); + + i = 0; + if (device) + { + while (ch = file[i], i < device) vms_name[i++] = ch; + } + j = i; + + /* go from the end looking for a '/' and mark it */ + i = strlen(file) - 1; + while(ch = file[i], ch != '/' && i-- >= 0); + if (ch == '/') + { + file[i] = ']'; + last = 0; + } + else last = 1; + + i = j; + vms_name[j++] = '['; + vms_name[j++] = '.'; + first = 0; + while(ch = file[i++], ch != '\0') + { + switch (ch) + { + case '.': + if (last) vms_name[j++] = '.'; + if (last) break; + ch = file[i++]; + if (ch == '.') + { + if (!first) j--; /* overwrite the dot */ + vms_name[j++] = '-'; + } + else if (ch == '/'); /* './' combinations-- do nothing */ + else if (ch == ']') + { + last = 1; + if (vms_name[j-1] == '.') j--; + vms_name[j++] = ']'; + } + + else vms_name[j++] = '.'; + break; + case '/': + if (first) + { + vms_name[j++] = '.'; + } + else + { + first = 1; + /* if '/' is first char or follows a colon do nothing */ + if ((i!=1) && (file[i-2] != ':')) + { + vms_name[j++] = '.'; + } + else j--; /* overwrite the '.' following '[' */ + } + break; + case ']': + last = 1; + if (vms_name[j-1] == '.') j--; + vms_name[j++] = ']'; + break; + default: + vms_name[j++] = ch; + } + } + return (vms_name); +} + +/* +main(int argc, char **argv) +{ + puts(unix2vms(argv[1])); +} +*/ + +#endif /* VMS */ + +#include + +char *most_get_time() +{ + time_t clk; + char *the_time; + + clk = time((time_t *) 0); + the_time = (char *) ctime(&clk); + /* returns the form Sun Sep 16 01:03:52 1985\n\0 */ + the_time[24] = '\0'; + return(the_time); +} + +void most_set_width (int width, int redraw) +{ +#ifdef IBMPC_SYSTEM + (void) width; (void) redraw; +#else +#ifdef VMS + short fd; + int status; + iosb iostatus; + static termchar tc; /* Terminal characteristics */ + $DESCRIPTOR( devnam, "SYS$ERROR"); +#else +# ifdef TIOCGWINSZ + struct winsize wind_struct; +# endif +#endif + + /* Switching physical terminal to narrow/wide mode.*/ + + if(width <= 80) + { + width = 80; + most_narrow_width(); + } + else + { + width = 132; + most_wide_width(); + } + SLtt_Screen_Cols = width; + +#ifdef VMS + /* Assign input to a channel */ + status = sys$assign(&devnam, &fd, 0, 0); + if ((status & 1) == 0) + exit(status); + /* Get current terminal characteristics */ + status = sys$qiow( /* Queue and wait */ + 0, /* Wait on event flag zero */ + fd, /* Channel to input terminal */ + IO$_SENSEMODE, /* Get current characteristic */ + &iostatus, /* Status after operation */ + 0, 0, /* No AST service */ + &tc, /* Terminal characteristics buf */ + sizeof(tc), /* Size of the buffer */ + 0, 0, 0, 0); /* P3-P6 unused */ + + /*set terminal characteristics */ + tc.t_width=width; + status = sys$qiow( /* Queue and wait */ + 0, /* Wait on event flag zero */ + fd, /* Channel to input terminal */ + IO$_SETMODE, /* Get current characteristic */ + &iostatus, /* Status after operation */ + 0, 0, /* No AST service */ + &tc, /* Terminal characteristics buf */ + sizeof(tc), /* Size of the buffer */ + 0, 0, 0, 0); /* P3-P6 unused */ + + if( (sys$dassgn(fd) & 1)==0) + exit(status); + + /* here we redraw the screen, on unix, we assume that the terminal + * driver sends the appropriate signal that most catches to redraw so we + * do not redraw because it is likely that screen will be redrawn twice */ + + if (redraw) + most_resize_display (); + +#else + (void) redraw; +# ifdef TIOCGWINSZ + /* this may need work on other unix-- works for sun4 */ + if (-1 != ioctl(TTY_DESCR,TIOCGWINSZ,&wind_struct)) + { + wind_struct.ws_col = width; + ioctl(TTY_DESCR,TIOCSWINSZ,&wind_struct); + } +# endif +#endif /* VMS */ +#endif /* NOT IBMPC_SYSTEM */ +} diff --git a/vendor/most-5.1.0/src/sysdep.h b/vendor/most-5.1.0/src/sysdep.h new file mode 100644 index 0000000..6492535 --- /dev/null +++ b/vendor/most-5.1.0/src/sysdep.h @@ -0,0 +1,51 @@ +#ifndef __DAVIS_SYSDEP_H__ +# define __DAVIS_SYSDEP_H__ +/* + This file is part of MOST. + + Copyright (c) 1991, 1999, 2002, 2005-2018, 2019 John E. Davis + + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the Free + Software Foundation; either version 2 of the License, or (at your option) + any later version. + + This program is distributed in the hope that 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. +*/ + +# include + +# if defined(sequent) || defined(apollo) +# define HAS_TERMIOS 0 +# else +# define HAS_TERMIOS 1 +# endif + +# ifdef VMS +extern int most_do_emacs_command(void); + +extern int most_do_shell_command(); +extern int most_expand_file_name(char *,char *); +extern char *most_unix2vms(char *); + +# endif /* VMS */ + +extern int most_reinit_terminal (void); +extern void most_init_tty(void); +extern void most_reset_tty(void); +extern int most_getkey(void); +extern void most_get_term_dimensions(int *, int *); +extern int most_delete_file(char *); +extern void most_set_width(int, int); +extern char *most_get_time(void); + +extern void most_resize_display (void); +#endif /* __DAVIS_SYSDEP_H__ */ + diff --git a/vendor/most-5.1.0/src/version.h b/vendor/most-5.1.0/src/version.h new file mode 100644 index 0000000..2e0bcac --- /dev/null +++ b/vendor/most-5.1.0/src/version.h @@ -0,0 +1,24 @@ +/* + This file is part of MOST. + + Copyright (c) 2006-2018, 2019 John E. Davis + + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the Free + Software Foundation; either version 2 of the License, or (at your option) + any later version. + + This program is distributed in the hope that 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. +*/ +#ifndef MOST_VERSION +#define MOST_VERSION 50100 + +#define MOST_VERSION_STR "5.1.0" +#endif /* MOST_VERSION */ diff --git a/vendor/most-5.1.0/src/w32conf.h b/vendor/most-5.1.0/src/w32conf.h new file mode 100644 index 0000000..31aa558 --- /dev/null +++ b/vendor/most-5.1.0/src/w32conf.h @@ -0,0 +1,39 @@ +/* -*- C -*- */ + +/* Note: this is for DJGPP and WIN32 systems only. + * See mostconf.h for other systems, e.g., Unix. + */ + +#ifndef MOST_CONFIG_H +# define MOST_CONFIG_H + +/* define if you have stdlib.h */ +# define HAVE_STDLIB_H 1 + +/* define if you have unistd.h */ +# define HAVE_UNISTD_H 1 + +/* define if you have memory.h */ +# define HAVE_MEMORY_H 1 + +/* define if you have malloc.h */ +# define HAVE_MALLOC_H 1 + +/* define if you have memset */ +# define HAVE_MEMSET 1 + +/* define if you have memcpy */ +# define HAVE_MEMCPY 1 + +/* define if you have this. */ +# define HAVE_GETCWD 1 + +# define HAVE_DIRENT_H 1 + +# define MAX_PATHLEN 1024 + +#define MOST_INT long +#define MOST_UINT unsigned long +#define MOST_INT_D_FMT "%ld" + +#endif /* MOST_CONFIG_H */ diff --git a/vendor/most-5.1.0/src/window.c b/vendor/most-5.1.0/src/window.c new file mode 100644 index 0000000..2575505 --- /dev/null +++ b/vendor/most-5.1.0/src/window.c @@ -0,0 +1,1048 @@ +/* + This file is part of MOST. + + Copyright (c) 1991, 1999, 2002, 2005-2018, 2019 John E. Davis + + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the Free + Software Foundation; either version 2 of the License, or (at your option) + any later version. + + This program is distributed in the hope that 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. +*/ +#include "config.h" + +#include + +#ifndef VMS +# include +#endif + +#ifdef HAVE_STDLIB_H +# include +#endif + +#ifdef HAVE_UNISTD_H +# include +#endif + +#include +#include "jdmacros.h" + +#include "window.h" +#include "search.h" +#include "display.h" +#include "most.h" +#include "sysdep.h" +#include "file.h" +#include "line.h" + +char *Most_Global_Msg = "Press `Q' to quit, `H' for help, and SPACE to scroll."; + +Most_Window_Type *Most_Win; +Most_Window_Type *Most_Top_Win; +int Most_Top_Line; /* row number of top window */ +int Most_Curs_Row; +int Most_Curs_Col; +int Most_Column = 1; +int Most_Restore_Width_To = 0; +char Most_Mini_Buf[256]; +unsigned long Most_Curs_Offset; + +static int Beep_Mini = 0; +static int Minibuffer_Selected; + +void most_message(char *what, int how) +{ + strcpy (Most_Mini_Buf,what); + if (how) Beep_Mini = 1; else Beep_Mini = 0; +} + +static char *Last_Message; +void most_select_minibuffer() +{ + SLsmg_gotorc (SLtt_Screen_Rows - 1, 0); + SLsmg_erase_eol (); + /* SLsmg_refresh (); */ + Last_Message = NULL; + Minibuffer_Selected = 1; +} + +void most_exit_minibuffer() +{ +#if 0 + SLsmg_gotorc (SLtt_Screen_Rows - 1, 0); + SLsmg_erase_eol (); +#endif + Minibuffer_Selected = 0; +} + +static void put_message_1 (char *what) +{ + most_select_minibuffer (); + SLsmg_write_string (what); + most_exit_minibuffer(); + Last_Message = what; +} + +void most_flush_message (char *msg) +{ + SLsmg_gotorc (SLtt_Screen_Rows - 1, 0); + SLsmg_write_string (msg); + SLsmg_erase_eol (); + SLsmg_refresh (); +} + +void most_put_message () +{ + if (Beep_Mini) SLtt_beep(); + + put_message_1 ((char *) Most_Mini_Buf); + + if (Beep_Mini) + { + SLsmg_refresh (); + /* wait half a second */ + if (SLang_input_pending (5)) + { + (void) most_getkey (); + SLKeyBoard_Quit = 0; + SLang_set_error (0); + } + } + Beep_Mini = 0; + *Most_Mini_Buf = 0; +} + +/* puts 'what in the minibuffer to be edited. */ +/* returns number of chars read */ + +SLang_RLine_Info_Type *Most_RLI; + +#if SLANG_VERSION < 20000 +typedef SLang_RLine_Info_Type SLrline_Type; + +static void rline_update (unsigned char *buf, int len, int col) +{ + SLsmg_gotorc (SLtt_Screen_Rows - 1, 0); + SLsmg_write_nchars ((char *) buf, len); + SLsmg_erase_eol (); + SLsmg_gotorc (SLtt_Screen_Rows - 1, col); + SLsmg_refresh (); +} +#else +static void rline_update (SLrline_Type *rli, char *prompt, + char *buf, unsigned int len, unsigned int point, + VOID_STAR client_data) +{ + int col; + + (void) client_data; + (void) rli; + + while (1) + { + SLsmg_gotorc (SLtt_Screen_Rows - 1, 0); + SLsmg_write_string (prompt); + SLsmg_write_nchars (buf, point); + col = SLsmg_get_column (); + SLsmg_write_nchars (buf + point, len - point); + if (col < SLtt_Screen_Cols) + break; + buf++; point--; len--; /* FIXME for UTF-8 */ + } + SLsmg_erase_eol (); + SLsmg_gotorc (SLtt_Screen_Rows - 1, col); + SLsmg_refresh (); +} +#endif + +#if SLANG_VERSION < 20000 +static SLang_RLine_Info_Type *init_readline (void) +{ + unsigned char *buf = NULL; + SLang_RLine_Info_Type *rli; + + if ((NULL == (rli = (SLang_RLine_Info_Type *) SLMALLOC (sizeof(SLang_RLine_Info_Type)))) + || (NULL == (buf = (unsigned char *) SLMALLOC (256)))) + { + fprintf(stderr, "malloc error.\n"); + exit(11); + } + + SLMEMSET ((char *) rli, 0, sizeof (SLang_RLine_Info_Type)); + rli->buf = buf; + rli->buf_len = 255; + rli->tab = 8; + rli->dhscroll = 20; + rli->getkey = most_getkey; + rli->tt_goto_column = NULL; + rli->update_hook = rline_update; + + if (SLang_init_readline (rli) < 0) + { + most_exit_error ("Unable to initialize readline library."); + } + + return rli; +} + +static char *SLrline_read_line (SLrline_Type *rli, char *prompt, unsigned int *lenp) +{ + int i; + + rli->prompt = prompt; + i = SLang_read_line (rli); + if (i < 0) + { + *lenp = 0; + return NULL; + } + *lenp = i; + return SLmake_string ((char *)rli->buf); +} + +static int SLrline_set_line (SLrline_Type *rli, char *what) +{ + strcpy ((char *)rli->buf, what); + return 0; +} +#define SLrline_save_line SLang_rline_save_line + +static int SLrline_set_point (SLrline_Type *rli, int point) +{ + rli->point = point; + return 0; +} + +#else +static SLang_RLine_Info_Type *init_readline (void) +{ + SLang_RLine_Info_Type *rli; + unsigned int flags = SL_RLINE_BLINK_MATCH; + + if (Most_UTF8_Mode) + flags |= SL_RLINE_UTF8_MODE; + + if (NULL == (rli = SLrline_open (SLtt_Screen_Cols, flags))) + return NULL; + + (void) SLrline_set_update_hook (rli, rline_update, NULL); + return rli; +} +#endif + +int most_read_from_minibuffer(char *prompt, char *stuff, char *what, unsigned int buflen) +{ + int i = 0; + char *buf; + unsigned int len; + + if (Most_RLI == NULL) + { + Most_RLI = init_readline (); + } +#if SLANG_VERSION < 20000 + Most_RLI->edit_width = SLtt_Screen_Cols - 1; + Most_RLI->prompt = prompt; + *Most_RLI->buf = 0; +#else + SLrline_set_display_width (Most_RLI, SLtt_Screen_Cols); +#endif + + most_select_minibuffer(); + + /* do not use default. The up arrow can always get it back. */ + if (stuff != NULL) + { + if (-1 == SLrline_set_line (Most_RLI, stuff)) + return -1; + + SLrline_set_point (Most_RLI, strlen (stuff)); + } + + buf = SLrline_read_line (Most_RLI, prompt, &len); + + if ((buf != NULL) && (0 == SLang_get_error()) && !SLKeyBoard_Quit) + { + SLrline_save_line (Most_RLI); + strncpy(what, (char *) buf, buflen); + what[buflen-1] = 0; + } + SLfree (buf); + + if (SLKeyBoard_Quit) i = -1; + SLang_set_error (0); + SLKeyBoard_Quit = 0; + + most_exit_minibuffer(); + + if (i == -1) most_message ("Aborted!", 1); + + return i; +} + +void most_clear_minibuffer() +{ + Most_Mini_Buf[0] = '\0'; + Beep_Mini = 0; + most_put_message (); +} + +void most_check_minibuffer () +{ + if (*Most_Mini_Buf) most_put_message (); + else + if (Last_Message != Most_Global_Msg) + put_message_1 (Most_Global_Msg); +} + +static int get_scroll(int *line) +{ + /* line is the line we want at the top of the window if possible */ + int dtop, dbot,n,top,bot,wsize; + + top = Most_Win->beg_line; + wsize = Most_Win->bot - Most_Win->top; /* actually 1 less than window size */ + bot = top + wsize; + + if ((*line == 1) && (top == 1)) + { + Most_Curs_Col = Most_Curs_Row = 1; + if (Most_C_Offset != 0) + { + Most_C_Offset = 0; + Most_C_Line = 1; + return 0; + } + most_message("Top of Buffer.",0); + return(0); + } + + /* handles endof file in a window */ + if ((bot > Most_Num_Lines) && *line > Most_C_Line) + { + *line = top; + most_message("End of Buffer.",1); + return(0); + } + + if (Most_Num_Lines <= wsize) /* short file */ + { + *line = 1; + return(0); + } + + dtop = top - 1; + dbot = Most_Num_Lines - bot; + n = *line - top; + + if ((n>0) && (dbot < n)) + { + n = dbot; + *line = top + n; + if (!n) most_message("End of buffer.",1); + } + else if ((n < 0) && (dtop + n < 0)) + { + n = -dtop; + *line = n + top; + if (!n) + { + Most_Curs_Col = Most_Curs_Row = 1; + if (Most_C_Offset != 0) + { + Most_C_Offset = 0; + Most_C_Line = 1; + return 0; + } + most_message("Top of buffer.",0); + } + } + return(n); +} + +static void check_dirty_flag (void) +{ + if (Most_Win->dirty_flag == 0) return; + + Most_Win->dirty_flag = 0; + /* + Most_Num_Lines = most_count_lines (Most_Beg, Most_Eob); + */ + Most_Win->n_lines = Most_Num_Lines; +} + +void most_update_window (int line) +{ + int save_line, save_col; + unsigned long save_offset; + + most_read_to_line (line); + check_dirty_flag (); + + if (Most_Column != Most_Win->col) + { + if (Most_Column < 1) Most_Column = 1; + if (Most_Column != Most_Win->col) + { + save_offset = Most_Curs_Offset; + save_line = Most_Curs_Row; + save_col = Most_Curs_Col; + most_redraw_window (); + most_update_status (); + Most_Win->curs_offset = Most_Curs_Offset = save_offset; + Most_Win->curs_line = Most_Curs_Row = save_line; + Most_Win->curs_col = Most_Curs_Col = save_col; + } + return; + } + + (void) get_scroll (&line); + + most_goto_line (line); + most_redraw_window (); + most_update_status (); +} + +/* updates current window as well as scroll lock ones */ +/* Although current window is update in an absolute fashion, scroll locked + ones are updated in a relative fashion */ +void most_update_windows (int line) +{ + int dline,flg; + Most_Window_Type *w; + + if (line == -1) + { + check_dirty_flag (); + line = Most_Num_Lines; + } + + dline = line - Most_C_Line; + most_update_window(line); + if (!Most_Win->lock) return; + flg = 0; + w = Most_Win; + while(Most_Win = Most_Win->next, Most_Win != w) + { + if (Most_Win->lock) + { + flg = 1; + most_set_window(Most_Win); + line = Most_C_Line + dline; + most_update_window(line); + } + } + Most_Win = w; + if (flg) most_set_window(Most_Win); +} + +void most_redraw_window (void) +{ + int n, r; + + check_dirty_flag (); + + n = Most_Win->bot - Most_Win->top; + + if ((Most_C_Line + n) > Most_Num_Lines) + most_goto_line (Most_Num_Lines - n); + + Most_Curs_Offset = Most_C_Offset; + Most_Win->curs_offset = Most_Win->top_offset = Most_Curs_Offset; + Most_Win->beg_line = Most_C_Line; + Most_Win->col = Most_Column; + Most_Win->curs_col = Most_Curs_Col = 1; + Most_Win->curs_line = Most_Curs_Row = 1; + + r = Most_Win->top; + most_goto_rc (r, 1); + + most_display_line (1); + + while (n--) + { + r++; + most_goto_rc (r, 1); + + if (most_forward_line(1)) + most_display_line(0); + else + SLsmg_erase_eol (); + } + + Most_C_Offset = Most_Win->top_offset; + Most_C_Line = Most_Win->beg_line; +} + +#define MOST_V_OPT 1 +#define MOST_T_OPT 2 +#define MOST_B_OPT 4 +#define MOST_S_OPT 8 +#define MOST_W_OPT 16 + +/* associates current window with current buffer */ +void most_save_win_flags(Most_Window_Type *w) +{ + w->flags = 0; + if (Most_V_Opt) w->flags |= MOST_V_OPT; + if (Most_B_Opt) w->flags |= MOST_B_OPT; + if (Most_T_Opt) w->flags |= MOST_T_OPT; + if (Most_W_Opt) w->flags |= MOST_W_OPT; + if (Most_S_Opt) w->flags |= MOST_S_OPT; + w->n_lines = Most_Num_Lines; + w->display = Most_Selective_Display; +} + +void most_window_buffer() +{ + Most_Win->beg_line = Most_C_Line; + Most_Win->top_offset = Most_C_Offset; + Most_Win->col = Most_Column; + Most_Win->buf = Most_Buf; + Most_Selective_Display = 0; + most_save_win_flags(Most_Win); + + Most_Curs_Row = Most_Win->curs_line = 1; + Most_Curs_Col = Most_Win->curs_col = 1; + Most_Curs_Offset = Most_Win->curs_offset = Most_Win->top_offset; +} + +static void restore_win_flags (void) +{ + Most_V_Opt = Most_Win->flags & MOST_V_OPT; + Most_B_Opt = Most_Win->flags & MOST_B_OPT; + Most_T_Opt = Most_Win->flags & MOST_T_OPT; + Most_W_Opt = Most_Win->flags & MOST_W_OPT; + Most_S_Opt = Most_Win->flags & MOST_S_OPT; + Most_Num_Lines = Most_Win->n_lines; + Most_Selective_Display = Most_Win->display; +} + +static Most_Window_Type *make_window(int r1,int r2) +{ + Most_Window_Type *neew; + + neew = (Most_Window_Type *) MOSTMALLOC(sizeof(Most_Window_Type)); + SLMEMSET ((char *) neew, 0, sizeof (Most_Window_Type)); +#if 0 + neew->status = (char *) MOSTMALLOC(256); + SLMEMSET (neew->status, 0, SLtt_Screen_Cols + 1); +#endif + neew->col = Most_Column; + neew->top = r1; + neew->bot = r2; + neew->lock = 0; + neew->buf = NULL; + most_save_win_flags(neew); + neew->dirty_flag = 1; + return(neew); +} + +int Most_Display_Inited = 0; + +static void error_hook (char *msg) +{ + most_message (msg, 1); +} + +void most_init_display () +{ + int h = SLtt_Screen_Rows; + + if (Most_Display_Inited) return; + Most_Display_Inited = 1; + + most_get_term_dimensions(&SLtt_Screen_Cols, &SLtt_Screen_Rows); + + if (Most_Win == NULL) + { + Most_Top_Win = Most_Win = make_window(1,SLtt_Screen_Rows - 2); + Most_Win->prev = Most_Win->next = Most_Win; + } + else if (h > SLtt_Screen_Rows) most_resize_display (); + else Most_Top_Win->prev->bot = SLtt_Screen_Rows - 2; + + SLsmg_init_smg (); + SLang_Error_Hook = error_hook; + + most_goto_rc (Most_Win->top,1); + Most_Display_Inited = 1; + /* SLsmg_refresh (); */ +} + +void most_reset_display() +{ + if (Most_Display_Inited == 0) return; + SLsmg_reset_smg (); + + if (Most_Restore_Width_To) + { + most_set_width(Most_Restore_Width_To, 0); + Most_Restore_Width_To = 0; + } + + Most_Display_Inited = 0; +} + +static void update_status1 (void) +{ + char info[256]; + char buf[32]; + char *file; + unsigned int len; + unsigned int num_chars; + unsigned int field_width, info_len; + unsigned char *eob; + int r; + MOST_INT x; + + eob = Most_Eob; +#if MOST_HAS_MMAP + if (Most_Buf->is_mmaped) + eob = Most_Beg + Most_Buf->mmap_size; +#endif + + if (eob == Most_Beg) x = 100; + else + { + x = Most_C_Offset * 100; + x = x / (eob - Most_Beg); + } + + if (Most_C_Line + (Most_Win->bot - Most_Win->top + 1) >= Most_Num_Lines) + x = 100; + + /* for files with end of file above the bottom row (due to window manipulations) */ + if (x > 100) x = 100; + + sprintf (info, "(" MOST_INT_D_FMT ",%d) " MOST_INT_D_FMT "%%", + Most_C_Line, Most_Column, x); + + r = Most_Win->bot + 1; + most_goto_rc (r,1); + + most_tt_reverse_video (); + + buf[0] = '-'; + if (Most_Win->lock) buf[1] = '*'; else buf[1] = '-'; + strcpy (buf + 2, " MOST: "); + + num_chars = strlen (buf); + SLsmg_write_nchars (buf, num_chars); + + /* So far num_chars have been written out. We would like to put the + * line number information about info_len charcters from the RHS of the + * screen. This leaves a field width of + * SLtt_Screen_Cols - (16 + num_chars) for the filename. + */ + info_len = strlen (info); + field_width = 12; + if (info_len > field_width) + field_width = info_len; + field_width = field_width + num_chars; + if (field_width > (unsigned int)SLtt_Screen_Cols) + field_width = 0; + else + field_width = (unsigned int)SLtt_Screen_Cols - field_width; + + file = Most_Win->buf->file; + len = strlen (file); + + if (len >= field_width) + { + /* Filename does not fit. So, only display the trailing characters + * of the Filename. Indicate this with ... + */ + if (field_width > 3) + { + buf[0] = '.'; + buf[1] = '.'; + buf[2] = '.'; + SLsmg_write_nchars (buf, 3); + + len += 3; + } + + file += (len - field_width); + } + SLsmg_write_string (file); + SLsmg_erase_eol (); + + most_goto_rc (r, num_chars + field_width + 1); + + SLsmg_write_nchars (info, info_len); + most_tt_normal_video(); +} + +void most_update_status (void) +{ + check_dirty_flag (); + + Most_C_Line = Most_Win->beg_line; + Most_C_Offset = Most_Win->top_offset; + /* most_set_scroll_region(1,SLtt_Screen_Rows); */ + update_status1(); + /* most_set_scroll_region(Most_Win->top,Most_Win->bot); */ + /* SLsmg_refresh (); */ +} + +/* splits window-- no screen update, does not affect scrolling region */ +int most_split_window (void) +{ + Most_Window_Type *neew; + int b2,t2,b1, line; + + b2 = Most_Win->bot; + b1 = (Most_Win->bot + Most_Win->top) / 2 - 1; + t2 = b1 + 2; + if ((b1 == Most_Win->top) || (t2 == b2)) return(0); + + /* line is top line of new window. */ + line = Most_Win->beg_line + t2 - Most_Win->top; + Most_Win->bot = b1; + neew = make_window(t2,b2); + /* add to ring */ + Most_Win->next->prev = neew; + neew->next = Most_Win->next; + neew->prev = Most_Win; + Most_Win->next = neew; + + neew->beg_line = line; + neew->buf = Most_Buf; +#if 0 + /* new window status line is at same position as old */ + strcpy(neew->status,Most_Win->status); +#endif + return(1); +} + +void most_two_windows() +{ + int line; + Most_Window_Type *nnew, *old; + if (!most_split_window()) return; + + old = Most_Win; + nnew = Most_Win->next; + line = nnew->beg_line; + if (line + nnew->bot - nnew->top > Most_Num_Lines) + { + most_other_window(1); + /* since split window left nnew window undefined... */ + Most_C_Offset = old->top_offset; + Most_C_Line = old->beg_line; + if (Most_Num_Lines <= nnew->bot - nnew->top + 1) + { + Most_C_Line = nnew->beg_line = 1; + Most_C_Offset = 0; + nnew->top_offset = 0; + most_redraw_window(); + most_update_status(); + } + else if (line > Most_Num_Lines) + { + most_goto_line(Most_Num_Lines - nnew->bot + nnew->top); + Most_Win->top_offset = Most_C_Offset; + Most_Win->beg_line = Most_C_Line; + most_redraw_window(); + most_update_status(); + } + else + { + most_goto_line(line); + Most_Win->top_offset = Most_C_Offset; + Most_Win->beg_line = Most_C_Line; + most_update_window(Most_Num_Lines - nnew->bot + nnew->top); + } + Most_Win->curs_line = 1; + Most_Win->curs_col = Most_Column; + Most_Win->curs_offset = Most_C_Offset; + most_other_window(-1); + } + else + { + Most_Win = nnew; + (void) most_forward_line(line - old->beg_line); + nnew->beg_line = Most_C_Line; + nnew->curs_line = 1; + nnew->curs_col = Most_Column; + nnew->top_offset = Most_C_Offset; + nnew->curs_offset = Most_C_Offset; + most_update_status(); + Most_Win = old; + } + most_update_status(); +} + +static void delete_other_windows (void) +{ + Most_Window_Type *w, *tmp; + + if (Most_Win->next == Most_Win) return; + w = Most_Win; + Most_Win = Most_Win->next; + /* delete other windows preserving the ring! */ + while (Most_Win != w) + { + most_free_window_buffer(); /* needs a ring */ + tmp = Most_Win->next; +#if 0 + /* if this is the bottom window, save its status line */ + if (tmp == Most_Top_Win) strcpy(w->status,Most_Win->status); +#endif + tmp->prev = Most_Win->prev; + Most_Win->prev->next = tmp; +#if 0 + SLFREE(Most_Win->status); +#endif + SLFREE(Most_Win); + Most_Win = tmp; + } + Most_Win = w; +} + +void most_one_window () +{ + /* Note: This is called from a SIGWINCH signal handler. As a result, make + * sure that top, bot is set. + */ + if (Most_Win->next != Most_Win) + delete_other_windows (); + + Most_Win->top = 1; + Most_Win->bot = SLtt_Screen_Rows - 2; + if (Most_Win->bot < 1) + Most_Win->bot = 1; + + Most_Top_Win = Most_Win; + most_redraw_window(); + most_update_status(); +} + +void most_set_window (Most_Window_Type *w) +{ + Most_Win = w; + + if (Most_Win->buf == NULL) + { + Most_Win->buf = Most_Buf; + if (Most_Buf == NULL) + return; + } + + most_switch_to_buffer(Most_Win->buf); + + Most_C_Offset = Most_Win->top_offset; + Most_Curs_Offset = Most_Win->curs_offset; + Most_Curs_Row = Most_Win->curs_line; + Most_Curs_Col = Most_Win->curs_col; + Most_C_Line = Most_Win->beg_line; + Most_Column = Most_Win->col; + restore_win_flags(); + check_dirty_flag (); + most_point_cursor (); +} + +void most_other_window(int n) +{ + if (!n) return; + Most_Win->top_offset = Most_C_Offset; + Most_Win->curs_offset = Most_Curs_Offset; + Most_Win->curs_line = Most_Curs_Row; + Most_Win->curs_col = Most_Curs_Col; + Most_Win->beg_line = Most_C_Line; + Most_Win->col = Most_Column; + + most_save_win_flags(Most_Win); + if (n < 0) + while (n++) Most_Win = Most_Win->prev; + else + while (n--) Most_Win = Most_Win->next; + most_set_window(Most_Win); +} + +/* kills window by moving lower window up */ +static void delete_as_top_window (void) +{ + int t = Most_Win->top; + + Most_Win->prev->next = Most_Win->next; + Most_Win->next->prev = Most_Win->prev; + + most_other_window(1); + Most_Win->top = t; + most_redraw_window(); + most_update_status(); +} + +/* free buffer for this window if no other windows are viewing it. */ +void most_free_window_buffer (void) +{ + Most_Window_Type *w; + Most_Buffer_Type *b; + + w = Most_Win->next; + + while(Most_Win != w) + { + if (Most_Win->buf == w->buf) return; + w = w->next; + } + b = w->buf; + if (b == NULL) return; + + most_close_buffer_file (b); + Most_Win->buf = NULL; + SLFREE(b); +} + +void most_free_windows (void) +{ + Most_Window_Type *w; + + while (Most_Win != NULL) + { + most_free_window_buffer (); + w = Most_Win->next; + w->prev = Most_Win->prev; + Most_Win->prev->next = w; +#if 0 + SLFREE (Most_Win->status); +#endif + SLFREE (Most_Win); + if (w == Most_Win) w = NULL; + Most_Win = w; + } + + Most_Buf = NULL; + Most_Beg = Most_Eob = NULL; + Most_C_Line = 0; + Most_Num_Lines = Most_C_Line = 0; +} + +void most_delete_window (void) +{ + int new_b; + Most_Window_Type *w; + + w = Most_Win; + if (Most_Win->next == Most_Win) return; + most_free_window_buffer(); + + if (Most_Win->next != Most_Top_Win) + { + if (Most_Win == Most_Top_Win) + { + delete_as_top_window (); + Most_Top_Win = Most_Win; /* not anymore, this one is */ + } + else + delete_as_top_window(); +#if 0 + SLFREE(w->status); +#endif + SLFREE(w); + return; + } + + new_b = Most_Win->bot; + most_other_window(-1); + Most_Win->bot = new_b; + most_redraw_window(); + +#if 0 + strcpy(Most_Win->status,w->status); /* share the same line */ +#endif + + Most_Win->next = w->next; + Most_Win->next->prev = Most_Win; + +#if 0 + SLFREE (w->status); +#endif + SLFREE(w); + + most_update_status(); +} + +void most_redraw_display (void) +{ + Most_Window_Type *w; + int n,t; + + SLsmg_cls (); + + Last_Message = NULL; + most_save_win_flags(Most_Win); + w = Most_Win; + do + { + Most_Win = Most_Win->next; + most_switch_to_buffer(Most_Win->buf); + Most_C_Offset = Most_Win->top_offset; + Most_C_Line = Most_Win->beg_line; + Most_Column = Most_Win->col; + + restore_win_flags(); + n = Most_Win->bot - Most_Win->top; + + check_dirty_flag (); + + t = Most_Win->top; + most_goto_rc(t, 1); + most_display_line(1); + + while (n--) + { + t++; + most_goto_rc (t, 1); + if (most_forward_line(1)) most_display_line(0); + } + Most_C_Line = Most_Win->beg_line; + Most_C_Offset = Most_Win->top_offset; + update_status1(); + } + while(Most_Win != w); + + most_set_window(w); + + if (Minibuffer_Selected) + { + most_select_minibuffer (); + SLtt_write_string ((char *) Most_Mini_Buf); + } + SLsmg_refresh (); +} + +void most_toggle_lock() +{ + Most_Win->lock = !(Most_Win->lock); + most_update_status(); +} + +void most_point_cursor (void) +{ + int r, c; + + c = Most_Curs_Col - Most_Column + 1; + r = Most_Curs_Row; + + if (r < 1) r = 1; + else if (r > (Most_Win->bot - Most_Win->top + 1)) + r = Most_Win->bot - Most_Win->top + 1; + + if (c > SLtt_Screen_Cols) c = SLtt_Screen_Cols; + else if (c < 1) c = 1; + + most_goto_rc (r + Most_Win->top - 1, c); +} + diff --git a/vendor/most-5.1.0/src/window.h b/vendor/most-5.1.0/src/window.h new file mode 100644 index 0000000..362bbef --- /dev/null +++ b/vendor/most-5.1.0/src/window.h @@ -0,0 +1,88 @@ +#ifndef _DAVIS_WINDOW_H_ +# define _DAVIS_WINDOW_H_ +/* + This file is part of MOST. + + Copyright (c) 1991, 1999, 2002, 2005-2018, 2019 John E. Davis + + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the Free + Software Foundation; either version 2 of the License, or (at your option) + any later version. + + This program is distributed in the hope that 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. +*/ +# include "buffer.h" + +typedef struct _Most_Window_Type +{ + unsigned long top_offset; /* offset of top line of window from bob */ + int beg_line; /* line number of top */ + int curs_line; /* line number of curs pos */ + int curs_col; /* column number of curs pos */ + unsigned long curs_offset; /* pos of cursor from bob*/ + int col; /* column offset */ + int n_lines; /* number of lines of buffer (mode dependent) */ + int top; /* screen location of top */ + int bot; /* screen location of bot */ + int display; /* value of MOST_S_OPT for selective display */ +#if 0 + char *status; /* status line */ +#endif + Most_Buffer_Type *buf; /* buffer structure in window */ + struct _Most_Window_Type *next; /* next window */ + struct _Most_Window_Type *prev; /* prev window */ + int flags; /* Squeeze lines, etc.. */ + int lock; /* true if locked */ + int dirty_flag; +} +Most_Window_Type; + +extern Most_Window_Type *Most_Win; +extern Most_Window_Type *Most_Top_Win; +extern unsigned long Most_Curs_Offset; +extern int Most_Column; +extern int Most_Curs_Row; +extern int Most_Curs_Col; +#define MOST_MINI_BUF_LEN 256 +extern char Most_Mini_Buf[MOST_MINI_BUF_LEN]; +extern int Most_Selective_Display; +extern int Most_Restore_Width_To; +extern int Most_Display_Inited; + +extern int most_split_window (void); +extern void most_toggle_lock(void); +extern void most_update_window(int); /* moves window to have arg lines on the top */ +extern void most_update_status(void); +extern void most_redraw_window(void); /* redraws window updating the structure */ +extern void most_window_buffer(void); +extern void most_init_display(void); +extern void most_reset_display(void); +extern void most_other_window(int); +extern void most_set_window (Most_Window_Type *); +extern void most_update_windows(int); +extern void most_message(char *, int); +extern void most_put_message(void); +extern void most_clear_minibuffer(void); +extern void most_check_minibuffer(void); +extern void most_free_window_buffer(void); +extern void most_select_minibuffer(void); +extern void most_exit_minibuffer(void); +extern int most_read_from_minibuffer(char *, char *, char *, unsigned int); +extern void most_redraw_display(void); +extern void most_one_window(void); +extern void most_two_windows(void); +extern void most_delete_window(void); +extern void most_save_win_flags(Most_Window_Type *); +extern void most_free_windows (void); +extern void most_flush_message (char *); +extern void most_point_cursor (void); +#endif +