diff options
author | Dale Rahn <drahn@cvs.openbsd.org> | 2004-02-29 19:27:25 +0000 |
---|---|---|
committer | Dale Rahn <drahn@cvs.openbsd.org> | 2004-02-29 19:27:25 +0000 |
commit | 06bbcaeb9d33fce156543e2d84b1df4a0a9e1127 (patch) | |
tree | 8614ca58169c994e07adc995d206e8434b020c5d /gnu/lib/libf2c/libU77 | |
parent | 4a95829907bd98f42503d9e6f91af8df4c9313ab (diff) |
Import of libf2c from gcc3.3.2
Diffstat (limited to 'gnu/lib/libf2c/libU77')
64 files changed, 6678 insertions, 0 deletions
diff --git a/gnu/lib/libf2c/libU77/COPYING.LIB b/gnu/lib/libf2c/libU77/COPYING.LIB new file mode 100644 index 00000000000..b1e3f5a2638 --- /dev/null +++ b/gnu/lib/libf2c/libU77/COPYING.LIB @@ -0,0 +1,504 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 + + Copyright (C) 1991, 1999 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations below. + + When we speak of free software, we are referring to freedom of use, +not price. Our General Public Licenses are designed to make sure that +you have the freedom to distribute copies of free software (and charge +for this service if you wish); that you receive source code or can get +it if you want it; that you can change the software and use pieces of +it in new free programs; and that you are informed that you can do +these things. + + To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the library or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link other code with the library, you must provide +complete object files to the recipients, so that they can relink them +with the library after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. + + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. + + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it becomes +a de-facto standard. To achieve this, non-free programs must be +allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, whereas the latter must +be combined with the library in order to run. + + GNU LESSER GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser General Public License (also called "this License"). +Each licensee is addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also combine or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + d) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + e) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the materials to be distributed need not include anything that is +normally distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties with +this License. + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License may add +an explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Lesser General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Libraries + + If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms of the +ordinary General Public License). + + To apply these terms, attach the following notices to the library. It is +safest to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + <one line to give the library's name and a brief idea of what it does.> + Copyright (C) <year> <name of author> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +Also add information on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the library, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James Random Hacker. + + <signature of Ty Coon>, 1 April 1990 + Ty Coon, President of Vice + +That's all there is to it! + + diff --git a/gnu/lib/libf2c/libU77/Makefile.in b/gnu/lib/libf2c/libU77/Makefile.in new file mode 100644 index 00000000000..19945115016 --- /dev/null +++ b/gnu/lib/libf2c/libU77/Makefile.in @@ -0,0 +1,191 @@ +# Makefile for GNU F77 compiler runtime, libc interface. +# Copyright (C) 1995-1998, 2001 Free Software Foundation, Inc. +# Contributed by Dave Love (d.love@dl.ac.uk). +# +#This file is part of the GNU Fortran libU77 library. +# +#The GNU Fortran libU77 library is free software; you can redistribute +#it and/or modify it under the terms of the GNU Library General Public +#License as published by the Free Software Foundation; either version 2, +#or (at your option) any later version. +# +#GNU Fortran is distributed in the hope that it will be useful, +#but WITHOUT ANY WARRANTY; without even the implied warranty of +#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +#GNU Library General Public License for more details. +# +#You should have received a copy of the GNU General Public License +#along with GNU Fortran; see the file COPYING. If not, write to +#the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA +#02111-1307, USA. + +#### Start of system configuration section. #### + +# $(srcdir) must be set to the g77 runtime libU77 source directory +srcdir = @srcdir@ +VPATH = @srcdir@ + +# configure sets this to all the -D options appropriate for the +# configuration. +DEFS = @DEFS@ +LIBS = @LIBS@ + +F2C_H_DIR = @srcdir@/.. +G2C_H_DIR = .. +CC = @CC@ +CFLAGS = @CFLAGS@ +CPPFLAGS = @CPPFLAGS@ +@SET_MAKE@ + +SHELL = /bin/sh + +#### End of system configuration section. #### + +# fio.h is in libI77. config.h is in `.'. +ALL_CFLAGS = -I. -I$(srcdir) -I$(F2C_H_DIR)/libI77 -I$(G2C_H_DIR) \ + -I$(F2C_H_DIR) $(CPPFLAGS) $(DEFS) $(CFLAGS) + +# This could probably be done more elegantly, but it's currently +# just for running the u77-test test. +G77DIR = ../../../gcc/ + +.SUFFIXES: +.SUFFIXES: .c .lo + +.c.lo: + @LIBTOOL@ --mode=compile $(CC) -c -DSkip_f2c_Undefs $(ALL_CFLAGS) $< + +OBJS = VersionU.lo gerror_.lo perror_.lo ierrno_.lo itime_.lo time_.lo \ + unlink_.lo fnum_.lo getpid_.lo getuid_.lo getgid_.lo kill_.lo rand_.lo \ + srand_.lo irand_.lo sleep_.lo idate_.lo ctime_.lo etime_.lo \ + dtime_.lo isatty_.lo ltime_.lo fstat_.lo stat_.lo \ + lstat_.lo access_.lo link_.lo getlog_.lo ttynam_.lo getcwd_.lo symlnk_.lo \ + vxttime_.lo vxtidate_.lo gmtime_.lo fdate_.lo secnds_.lo \ + bes.lo dbes.lo \ + chdir_.lo chmod_.lo lnblnk_.lo hostnm_.lo rename_.lo fgetc_.lo fputc_.lo \ + umask_.lo sys_clock_.lo date_.lo second_.lo flush1_.lo mclock_.lo \ + alarm_.lo datetime_.lo +SRCS = Version.c gerror_.c perror_.c ierrno_.c itime_.c time_.c \ + unlink_.c fnum_.c getpid_.c getuid_.c getgid_.c kill_.c rand_.c \ + srand_.c irand_.c sleep_.c idate_.c ctime_.c etime_.c \ + dtime_.c isatty_.c ltime_.c fstat_.c stat_.c \ + lstat_.c access_.c link_.c getlog_.c ttynam_.c getcwd_.c symlnk_.c \ + vxttime_.c vxtidate_.c gmtime_.c fdate_.c secnds_.c \ + bes.c dbes.c \ + chdir_.c chmod_.c lnblnk_.c hostnm_.c rename_.c fgetc_.c fputc_.c \ + umask_.c sys_clock_.c date_.c second_.c flush1_.c mclock_.c \ + alarm_.c datetime_.c + +all: ../s-libu77 + +../s-libu77: $(OBJS) + -rm -f $@.T $@ + objs='$(OBJS)'; for name in $$objs; do \ + echo libU77/$${name} >> $@.T; done + mv $@.T $@ + +Makefile: Makefile.in config.status + $(SHELL) config.status + +config.status: configure + rm -f config.cache + CONFIG_SITE=no-such-file CC='$(CC)' CFLAGS='$(CFLAGS)' \ + CPPFLAGS='$(CPPFLAGS)' $(SHELL) config.status --recheck + +${srcdir}/configure: configure.in + cd ${srcdir} && autoconf + +${srcdir}/config.hin: stamp-h.in +${srcdir}/stamp-h.in: configure.in acconfig.h + cd ${srcdir} && autoheader + echo timestamp > ${srcdir}/stamp-h.in + +config.h: stamp-h +stamp-h: config.hin config.status + $(SHELL) config.status + echo timestamp > stamp-h + +VersionU.lo: Version.c + @LIBTOOL@ --mode=compile $(CC) -c $(ALL_CFLAGS) $(srcdir)/Version.c -o $@ + +$(OBJS): $(F2C_H_DIR)/f2c.h $(G2C_H_DIR)/g2c.h config.h +access_.lo: access_.c +ctime_.lo: ctime_.c +dtime_.lo: dtime_.c +etime_.lo: etime_.c +fnum_.lo: fnum_.c $(F2C_H_DIR)/libI77/fio.h +fstat_.lo: fstat_.c +gerror_.lo: gerror_.c +getcwd_.lo: getcwd_.c +getgid_.lo: getgid_.c +getlog_.lo: getlog_.c +getpid_.lo: getpid_.c +getuid_.lo: getuid_.c +idate_.lo: idate_.c +ierrno_.lo: ierrno_.c +irand_.lo: irand_.c +isatty_.lo: isatty_.c $(F2C_H_DIR)/libI77/fio.h +itime_.lo: itime_.c +kill_.lo: kill_.c +link_.lo: link_.c +loc_.lo: loc_.c +lstat_.lo: lstat_.c +ltime_.lo: ltime_.c +perror_.lo: perror_.c +qsort.lo: qsort.c +qsort_.lo: qsort_.c +rand_.lo: rand_.c +rename_.lo: rename_.c +second_.lo: second_.c +sleep_.lo: sleep_.c +srand_.lo: srand_.c +stat_.lo: stat_.c +symlnk_.lo: symlnk_.c +time_.lo: time_.c +ttynam_.lo: ttynam_.c +unlink_.lo: unlink_.c +wait_.lo: wait_.c +vxttime_.lo: vxttime_.c +vtxidate_.lo: vxtidate_.c +fdate_.lo: fdate_.c +gmtime_.lo: gmtime_.c +secnds_.lo: secnds_.c +bes.lo: bes.c +dbes.lo: dbes.c +lnblnk_.lo: lnblnk_.c +chmod_.lo: chmod_.c +chdir_.lo: chdir_.c +hostnm_.lo: hostnm_.c +rename_.lo: rename_.c +fputc_.lo: fputc_.c +fgetc_.lo: fgetc_.c +sys_clock_.lo: sys_clock_.c +date_.lo: date_.c +umask_.lo: umask_.c +flush1_.lo: flush1_.c +mclock_.lo: mclock_.c +alarm_.lo: alarm_.c +datetime_.lo: datetime_.c + +check: + -$(G77DIR)g77 -B$(G77DIR) -L.. -g $(srcdir)/u77-test.f \ + -lg2c $(LIBS) -lm -o a.out && ./a.out + rm -f a.out + +install uninstall install-strip dist installcheck installdirs: + +mostlyclean: + rm -f *.o *.lo a.out + rm -rf .libs + +clean: mostlyclean + rm -f config.log ../s-libu77 + +distclean: clean + rm -f config.cache config.status Makefile config.h stamp.h \ + ../s-libu77 configure + +maintainer-clean: + +.PHONY: mostlyclean clean distclean maintainer-clean all check uninstall \ + install-strip dist installcheck installdirs archive diff --git a/gnu/lib/libf2c/libU77/PROJECTS b/gnu/lib/libf2c/libU77/PROJECTS new file mode 100644 index 00000000000..0cf1383cbf9 --- /dev/null +++ b/gnu/lib/libf2c/libU77/PROJECTS @@ -0,0 +1,10 @@ + -*- indented-text-*- + +* Interface to strget + +* Non-blocking (`asynchronous') i/o (per c.l.f. discussion) + +* `ioinit'-type routine for various i/o options + +* IEEE/VAX/... number format conversion (or XDR interface). This + might be made optionally transparent per logical unit a la DECtran. diff --git a/gnu/lib/libf2c/libU77/README b/gnu/lib/libf2c/libU77/README new file mode 100644 index 00000000000..bfedb90bd97 --- /dev/null +++ b/gnu/lib/libf2c/libU77/README @@ -0,0 +1,40 @@ +19970811 -*-text-*- + +g77 libU77 +---------- + +This directory contains an implementation of most of the `traditional' +Unix libU77 routines, mostly an interface to libc and libm routines +and some extra ones for time and date etc. It's intended for use with +g77, to whose configuration procedure it's currently tied, but should +be compatible with f2c otherwise, if using the same f2c.h. + +The contents of libU77 and its interfaces aren't consistent across +implementations. This one is mostly taken from documentation for (an +old version of) the Convex implementation and the v2 SunPro one. +As of g77 version 0.5.20, most of these routines have been made +into g77 intrinsics. Some routines have a version with a name prefixed +by `vxt', corresponding to the VMS Fortran versions, and these should +be integrated with g77's intrinsics visibility control. + +A few routines are currently missing; in the case of `fork', for +instance, because they're probably not useful, and in the case of +`qsort' and those for stream-based i/o handling, because they need +more effort/research. The configuration should weed out those few +which correspond to facilities which may not be present on some Unix +systems, such as symbolic links. It's unclear whether the interfaces +to the native library random number routines should be retained, since +their implementation is likely to be something one should avoid +assiduously. + +This library has been tested it under SunOS4.1.3 and Irix5.2 and there +has been some feedback from Linux; presumably potential problems lie +mainly with systems with impoverished native C library support which +haven't been properly taken care of with autoconf. + +There's another GPL'd implementation of this stuff which I only found +out about recently (despite having looked) and I haven't yet checked +how they should be amalgamated. + +Dave Love <d.love@dl.ac.uk> Aug '95 +(minor changes by Craig Burley <burley@gnu.org> Aug '97) diff --git a/gnu/lib/libf2c/libU77/Version.c b/gnu/lib/libf2c/libU77/Version.c new file mode 100644 index 00000000000..39e6b8b80af --- /dev/null +++ b/gnu/lib/libf2c/libU77/Version.c @@ -0,0 +1,12 @@ +static char junk[] = "\n@(#) LIBU77 VERSION 19980709\n"; + +char __G77_LIBU77_VERSION__[] = "3.2.2 20030422 (release)"; + +#include <stdio.h> + +void +g77__uvers__ () +{ + fprintf (stderr, "__G77_LIBU77_VERSION__: %s", __G77_LIBU77_VERSION__); + fputs (junk, stderr); +} diff --git a/gnu/lib/libf2c/libU77/access_.c b/gnu/lib/libf2c/libU77/access_.c new file mode 100644 index 00000000000..fefdebb0d8d --- /dev/null +++ b/gnu/lib/libf2c/libU77/access_.c @@ -0,0 +1,80 @@ +/* Copyright (C) 1995, 1997 Free Software Foundation, Inc. +This file is part of GNU Fortran libU77 library. + +This library is free software; you can redistribute it and/or modify it +under the terms of the GNU Library General Public License as published +by the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +GNU Fortran is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with GNU Fortran; see the file COPYING.LIB. If +not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif +#if HAVE_UNISTD_H +# include <unistd.h> +#endif +#if HAVE_STDLIB_H +# include <stdlib.h> +#else +# include <stdio.h> +#endif + +#include <errno.h> +#include <limits.h> +#include "f2c.h" + +#ifndef R_OK /* for SVR1-2 */ +# define R_OK 4 +#endif +#ifndef W_OK +# define W_OK 2 +#endif +#ifndef X_OK +# define X_OK 1 +#endif +#ifndef F_OK +# define F_OK 0 +#endif + +#ifdef KR_headers +void g_char (); + +integer G77_access_0 (name, mode, Lname, Lmode) + char *name, *mode; + ftnlen Lname, Lmode; +#else +void g_char(const char *a, ftnlen alen, char *b); + +integer G77_access_0 (const char *name, const char *mode, ftnlen Lname, ftnlen Lmode) +#endif +{ + char *buff; + char *bp, *blast; + int amode, i; + + buff = malloc (Lname+1); + if (!buff) return -1; + g_char (name, Lname, buff); + amode = 0; + for (i=0;i<Lmode;i++) { + switch (mode[i]) { + case 'r': amode |= R_OK; break; + case 'w': amode |= W_OK; break; + case 'x': amode |= X_OK; break; + case ' ': amode |= F_OK; break; /* as per Sun, at least */ + default: return EINVAL; + } + } + i = access (buff, amode); + free (buff); + return i; +} diff --git a/gnu/lib/libf2c/libU77/acconfig.h b/gnu/lib/libf2c/libU77/acconfig.h new file mode 100644 index 00000000000..778e15410c8 --- /dev/null +++ b/gnu/lib/libf2c/libU77/acconfig.h @@ -0,0 +1,11 @@ +/* Define as the path of the `chmod' program. */ +#undef CHMOD_PATH + +/* Define if your sys/time.h defines struct timezone. */ +#undef HAVE_STRUCT_TIMEZONE + +/* Define if your gettimeofday takes only one argument. */ +#undef GETTIMEOFDAY_ONE_ARGUMENT + +/* Define if your gettimeofday takes a time zome argument. */ +#undef HAVE_TIMEZONE diff --git a/gnu/lib/libf2c/libU77/aclocal.m4 b/gnu/lib/libf2c/libU77/aclocal.m4 new file mode 100644 index 00000000000..58f6a675899 --- /dev/null +++ b/gnu/lib/libf2c/libU77/aclocal.m4 @@ -0,0 +1,69 @@ +dnl Check: +dnl * If we have gettimeofday; +dnl * If we have struct timezone for use in calling it; +dnl * If calling it with a timezone pointer actually works -- this is deemed +dnl obsolete or undefined on some systems which say you should use a null +dnl pointer -- and undefine HAVE_TIMEZONE if so; +dnl * Whether it only takes one arg. +AC_DEFUN(LIBU77_GETTIMEOFDAY, [ + AC_CHECK_FUNCS(gettimeofday) + if test "$ac_cv_func_gettimeofday" = yes; then + AC_CACHE_CHECK([for struct timezone], g77_cv_struct_timezone, + [AC_TRY_COMPILE([#include <sys/time.h>], + [struct timezone tz;], + g77_cv_struct_timezone=yes, g77_cv_struct_timezone=no)]) + if test $g77_cv_struct_timezone = yes; then + dnl It may be that we can't call gettimeofday with a non-null pointer. + dnl In that case we'll lie about struct timezone. + AC_TRY_RUN([ +#ifdef TIME_WITH_SYS_TIME +#include <sys/time.h> +#include <time.h> +#else +#ifdef HAVE_SYS_TIME_H +#include <sys/time.h> +#else +#include <time.h> +#endif +#endif +main () +{ + struct timeval time; + struct timezone dummy; + if (gettimeofday (&time, &dummy)) + exit (1); + else + exit (0); +}], + [AC_DEFINE(HAVE_TIMEZONE)], ,[AC_DEFINE(HAVE_TIMEZONE)]) + fi + AC_REQUIRE([AC_HEADER_TIME]) + AC_CACHE_CHECK(whether gettimeofday can accept two arguments, + emacs_cv_gettimeofday_two_arguments, + AC_TRY_LINK([ +#ifdef TIME_WITH_SYS_TIME +#include <sys/time.h> +#include <time.h> +#else +#ifdef HAVE_SYS_TIME_H +#include <sys/time.h> +#else +#include <time.h> +#endif +#endif + ], + [ + struct timeval time; +#ifdef HAVE_TIMEZONE + struct timezone dummy; +#define DUMMY &dummy +#else +#define DUMMY NULL +#endif + gettimeofday (&time, DUMMY);], + emacs_cv_gettimeofday_two_arguments=yes, + emacs_cv_gettimeofday_two_arguments=no)) + if test $emacs_cv_gettimeofday_two_arguments = no; then + AC_DEFINE(GETTIMEOFDAY_ONE_ARGUMENT) + fi + fi]) diff --git a/gnu/lib/libf2c/libU77/alarm_.c b/gnu/lib/libf2c/libU77/alarm_.c new file mode 100644 index 00000000000..e7f9c2ddcc4 --- /dev/null +++ b/gnu/lib/libf2c/libU77/alarm_.c @@ -0,0 +1,70 @@ +/* Copyright (C) 1997, 2001 Free Software Foundation, Inc. +This file is part of GNU Fortran libU77 library. + +This library is free software; you can redistribute it and/or modify it +under the terms of the GNU Library General Public License as published +by the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +GNU Fortran is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with GNU Fortran; see the file COPYING.LIB. If +not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#if HAVE_UNISTD_H +# include <unistd.h> +#endif + +#include <errno.h> /* for ENOSYS */ +#include "f2c.h" + +#ifndef RETSIGTYPE +/* we shouldn't rely on this... */ +#ifdef KR_headers +#define RETSIGTYPE int +#else +#define RETSIGTYPE void +#endif +#endif +typedef RETSIGTYPE (*sig_type)(); + +#ifdef KR_headers +extern sig_type signal(); +#else +#include <signal.h> +typedef int (*sig_proc)(int); +#endif + +#ifndef SIG_ERR +#define SIG_ERR ((sig_type) -1) +#endif + +#ifdef KR_headers +integer G77_alarm_0 (seconds, proc) + integer *seconds; + sig_type proc; +#else +integer G77_alarm_0 (integer *seconds, sig_proc proc) +#endif +{ + int status; +#if defined (HAVE_ALARM) && defined (SIGALRM) + if (signal(SIGALRM, (sig_type)proc) == SIG_ERR) + status = -1; + else + status = alarm (*seconds); +#else /* ! HAVE_ALARM || ! SIGALRM */ + errno = ENOSYS; + status = -1; +#endif + return status; +} diff --git a/gnu/lib/libf2c/libU77/bes.c b/gnu/lib/libf2c/libU77/bes.c new file mode 100644 index 00000000000..442337fd77a --- /dev/null +++ b/gnu/lib/libf2c/libU77/bes.c @@ -0,0 +1,46 @@ +/* Copyright (C) 1995, 1996 Free Software Foundation, Inc. +This file is part of GNU Fortran libU77 library. + +This library is free software; you can redistribute it and/or modify it +under the terms of the GNU Library General Public License as published +by the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +GNU Fortran is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with GNU Fortran; see the file COPYING.LIB. If +not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + +#if 0 /* Don't include these unless necessary -- jcb. */ +#include "f2c.h" +#include <math.h> + +double G77_besj0_0 (const real *x) { + return j0 (*x); +} + +double G77_besj1_0 (const real *x) { + return j1 (*x); +} + +double G77_besjn_0 (const integer *n, real *x) { + return jn (*n, *x); + } + +double G77_besy0_0 (const real *x) { + return y0 (*x); +} + +double G77_besy1_0 (const real *x) { + return y1 (*x); +} + +double G77_besyn_0 (const integer *n, real *x) { + return yn (*n, *x); +} +#endif diff --git a/gnu/lib/libf2c/libU77/chdir_.c b/gnu/lib/libf2c/libU77/chdir_.c new file mode 100644 index 00000000000..9bd53fb95d7 --- /dev/null +++ b/gnu/lib/libf2c/libU77/chdir_.c @@ -0,0 +1,57 @@ +/* Copyright (C) 1995, 1997 Free Software Foundation, Inc. +This file is part of GNU Fortran libU77 library. + +This library is free software; you can redistribute it and/or modify it +under the terms of the GNU Library General Public License as published +by the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +GNU Fortran is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with GNU Fortran; see the file COPYING.LIB. If +not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif +#if HAVE_UNISTD_H +# include <unistd.h> +#endif +#if HAVE_STDLIB_H +# include <stdlib.h> +#else +# include <stdio.h> +#endif + +#include <errno.h> +#include "f2c.h" + + +#ifdef KR_headers +void g_char (); + +integer G77_chdir_0 (name, Lname) + char *name; + ftnlen Lname; +#else +void g_char(const char *a, ftnlen alen, char *b); + +integer G77_chdir_0 (const char *name, const ftnlen Lname) +#endif +{ + char *buff; + char *bp, *blast; + int i; + + buff = malloc (Lname+1); + if (!buff) return -1; + g_char (name, Lname, buff); + i = chdir (buff); + free (buff); + return i ? errno : 0; +} diff --git a/gnu/lib/libf2c/libU77/chmod_.c b/gnu/lib/libf2c/libU77/chmod_.c new file mode 100644 index 00000000000..d482d9ed828 --- /dev/null +++ b/gnu/lib/libf2c/libU77/chmod_.c @@ -0,0 +1,82 @@ +/* Copyright (C) 1995, 1997 Free Software Foundation, Inc. +This file is part of GNU Fortran libU77 library. + +This library is free software; you can redistribute it and/or modify it +under the terms of the GNU Library General Public License as published +by the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +GNU Fortran is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with GNU Fortran; see the file COPYING.LIB. If +not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + + +/* This definitely shouldn't be done this way -- should canibalise + chmod(1) from GNU or BSD. */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif +#if HAVE_UNISTD_H +# include <unistd.h> +#endif +#if HAVE_STDLIB_H +# include <stdlib.h> +#else +# include <stdio.h> +#endif +#if STDC_HEADERS +# include <string.h> +#endif + +#include "f2c.h" + +#ifndef CHMOD_PATH +#define CHMOD_PATH "/bin/chmod" +#endif + +#ifdef KR_headers +extern void s_cat (); +void g_char (); + +integer G77_chmod_0 (name, mode, Lname, Lmode) + char *name, *mode; + ftnlen Lname, Lmode; +#else +extern void s_cat(char *lp, char *rpp[], ftnlen rnp[], ftnlen *np, ftnlen ll); +void g_char(const char *a, ftnlen alen, char *b); + +integer G77_chmod_0 (/* const */ char *name, /* const */ char *mode, const ftnlen Lname, const ftnlen Lmode) +#endif +{ + char *buff; + char *bp, *blast; + int i; + ftnlen l, l2; + ftnlen six = 6; + address a[6]; + ftnlen ii[6]; + char chmod_path [] = CHMOD_PATH; + l = strlen (chmod_path); + buff = malloc (Lname+Lmode+l+3+13+1); + if (!buff) return -1; + ii[0] = l; a[0] = chmod_path; + ii[1] = 1; a[1] = " "; + ii[2] = Lmode; a[2] = mode; + ii[3] = 2; a[3] = " '"; + for (l2=Lname; (l2 > 1) && (name[l2-1] == ' '); ) + l2--; + ii[4] = l2; a[4] = name; + ii[5] = 13; a[5] = "' 2>/dev/null"; + s_cat (buff, a, ii, &six, Lname+Lmode+l+3+13); + buff[Lname+Lmode+l+3+13] = '\0'; + i = system (buff); + free (buff); + return i; +} diff --git a/gnu/lib/libf2c/libU77/config.hin b/gnu/lib/libf2c/libU77/config.hin new file mode 100644 index 00000000000..2f20872a4cf --- /dev/null +++ b/gnu/lib/libf2c/libU77/config.hin @@ -0,0 +1,116 @@ +/* config.hin. Generated automatically from configure.in by autoheader. */ + +/* Define to empty if the keyword does not work. */ +#undef const + +/* Define if your struct stat has st_blksize. */ +#undef HAVE_ST_BLKSIZE + +/* Define if your struct stat has st_blocks. */ +#undef HAVE_ST_BLOCKS + +/* Define if your struct stat has st_rdev. */ +#undef HAVE_ST_RDEV + +/* Define to `int' if <sys/types.h> doesn't define. */ +#undef mode_t + +/* Define to `int' if <sys/types.h> doesn't define. */ +#undef pid_t + +/* Define to `unsigned' if <sys/types.h> doesn't define. */ +#undef size_t + +/* Define if you have the ANSI C header files. */ +#undef STDC_HEADERS + +/* Define if you can safely include both <sys/time.h> and <time.h>. */ +#undef TIME_WITH_SYS_TIME + +/* Define if your <sys/time.h> declares struct tm. */ +#undef TM_IN_SYS_TIME + +/* Define as the path of the `chmod' program. */ +#undef CHMOD_PATH + +/* Define if you have the alarm function. */ +#undef HAVE_ALARM + +/* Define if you have the clock function. */ +#undef HAVE_CLOCK + +/* Define if you have the getcwd function. */ +#undef HAVE_GETCWD + +/* Define if you have the getgid function. */ +#undef HAVE_GETGID + +/* Define if you have the gethostname function. */ +#undef HAVE_GETHOSTNAME + +/* Define if you have the getlogin function. */ +#undef HAVE_GETLOGIN + +/* Define if you have the getrusage function. */ +#undef HAVE_GETRUSAGE + +/* Define if you have the getuid function. */ +#undef HAVE_GETUID + +/* Define if you have the getwd function. */ +#undef HAVE_GETWD + +/* Define if you have the kill function. */ +#undef HAVE_KILL + +/* Define if you have the link function. */ +#undef HAVE_LINK + +/* Define if you have the lstat function. */ +#undef HAVE_LSTAT + +/* Define if you have the strerror function. */ +#undef HAVE_STRERROR + +/* Define if you have the symlink function. */ +#undef HAVE_SYMLINK + +/* Define if you have the times function. */ +#undef HAVE_TIMES + +/* Define if you have the ttyname function. */ +#undef HAVE_TTYNAME + +/* Define if you have the <limits.h> header file. */ +#undef HAVE_LIMITS_H + +/* Define if you have the <stdlib.h> header file. */ +#undef HAVE_STDLIB_H + +/* Define if you have the <string.h> header file. */ +#undef HAVE_STRING_H + +/* Define if you have the <sys/param.h> header file. */ +#undef HAVE_SYS_PARAM_H + +/* Define if you have the <sys/time.h> header file. */ +#undef HAVE_SYS_TIME_H + +/* Define if you have the <sys/times.h> header file. */ +#undef HAVE_SYS_TIMES_H + +/* Define if you have the <unistd.h> header file. */ +#undef HAVE_UNISTD_H + +/* Get Single Unix Specification semantics */ +#undef _XOPEN_SOURCE + +/* Get Single Unix Specification semantics */ +#undef _XOPEN_SOURCE_EXTENDED + +/* Solaris extensions */ +#undef __EXTENSIONS__ + +/* Get 64-bit file size support */ +#undef _FILE_OFFSET_BITS + diff --git a/gnu/lib/libf2c/libU77/configure b/gnu/lib/libf2c/libU77/configure new file mode 100755 index 00000000000..f25748f99f0 --- /dev/null +++ b/gnu/lib/libf2c/libU77/configure @@ -0,0 +1,2037 @@ +#! /bin/sh + +# Guess values for system-dependent variables and create Makefiles. +# Generated automatically using autoconf version 2.13 +# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. +# +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. + +# Defaults: +ac_help= +ac_default_prefix=/usr/local +# Any additions from configure.in: + +# Initialize some variables set by options. +# The variables have the same names as the options, with +# dashes changed to underlines. +build=NONE +cache_file=./config.cache +exec_prefix=NONE +host=NONE +no_create= +nonopt=NONE +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= +target=NONE +verbose= +x_includes=NONE +x_libraries=NONE +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datadir='${prefix}/share' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +libdir='${exec_prefix}/lib' +includedir='${prefix}/include' +oldincludedir='/usr/include' +infodir='${prefix}/info' +mandir='${prefix}/man' + +# Initialize some other variables. +subdirs= +MFLAGS= MAKEFLAGS= +SHELL=${CONFIG_SHELL-/bin/sh} +# Maximum number of lines to put in a shell here document. +ac_max_here_lines=12 + +ac_prev= +for ac_option +do + + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval "$ac_prev=\$ac_option" + ac_prev= + continue + fi + + case "$ac_option" in + -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; + *) ac_optarg= ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case "$ac_option" in + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir="$ac_optarg" ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build="$ac_optarg" ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file="$ac_optarg" ;; + + -datadir | --datadir | --datadi | --datad | --data | --dat | --da) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ + | --da=*) + datadir="$ac_optarg" ;; + + -disable-* | --disable-*) + ac_feature=`echo $ac_option|sed -e 's/-*disable-//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then + { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } + fi + ac_feature=`echo $ac_feature| sed 's/-/_/g'` + eval "enable_${ac_feature}=no" ;; + + -enable-* | --enable-*) + ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then + { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } + fi + ac_feature=`echo $ac_feature| sed 's/-/_/g'` + case "$ac_option" in + *=*) ;; + *) ac_optarg=yes ;; + esac + eval "enable_${ac_feature}='$ac_optarg'" ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix="$ac_optarg" ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he) + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat << EOF +Usage: configure [options] [host] +Options: [defaults in brackets after descriptions] +Configuration: + --cache-file=FILE cache test results in FILE + --help print this message + --no-create do not create output files + --quiet, --silent do not print \`checking...' messages + --version print the version of autoconf that created configure +Directory and file names: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [same as prefix] + --bindir=DIR user executables in DIR [EPREFIX/bin] + --sbindir=DIR system admin executables in DIR [EPREFIX/sbin] + --libexecdir=DIR program executables in DIR [EPREFIX/libexec] + --datadir=DIR read-only architecture-independent data in DIR + [PREFIX/share] + --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data in DIR + [PREFIX/com] + --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var] + --libdir=DIR object code libraries in DIR [EPREFIX/lib] + --includedir=DIR C header files in DIR [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include] + --infodir=DIR info documentation in DIR [PREFIX/info] + --mandir=DIR man documentation in DIR [PREFIX/man] + --srcdir=DIR find the sources in DIR [configure dir or ..] + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM + run sed PROGRAM on installed program names +EOF + cat << EOF +Host type: + --build=BUILD configure for building on BUILD [BUILD=HOST] + --host=HOST configure for HOST [guessed] + --target=TARGET configure for TARGET [TARGET=HOST] +Features and packages: + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --x-includes=DIR X include files are in DIR + --x-libraries=DIR X library files are in DIR +EOF + if test -n "$ac_help"; then + echo "--enable and --with options recognized:$ac_help" + fi + exit 0 ;; + + -host | --host | --hos | --ho) + ac_prev=host ;; + -host=* | --host=* | --hos=* | --ho=*) + host="$ac_optarg" ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir="$ac_optarg" ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir="$ac_optarg" ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir="$ac_optarg" ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir="$ac_optarg" ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst \ + | --locals | --local | --loca | --loc | --lo) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* \ + | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) + localstatedir="$ac_optarg" ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir="$ac_optarg" ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir="$ac_optarg" ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix="$ac_optarg" ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix="$ac_optarg" ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix="$ac_optarg" ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name="$ac_optarg" ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir="$ac_optarg" ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir="$ac_optarg" ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site="$ac_optarg" ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir="$ac_optarg" ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir="$ac_optarg" ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target="$ac_optarg" ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers) + echo "configure generated by autoconf version 2.13" + exit 0 ;; + + -with-* | --with-*) + ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then + { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } + fi + ac_package=`echo $ac_package| sed 's/-/_/g'` + case "$ac_option" in + *=*) ;; + *) ac_optarg=yes ;; + esac + eval "with_${ac_package}='$ac_optarg'" ;; + + -without-* | --without-*) + ac_package=`echo $ac_option|sed -e 's/-*without-//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then + { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } + fi + ac_package=`echo $ac_package| sed 's/-/_/g'` + eval "with_${ac_package}=no" ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes="$ac_optarg" ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries="$ac_optarg" ;; + + -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; } + ;; + + *) + if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then + echo "configure: warning: $ac_option: invalid host type" 1>&2 + fi + if test "x$nonopt" != xNONE; then + { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } + fi + nonopt="$ac_option" + ;; + + esac +done + +if test -n "$ac_prev"; then + { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; } +fi + +trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 + +# File descriptor usage: +# 0 standard input +# 1 file creation +# 2 errors and warnings +# 3 some systems may open it to /dev/tty +# 4 used on the Kubota Titan +# 6 checking for... messages and results +# 5 compiler messages saved in config.log +if test "$silent" = yes; then + exec 6>/dev/null +else + exec 6>&1 +fi +exec 5>./config.log + +echo "\ +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. +" 1>&5 + +# Strip out --no-create and --no-recursion so they do not pile up. +# Also quote any args containing shell metacharacters. +ac_configure_args= +for ac_arg +do + case "$ac_arg" in + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c) ;; + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;; + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) + ac_configure_args="$ac_configure_args '$ac_arg'" ;; + *) ac_configure_args="$ac_configure_args $ac_arg" ;; + esac +done + +# NLS nuisances. +# Only set these to C if already set. These must not be set unconditionally +# because not all systems understand e.g. LANG=C (notably SCO). +# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'! +# Non-C LC_CTYPE values break the ctype check. +if test "${LANG+set}" = set; then LANG=C; export LANG; fi +if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi +if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi +if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -rf conftest* confdefs.h +# AIX cpp loses on an empty file, so make sure it contains at least a newline. +echo > confdefs.h + +# A filename unique to this package, relative to the directory that +# configure is in, which we can look for to find out if srcdir is correct. +ac_unique_file=access_.c + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then its parent. + ac_prog=$0 + ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'` + test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. + srcdir=$ac_confdir + if test ! -r $srcdir/$ac_unique_file; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r $srcdir/$ac_unique_file; then + if test "$ac_srcdir_defaulted" = yes; then + { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; } + else + { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; } + fi +fi +srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` + +# Prefer explicitly selected file to automatically selected ones. +if test -z "$CONFIG_SITE"; then + if test "x$prefix" != xNONE; then + CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" + else + CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" + fi +fi +for ac_site_file in $CONFIG_SITE; do + if test -r "$ac_site_file"; then + echo "loading site script $ac_site_file" + . "$ac_site_file" + fi +done + +if test -r "$cache_file"; then + echo "loading cache $cache_file" + . $cache_file +else + echo "creating cache $cache_file" + > $cache_file +fi + +ac_ext=c +# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CPP $CPPFLAGS' +ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cc_cross + +ac_exeext= +ac_objext=o +if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then + # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. + if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then + ac_n= ac_c=' +' ac_t=' ' + else + ac_n=-n ac_c= ac_t= + fi +else + ac_n= ac_c='\c' ac_t= +fi + + + + +# These defines are necessary to get 64-bit file size support. + +cat >> confdefs.h <<\EOF +#define _XOPEN_SOURCE 500L +EOF + +# The following is needed by irix6.2 so that struct timeval is declared. +cat >> confdefs.h <<\EOF +#define _XOPEN_SOURCE_EXTENDED 1 +EOF + +# The following is needed by Solaris2.5.1 so that struct timeval is declared. +cat >> confdefs.h <<\EOF +#define __EXTENSIONS__ 1 +EOF + +cat >> confdefs.h <<\EOF +#define _FILE_OFFSET_BITS 64 +EOF + + + + + +# For g77 we'll set CC to point at the built gcc, but this will get it into +# the makefiles +# Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:556: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_CC="gcc" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +CC="$ac_cv_prog_CC" +if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:586: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_prog_rejected=no + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + break + fi + done + IFS="$ac_save_ifs" +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# -gt 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + set dummy "$ac_dir/$ac_word" "$@" + shift + ac_cv_prog_CC="$@" + fi +fi +fi +fi +CC="$ac_cv_prog_CC" +if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + if test -z "$CC"; then + case "`uname -s`" in + *win32* | *WIN32*) + # Extract the first word of "cl", so it can be a program name with args. +set dummy cl; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:637: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_CC="cl" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +CC="$ac_cv_prog_CC" +if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + ;; + esac + fi + test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; } +fi + + +echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 +echo "configure:670: checking whether we are using GNU C" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.c <<EOF +#ifdef __GNUC__ + yes; +#endif +EOF +if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:679: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then + ac_cv_prog_gcc=yes +else + ac_cv_prog_gcc=no +fi +fi + +echo "$ac_t""$ac_cv_prog_gcc" 1>&6 + +if test $ac_cv_prog_gcc = yes; then + GCC=yes +else + GCC= +fi + +ac_test_CFLAGS="${CFLAGS+set}" +ac_save_CFLAGS="$CFLAGS" +CFLAGS= +echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 +echo "configure:698: checking whether ${CC-cc} accepts -g" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + echo 'void f(){}' > conftest.c +if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then + ac_cv_prog_cc_g=yes +else + ac_cv_prog_cc_g=no +fi +rm -f conftest* + +fi + +echo "$ac_t""$ac_cv_prog_cc_g" 1>&6 +if test "$ac_test_CFLAGS" = set; then + CFLAGS="$ac_save_CFLAGS" +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi + + +LIBTOOL='$(SHELL) ../libtool' + + +if test "$CROSS";then + ac_cv_c_cross=yes +else + ac_cv_c_cross=no +fi + +test "$AR" || AR=ar + +echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 +echo "configure:742: checking whether ${MAKE-make} sets \${MAKE}" >&5 +set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftestmake <<\EOF +all: + @echo 'ac_maketemp="${MAKE}"' +EOF +# GNU make sometimes prints "make[1]: Entering...", which would confuse us. +eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=` +if test -n "$ac_maketemp"; then + eval ac_cv_prog_make_${ac_make}_set=yes +else + eval ac_cv_prog_make_${ac_make}_set=no +fi +rm -f conftestmake +fi +if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then + echo "$ac_t""yes" 1>&6 + SET_MAKE= +else + echo "$ac_t""no" 1>&6 + SET_MAKE="MAKE=${MAKE-make}" +fi + + +# Extract the first word of "chmod", so it can be a program name with args. +set dummy chmod; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:772: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_path_ac_cv_prog_chmod'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + case "$ac_cv_prog_chmod" in + /*) + ac_cv_path_ac_cv_prog_chmod="$ac_cv_prog_chmod" # Let the user override the test with a path. + ;; + ?:/*) + ac_cv_path_ac_cv_prog_chmod="$ac_cv_prog_chmod" # Let the user override the test with a dos path. + ;; + *) + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_path_ac_cv_prog_chmod="$ac_dir/$ac_word" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_path_ac_cv_prog_chmod" && ac_cv_path_ac_cv_prog_chmod="no" + ;; +esac +fi +ac_cv_prog_chmod="$ac_cv_path_ac_cv_prog_chmod" +if test -n "$ac_cv_prog_chmod"; then + echo "$ac_t""$ac_cv_prog_chmod" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +if test "$ac_cv_prog_chmod" != no || test "$CROSS"; then + MAYBES=chmod_.o + cat >> confdefs.h <<EOF +#define CHMOD_PATH "$ac_cv_prog_chmod" +EOF + +else + MAYBES="" +fi + +echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 +echo "configure:816: checking how to run the C preprocessor" >&5 +# On Suns, sometimes $CPP names a directory. +if test -n "$CPP" && test -d "$CPP"; then + CPP= +fi +if test -z "$CPP"; then +if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + # This must be in double quotes, not single quotes, because CPP may get + # substituted into the Makefile and "${CC-cc}" will confuse make. + CPP="${CC-cc} -E" + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. + cat > conftest.$ac_ext <<EOF +#line 831 "configure" +#include "confdefs.h" +#include <assert.h> +Syntax Error +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:837: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + : +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + CPP="${CC-cc} -E -traditional-cpp" + cat > conftest.$ac_ext <<EOF +#line 848 "configure" +#include "confdefs.h" +#include <assert.h> +Syntax Error +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:854: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + : +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + CPP="${CC-cc} -nologo -E" + cat > conftest.$ac_ext <<EOF +#line 865 "configure" +#include "confdefs.h" +#include <assert.h> +Syntax Error +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:871: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + : +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + CPP=/lib/cpp +fi +rm -f conftest* +fi +rm -f conftest* +fi +rm -f conftest* + ac_cv_prog_CPP="$CPP" +fi + CPP="$ac_cv_prog_CPP" +else + ac_cv_prog_CPP="$CPP" +fi +echo "$ac_t""$CPP" 1>&6 + +echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 +echo "configure:896: checking for ANSI C header files" >&5 +if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <<EOF +#line 901 "configure" +#include "confdefs.h" +#include <stdlib.h> +#include <stdarg.h> +#include <string.h> +#include <float.h> +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:909: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + rm -rf conftest* + ac_cv_header_stdc=yes +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_header_stdc=no +fi +rm -f conftest* + +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. +cat > conftest.$ac_ext <<EOF +#line 926 "configure" +#include "confdefs.h" +#include <string.h> +EOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "memchr" >/dev/null 2>&1; then + : +else + rm -rf conftest* + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. +cat > conftest.$ac_ext <<EOF +#line 944 "configure" +#include "confdefs.h" +#include <stdlib.h> +EOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "free" >/dev/null 2>&1; then + : +else + rm -rf conftest* + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. +if test "$cross_compiling" = yes; then + : +else + cat > conftest.$ac_ext <<EOF +#line 965 "configure" +#include "confdefs.h" +#include <ctype.h> +#define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +#define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int main () { int i; for (i = 0; i < 256; i++) +if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); +exit (0); } + +EOF +if { (eval echo configure:976: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +then + : +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -fr conftest* + ac_cv_header_stdc=no +fi +rm -fr conftest* +fi + +fi +fi + +echo "$ac_t""$ac_cv_header_stdc" 1>&6 +if test $ac_cv_header_stdc = yes; then + cat >> confdefs.h <<\EOF +#define STDC_HEADERS 1 +EOF + +fi + + +echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6 +echo "configure:1001: checking whether time.h and sys/time.h may both be included" >&5 +if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <<EOF +#line 1006 "configure" +#include "confdefs.h" +#include <sys/types.h> +#include <sys/time.h> +#include <time.h> +int main() { +struct tm *tp; +; return 0; } +EOF +if { (eval echo configure:1015: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_header_time=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_header_time=no +fi +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_header_time" 1>&6 +if test $ac_cv_header_time = yes; then + cat >> confdefs.h <<\EOF +#define TIME_WITH_SYS_TIME 1 +EOF + +fi + +for ac_hdr in limits.h unistd.h sys/time.h string.h stdlib.h \ + sys/param.h sys/times.h +do +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +echo "configure:1040: checking for $ac_hdr" >&5 +if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <<EOF +#line 1045 "configure" +#include "confdefs.h" +#include <$ac_hdr> +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:1050: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` + cat >> confdefs.h <<EOF +#define $ac_tr_hdr 1 +EOF + +else + echo "$ac_t""no" 1>&6 +fi +done + + +echo $ac_n "checking for working const""... $ac_c" 1>&6 +echo "configure:1078: checking for working const" >&5 +if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <<EOF +#line 1083 "configure" +#include "confdefs.h" + +int main() { + +/* Ultrix mips cc rejects this. */ +typedef int charset[2]; const charset x; +/* SunOS 4.1.1 cc rejects this. */ +char const *const *ccp; +char **p; +/* NEC SVR4.0.2 mips cc rejects this. */ +struct point {int x, y;}; +static struct point const zero = {0,0}; +/* AIX XL C 1.02.0.0 rejects this. + It does not let you subtract one const X* pointer from another in an arm + of an if-expression whose if-part is not a constant expression */ +const char *g = "string"; +ccp = &g + (g ? g-g : 0); +/* HPUX 7.0 cc rejects these. */ +++ccp; +p = (char**) ccp; +ccp = (char const *const *) p; +{ /* SCO 3.2v4 cc rejects this. */ + char *t; + char const *s = 0 ? (char *) 0 : (char const *) 0; + + *t++ = 0; +} +{ /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ + int x[] = {25, 17}; + const int *foo = &x[0]; + ++foo; +} +{ /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ + typedef const int *iptr; + iptr p = 0; + ++p; +} +{ /* AIX XL C 1.02.0.0 rejects this saying + "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ + struct s { int j; const int *ap[3]; }; + struct s *b; b->j = 5; +} +{ /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ + const int foo = 10; +} + +; return 0; } +EOF +if { (eval echo configure:1132: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_c_const=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_c_const=no +fi +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_c_const" 1>&6 +if test $ac_cv_c_const = no; then + cat >> confdefs.h <<\EOF +#define const +EOF + +fi + +echo $ac_n "checking for size_t""... $ac_c" 1>&6 +echo "configure:1153: checking for size_t" >&5 +if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <<EOF +#line 1158 "configure" +#include "confdefs.h" +#include <sys/types.h> +#if STDC_HEADERS +#include <stdlib.h> +#include <stddef.h> +#endif +EOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "(^|[^a-zA-Z_0-9])size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then + rm -rf conftest* + ac_cv_type_size_t=yes +else + rm -rf conftest* + ac_cv_type_size_t=no +fi +rm -f conftest* + +fi +echo "$ac_t""$ac_cv_type_size_t" 1>&6 +if test $ac_cv_type_size_t = no; then + cat >> confdefs.h <<\EOF +#define size_t unsigned +EOF + +fi + +echo $ac_n "checking for mode_t""... $ac_c" 1>&6 +echo "configure:1186: checking for mode_t" >&5 +if eval "test \"`echo '$''{'ac_cv_type_mode_t'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <<EOF +#line 1191 "configure" +#include "confdefs.h" +#include <sys/types.h> +#if STDC_HEADERS +#include <stdlib.h> +#include <stddef.h> +#endif +EOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "(^|[^a-zA-Z_0-9])mode_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then + rm -rf conftest* + ac_cv_type_mode_t=yes +else + rm -rf conftest* + ac_cv_type_mode_t=no +fi +rm -f conftest* + +fi +echo "$ac_t""$ac_cv_type_mode_t" 1>&6 +if test $ac_cv_type_mode_t = no; then + cat >> confdefs.h <<\EOF +#define mode_t int +EOF + +fi + + +echo $ac_n "checking for pid_t""... $ac_c" 1>&6 +echo "configure:1220: checking for pid_t" >&5 +if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <<EOF +#line 1225 "configure" +#include "confdefs.h" +#include <sys/types.h> +#if STDC_HEADERS +#include <stdlib.h> +#include <stddef.h> +#endif +EOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "(^|[^a-zA-Z_0-9])pid_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then + rm -rf conftest* + ac_cv_type_pid_t=yes +else + rm -rf conftest* + ac_cv_type_pid_t=no +fi +rm -f conftest* + +fi +echo "$ac_t""$ac_cv_type_pid_t" 1>&6 +if test $ac_cv_type_pid_t = no; then + cat >> confdefs.h <<\EOF +#define pid_t int +EOF + +fi + +echo $ac_n "checking for st_blksize in struct stat""... $ac_c" 1>&6 +echo "configure:1253: checking for st_blksize in struct stat" >&5 +if eval "test \"`echo '$''{'ac_cv_struct_st_blksize'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <<EOF +#line 1258 "configure" +#include "confdefs.h" +#include <sys/types.h> +#include <sys/stat.h> +int main() { +struct stat s; s.st_blksize; +; return 0; } +EOF +if { (eval echo configure:1266: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_struct_st_blksize=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_struct_st_blksize=no +fi +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_struct_st_blksize" 1>&6 +if test $ac_cv_struct_st_blksize = yes; then + cat >> confdefs.h <<\EOF +#define HAVE_ST_BLKSIZE 1 +EOF + +fi + +echo $ac_n "checking for st_blocks in struct stat""... $ac_c" 1>&6 +echo "configure:1287: checking for st_blocks in struct stat" >&5 +if eval "test \"`echo '$''{'ac_cv_struct_st_blocks'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <<EOF +#line 1292 "configure" +#include "confdefs.h" +#include <sys/types.h> +#include <sys/stat.h> +int main() { +struct stat s; s.st_blocks; +; return 0; } +EOF +if { (eval echo configure:1300: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_struct_st_blocks=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_struct_st_blocks=no +fi +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_struct_st_blocks" 1>&6 +if test $ac_cv_struct_st_blocks = yes; then + cat >> confdefs.h <<\EOF +#define HAVE_ST_BLOCKS 1 +EOF + +else + LIBOBJS="$LIBOBJS fileblocks.${ac_objext}" +fi + +echo $ac_n "checking for st_rdev in struct stat""... $ac_c" 1>&6 +echo "configure:1323: checking for st_rdev in struct stat" >&5 +if eval "test \"`echo '$''{'ac_cv_struct_st_rdev'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <<EOF +#line 1328 "configure" +#include "confdefs.h" +#include <sys/types.h> +#include <sys/stat.h> +int main() { +struct stat s; s.st_rdev; +; return 0; } +EOF +if { (eval echo configure:1336: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_struct_st_rdev=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_struct_st_rdev=no +fi +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_struct_st_rdev" 1>&6 +if test $ac_cv_struct_st_rdev = yes; then + cat >> confdefs.h <<\EOF +#define HAVE_ST_RDEV 1 +EOF + +fi + +echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6 +echo "configure:1357: checking whether struct tm is in sys/time.h or time.h" >&5 +if eval "test \"`echo '$''{'ac_cv_struct_tm'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <<EOF +#line 1362 "configure" +#include "confdefs.h" +#include <sys/types.h> +#include <time.h> +int main() { +struct tm *tp; tp->tm_sec; +; return 0; } +EOF +if { (eval echo configure:1370: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_struct_tm=time.h +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_struct_tm=sys/time.h +fi +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_struct_tm" 1>&6 +if test $ac_cv_struct_tm = sys/time.h; then + cat >> confdefs.h <<\EOF +#define TM_IN_SYS_TIME 1 +EOF + +fi + + +echo $ac_n "checking for gethostname in -lsocket""... $ac_c" 1>&6 +echo "configure:1392: checking for gethostname in -lsocket" >&5 +ac_lib_var=`echo socket'_'gethostname | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lsocket $LIBS" +cat > conftest.$ac_ext <<EOF +#line 1400 "configure" +#include "confdefs.h" +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char gethostname(); + +int main() { +gethostname() +; return 0; } +EOF +if { (eval echo configure:1411: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + LIBS="$LIBS -lsocket" +else + echo "$ac_t""no" 1>&6 +fi + + + +for ac_func in symlink getcwd getwd lstat gethostname strerror clock \ + getrusage times alarm getlogin getgid getuid kill link ttyname +do +echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +echo "configure:1437: checking for $ac_func" >&5 +if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <<EOF +#line 1442 "configure" +#include "confdefs.h" +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func(); below. */ +#include <assert.h> +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +$ac_func(); +#endif + +; return 0; } +EOF +if { (eval echo configure:1465: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_$ac_func=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_$ac_func=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + cat >> confdefs.h <<EOF +#define $ac_tr_func 1 +EOF + +else + echo "$ac_t""no" 1>&6 +fi +done + + + + for ac_func in gettimeofday +do +echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +echo "configure:1494: checking for $ac_func" >&5 +if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <<EOF +#line 1499 "configure" +#include "confdefs.h" +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func(); below. */ +#include <assert.h> +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +$ac_func(); +#endif + +; return 0; } +EOF +if { (eval echo configure:1522: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_$ac_func=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_$ac_func=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + cat >> confdefs.h <<EOF +#define $ac_tr_func 1 +EOF + +else + echo "$ac_t""no" 1>&6 +fi +done + + if test "$ac_cv_func_gettimeofday" = yes; then + echo $ac_n "checking for struct timezone""... $ac_c" 1>&6 +echo "configure:1548: checking for struct timezone" >&5 +if eval "test \"`echo '$''{'g77_cv_struct_timezone'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <<EOF +#line 1553 "configure" +#include "confdefs.h" +#include <sys/time.h> +int main() { +struct timezone tz; +; return 0; } +EOF +if { (eval echo configure:1560: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + g77_cv_struct_timezone=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + g77_cv_struct_timezone=no +fi +rm -f conftest* +fi + +echo "$ac_t""$g77_cv_struct_timezone" 1>&6 + if test $g77_cv_struct_timezone = yes; then + if test "$cross_compiling" = yes; then + cat >> confdefs.h <<\EOF +#define HAVE_TIMEZONE 1 +EOF + +else + cat > conftest.$ac_ext <<EOF +#line 1581 "configure" +#include "confdefs.h" + +#ifdef TIME_WITH_SYS_TIME +#include <sys/time.h> +#include <time.h> +#else +#ifdef HAVE_SYS_TIME_H +#include <sys/time.h> +#else +#include <time.h> +#endif +#endif +main () +{ + struct timeval time; + struct timezone dummy; + if (gettimeofday (&time, &dummy)) + exit (1); + else + exit (0); +} +EOF +if { (eval echo configure:1604: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +then + cat >> confdefs.h <<\EOF +#define HAVE_TIMEZONE 1 +EOF + +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 +fi +rm -fr conftest* +fi + + fi + + echo $ac_n "checking whether gettimeofday can accept two arguments""... $ac_c" 1>&6 +echo "configure:1620: checking whether gettimeofday can accept two arguments" >&5 +if eval "test \"`echo '$''{'emacs_cv_gettimeofday_two_arguments'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <<EOF +#line 1625 "configure" +#include "confdefs.h" + +#ifdef TIME_WITH_SYS_TIME +#include <sys/time.h> +#include <time.h> +#else +#ifdef HAVE_SYS_TIME_H +#include <sys/time.h> +#else +#include <time.h> +#endif +#endif + +int main() { + + struct timeval time; +#ifdef HAVE_TIMEZONE + struct timezone dummy; +#define DUMMY &dummy +#else +#define DUMMY NULL +#endif + gettimeofday (&time, DUMMY); +; return 0; } +EOF +if { (eval echo configure:1651: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + emacs_cv_gettimeofday_two_arguments=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + emacs_cv_gettimeofday_two_arguments=no +fi +rm -f conftest* +fi + +echo "$ac_t""$emacs_cv_gettimeofday_two_arguments" 1>&6 + if test $emacs_cv_gettimeofday_two_arguments = no; then + cat >> confdefs.h <<\EOF +#define GETTIMEOFDAY_ONE_ARGUMENT 1 +EOF + + fi + fi + +test $ac_cv_func_symlink = yes && MAYBES="$MAYBES symlnk_.o" +test $ac_cv_func_lstat = yes && MAYBES="$MAYBES lstat_.o" +test $ac_cv_func_gethostname = yes && MAYBES="$MAYBES hostnm_.o" +test $ac_cv_func_clock = yes && MAYBES="$MAYBES mclock_.o" + + + + + + +trap '' 1 2 15 +cat > confcache <<\EOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs. It is not useful on other systems. +# If it contains results you don't want to keep, you may remove or edit it. +# +# By default, configure uses ./config.cache as the cache file, +# creating it if it does not exist already. You can give configure +# the --cache-file=FILE option to use a different cache file; that is +# what configure does when it calls configure scripts in +# subdirectories, so they share the cache. +# Giving --cache-file=/dev/null disables caching, for debugging configure. +# config.status only pays attention to the cache file if you give it the +# --recheck option to rerun configure. +# +EOF +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, don't put newlines in cache variables' values. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +(set) 2>&1 | + case `(ac_space=' '; set | grep ac_space) 2>&1` in + *ac_space=\ *) + # `set' does not quote correctly, so add quotes (double-quote substitution + # turns \\\\ into \\, and sed turns \\ into \). + sed -n \ + -e "s/'/'\\\\''/g" \ + -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" + ;; + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' + ;; + esac >> confcache +if cmp -s $cache_file confcache; then + : +else + if test -w $cache_file; then + echo "updating cache $cache_file" + cat confcache > $cache_file + else + echo "not updating unwritable cache $cache_file" + fi +fi +rm -f confcache + +trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +# Any assignment to VPATH causes Sun make to only execute +# the first set of double-colon rules, so remove it if not needed. +# If there is a colon in the path, we need to keep it. +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d' +fi + +trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15 + +DEFS=-DHAVE_CONFIG_H + +# Without the "./", some shells look in PATH for config.status. +: ${CONFIG_STATUS=./config.status} + +echo creating $CONFIG_STATUS +rm -f $CONFIG_STATUS +cat > $CONFIG_STATUS <<EOF +#! /bin/sh +# Generated automatically by configure. +# Run this file to recreate the current configuration. +# This directory was configured as follows, +# on host `(hostname || uname -n) 2>/dev/null | sed 1q`: +# +# $0 $ac_configure_args +# +# Compiler output produced by configure, useful for debugging +# configure, is in ./config.log if it exists. + +ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]" +for ac_option +do + case "\$ac_option" in + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" + exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; + -version | --version | --versio | --versi | --vers | --ver | --ve | --v) + echo "$CONFIG_STATUS generated by autoconf version 2.13" + exit 0 ;; + -help | --help | --hel | --he | --h) + echo "\$ac_cs_usage"; exit 0 ;; + *) echo "\$ac_cs_usage"; exit 1 ;; + esac +done + +ac_given_srcdir=$srcdir + +trap 'rm -fr `echo "Makefile config.h:config.hin" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 +EOF +cat >> $CONFIG_STATUS <<EOF + +# Protect against being on the right side of a sed subst in config.status. +sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g; + s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF +$ac_vpsub +$extrasub +s%@SHELL@%$SHELL%g +s%@CFLAGS@%$CFLAGS%g +s%@CPPFLAGS@%$CPPFLAGS%g +s%@CXXFLAGS@%$CXXFLAGS%g +s%@FFLAGS@%$FFLAGS%g +s%@DEFS@%$DEFS%g +s%@LDFLAGS@%$LDFLAGS%g +s%@LIBS@%$LIBS%g +s%@exec_prefix@%$exec_prefix%g +s%@prefix@%$prefix%g +s%@program_transform_name@%$program_transform_name%g +s%@bindir@%$bindir%g +s%@sbindir@%$sbindir%g +s%@libexecdir@%$libexecdir%g +s%@datadir@%$datadir%g +s%@sysconfdir@%$sysconfdir%g +s%@sharedstatedir@%$sharedstatedir%g +s%@localstatedir@%$localstatedir%g +s%@libdir@%$libdir%g +s%@includedir@%$includedir%g +s%@oldincludedir@%$oldincludedir%g +s%@infodir@%$infodir%g +s%@mandir@%$mandir%g +s%@CC@%$CC%g +s%@LIBTOOL@%$LIBTOOL%g +s%@AR@%$AR%g +s%@SET_MAKE@%$SET_MAKE%g +s%@ac_cv_prog_chmod@%$ac_cv_prog_chmod%g +s%@CPP@%$CPP%g +s%@LIBOBJS@%$LIBOBJS%g +s%@MAYBES@%$MAYBES%g +s%@CROSS@%$CROSS%g +s%@RANLIB@%$RANLIB%g +s%@RANLIB_TEST@%$RANLIB_TEST%g + +CEOF +EOF + +cat >> $CONFIG_STATUS <<\EOF + +# Split the substitutions into bite-sized pieces for seds with +# small command number limits, like on Digital OSF/1 and HP-UX. +ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script. +ac_file=1 # Number of current file. +ac_beg=1 # First line for current file. +ac_end=$ac_max_sed_cmds # Line after last line for current file. +ac_more_lines=: +ac_sed_cmds="" +while $ac_more_lines; do + if test $ac_beg -gt 1; then + sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file + else + sed "${ac_end}q" conftest.subs > conftest.s$ac_file + fi + if test ! -s conftest.s$ac_file; then + ac_more_lines=false + rm -f conftest.s$ac_file + else + if test -z "$ac_sed_cmds"; then + ac_sed_cmds="sed -f conftest.s$ac_file" + else + ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file" + fi + ac_file=`expr $ac_file + 1` + ac_beg=$ac_end + ac_end=`expr $ac_end + $ac_max_sed_cmds` + fi +done +if test -z "$ac_sed_cmds"; then + ac_sed_cmds=cat +fi +EOF + +cat >> $CONFIG_STATUS <<EOF + +CONFIG_FILES=\${CONFIG_FILES-"Makefile"} +EOF +cat >> $CONFIG_STATUS <<\EOF +for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case "$ac_file" in + *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` + ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; + *) ac_file_in="${ac_file}.in" ;; + esac + + # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories. + + # Remove last slash and all that follows it. Not all systems have dirname. + ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` + if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then + # The file is in a subdirectory. + test ! -d "$ac_dir" && mkdir "$ac_dir" + ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`" + # A "../" for each directory in $ac_dir_suffix. + ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'` + else + ac_dir_suffix= ac_dots= + fi + + case "$ac_given_srcdir" in + .) srcdir=. + if test -z "$ac_dots"; then top_srcdir=. + else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;; + /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;; + *) # Relative path. + srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix" + top_srcdir="$ac_dots$ac_given_srcdir" ;; + esac + + + echo creating "$ac_file" + rm -f "$ac_file" + configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." + case "$ac_file" in + *Makefile*) ac_comsub="1i\\ +# $configure_input" ;; + *) ac_comsub= ;; + esac + + ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` + sed -e "$ac_comsub +s%@configure_input@%$configure_input%g +s%@srcdir@%$srcdir%g +s%@top_srcdir@%$top_srcdir%g +" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file +fi; done +rm -f conftest.s* + +# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where +# NAME is the cpp macro being defined and VALUE is the value it is being given. +# +# ac_d sets the value in "#define NAME VALUE" lines. +ac_dA='s%^\([ ]*\)#\([ ]*define[ ][ ]*\)' +ac_dB='\([ ][ ]*\)[^ ]*%\1#\2' +ac_dC='\3' +ac_dD='%g' +# ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE". +ac_uA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' +ac_uB='\([ ]\)%\1#\2define\3' +ac_uC=' ' +ac_uD='\4%g' +# ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE". +ac_eA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' +ac_eB='$%\1#\2define\3' +ac_eC=' ' +ac_eD='%g' + +if test "${CONFIG_HEADERS+set}" != set; then +EOF +cat >> $CONFIG_STATUS <<EOF + CONFIG_HEADERS="config.h:config.hin" +EOF +cat >> $CONFIG_STATUS <<\EOF +fi +for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case "$ac_file" in + *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` + ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; + *) ac_file_in="${ac_file}.in" ;; + esac + + echo creating $ac_file + + rm -f conftest.frag conftest.in conftest.out + ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` + cat $ac_file_inputs > conftest.in + +EOF + +# Transform confdefs.h into a sed script conftest.vals that substitutes +# the proper values into config.h.in to produce config.h. And first: +# Protect against being on the right side of a sed subst in config.status. +# Protect against being in an unquoted here document in config.status. +rm -f conftest.vals +cat > conftest.hdr <<\EOF +s/[\\&%]/\\&/g +s%[\\$`]%\\&%g +s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp +s%ac_d%ac_u%gp +s%ac_u%ac_e%gp +EOF +sed -n -f conftest.hdr confdefs.h > conftest.vals +rm -f conftest.hdr + +# This sed command replaces #undef with comments. This is necessary, for +# example, in the case of _POSIX_SOURCE, which is predefined and required +# on some systems where configure will not decide to define it. +cat >> conftest.vals <<\EOF +s%^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */% +EOF + +# Break up conftest.vals because some shells have a limit on +# the size of here documents, and old seds have small limits too. + +rm -f conftest.tail +while : +do + ac_lines=`grep -c . conftest.vals` + # grep -c gives empty output for an empty file on some AIX systems. + if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi + # Write a limited-size here document to conftest.frag. + echo ' cat > conftest.frag <<CEOF' >> $CONFIG_STATUS + sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS + echo 'CEOF + sed -f conftest.frag conftest.in > conftest.out + rm -f conftest.in + mv conftest.out conftest.in +' >> $CONFIG_STATUS + sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail + rm -f conftest.vals + mv conftest.tail conftest.vals +done +rm -f conftest.vals + +cat >> $CONFIG_STATUS <<\EOF + rm -f conftest.frag conftest.h + echo "/* $ac_file. Generated automatically by configure. */" > conftest.h + cat conftest.in >> conftest.h + rm -f conftest.in + if cmp -s $ac_file conftest.h 2>/dev/null; then + echo "$ac_file is unchanged" + rm -f conftest.h + else + # Remove last slash and all that follows it. Not all systems have dirname. + ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` + if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then + # The file is in a subdirectory. + test ! -d "$ac_dir" && mkdir "$ac_dir" + fi + rm -f $ac_file + mv conftest.h $ac_file + fi +fi; done + +EOF +cat >> $CONFIG_STATUS <<EOF + +EOF +cat >> $CONFIG_STATUS <<\EOF + +exit 0 +EOF +chmod +x $CONFIG_STATUS +rm -fr confdefs* $ac_clean_files +test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 + diff --git a/gnu/lib/libf2c/libU77/configure.in b/gnu/lib/libf2c/libU77/configure.in new file mode 100644 index 00000000000..13fa524129f --- /dev/null +++ b/gnu/lib/libf2c/libU77/configure.in @@ -0,0 +1,124 @@ +# Process this file with autoconf to produce a configure script. +# Copyright (C) 1995, 1998, 1999 Free Software Foundation, Inc. +# Contributed by Dave Love (d.love@dl.ac.uk). +# +#This file is part of the GNU Fortran libU77 library. +# +#This library is free software; you can redistribute it and/or modify +#it under the terms of the GNU General Public License as published by +#the Free Software Foundation; either version 2, or (at your option) +#any later version. +# +#GNU Fortran is distributed in the hope that it will be useful, +#but WITHOUT ANY WARRANTY; without even the implied warranty of +#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +#GNU Library General Public License for more details. +# +#You should have received a copy of the GNU Library General Public +#License along with GNU Fortran; see the file COPYING. If not, write +#to Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, +#USA. + +AC_PREREQ(2.12.1) +AC_INIT(access_.c) +AC_CONFIG_HEADER(config.h:config.hin) + +# These defines are necessary to get 64-bit file size support. + +AC_DEFINE(_XOPEN_SOURCE, 500L, [Get Single Unix Specification semantics]) +# The following is needed by irix6.2 so that struct timeval is declared. +AC_DEFINE(_XOPEN_SOURCE_EXTENDED, 1, [Get Single Unix Specification semantics]) +# The following is needed by Solaris2.5.1 so that struct timeval is declared. +AC_DEFINE(__EXTENSIONS__, 1, [Solaris extensions]) +AC_DEFINE(_FILE_OFFSET_BITS, 64, [Get 64-bit file size support]) + +dnl Checks for programs. + +dnl FIXME AC_PROG_CC wants CC to be able to link things, but it may +dnl not be able to. +define([AC_PROG_CC_WORKS],[]) + +# For g77 we'll set CC to point at the built gcc, but this will get it into +# the makefiles +AC_PROG_CC + +LIBTOOL='$(SHELL) ../libtool' +AC_SUBST(LIBTOOL) + +dnl AC_C_CROSS +dnl Gives misleading `(cached)' message from the check. +if test "$CROSS";then + ac_cv_c_cross=yes +else + ac_cv_c_cross=no +fi + +test "$AR" || AR=ar +AC_SUBST(AR) +AC_PROG_MAKE_SET + +dnl This is only because we (horribly) punt the chmod job to the program at +dnl present. Note that the result of this test could be wrong in the cross +dnl case. +AC_PATH_PROG(ac_cv_prog_chmod, chmod, no) +if test "$ac_cv_prog_chmod" != no || test "$CROSS"; then + MAYBES=chmod_.o + AC_DEFINE_UNQUOTED(CHMOD_PATH,"$ac_cv_prog_chmod") +else + MAYBES="" +fi + +dnl Checks for header files. +AC_HEADER_STDC +dnl We could do this if we didn't know we were using gcc +dnl AC_MSG_CHECKING(for prototype-savvy compiler) +dnl AC_CACHE_VAL(ac_cv_sys_proto, +dnl [AC_TRY_LINK(, +dnl dnl looks screwy because TRY_LINK expects a function body +dnl [return 0;} int foo (int * bar) {], +dnl ac_cv_sys_proto=yes, +dnl [ac_cv_sys_proto=no +dnl AC_DEFINE(KR_headers)])]) +dnl AC_MSG_RESULT($ac_cv_sys_proto) + +AC_HEADER_TIME +AC_CHECK_HEADERS(limits.h unistd.h sys/time.h string.h stdlib.h \ + sys/param.h sys/times.h) + +dnl Checks for typedefs, structures, and compiler characteristics. +AC_C_CONST +AC_TYPE_SIZE_T +AC_TYPE_MODE_T + +AC_TYPE_PID_T +dnl The next 3 demand a dummy fileblocks.o (added to LIBOJS). We don't use +dnl LIBOJS, though. +AC_STRUCT_ST_BLKSIZE +AC_STRUCT_ST_BLOCKS +AC_STRUCT_ST_RDEV +AC_STRUCT_TM + +dnl Some systems (SVR4, SCO OpenServer) need -lsocket for gethostname() +AC_CHECK_LIB(socket, gethostname, [LIBS="$LIBS -lsocket"]) + +dnl Checks for library functions. + +AC_CHECK_FUNCS(symlink getcwd getwd lstat gethostname strerror clock \ + getrusage times alarm getlogin getgid getuid kill link ttyname) + +dnl The standard autoconf HAVE_STRUCT_TIMEZONE doesn't actually check +dnl for struct timezone, as you might think. We also need to check how +dnl to call gettimeofday if we have it. +LIBU77_GETTIMEOFDAY + +test $ac_cv_func_symlink = yes && MAYBES="$MAYBES symlnk_.o" +test $ac_cv_func_lstat = yes && MAYBES="$MAYBES lstat_.o" +test $ac_cv_func_gethostname = yes && MAYBES="$MAYBES hostnm_.o" +test $ac_cv_func_clock = yes && MAYBES="$MAYBES mclock_.o" +AC_SUBST(MAYBES) + +AC_SUBST(CROSS) +AC_SUBST(RANLIB) +AC_SUBST(RANLIB_TEST) + +AC_OUTPUT(Makefile) diff --git a/gnu/lib/libf2c/libU77/ctime_.c b/gnu/lib/libf2c/libU77/ctime_.c new file mode 100644 index 00000000000..a855cb59539 --- /dev/null +++ b/gnu/lib/libf2c/libU77/ctime_.c @@ -0,0 +1,58 @@ +/* Copyright (C) 1995, 1996, 2001 Free Software Foundation, Inc. +This file is part of GNU Fortran libU77 library. + +This library is free software; you can redistribute it and/or modify it +under the terms of the GNU Library General Public License as published +by the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +GNU Fortran is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with GNU Fortran; see the file COPYING.LIB. If +not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif +#include <sys/types.h> +#if TIME_WITH_SYS_TIME +# include <sys/time.h> +# include <time.h> +#else +# if HAVE_SYS_TIME_H +# include <sys/time.h> +# else +# include <time.h> +# endif +#endif +#if HAVE_STRING_H +# include <string.h> +#else +# include <strings.h> +#endif +#include "f2c.h" + +/* may need sys/time.h & long arg for stime (bsd, svr1-3) */ + +#ifdef KR_headers +/* Character */ void G77_ctime_0 (chtime, Lchtime, xstime) + char *chtime; + longint * xstime; + ftnlen Lchtime; +#else +/* Character */ void G77_ctime_0 (char *chtime, const ftnlen Lchtime, longint * xstime) +#endif +{ + int i, l; + int s_copy (); + time_t stime = *xstime; + + /* Allow a length other than 24 for compatibility with what other + systems do, despite it being documented as 24. */ + s_copy (chtime, ctime (&stime), Lchtime, 24); +} diff --git a/gnu/lib/libf2c/libU77/date_.c b/gnu/lib/libf2c/libU77/date_.c new file mode 100644 index 00000000000..c3cd55d7ace --- /dev/null +++ b/gnu/lib/libf2c/libU77/date_.c @@ -0,0 +1,55 @@ +/* date_.f -- translated by f2c (version 19961001). + You must link the resulting object file with the libraries: + -lf2c -lm (in that order) +*/ + +#include "f2c.h" + +/* Table of constant values */ + +static integer c__5 = 5; + +/* Subroutine */ int G77_date_y2kbug_0 (char *buf, ftnlen buf_len) +{ + /* System generated locals */ + address a__1[5]; + longint i__1; + integer i__2[5]; + char ch__1[24]; + + /* Builtin functions */ + /* Subroutine */ int s_copy(), s_cat(); + + /* Local variables */ + static char cbuf[24]; + extern longint G77_time_0 (); + extern /* Character */ VOID G77_ctime_0 (); + + i__1 = G77_time_0 (); + G77_ctime_0 (ch__1, 24L, &i__1); + s_copy(cbuf, ch__1, 24L, 24L); +/* Writing concatenation */ + i__2[0] = 2, a__1[0] = cbuf + 8; + i__2[1] = 1, a__1[1] = "-"; + i__2[2] = 3, a__1[2] = cbuf + 4; + i__2[3] = 1, a__1[3] = "-"; + i__2[4] = 2, a__1[4] = cbuf + 22; + s_cat(buf, a__1, i__2, &c__5, buf_len); + return 0; +} /* date_ */ + +#ifdef PIC +# include <stdio.h> + +const char *G77_Non_Y2K_Compliance_Message = + "Call to non Y2K compliant subroutine detected."; + +int G77_date_y2kbuggy_0 (char *buf, ftnlen buf_len) +{ + extern int G77_abort_0(); + fprintf (stderr, "%s\n", G77_Non_Y2K_Compliance_Message); + G77_abort_0(); +} +#endif + + diff --git a/gnu/lib/libf2c/libU77/datetime_.c b/gnu/lib/libf2c/libU77/datetime_.c new file mode 100644 index 00000000000..62b06b6ad3b --- /dev/null +++ b/gnu/lib/libf2c/libU77/datetime_.c @@ -0,0 +1,99 @@ +/* Copyright (C) 1997, 1998, 1999, 2001 Free Software Foundation, Inc. +This file is part of GNU Fortran libU77 library. + +This library is free software; you can redistribute it and/or modify it +under the terms of the GNU Library General Public License as published +by the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +GNU Fortran is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with GNU Fortran; see the file COPYING.LIB. If +not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif +#include <stdio.h> +#include <sys/types.h> +#if TIME_WITH_SYS_TIME +# include <sys/time.h> +# include <time.h> +#else +# if HAVE_SYS_TIME_H +# include <sys/time.h> +# else +# include <time.h> +# endif +#endif +#include "f2c.h" + +#ifdef KR_headers +VOID s_copy (); +#else +void s_copy(register char *a, register char *b, ftnlen la, ftnlen lb); +#endif + +int G77_date_and_time_0 (char *date, char *fftime, char *zone, + integer *values, ftnlen date_len, + ftnlen fftime_len, ftnlen zone_len) +{ + time_t lt=time(<); + struct tm ltime = *localtime(<), gtime = *gmtime(<); + char dat[9], zon[6], ftim[11]; + int i, vals[8]; + + vals[0] = 1900 + ltime.tm_year; + vals[1] = 1 + ltime.tm_mon; + vals[2] = ltime.tm_mday; + /* fixme: year boundaries */ + vals[3] = (ltime.tm_min - gtime.tm_min + + 60*(ltime.tm_hour - gtime.tm_hour + + 24*(ltime.tm_yday -gtime.tm_yday))); + vals[4] = ltime.tm_hour; + vals[5] = ltime.tm_min; + vals[6] = ltime.tm_sec; + vals[7] = 0; /* no STDC/POSIX way to get this */ + /* GNUish way; maybe use `ftime' on other systems. */ +#if HAVE_GETTIMEOFDAY + { + struct timeval tp; +# if GETTIMEOFDAY_ONE_ARGUMENT + if (! gettimeofday (&tp)) +# else +# if HAVE_STRUCT_TIMEZONE + struct timezone tzp; + /* Some systems such as HPUX, do have struct timezone, but + gettimeofday takes void* as the 2nd arg. However, the effect + of passing anything other than a null pointer is unspecified on + HPUX. Configure checks if gettimeofday actually fails with a + non-NULL arg and pretends that struct timezone is missing if it + does fail. */ + if (! gettimeofday (&tp, &tzp)) +# else + if (! gettimeofday (&tp, (void *) 0)) +# endif /* HAVE_STRUCT_TIMEZONE */ +# endif /* GETTIMEOFDAY_ONE_ARGUMENT */ + vals[7] = tp.tv_usec/1000; + } +#endif /* HAVE_GETTIMEOFDAY */ + if (values) /* null pointer for missing optional */ + for (i=0; i<=7; i++) + values[i] = vals[i]; + sprintf (dat, "%04d%02d%02d", vals[0], vals[1], vals[2]); + s_copy(date, dat, date_len, 8); + if (zone) { + sprintf(zon, "%+03d%02d", vals[3] / 60, abs(vals[3] % 60)); + s_copy(zone, zon, zone_len, 5); + } + if (fftime) { + sprintf (ftim, "%02d%02d%02d.%03d", vals[4], vals[5], vals[6], vals[7]); + s_copy(fftime, ftim, fftime_len, 10); + } + return 0; +} diff --git a/gnu/lib/libf2c/libU77/dbes.c b/gnu/lib/libf2c/libU77/dbes.c new file mode 100644 index 00000000000..1ef5978a8e8 --- /dev/null +++ b/gnu/lib/libf2c/libU77/dbes.c @@ -0,0 +1,46 @@ +/* Copyright (C) 1995, 1996 Free Software Foundation, Inc. +This file is part of GNU Fortran libU77 library. + +This library is free software; you can redistribute it and/or modify it +under the terms of the GNU Library General Public License as published +by the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +GNU Fortran is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with GNU Fortran; see the file COPYING.LIB. If +not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + +#if 0 /* Don't include these unless necessary -- dnp. */ +#include "f2c.h" +#include <math.h> + +double G77_dbesj0_0 (const double *x) { + return j0 (*x); +} + +double G77_dbesj1_0 (const double *x) { + return j1 (*x); +} + +double G77_dbesjn_0 (const integer *n, double *x) { + return jn (*n, *x); + } + +double G77_dbesy0_0 (const double *x) { + return y0 (*x); +} + +double G77_dbesy1_0 (const double *x) { + return y1 (*x); +} + +double G77_dbesyn_0 (const integer *n, double *x) { + return yn (*n, *x); +} +#endif diff --git a/gnu/lib/libf2c/libU77/dtime_.c b/gnu/lib/libf2c/libU77/dtime_.c new file mode 100644 index 00000000000..19100e698de --- /dev/null +++ b/gnu/lib/libf2c/libU77/dtime_.c @@ -0,0 +1,172 @@ +/* Copyright (C) 1995, 1996 Free Software Foundation, Inc. +This file is part of GNU Fortran libU77 library. + +This library is free software; you can redistribute it and/or modify it +under the terms of the GNU Library General Public License as published +by the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +GNU Fortran is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with GNU Fortran; see the file COPYING.LIB. If +not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif +#if HAVE_STDLIB_H +# include <stdlib.h> +#endif +#if HAVE_UNISTD_H +# include <unistd.h> +#endif +#include <sys/types.h> +#if HAVE_SYS_TIMES_H +# include <sys/times.h> +#endif +#if HAVE_SYS_PARAM_H +# include <sys/param.h> +#endif +#if HAVE_GETRUSAGE +# include <sys/time.h> +# include <sys/resource.h> +#endif +#if defined (_WIN32) +# include <windows.h> +# undef min +# undef max +#endif +#include <errno.h> /* for ENOSYS */ +#include "f2c.h" + +/* For dtime, etime we store the clock tick parameter (clk_tck) the + first time either of them is invoked rather than each time. This + approach probably speeds up each invocation by avoiding a system + call each time, but means that the overhead of the first call is + different to all others. */ +static long clk_tck = 0; + +#ifdef KR_headers +double G77_dtime_0 (tarray) + real tarray[2]; +#else +double G77_dtime_0 (real tarray[2]) +#endif +{ +#if defined (_WIN32) + static int win32_platform = -1; + + if (win32_platform == -1) + { + OSVERSIONINFO osv; + osv.dwOSVersionInfoSize = sizeof (osv); + GetVersionEx (&osv); + win32_platform = osv.dwPlatformId; + } + + /* We need to use this hack on non-NT platforms, where the first call + returns 0.0 and subsequent ones return the correct value. */ + if (win32_platform != VER_PLATFORM_WIN32_NT) + { + static unsigned long long clock_freq; + static unsigned long long old_count; + unsigned long long count; + double delta; + LARGE_INTEGER counter_val; + + if (clock_freq == 0) + { + LARGE_INTEGER freq; + if (! QueryPerformanceFrequency (&freq)) + { + errno = ENOSYS; + return 0.0; + } + else + { + clock_freq = ((unsigned long long) freq.HighPart << 32) + + ((unsigned) freq.LowPart); + } + } + + if (! QueryPerformanceCounter (&counter_val)) + return -1.0; + + count = ((unsigned long long) counter_val.HighPart << 32) + + (unsigned) counter_val.LowPart; + delta = ((double) (count - old_count)) / clock_freq; + tarray[0] = (float) delta; + tarray[1] = 0.0; + old_count = count; + } + else + { + static unsigned long long old_utime, old_stime; + unsigned long long utime, stime; + FILETIME creation_time, exit_time, kernel_time, user_time; + + GetProcessTimes (GetCurrentProcess (), &creation_time, &exit_time, + &kernel_time, &user_time); + utime = ((unsigned long long) user_time.dwHighDateTime << 32) + + (unsigned) user_time.dwLowDateTime; + stime = ((unsigned long long) kernel_time.dwHighDateTime << 32) + + (unsigned) kernel_time.dwLowDateTime; + + tarray[0] = (utime - old_utime) / 1.0e7; + tarray[1] = (stime - old_stime) / 1.0e7; + old_utime = utime; + old_stime = stime; + } + return tarray[0] + tarray[1]; + +#elif defined (HAVE_GETRUSAGE) || defined (HAVE_TIMES) + /* The getrusage version is only the default for convenience. */ +#ifdef HAVE_GETRUSAGE + float utime, stime; + static float old_utime = 0.0, old_stime = 0.0; + struct rusage rbuff; + + if (getrusage (RUSAGE_SELF, &rbuff) != 0) + abort (); + utime = (float) (rbuff.ru_utime).tv_sec + + (float) (rbuff.ru_utime).tv_usec/1000000.0; + tarray[0] = utime - (float) old_utime; + stime = (float) (rbuff.ru_stime).tv_sec + + (float) (rbuff.ru_stime).tv_usec/1000000.0; + tarray[1] = stime - old_stime; +#else /* HAVE_GETRUSAGE */ + time_t utime, stime; + static time_t old_utime = 0, old_stime = 0; + struct tms buffer; + +/* NeXTStep seems to define _SC_CLK_TCK but not to have sysconf; + fixme: does using _POSIX_VERSION help? */ +# if defined _SC_CLK_TCK && defined _POSIX_VERSION + if (! clk_tck) clk_tck = sysconf(_SC_CLK_TCK); +# elif defined CLOCKS_PER_SECOND + if (! clk_tck) clk_tck = CLOCKS_PER_SECOND; +# elif defined CLK_TCK + if (! clk_tck) clk_tck = CLK_TCK; +# elif defined HZ + if (! clk_tck) clk_tck = HZ; +# elif defined HAVE_GETRUSAGE +# else + #error Dont know clock tick length +# endif + if (times(&buffer) == (clock_t)-1) return -1.0; + utime = buffer.tms_utime; stime = buffer.tms_stime; + tarray[0] = ((float)(utime - old_utime)) / (float)clk_tck; + tarray[1] = ((float)(stime - old_stime)) / (float)clk_tck; +#endif /* HAVE_GETRUSAGE */ + old_utime = utime; old_stime = stime; + return (tarray[0]+tarray[1]); +#else /* ! HAVE_GETRUSAGE && ! HAVE_TIMES */ + errno = ENOSYS; + return 0.0; +#endif /* ! HAVE_GETRUSAGE && ! HAVE_TIMES */ +} diff --git a/gnu/lib/libf2c/libU77/etime_.c b/gnu/lib/libf2c/libU77/etime_.c new file mode 100644 index 00000000000..88eead3fbb4 --- /dev/null +++ b/gnu/lib/libf2c/libU77/etime_.c @@ -0,0 +1,163 @@ +/* Copyright (C) 1995, 1996 Free Software Foundation, Inc. +This file is part of GNU Fortran libU77 library. + +This library is free software; you can redistribute it and/or modify it +under the terms of the GNU Library General Public License as published +by the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +GNU Fortran is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with GNU Fortran; see the file COPYING.LIB. If +not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif +#if HAVE_STDLIB_H +# include <stdlib.h> +#endif +#if HAVE_UNISTD_H +# include <unistd.h> +#endif +#include <sys/types.h> +#if HAVE_SYS_TIMES_H +# include <sys/times.h> +#endif +#if HAVE_SYS_PARAM_H +# include <sys/param.h> +#endif +#if HAVE_GETRUSAGE +# include <sys/time.h> +# include <sys/resource.h> +#endif +#if defined (_WIN32) +# include <windows.h> +# undef min +# undef max +#endif +#include <errno.h> /* for ENOSYS */ +#include "f2c.h" + +/* For dtime, etime we store the clock tick parameter (clk_tck) the + first time either of them is invoked rather than each time. This + approach probably speeds up each invocation by avoiding a system + call each time, but means that the overhead of the first call is + different to all others. */ +static long clk_tck = 0; + +#ifdef KR_headers +double G77_etime_0 (tarray) + real tarray[2]; +#else +double G77_etime_0 (real tarray[2]) +#endif +{ +#if defined (_WIN32) + static int win32_platform = -1; + double usertime, systime; + + if (win32_platform == -1) + { + OSVERSIONINFO osv; + osv.dwOSVersionInfoSize = sizeof (osv); + GetVersionEx (&osv); + win32_platform = osv.dwPlatformId; + } + + /* non-NT platforms don't have a clue as to how long a process has + been running, so simply return the uptime. Bad judgement call? */ + if (win32_platform != VER_PLATFORM_WIN32_NT) + { + static unsigned long long clock_freq; + static unsigned long long old_count; + unsigned long long count; + LARGE_INTEGER counter_val; + + if (clock_freq == 0) + { + LARGE_INTEGER freq; + if (! QueryPerformanceFrequency (&freq)) + { + errno = ENOSYS; + return 0.0; + } + else + { + clock_freq = ((unsigned long long) freq.HighPart << 32) + + ((unsigned) freq.LowPart); + if (! QueryPerformanceCounter (&counter_val)) + return -1.0; + old_count = ((unsigned long long) counter_val.HighPart << 32) + + (unsigned) counter_val.LowPart; + } + } + + if (! QueryPerformanceCounter (&counter_val)) + return -1.0; + + count = ((unsigned long long) counter_val.HighPart << 32) + + (unsigned) counter_val.LowPart; + tarray[0] = usertime = (double) (count - old_count) / clock_freq; + tarray[1] = systime = 0.0; + } + else + { + FILETIME creation_time, exit_time, kernel_time, user_time; + unsigned long long utime, stime; + + GetProcessTimes (GetCurrentProcess (), &creation_time, &exit_time, + &kernel_time, &user_time); + utime = ((unsigned long long) user_time.dwHighDateTime << 32) + + (unsigned) user_time.dwLowDateTime; + stime = ((unsigned long long) kernel_time.dwHighDateTime << 32) + + (unsigned) kernel_time.dwLowDateTime; + + tarray[0] = usertime = utime / 1.0e7; + tarray[1] = systime = stime / 1.0e7; + } + return usertime + systime; + +#elif defined (HAVE_GETRUSAGE) || defined (HAVE_TIMES) + /* The getrusage version is only the default for convenience. */ +#ifdef HAVE_GETRUSAGE + struct rusage rbuff; + + if (getrusage (RUSAGE_SELF, &rbuff) != 0) + abort (); + tarray[0] = ((float) (rbuff.ru_utime).tv_sec + + (float) (rbuff.ru_utime).tv_usec/1000000.0); + tarray[1] = ((float) (rbuff.ru_stime).tv_sec + + (float) (rbuff.ru_stime).tv_usec/1000000.0); +#else /* HAVE_GETRUSAGE */ + struct tms buffer; + +/* NeXTStep seems to define _SC_CLK_TCK but not to have sysconf; + fixme: does using _POSIX_VERSION help? */ +# if defined _SC_CLK_TCK && defined _POSIX_VERSION + if (! clk_tck) clk_tck = sysconf(_SC_CLK_TCK); +# elif defined CLOCKS_PER_SECOND + if (! clk_tck) clk_tck = CLOCKS_PER_SECOND; +# elif defined CLK_TCK + if (! clk_tck) clk_tck = CLK_TCK; +# elif defined HZ + if (! clk_tck) clk_tck = HZ; +# elif defined HAVE_GETRUSAGE +# else + #error Dont know clock tick length +# endif + if (times(&buffer) == (clock_t)-1) return -1.0; + tarray[0] = (float) buffer.tms_utime / (float)clk_tck; + tarray[1] = (float) buffer.tms_stime / (float)clk_tck; +#endif /* HAVE_GETRUSAGE */ + return (tarray[0]+tarray[1]); +#else /* ! HAVE_GETRUSAGE && ! HAVE_TIMES */ + errno = ENOSYS; + return 0.0; +#endif /* ! HAVE_GETRUSAGE && ! HAVE_TIMES */ +} diff --git a/gnu/lib/libf2c/libU77/fdate_.c b/gnu/lib/libf2c/libU77/fdate_.c new file mode 100644 index 00000000000..a0bc9836f44 --- /dev/null +++ b/gnu/lib/libf2c/libU77/fdate_.c @@ -0,0 +1,54 @@ +/* Copyright (C) 1995, 1996, 2001 Free Software Foundation, Inc. +This file is part of GNU Fortran libU77 library. + +This library is free software; you can redistribute it and/or modify it +under the terms of the GNU Library General Public License as published +by the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +GNU Fortran is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with GNU Fortran; see the file COPYING.LIB. If +not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif +#include <stdio.h> +#include <sys/types.h> +#if TIME_WITH_SYS_TIME +# include <sys/time.h> +# include <time.h> +#else +# if HAVE_SYS_TIME_H +# include <sys/time.h> +# else +# include <time.h> +# endif +#endif +#if HAVE_STRING_H +# include <string.h> +#else +# include <strings.h> +#endif + +#include "f2c.h" + +/* NB. this implementation is for a character*24 function. There's + also a subroutine version. Of course, the calling convention is + essentially the same for both. */ + +/* Character *24 */ void G77_fdate_0 (char *ret_val, ftnlen ret_val_len) +{ + int s_copy (); + time_t tloc; + tloc = time (NULL); + /* Allow a length other than 24 for compatibility with what other + systems do, despite it being documented as 24. */ + s_copy (ret_val, ctime ((time_t *) &tloc), ret_val_len, 24); +} diff --git a/gnu/lib/libf2c/libU77/fgetc_.c b/gnu/lib/libf2c/libU77/fgetc_.c new file mode 100644 index 00000000000..49f39830d2c --- /dev/null +++ b/gnu/lib/libf2c/libU77/fgetc_.c @@ -0,0 +1,70 @@ +/* Copyright (C) 1996 Free Software Foundation, Inc. +This file is part of GNU Fortran libU77 library. + +This library is free software; you can redistribute it and/or modify it +under the terms of the GNU Library General Public License as published +by the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +GNU Fortran is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with GNU Fortran; see the file COPYING.LIB. If +not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif +#include <stdio.h> +#include "f2c.h" +#include "fio.h" + +#ifdef KR_headers +integer G77_fgetc_0 (lunit, c, Lc) + integer *lunit; + ftnlen Lc; /* should be 1 */ + char *c; +#else +integer G77_fgetc_0 (const integer *lunit, char *c, ftnlen Lc) +#endif +{ + int err; + FILE *f = f__units[*lunit].ufd; + + if (*lunit>=MXUNIT || *lunit<0) + return 101; /* bad unit error */ + err = getc (f); + if (err == EOF) { + if (feof (f)) + return -1; + else + return ferror (f); } + else { + if (Lc == 0) + return 0; + + c[0] = err; + while (--Lc) + *++c = ' '; + return 0; } +} + +#ifdef KR_headers +integer G77_fget_0 (c, Lc) + ftnlen Lc; /* should be 1 */ + char *c; +#else +integer G77_fget_0 (char *c, const ftnlen Lc) +#endif +{ + integer five = 5; + + return G77_fgetc_0 (&five, c, Lc); +} diff --git a/gnu/lib/libf2c/libU77/flush1_.c b/gnu/lib/libf2c/libU77/flush1_.c new file mode 100644 index 00000000000..451915debac --- /dev/null +++ b/gnu/lib/libf2c/libU77/flush1_.c @@ -0,0 +1,46 @@ +/* Copyright (C) 1995 Free Software Foundation, Inc. +This file is part of GNU Fortran libU77 library. + +This library is free software; you can redistribute it and/or modify it +under the terms of the GNU Library General Public License as published +by the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +GNU Fortran is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with GNU Fortran; see the file COPYING.LIB. If +not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif +#include <stdio.h> +#include "f2c.h" +#include "fio.h" + +/* This flushes a single unit, c.f. libI77 version. */ + +#ifdef KR_headers +extern integer G77_fnum_0 (); + +/* Subroutine */ int G77_flush1_0 (lunit) + integer *lunit; +#else +extern integer G77_fnum_0 (integer *); + +/* Subroutine */ int G77_flush1_0 (const integer *lunit) +#endif +{ + if (*lunit>=MXUNIT || *lunit<0) + err(1,101,"flush"); + /* f__units is a table of descriptions for the unit numbers (defined + in io.h) with file descriptors rather than streams */ + if (f__units[*lunit].ufd != NULL && f__units[*lunit].uwrt) + fflush(f__units[*lunit].ufd); + return 0; +} diff --git a/gnu/lib/libf2c/libU77/fnum_.c b/gnu/lib/libf2c/libU77/fnum_.c new file mode 100644 index 00000000000..0a3ba013e06 --- /dev/null +++ b/gnu/lib/libf2c/libU77/fnum_.c @@ -0,0 +1,38 @@ +/* Copyright (C) 1995 Free Software Foundation, Inc. +This file is part of GNU Fortran libU77 library. + +This library is free software; you can redistribute it and/or modify it +under the terms of the GNU Library General Public License as published +by the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +GNU Fortran is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with GNU Fortran; see the file COPYING.LIB. If +not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif +#include "f2c.h" +#include "fio.h" + +#ifdef KR_headers +integer G77_fnum_0 (lunit) + integer *lunit; +#else +integer G77_fnum_0 (integer *lunit) +#endif +{ + if (*lunit>=MXUNIT || *lunit<0) + err(1,101,"fnum"); + /* f__units is a table of descriptions for the unit numbers (defined + in io.h). Use file descriptor (ufd) and fileno rather than udev + field since udev is unix specific */ + return fileno(f__units[*lunit].ufd); +} diff --git a/gnu/lib/libf2c/libU77/fputc_.c b/gnu/lib/libf2c/libU77/fputc_.c new file mode 100644 index 00000000000..5a1109e8d4f --- /dev/null +++ b/gnu/lib/libf2c/libU77/fputc_.c @@ -0,0 +1,65 @@ +/* Copyright (C) 1996 Free Software Foundation, Inc. +This file is part of GNU Fortran libU77 library. + +This library is free software; you can redistribute it and/or modify it +under the terms of the GNU Library General Public License as published +by the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +GNU Fortran is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with GNU Fortran; see the file COPYING.LIB. If +not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif +#include <stdio.h> +#include "f2c.h" +#include "fio.h" + +#ifdef KR_headers +integer G77_fputc_0 (lunit, c, Lc) + integer *lunit; + ftnlen Lc; /* should be 1 */ + char *c; +#else +integer G77_fputc_0 (const integer *lunit, const char *c, const ftnlen Lc) +#endif +{ + int err; + FILE *f = f__units[*lunit].ufd; + + if (*lunit>=MXUNIT || *lunit<0) + return 101; /* bad unit error */ + err = putc (c[0], f); + if (err == EOF) { + if (feof (f)) + return -1; + else + return ferror (f); + } + else + return 0; +} + +#ifdef KR_headers +integer G77_fput_0 (c, Lc) + ftnlen Lc; /* should be 1 */ + char *c; +#else +integer G77_fput_0 (const char *c, const ftnlen Lc) +#endif +{ + integer six = 6; + + return G77_fputc_0 (&six, c, Lc); +} diff --git a/gnu/lib/libf2c/libU77/fstat_.c b/gnu/lib/libf2c/libU77/fstat_.c new file mode 100644 index 00000000000..da5434ad0b7 --- /dev/null +++ b/gnu/lib/libf2c/libU77/fstat_.c @@ -0,0 +1,71 @@ +/* Copyright (C) 1995 Free Software Foundation, Inc. +This file is part of GNU Fortran libU77 library. + +This library is free software; you can redistribute it and/or modify it +under the terms of the GNU Library General Public License as published +by the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +GNU Fortran is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with GNU Fortran; see the file COPYING.LIB. If +not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif +#include "f2c.h" +#include <sys/types.h> +#include <sys/stat.h> + +#ifdef KR_headers +extern integer G77_fnum_0 (); + +integer G77_fstat_0 (lunit, statb) + integer *lunit; + integer statb[13]; +#else +extern integer G77_fnum_0 (const integer *); + +integer G77_fstat_0 (const integer *lunit, integer statb[13]) +#endif +{ + int err; + struct stat buf; + + err = fstat (G77_fnum_0 (lunit), &buf); + statb[0] = buf.st_dev; + statb[1] = buf.st_ino; + statb[2] = buf.st_mode; + statb[3] = buf.st_nlink; + statb[4] = buf.st_uid; + statb[5] = buf.st_gid; +#if HAVE_ST_RDEV + statb[6] = buf.st_rdev; /* not posix */ +#else + statb[6] = 0; +#endif + statb[7] = buf.st_size; + statb[8] = buf.st_atime; + statb[9] = buf.st_mtime; + statb[10] = buf.st_ctime; +#if HAVE_ST_BLKSIZE + statb[11] = buf.st_blksize; /* not posix */ +#else + statb[11] = -1; +#endif +#if HAVE_ST_BLOCKS + statb[12] = buf.st_blocks; /* not posix */ +#else + statb[12] = -1; +#endif + return err; +} diff --git a/gnu/lib/libf2c/libU77/gerror_.c b/gnu/lib/libf2c/libU77/gerror_.c new file mode 100644 index 00000000000..6f5943c1dce --- /dev/null +++ b/gnu/lib/libf2c/libU77/gerror_.c @@ -0,0 +1,49 @@ +/* Copyright (C) 1995 Free Software Foundation, Inc. +This file is part of GNU Fortran libU77 library. + +This library is free software; you can redistribute it and/or modify it +under the terms of the GNU Library General Public License as published +by the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +GNU Fortran is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with GNU Fortran; see the file COPYING.LIB. If +not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif +#include <errno.h> +#include <stddef.h> +#if HAVE_STRING_H +# include <string.h> +#else +# include <strings.h> +#endif +#include "f2c.h" + +#ifndef HAVE_STRERROR + extern char *sys_errlist []; +# define strerror(i) (sys_errlist[i]) +#endif +#ifdef KR_headers +extern void s_copy (); +/* Subroutine */ int G77_gerror_0 (str, Lstr) + char *str; ftnlen Lstr; +#else +extern void s_copy(register char *a, register char *b, ftnlen la, ftnlen lb); +/* Subroutine */ int G77_gerror_0 (char *str, ftnlen Lstr) +#endif +{ + char * s; + + s = strerror(errno); + s_copy (str, s, Lstr, strlen (s)); + return 0; +} diff --git a/gnu/lib/libf2c/libU77/getcwd_.c b/gnu/lib/libf2c/libU77/getcwd_.c new file mode 100644 index 00000000000..e757803896a --- /dev/null +++ b/gnu/lib/libf2c/libU77/getcwd_.c @@ -0,0 +1,99 @@ +/* Copyright (C) 1995, 1996 Free Software Foundation, Inc. +This file is part of GNU Fortran libU77 library. + +This library is free software; you can redistribute it and/or modify it +under the terms of the GNU Library General Public License as published +by the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +GNU Fortran is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with GNU Fortran; see the file COPYING.LIB. If +not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif +#include <errno.h> +#if HAVE_STRING_H +# include <string.h> +#else +# include <strings.h> +#endif +#include <stdio.h> /* for NULL */ +#include <errno.h> /* for ENOSYS */ +#include "f2c.h" + +#if HAVE_GETCWD + +#ifdef HAVE_UNISTD_H +# include <unistd.h> +#else + extern char *getcwd (); +#endif + +#ifdef KR_headers +extern void s_copy (); +integer G77_getcwd_0 (str, Lstr) + char *str; ftnlen Lstr; +#else +extern void s_copy(register char *a, register char *b, ftnlen la, ftnlen lb); +integer G77_getcwd_0 (char *str, const ftnlen Lstr) +#endif +{ + int i; + char *ret; + + ret = getcwd (str, Lstr); + if (ret == NULL) return errno; + for (i=strlen(str); i<Lstr; i++) + str[i] = ' '; + return 0; +} + +#elif HAVE_GETWD /* HAVE_GETCWD */ + +/* getwd usage taken from SunOS4 man */ + +# include <sys/param.h> + extern char *getwd (); +#ifdef KR_headers +extern VOID s_copy (); +integer G77_getcwd_0 (str, Lstr) + char *str; ftnlen Lstr; +#else +extern void s_copy(register char *a, register char *b, ftnlen la, ftnlen lb); +integer G77_getcwd_0 (char *str, const ftnlen Lstr) +#endif +{ + char pathname[MAXPATHLEN]; + size_t l; + + if (getwd (pathname) == NULL) { + return errno; + } else { + s_copy (str, pathname, Lstr, strlen (str)); + return 0; + } +} + +#else /* !HAVE_GETWD && !HAVE_GETCWD */ + +#ifdef KR_headers +extern VOID s_copy (); +integer G77_getcwd_0 (str, Lstr) + char *str; ftnlen Lstr; +#else +extern void s_copy(register char *a, register char *b, ftnlen la, ftnlen lb); +integer G77_getcwd_0 (char *str, const ftnlen Lstr) +#endif +{ + return errno = ENOSYS; +} + +#endif diff --git a/gnu/lib/libf2c/libU77/getgid_.c b/gnu/lib/libf2c/libU77/getgid_.c new file mode 100644 index 00000000000..b489bacc6ed --- /dev/null +++ b/gnu/lib/libf2c/libU77/getgid_.c @@ -0,0 +1,41 @@ +/* Copyright (C) 1995 Free Software Foundation, Inc. +This file is part of GNU Fortran libU77 library. + +This library is free software; you can redistribute it and/or modify it +under the terms of the GNU Library General Public License as published +by the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +GNU Fortran is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with GNU Fortran; see the file COPYING.LIB. If +not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif +#if HAVE_UNISTD_H +#include <unistd.h> +#endif +#include <sys/types.h> +#include <errno.h> /* for ENOSYS */ +#include "f2c.h" + +#ifdef KR_headers +integer G77_getgid_0 () +#else +integer G77_getgid_0 (void) +#endif +{ +#if defined (HAVE_GETGID) + return getgid (); +#else + errno = ENOSYS; + return -1; +#endif +} diff --git a/gnu/lib/libf2c/libU77/getlog_.c b/gnu/lib/libf2c/libU77/getlog_.c new file mode 100644 index 00000000000..82cb564a67a --- /dev/null +++ b/gnu/lib/libf2c/libU77/getlog_.c @@ -0,0 +1,71 @@ +/* Copyright (C) 1995 Free Software Foundation, Inc. +This file is part of GNU Fortran libU77 library. + +This library is free software; you can redistribute it and/or modify it +under the terms of the GNU Library General Public License as published +by the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +GNU Fortran is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with GNU Fortran; see the file COPYING.LIB. If +not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif +#include <sys/types.h> +#if HAVE_STDLIB_H +# include <stdlib.h> +#else +# include <stdio.h> +#endif +#include <stdio.h> +#if HAVE_UNISTD_H +# include <unistd.h> +#endif +#if HAVE_STRING_H +# include <string.h> +#else +# include <strings.h> +#endif +#include <errno.h> /* for ENOSYS */ +#include "f2c.h" + +/* getlogin not in svr1-3 */ + +/* SGI also has character*(*) function getlog() */ + +#ifdef KR_headers +extern VOID s_copy (); +/* Subroutine */ int G77_getlog_0 (str, Lstr) + char *str; ftnlen Lstr; +#else +extern void s_copy(register char *a, register char *b, ftnlen la, ftnlen lb); +/* Subroutine */ int G77_getlog_0 (char *str, const ftnlen Lstr) +#endif +{ + size_t i; + char *p; + int status; + +#if defined (HAVE_GETLOGIN) + p = getlogin (); + if (p != NULL) { + i = strlen (p); + s_copy (str, p, Lstr, i); + } else { + s_copy (str, " ", Lstr, 1); + } + status = 0; +#else + errno = ENOSYS; + status = -1; +#endif + return status; +} diff --git a/gnu/lib/libf2c/libU77/getpid_.c b/gnu/lib/libf2c/libU77/getpid_.c new file mode 100644 index 00000000000..fa484785957 --- /dev/null +++ b/gnu/lib/libf2c/libU77/getpid_.c @@ -0,0 +1,35 @@ +/* Copyright (C) 1995 Free Software Foundation, Inc. +This file is part of GNU Fortran libU77 library. + +This library is free software; you can redistribute it and/or modify it +under the terms of the GNU Library General Public License as published +by the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +GNU Fortran is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with GNU Fortran; see the file COPYING.LIB. If +not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif +#if HAVE_UNISTD_H +#include <unistd.h> +#endif +#include <sys/types.h> +#include "f2c.h" + +#ifdef KR_headers +integer G77_getpid_0 () +#else +integer G77_getpid_0 (void) +#endif +{ + return getpid (); +} diff --git a/gnu/lib/libf2c/libU77/getuid_.c b/gnu/lib/libf2c/libU77/getuid_.c new file mode 100644 index 00000000000..408ff0ab600 --- /dev/null +++ b/gnu/lib/libf2c/libU77/getuid_.c @@ -0,0 +1,41 @@ +/* Copyright (C) 1995 Free Software Foundation, Inc. +This file is part of GNU Fortran libU77 library. + +This library is free software; you can redistribute it and/or modify it +under the terms of the GNU Library General Public License as published +by the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +GNU Fortran is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with GNU Fortran; see the file COPYING.LIB. If +not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif +#if HAVE_UNISTD_H +#include <unistd.h> +#endif +#include <sys/types.h> +#include <errno.h> /* for ENOSYS */ +#include "f2c.h" + +#ifdef KR_headers +integer G77_getuid_0 () +#else +integer G77_getuid_0 (void) +#endif +{ +#if defined (HAVE_GETUID) + return getuid (); +#else + errno = ENOSYS; + return -1; +#endif +} diff --git a/gnu/lib/libf2c/libU77/gmtime_.c b/gnu/lib/libf2c/libU77/gmtime_.c new file mode 100644 index 00000000000..8036b5aabe4 --- /dev/null +++ b/gnu/lib/libf2c/libU77/gmtime_.c @@ -0,0 +1,56 @@ +/* Copyright (C) 1995, 2001 Free Software Foundation, Inc. +This file is part of GNU Fortran libU77 library. + +This library is free software; you can redistribute it and/or modify it +under the terms of the GNU Library General Public License as published +by the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +GNU Fortran is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with GNU Fortran; see the file COPYING.LIB. If +not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif +#include <sys/types.h> +/* fixme: do we need to use TM_IN_SYS_TIME? */ +#if TIME_WITH_SYS_TIME +# include <sys/time.h> +# include <time.h> +#else +# if HAVE_SYS_TIME_H +# include <sys/time.h> +# else +# include <time.h> +# endif +#endif +#include "f2c.h" + +#ifdef KR_headers +/* Subroutine */ int G77_gmtime_0 (xstime, tarray) + integer *xstime, tarray[9]; +#else +/* Subroutine */ int G77_gmtime_0 (const integer * xstime, integer tarray[9]) +#endif +{ + struct tm *lt; + time_t stime = *xstime; + lt = gmtime (&stime); + tarray[0] = lt->tm_sec; + tarray[1] = lt->tm_min; + tarray[2] = lt->tm_hour; + tarray[3] = lt->tm_mday; + tarray[4] = lt->tm_mon; + tarray[5] = lt->tm_year; + tarray[6] = lt->tm_wday; + tarray[7] = lt->tm_yday; + tarray[8] = lt->tm_isdst; + return 0; +} diff --git a/gnu/lib/libf2c/libU77/hostnm_.c b/gnu/lib/libf2c/libU77/hostnm_.c new file mode 100644 index 00000000000..fd717b9f857 --- /dev/null +++ b/gnu/lib/libf2c/libU77/hostnm_.c @@ -0,0 +1,49 @@ +/* Copyright (C) 1995 Free Software Foundation, Inc. +This file is part of GNU Fortran libU77 library. + +This library is free software; you can redistribute it and/or modify it +under the terms of the GNU Library General Public License as published +by the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +GNU Fortran is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with GNU Fortran; see the file COPYING.LIB. If +not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif +#if HAVE_STRING_H +# include <string.h> +#else +# include <strings.h> +#endif +#if HAVE_UNISTD_H +# include <unistd.h> +#endif +#include <errno.h> /* for ENOSYS */ +#include "f2c.h" + +integer G77_hostnm_0 (char *name, ftnlen Lname) +{ + int ret, i; + +#if HAVE_GETHOSTNAME + ret = gethostname (name, Lname); + if (ret==0) { + /* Pad with blanks (assuming gethostname will make an error + return if it can't fit in the null). */ + for (i=strlen(name); i<Lname; i++) + name[i] = ' '; + } + return ret; +#else + return errno = ENOSYS; +#endif +} diff --git a/gnu/lib/libf2c/libU77/idate_.c b/gnu/lib/libf2c/libU77/idate_.c new file mode 100644 index 00000000000..572efd956eb --- /dev/null +++ b/gnu/lib/libf2c/libU77/idate_.c @@ -0,0 +1,58 @@ +/* Copyright (C) 1995, 1996, 2001 Free Software Foundation, Inc. +This file is part of GNU Fortran libU77 library. + +This library is free software; you can redistribute it and/or modify it +under the terms of the GNU Library General Public License as published +by the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +GNU Fortran is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with GNU Fortran; see the file COPYING.LIB. If +not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif +#include <stdio.h> +#include <sys/types.h> +#if TIME_WITH_SYS_TIME +# include <sys/time.h> +# include <time.h> +#else +# if HAVE_SYS_TIME_H +# include <sys/time.h> +# else +# include <time.h> +# endif +#endif +#include "f2c.h" + +/* VMS and Irix versions (at least) differ from libU77 elsewhere */ + +/* libU77 one: */ + +#ifdef KR_headers +/* Subroutine */ int G77_idate_0 (iarray) + int iarray[3]; +#else +/* Subroutine */ int G77_idate_0 (int iarray[3]) +#endif +{ + struct tm *lt; + time_t tim; + tim = time(NULL); + lt = localtime(&tim); + iarray[0] = lt->tm_mday; + iarray[1] = lt->tm_mon + 1; /* in range 1-12 in SunOS (experimentally) */ + /* The `+1900' is consistent with SunOS and Irix, but they don't say + it's added. I think I've seen a system where tm_year was since + 1970, but can't now verify that, so assume the ANSI definition. */ + iarray[2] = lt->tm_year + 1900; + return 0; +} diff --git a/gnu/lib/libf2c/libU77/ierrno_.c b/gnu/lib/libf2c/libU77/ierrno_.c new file mode 100644 index 00000000000..557b53a4664 --- /dev/null +++ b/gnu/lib/libf2c/libU77/ierrno_.c @@ -0,0 +1,32 @@ +/* Copyright (C) 1995 Free Software Foundation, Inc. +This file is part of GNU Fortran libU77 library. + +This library is free software; you can redistribute it and/or modify it +under the terms of the GNU Library General Public License as published +by the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +GNU Fortran is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with GNU Fortran; see the file COPYING.LIB. If +not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif +#include <errno.h> +#include "f2c.h" + +#ifdef KR_headers +integer G77_ierrno_0 () +#else +integer G77_ierrno_0 (void) +#endif +{ + return errno; +} diff --git a/gnu/lib/libf2c/libU77/irand_.c b/gnu/lib/libf2c/libU77/irand_.c new file mode 100644 index 00000000000..2bf14ccee26 --- /dev/null +++ b/gnu/lib/libf2c/libU77/irand_.c @@ -0,0 +1,57 @@ +/* Copyright (C) 1995 Free Software Foundation, Inc. +This file is part of GNU Fortran libU77 library. + +This library is free software; you can redistribute it and/or modify it +under the terms of the GNU Library General Public License as published +by the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +GNU Fortran is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with GNU Fortran; see the file COPYING.LIB. If +not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif +#if HAVE_STDLIB_H +# include <stdlib.h> +#endif +#include "f2c.h" + +/* We could presumably do much better than the traditional libc + version, though at least the glibc one is reasonable, it seems. + For the sake of the innocent, I'm not sure we should really do + this... */ + +/* Note this is per SunOS -- other s may have no arg. */ + +#ifdef KR_headers +integer G77_irand_0 (flag) + integer *flag; +#else +integer G77_irand_0 (integer *flag) +#endif +{ + switch (*flag) { + case 0: + break; + case 1: + srand (0); /* Arbitrary choice of initialiser. */ + break; + default: + srand (*flag); + } + return rand (); +} + + + + + + diff --git a/gnu/lib/libf2c/libU77/isatty_.c b/gnu/lib/libf2c/libU77/isatty_.c new file mode 100644 index 00000000000..92c33468f53 --- /dev/null +++ b/gnu/lib/libf2c/libU77/isatty_.c @@ -0,0 +1,44 @@ +/* Copyright (C) 1995 Free Software Foundation, Inc. +This file is part of GNU Fortran libU77 library. + +This library is free software; you can redistribute it and/or modify it +under the terms of the GNU Library General Public License as published +by the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +GNU Fortran is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with GNU Fortran; see the file COPYING.LIB. If +not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif +#if HAVE_UNISTD_H +# include <unistd.h> +#endif +#include "f2c.h" +#include "fio.h" + +#ifdef KR_headers +extern integer G77_fnum_0 (); + +logical G77_isatty_0 (lunit) + integer *lunit; +#else +extern integer G77_fnum_0 (integer *); + +logical G77_isatty_0 (integer *lunit) +#endif +{ + if (*lunit>=MXUNIT || *lunit<0) + err(1,101,"isatty"); + /* f__units is a table of descriptions for the unit numbers (defined + in io.h) with file descriptors rather than streams */ + return (isatty(G77_fnum_0 (lunit)) ? TRUE_ : FALSE_); +} diff --git a/gnu/lib/libf2c/libU77/itime_.c b/gnu/lib/libf2c/libU77/itime_.c new file mode 100644 index 00000000000..ad47872dc8d --- /dev/null +++ b/gnu/lib/libf2c/libU77/itime_.c @@ -0,0 +1,52 @@ +/* Copyright (C) 1995, 2001 Free Software Foundation, Inc. +This file is part of GNU Fortran libU77 library. + +This library is free software; you can redistribute it and/or modify it +under the terms of the GNU Library General Public License as published +by the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +GNU Fortran is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with GNU Fortran; see the file COPYING.LIB. If +not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif +#include <stdio.h> +#include <sys/types.h> +#if TIME_WITH_SYS_TIME +# include <sys/time.h> +# include <time.h> +#else +# if HAVE_SYS_TIME_H +# include <sys/time.h> +# else +# include <time.h> +# endif +#endif +#include "f2c.h" + +#ifdef KR_headers +/* Subroutine */ int G77_itime_0 (tarray) + integer tarray[3]; +#else +/* Subroutine */ int G77_itime_0 (integer tarray[3]) +#endif +{ + struct tm *lt; + time_t tim; + + tim = time(NULL); + lt = localtime(&tim); + tarray[0] = lt->tm_hour; + tarray[1] = lt->tm_min; + tarray[2] = lt->tm_sec; + return 0; +} diff --git a/gnu/lib/libf2c/libU77/kill_.c b/gnu/lib/libf2c/libU77/kill_.c new file mode 100644 index 00000000000..99197bd02e7 --- /dev/null +++ b/gnu/lib/libf2c/libU77/kill_.c @@ -0,0 +1,42 @@ +/* Copyright (C) 1995 Free Software Foundation, Inc. +This file is part of GNU Fortran libU77 library. + +This library is free software; you can redistribute it and/or modify it +under the terms of the GNU Library General Public License as published +by the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +GNU Fortran is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with GNU Fortran; see the file COPYING.LIB. If +not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif +#include <sys/types.h> +#include <signal.h> +#include <errno.h> +#include "f2c.h" + +/* fixme: bsd, svr1-3 use int, not pid_t */ + +#ifdef KR_headers +integer G77_kill_0 (pid, signum) + integer *pid, *signum; +#else +integer G77_kill_0 (const integer *pid, const integer *signum) +#endif +{ +#if defined (HAVE_KILL) + return kill ((pid_t) *pid, *signum) ? errno : 0; +#else + errno = ENOSYS; + return -1; +#endif +} diff --git a/gnu/lib/libf2c/libU77/link_.c b/gnu/lib/libf2c/libU77/link_.c new file mode 100644 index 00000000000..003fac8ffe2 --- /dev/null +++ b/gnu/lib/libf2c/libU77/link_.c @@ -0,0 +1,66 @@ +/* Copyright (C) 1995, 1997 Free Software Foundation, Inc. +This file is part of GNU Fortran libU77 library. + +This library is free software; you can redistribute it and/or modify it +under the terms of the GNU Library General Public License as published +by the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +GNU Fortran is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with GNU Fortran; see the file COPYING.LIB. If +not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif +#if HAVE_STDLIB_H +# include <stdlib.h> +#else +# include <stdio.h> +#endif +#if HAVE_UNISTD_H +# include <unistd.h> +#endif +#include <errno.h> +#if HAVE_SYS_PARAM_H +# include <sys/param.h> +#endif +#include <errno.h> /* for ENOSYS */ +#include "f2c.h" + +#ifdef KR_headers +void g_char (); + +integer G77_link_0 (path1, path2, Lpath1, Lpath2) + char *path1, *path2; ftnlen Lpath1, Lpath2; +#else +void g_char(const char *a, ftnlen alen, char *b); + +integer G77_link_0 (const char *path1, const char *path2, const ftnlen Lpath1, const ftnlen Lpath2) +#endif +{ +#if defined (HAVE_LINK) + char *buff1, *buff2; + char *bp, *blast; + int i; + + buff1 = malloc (Lpath1+1); + if (buff1 == NULL) return -1; + g_char (path1, Lpath1, buff1); + buff2 = malloc (Lpath2+1); + if (buff2 == NULL) return -1; + g_char (path2, Lpath2, buff2); + i = link (buff1, buff2); + free (buff1); free (buff2); + return i ? errno : 0; +#else /* ! HAVE_LINK */ + errno = ENOSYS; + return -1; +#endif +} diff --git a/gnu/lib/libf2c/libU77/lnblnk_.c b/gnu/lib/libf2c/libU77/lnblnk_.c new file mode 100644 index 00000000000..806eca293f1 --- /dev/null +++ b/gnu/lib/libf2c/libU77/lnblnk_.c @@ -0,0 +1,35 @@ +/* Copyright (C) 1995, 1997 Free Software Foundation, Inc. +This file is part of GNU Fortran libU77 library. + +This library is free software; you can redistribute it and/or modify it +under the terms of the GNU Library General Public License as published +by the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +GNU Fortran is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with GNU Fortran; see the file COPYING.LIB. If +not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + + +/* via f2c from Fortran */ + +#include "f2c.h" + +integer G77_lnblnk_0 (char *str, ftnlen str_len) +{ + integer ret_val; + integer i_len(); + + for (ret_val = str_len; ret_val >= 1; --ret_val) { + if (*(unsigned char *)&str[ret_val - 1] != ' ') { + return ret_val; + } + } + return ret_val; +} diff --git a/gnu/lib/libf2c/libU77/lstat_.c b/gnu/lib/libf2c/libU77/lstat_.c new file mode 100644 index 00000000000..801f6aad1af --- /dev/null +++ b/gnu/lib/libf2c/libU77/lstat_.c @@ -0,0 +1,86 @@ +/* Copyright (C) 1995, 1997 Free Software Foundation, Inc. +This file is part of GNU Fortran libU77 library. + +This library is free software; you can redistribute it and/or modify it +under the terms of the GNU Library General Public License as published +by the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +GNU Fortran is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with GNU Fortran; see the file COPYING.LIB. If +not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif +#include <stdio.h> +#if HAVE_STDLIB_H +# include <stdlib.h> +#endif +#include <sys/types.h> +#include <sys/stat.h> +#include <errno.h> /* for ENOSYS */ +#include "f2c.h" + +/* lstat isn't posix */ + +#ifdef KR_headers +void g_char(); + +integer G77_lstat_0 (name, statb, Lname) + char *name; + integer statb[13]; + ftnlen Lname; +#else +void g_char(const char *a, ftnlen alen, char *b); + +integer G77_lstat_0 (const char *name, integer statb[13], const ftnlen Lname) +#endif +{ +#if HAVE_LSTAT + char *buff; + char *bp, *blast; + int err; + struct stat buf; + + buff = malloc (Lname+1); + if (buff == NULL) return -1; + g_char (name, Lname, buff); + err = lstat (buff, &buf); + free (buff); + statb[0] = buf.st_dev; + statb[1] = buf.st_ino; + statb[2] = buf.st_mode; + statb[3] = buf.st_nlink; + statb[4] = buf.st_uid; + statb[5] = buf.st_gid; +#if HAVE_ST_RDEV + statb[6] = buf.st_rdev; +#else + statb[6] = 0; +#endif + statb[7] = buf.st_size; + statb[8] = buf.st_atime; + statb[9] = buf.st_mtime; + statb[10] = buf.st_ctime; +#if HAVE_ST_BLKSIZE + statb[11] = buf.st_blksize; +#else + statb[11] = -1; +#endif +#if HAVE_ST_BLOCKS + statb[12] = buf.st_blocks; +#else + statb[12] = -1; +#endif + return err; +#else /* !HAVE_LSTAT */ + return errno = ENOSYS; +#endif /* !HAVE_LSTAT */ +} diff --git a/gnu/lib/libf2c/libU77/ltime_.c b/gnu/lib/libf2c/libU77/ltime_.c new file mode 100644 index 00000000000..d4afa878cea --- /dev/null +++ b/gnu/lib/libf2c/libU77/ltime_.c @@ -0,0 +1,56 @@ +/* Copyright (C) 1995, 2001 Free Software Foundation, Inc. +This file is part of GNU Fortran libU77 library. + +This library is free software; you can redistribute it and/or modify it +under the terms of the GNU Library General Public License as published +by the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +GNU Fortran is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with GNU Fortran; see the file COPYING.LIB. If +not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif +#include <sys/types.h> +/* fixme: do we need to use TM_IN_SYS_TIME? */ +#if TIME_WITH_SYS_TIME +# include <sys/time.h> +# include <time.h> +#else +# if HAVE_SYS_TIME_H +# include <sys/time.h> +# else +# include <time.h> +# endif +#endif +#include "f2c.h" + +#ifdef KR_headers +/* Subroutine */ int G77_ltime_0 (xstime, tarray) + integer *xstime, tarray[9]; +#else +/* Subroutine */ int G77_ltime_0 (const integer * xstime, integer tarray[9]) +#endif +{ + struct tm *lt; + time_t stime = *xstime; + lt = localtime (&stime); + tarray[0] = lt->tm_sec; + tarray[1] = lt->tm_min; + tarray[2] = lt->tm_hour; + tarray[3] = lt->tm_mday; + tarray[4] = lt->tm_mon; + tarray[5] = lt->tm_year; + tarray[6] = lt->tm_wday; + tarray[7] = lt->tm_yday; + tarray[8] = lt->tm_isdst; + return 0; +} diff --git a/gnu/lib/libf2c/libU77/mclock_.c b/gnu/lib/libf2c/libU77/mclock_.c new file mode 100644 index 00000000000..6b7e81b1e04 --- /dev/null +++ b/gnu/lib/libf2c/libU77/mclock_.c @@ -0,0 +1,47 @@ +/* Copyright (C) 1996 Free Software Foundation, Inc. +This file is part of GNU Fortran libU77 library. + +This library is free software; you can redistribute it and/or modify it +under the terms of the GNU Library General Public License as published +by the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +GNU Fortran is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with GNU Fortran; see the file COPYING.LIB. If +not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif +#if TIME_WITH_SYS_TIME +# include <sys/time.h> +# include <time.h> +#else +# if HAVE_SYS_TIME_H +# include <sys/time.h> +# else +# include <time.h> +# endif +#endif +#include "f2c.h" + +/* Reported by wd42ej@sgi83.wwb.noaa.gov (Russ Jones AUTO-Sun3) on AIX. */ + +#ifdef KR_headers +longint G77_mclock_0 () +#else +longint G77_mclock_0 (void) +#endif +{ +#if HAVE_CLOCK + return clock (); +#else + return -1; +#endif +} diff --git a/gnu/lib/libf2c/libU77/perror_.c b/gnu/lib/libf2c/libU77/perror_.c new file mode 100644 index 00000000000..26d8582dbcc --- /dev/null +++ b/gnu/lib/libf2c/libU77/perror_.c @@ -0,0 +1,48 @@ +/* Copyright (C) 1995 Free Software Foundation, Inc. +This file is part of GNU Fortran libU77 library. + +This library is free software; you can redistribute it and/or modify it +under the terms of the GNU Library General Public License as published +by the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +GNU Fortran is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with GNU Fortran; see the file COPYING.LIB. If +not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif +#include <stdio.h> +#include <errno.h> +#if HAVE_STRING_H +# include <string.h> +#else +# include <strings.h> +#endif +#include "f2c.h" + +#ifdef KR_headers +/* Subroutine */ int G77_perror_0 (str, Lstr) + char *str; ftnlen Lstr; +#else +/* Subroutine */ int G77_perror_0 (const char *str, const ftnlen Lstr) +#endif +{ + char buff[1000]; + char *bp, *blast; + + /* same technique as `system' -- what's wrong with malloc? */ + blast = buff + (Lstr < 1000 ? Lstr : 1000); + for (bp = buff ; bp<blast && *str!='\0' ; ) + *bp++ = *str++; + *bp = '\0'; + perror (buff); + return 0; +} diff --git a/gnu/lib/libf2c/libU77/rand_.c b/gnu/lib/libf2c/libU77/rand_.c new file mode 100644 index 00000000000..165aee1220c --- /dev/null +++ b/gnu/lib/libf2c/libU77/rand_.c @@ -0,0 +1,54 @@ +/* Copyright (C) 1995 Free Software Foundation, Inc. +This file is part of GNU Fortran libU77 library. + +This library is free software; you can redistribute it and/or modify it +under the terms of the GNU Library General Public License as published +by the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +GNU Fortran is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with GNU Fortran; see the file COPYING.LIB. If +not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif +#if HAVE_STDLIB_H +# include <stdlib.h> +#endif +#include "f2c.h" +#ifndef RAND_MAX +# define RAND_MAX 2147483647 /* from SunOS */ +#endif + +/* We could presumably do much better than the traditional libc + version, though at least the glibc one is reasonable, it seems. + For the sake of the innocent, I'm not sure we should really do + this... */ + +/* Note this is per SunOS -- other s may have no arg. */ + +#ifdef KR_headers +double G77_rand_0 (flag) + integer *flag; +#else +double G77_rand_0 (integer *flag) +#endif +{ + switch (*flag) { + case 0: + break; + case 1: + srand (0); /* Arbitrary choice of initialiser. */ + break; + default: + srand (*flag); + } + return (float) rand () / RAND_MAX; +} diff --git a/gnu/lib/libf2c/libU77/rename_.c b/gnu/lib/libf2c/libU77/rename_.c new file mode 100644 index 00000000000..9583001c421 --- /dev/null +++ b/gnu/lib/libf2c/libU77/rename_.c @@ -0,0 +1,56 @@ +/* Copyright (C) 1995, 1997 Free Software Foundation, Inc. +This file is part of GNU Fortran libU77 library. + +This library is free software; you can redistribute it and/or modify it +under the terms of the GNU Library General Public License as published +by the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +GNU Fortran is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with GNU Fortran; see the file COPYING.LIB. If +not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif +#if HAVE_UNISTD_H +# include <unistd.h> +#endif +#if HAVE_STDLIB_H +# include <stdlib.h> +#endif +#include <stdio.h> +#include <errno.h> +#include "f2c.h" + +#ifdef KR_headers +void g_char (); + +integer G77_rename_0 (path1, path2, Lpath1, Lpath2) + char *path1, *path2; ftnlen Lpath1, Lpath2; +#else +void g_char(const char *a, ftnlen alen, char *b); + +integer G77_rename_0 (const char *path1, const char *path2, const ftnlen Lpath1, const ftnlen Lpath2) +#endif +{ + char *buff1, *buff2; + char *bp, *blast; + int i; + + buff1 = malloc (Lpath1+1); + if (buff1 == NULL) return -1; + g_char (path1, Lpath1, buff1); + buff2 = malloc (Lpath2+1); + if (buff2 == NULL) return -1; + g_char (path2, Lpath2, buff2); + i = rename (buff1, buff2); + free (buff1); free (buff2); + return i ? errno : 0; +} diff --git a/gnu/lib/libf2c/libU77/secnds_.c b/gnu/lib/libf2c/libU77/secnds_.c new file mode 100644 index 00000000000..1942528530f --- /dev/null +++ b/gnu/lib/libf2c/libU77/secnds_.c @@ -0,0 +1,51 @@ +/* Copyright (C) 1995 Free Software Foundation, Inc. +This file is part of GNU Fortran libU77 library. + +This library is free software; you can redistribute it and/or modify it +under the terms of the GNU Library General Public License as published +by the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +GNU Fortran is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with GNU Fortran; see the file COPYING.LIB. If +not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif +#include <stdio.h> +#if TIME_WITH_SYS_TIME +# include <sys/time.h> +# include <time.h> +#else +# if HAVE_SYS_TIME_H +# include <sys/time.h> +# else +# include <time.h> +# endif +#endif +#include <sys/types.h> + +#include "f2c.h" + +/* This is a VMS intrinsic. */ + +double G77_secnds_0 (real *r) +{ + struct tm *lt; + time_t clock; + float f; + + clock = time (NULL); + lt = localtime (&clock); + f= (3600.0*((real)lt->tm_hour) + 60.0*((real)lt->tm_min) + + (real)lt->tm_sec - *r); + return f; +} + diff --git a/gnu/lib/libf2c/libU77/second_.c b/gnu/lib/libf2c/libU77/second_.c new file mode 100644 index 00000000000..41bb5a90a92 --- /dev/null +++ b/gnu/lib/libf2c/libU77/second_.c @@ -0,0 +1,26 @@ +/* Copyright (C) 1996 Free Software Foundation, Inc. +This file is part of GNU Fortran libU77 library. + +This library is free software; you can redistribute it and/or modify it +under the terms of the GNU Library General Public License as published +by the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +GNU Fortran is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with GNU Fortran; see the file COPYING.LIB. If +not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + +#include "f2c.h" + +double G77_second_0 () { + extern double G77_etime_0 (); + real tarray[2]; + + return G77_etime_0 (tarray); +} diff --git a/gnu/lib/libf2c/libU77/sleep_.c b/gnu/lib/libf2c/libU77/sleep_.c new file mode 100644 index 00000000000..36e1b8d9a7b --- /dev/null +++ b/gnu/lib/libf2c/libU77/sleep_.c @@ -0,0 +1,37 @@ +/* Copyright (C) 1995 Free Software Foundation, Inc. +This file is part of GNU Fortran libU77 library. + +This library is free software; you can redistribute it and/or modify it +under the terms of the GNU Library General Public License as published +by the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +GNU Fortran is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with GNU Fortran; see the file COPYING.LIB. If +not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif +#if HAVE_UNISTD_H +# include <unistd.h> +#endif +#include "f2c.h" + +/* Subroutine */ +#ifdef KR_headers +int G77_sleep_0 (seconds) + integer *seconds; +#else +int G77_sleep_0 (const integer *seconds) +#endif +{ + (void) sleep ((unsigned int) *seconds); + return 0; +} diff --git a/gnu/lib/libf2c/libU77/srand_.c b/gnu/lib/libf2c/libU77/srand_.c new file mode 100644 index 00000000000..8edc62e4fe0 --- /dev/null +++ b/gnu/lib/libf2c/libU77/srand_.c @@ -0,0 +1,37 @@ +/* Copyright (C) 1995 Free Software Foundation, Inc. +This file is part of GNU Fortran libU77 library. + +This library is free software; you can redistribute it and/or modify it +under the terms of the GNU Library General Public License as published +by the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +GNU Fortran is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with GNU Fortran; see the file COPYING.LIB. If +not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif +#if STDC_HEADERS +# include <stdlib.h> +#endif +#include "f2c.h" + +/* Subroutine */ +#ifdef KR_headers +int G77_srand_0 (seed) + integer *seed; +#else +int G77_srand_0 (const integer *seed) +#endif +{ + srand ((unsigned int) *seed); + return 0; +} diff --git a/gnu/lib/libf2c/libU77/stamp-h.in b/gnu/lib/libf2c/libU77/stamp-h.in new file mode 100644 index 00000000000..9788f70238c --- /dev/null +++ b/gnu/lib/libf2c/libU77/stamp-h.in @@ -0,0 +1 @@ +timestamp diff --git a/gnu/lib/libf2c/libU77/stat_.c b/gnu/lib/libf2c/libU77/stat_.c new file mode 100644 index 00000000000..b24f3892221 --- /dev/null +++ b/gnu/lib/libf2c/libU77/stat_.c @@ -0,0 +1,79 @@ +/* Copyright (C) 1995, 1997 Free Software Foundation, Inc. +This file is part of GNU Fortran libU77 library. + +This library is free software; you can redistribute it and/or modify it +under the terms of the GNU Library General Public License as published +by the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +GNU Fortran is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with GNU Fortran; see the file COPYING.LIB. If +not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif +#include <stdio.h> +#if HAVE_STDLIB_H +# include <stdlib.h> +#endif +#include <sys/types.h> +#include <sys/stat.h> +#include "f2c.h" + +#ifdef KR_headers +void g_char (); + +integer G77_stat_0 (name, statb, Lname) + char *name; + integer statb[13]; + ftnlen Lname; +#else +void g_char(const char *a, ftnlen alen, char *b); + +integer G77_stat_0 (const char *name, integer statb[13], const ftnlen Lname) +#endif +{ + char *buff; + char *bp, *blast; + int err; + struct stat buf; + + buff = malloc (Lname+1); + if (buff == NULL) return -1; + g_char (name, Lname, buff); + err = stat (buff, &buf); + free (buff); + statb[0] = buf.st_dev; + statb[1] = buf.st_ino; + statb[2] = buf.st_mode; + statb[3] = buf.st_nlink; + statb[4] = buf.st_uid; + statb[5] = buf.st_gid; +#if HAVE_ST_RDEV + statb[6] = buf.st_rdev; /* not posix */ +#else + statb[6] = 0; +#endif + statb[7] = buf.st_size; + statb[8] = buf.st_atime; + statb[9] = buf.st_mtime; + statb[10] = buf.st_ctime; +#if HAVE_ST_BLKSIZE + statb[11] = buf.st_blksize; /* not posix */ +#else + statb[11] = -1; +#endif +#if HAVE_ST_BLOCKS + statb[12] = buf.st_blocks; /* not posix */ +#else + statb[12] = -1; +#endif + return err; +} diff --git a/gnu/lib/libf2c/libU77/symlnk_.c b/gnu/lib/libf2c/libU77/symlnk_.c new file mode 100644 index 00000000000..4b0bf24541d --- /dev/null +++ b/gnu/lib/libf2c/libU77/symlnk_.c @@ -0,0 +1,64 @@ +/* Copyright (C) 1995, 1997 Free Software Foundation, Inc. +This file is part of GNU Fortran. + +GNU Fortran is free software; you can redistribute it and/or modify it +under the terms of the GNU Library General Public License as published +by the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +GNU Fortran is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with GNU Fortran; see the file COPYING.LIB. If +not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif +#if HAVE_STDLIB_H +# include <stdlib.h> +#else +# include <stdio.h> +#endif +#if HAVE_UNISTD_H +# include <unistd.h> +#endif +#include <errno.h> +#if HAVE_SYS_PARAM_H +# include <sys/param.h> +#endif +#include "f2c.h" + +#ifdef KR_headers +void g_char (); + +integer G77_symlnk_0 (path1, path2, Lpath1, Lpath2) + char *path1, *path2; ftnlen Lpath1, Lpath2; +#else +void g_char(const char *a, ftnlen alen, char *b); + +integer G77_symlnk_0 (const char *path1, const char *path2, const ftnlen Lpath1, const ftnlen Lpath2) +#endif +{ +#if HAVE_SYMLINK + char *buff1, *buff2; + char *bp, *blast; + int i; + + buff1 = (char *) malloc (Lpath1+1); + if (buff1 == NULL) return -1; + g_char (path1, Lpath1, buff1); + buff2 = (char *) malloc (Lpath2+1); + if (buff2 == NULL) return -1; + g_char (path2, Lpath2, buff2); + i = symlink (buff1, buff2); + free (buff1); free (buff2); + return i ? errno : 0; +#else /* !HAVE_SYMLINK */ + return errno = ENOSYS; +#endif /* !HAVE_SYMLINK */ +} diff --git a/gnu/lib/libf2c/libU77/sys_clock_.c b/gnu/lib/libf2c/libU77/sys_clock_.c new file mode 100644 index 00000000000..86ee2fdefd5 --- /dev/null +++ b/gnu/lib/libf2c/libU77/sys_clock_.c @@ -0,0 +1,81 @@ +/* Copyright (C) 1996, 1998, 2001 Free Software Foundation, Inc. +This file is part of GNU Fortran libU77 library. + +This library is free software; you can redistribute it and/or modify it +under the terms of the GNU Library General Public License as published +by the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +GNU Fortran is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with GNU Fortran; see the file COPYING.LIB. If +not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif +#include <sys/types.h> +#if HAVE_SYS_PARAM_H +# include <sys/param.h> +#endif +#if TIME_WITH_SYS_TIME +# include <sys/time.h> +# include <time.h> +#else +# if HAVE_SYS_TIME_H +# include <sys/time.h> +# else +# include <time.h> +# endif +#endif +#if HAVE_SYS_TIMES_H +# include <sys/times.h> +#endif +#include <limits.h> +#if HAVE_UNISTD_H +# include <unistd.h> +#endif +#include <errno.h> /* for ENOSYS */ +#include "f2c.h" + +#ifdef KR_headers +int G77_system_clock_0 (count, count_rate, count_max) + integer *count, *count_rate, *count_max; +#else +int G77_system_clock_0 (integer *count, integer *count_rate, integer *count_max) +#endif +{ +#if defined (HAVE_TIMES) + struct tms buffer; + unsigned long cnt; + if (count_rate) { +#ifdef _SC_CLK_TCK + *count_rate = sysconf(_SC_CLK_TCK); +#elif defined CLOCKS_PER_SECOND + *count_rate = CLOCKS_PER_SECOND; +#elif defined CLK_TCK + *count_rate = CLK_TCK; +#elif defined HZ + *count_rate = HZ; +#else +#error Dont know clock tick length +#endif + } + if (count_max) /* optional arg present? */ + *count_max = INT_MAX; /* dubious */ + cnt = times (&buffer); + if (cnt > (unsigned long) (INT_MAX)) + *count = INT_MAX; /* also dubious */ + else + *count = cnt; + return 0; +#else /* ! HAVE_TIMES */ + errno = ENOSYS; + return -1; +#endif /* ! HAVE_TIMES */ +} diff --git a/gnu/lib/libf2c/libU77/time_.c b/gnu/lib/libf2c/libU77/time_.c new file mode 100644 index 00000000000..73894b0b413 --- /dev/null +++ b/gnu/lib/libf2c/libU77/time_.c @@ -0,0 +1,46 @@ +/* Copyright (C) 1995 Free Software Foundation, Inc. +This file is part of GNU Fortran libU77 library. + +This library is free software; you can redistribute it and/or modify it +under the terms of the GNU Library General Public License as published +by the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +GNU Fortran is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with GNU Fortran; see the file COPYING.LIB. If +not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif +#include <stdio.h> +#if TIME_WITH_SYS_TIME +# include <sys/time.h> +# include <time.h> +#else +# if HAVE_SYS_TIME_H +# include <sys/time.h> +# else +# include <time.h> +# endif +#endif +#include "f2c.h" + +/* As well as this external function some compilers have an intrinsic + subroutine which fills a character argument (which is the VMS way) + -- caveat emptor. */ +#ifdef KR_headers +longint G77_time_0 () +#else +longint G77_time_0 (void) +#endif +{ + /* There are potential problems with the cast of the time_t here. */ + return time (NULL); +} diff --git a/gnu/lib/libf2c/libU77/ttynam_.c b/gnu/lib/libf2c/libU77/ttynam_.c new file mode 100644 index 00000000000..c7610fb0c87 --- /dev/null +++ b/gnu/lib/libf2c/libU77/ttynam_.c @@ -0,0 +1,64 @@ +/* Copyright (C) 1995, 1996 Free Software Foundation, Inc. +This file is part of GNU Fortran libU77 library. + +This library is free software; you can redistribute it and/or modify it +under the terms of the GNU Library General Public License as published +by the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +GNU Fortran is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with GNU Fortran; see the file COPYING.LIB. If +not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif +#include <sys/types.h> +#if STDC_HEADERS +# include <stdlib.h> +#endif +#if HAVE_UNISTD_H +# include <unistd.h> /* POSIX for ttyname */ +#endif +#include <stdio.h> +#if HAVE_STRING_H +# include <string.h> +#else +# include <strings.h> +#endif +#include <errno.h> /* for ENOSYS */ +#include "f2c.h" + +#ifdef KR_headers +extern void s_copy (); +extern integer G77_fnum_0 (); +/* Character */ void G77_ttynam_0 (ret_val, ret_val_len, lunit) + char *ret_val; ftnlen ret_val_len; integer *lunit +#else +extern integer G77_fnum_0 (integer *lunit); +extern void s_copy(register char *a, register char *b, ftnlen la, ftnlen lb); +/* Character */ void G77_ttynam_0 (char *ret_val, ftnlen ret_val_len, integer *lunit) +#endif +{ +#if defined (HAVE_TTYNAME) + size_t i; + char *p; + + p = ttyname (G77_fnum_0 (lunit)); + if (p != NULL) { + i = strlen (p); + s_copy (ret_val, p, ret_val_len, i); + } else { + s_copy (ret_val, " ", ret_val_len, 1); + } +#else + errno = ENOSYS; + s_copy (ret_val, " ", ret_val_len, 1); +#endif +} diff --git a/gnu/lib/libf2c/libU77/u77-test.f b/gnu/lib/libf2c/libU77/u77-test.f new file mode 100644 index 00000000000..3c8151c533d --- /dev/null +++ b/gnu/lib/libf2c/libU77/u77-test.f @@ -0,0 +1,415 @@ +*** Some random stuff for testing libU77. Should be done better. It's +* hard to test things where you can't guarantee the result. Have a +* good squint at what it prints, though detected errors will cause +* starred messages. +* +* Currently not tested: +* ALARM +* CHDIR (func) +* CHMOD (func) +* FGET (func/subr) +* FGETC (func) +* FPUT (func/subr) +* FPUTC (func) +* FSTAT (subr) +* GETCWD (subr) +* HOSTNM (subr) +* IRAND +* KILL +* LINK (func) +* LSTAT (subr) +* RENAME (func/subr) +* SIGNAL (subr) +* SRAND +* STAT (subr) +* SYMLNK (func/subr) +* UMASK (func) +* UNLINK (func) +* +* NOTE! This is the libU77 version, so it should be a bit more +* "interactive" than the testsuite version, which is in +* gcc/testsuite/g77.f-torture/execute/u77-test.f. +* This version purposely exits with a "failure" status, to test +* returning of non-zero status, and it doesn't call the ABORT +* intrinsic (it substitutes an EXTERNAL stub, so the code can be +* kept nearly the same in both copies). Also, it goes ahead and +* tests the HOSTNM intrinsic. Please keep the other copy up-to-date when +* you modify this one. + + implicit none + +* external hostnm + intrinsic hostnm + integer hostnm + + integer i, j, k, ltarray (9), idat (3), count, rate, count_max, + + pid, mask + real tarray1(2), tarray2(2), r1, r2 + double precision d1 + integer(kind=2) bigi + logical issum + intrinsic getpid, getuid, getgid, ierrno, gerror, time8, + + fnum, isatty, getarg, access, unlink, fstat, iargc, + + stat, lstat, getcwd, gmtime, etime, chmod, itime, date, + + chdir, fgetc, fputc, system_clock, second, idate, secnds, + + time, ctime, fdate, ttynam, date_and_time, mclock, mclock8, + + cpu_time, dtime, ftell, abort + external lenstr, ctrlc + integer lenstr + logical l + character gerr*80, c*1 + character ctim*25, line*80, lognam*20, wd*1000, line2*80, + + ddate*8, ttime*10, zone*5, ctim2*25 + integer fstatb (13), statb (13) + integer *2 i2zero + integer values(8) + integer(kind=7) sigret + + i = time () + ctim = ctime (i) + WRITE (6,'(A/)') '1 GNU libU77 test at: ' // ctim(:lenstr (ctim)) + write (6,'(A,I3,'', '',I3)') + + ' Logical units 5 and 6 correspond (FNUM) to' + + // ' Unix i/o units ', fnum(5), fnum(6) + if (lnblnk('foo ').ne.3 .or. len_trim('foo ').ne.3) then + print *, 'LNBLNK or LEN_TRIM failed' + call abort + end if + + bigi = time8 () + + call ctime (i, ctim2) + if (ctim .ne. ctim2) then + write (6, *) '*** CALL CTIME disagrees with CTIME(): ', + + ctim2(:lenstr (ctim2)), ' vs. ', ctim(:lenstr (ctim)) + call doabort + end if + + j = time () + if (i .gt. bigi .or. bigi .gt. j) then + write (6, *) '*** TIME/TIME8/TIME sequence failures: ', + + i, bigi, j + call doabort + end if + + print *, 'Command-line arguments: ', iargc () + do i = 0, iargc () + call getarg (i, line) + print *, 'Arg ', i, ' is: ', line(:lenstr (line)) + end do + + l= isatty(6) + line2 = ttynam(6) + if (l) then + line = 'and 6 is a tty device (ISATTY) named '//line2 + else + line = 'and 6 isn''t a tty device (ISATTY)' + end if + write (6,'(1X,A)') line(:lenstr(line)) + call ttynam (6, line) + if (line .ne. line2) then + print *, '*** CALL TTYNAM disagrees with TTYNAM: ', + + line(:lenstr (line)) + call doabort + end if + +* regression test for compiler crash fixed by JCB 1998-08-04 com.c + sigret = signal(2, ctrlc) + + pid = getpid() + WRITE (6,'(A,I10)') ' Process id (GETPID): ', pid + WRITE (6,'(A,I10)') ' User id (GETUID): ', GETUID () + WRITE (6,'(A,I10)') ' Group id (GETGID): ', GETGID () + WRITE (6, *) 'If you have the `id'' program, the following call' + write (6, *) 'of SYSTEM should agree with the above:' + call flush(6) + CALL SYSTEM ('echo " " `id`') + call flush + + lognam = 'blahblahblah' + call getlog (lognam) + write (6,*) 'Login name (GETLOG): ', lognam(:lenstr (lognam)) + + wd = 'blahblahblah' + call getenv ('LOGNAME', wd) + write (6,*) 'Login name (GETENV of LOGNAME): ', wd(:lenstr (wd)) + + call umask(0, mask) + write(6,*) 'UMASK returns', mask + call umask(mask) + + ctim = fdate() + write (6,*) 'FDATE returns: ', ctim(:lenstr (ctim)) + call fdate (ctim) + write (6,*) 'CALL FDATE returns: ', ctim(:lenstr (ctim)) + + j=time() + call ltime (j, ltarray) + write (6,'(1x,a,9i4)') 'LTIME returns:', ltarray + call gmtime (j, ltarray) + write (6,'(1x,a,9i4)') 'GMTIME returns:', ltarray + + call system_clock(count) ! omitting optional args + call system_clock(count, rate, count_max) + write(6,*) 'SYSTEM_CLOCK returns: ', count, rate, count_max + + call date_and_time(ddate) ! omitting optional args + call date_and_time(ddate, ttime, zone, values) + write(6, *) 'DATE_AND_TIME returns: ', ddate, ' ', ttime, ' ', + + zone, ' ', values + + write (6,*) 'Sleeping for 1 second (SLEEP) ...' + call sleep (1) + +c consistency-check etime vs. dtime for first call + r1 = etime (tarray1) + r2 = dtime (tarray2) + if (abs (r1-r2).gt.1.0) then + write (6,*) + + 'Results of ETIME and DTIME differ by more than a second:', + + r1, r2 + call doabort + end if + if (.not. issum (r1, tarray1(1), tarray1(2))) then + write (6,*) '*** ETIME didn''t return sum of the array: ', + + r1, ' /= ', tarray1(1), '+', tarray1(2) + call doabort + end if + if (.not. issum (r2, tarray2(1), tarray2(2))) then + write (6,*) '*** DTIME didn''t return sum of the array: ', + + r2, ' /= ', tarray2(1), '+', tarray2(2) + call doabort + end if + write (6, '(A,3F10.3)') + + ' Elapsed total, user, system time (ETIME): ', + + r1, tarray1 + +c now try to get times to change enough to see in etime/dtime + write (6,*) 'Looping until clock ticks at least once...' + do i = 1,1000 + do j = 1,1000 + end do + call dtime (tarray2, r2) + if (tarray2(1) .ne. 0. .or. tarray2(2) .ne. 0.) exit + end do + call etime (tarray1, r1) + if (.not. issum (r1, tarray1(1), tarray1(2))) then + write (6,*) '*** ETIME didn''t return sum of the array: ', + + r1, ' /= ', tarray1(1), '+', tarray1(2) + call doabort + end if + if (.not. issum (r2, tarray2(1), tarray2(2))) then + write (6,*) '*** DTIME didn''t return sum of the array: ', + + r2, ' /= ', tarray2(1), '+', tarray2(2) + call doabort + end if + write (6, '(A,3F10.3)') + + ' Differences in total, user, system time (DTIME): ', + + r2, tarray2 + write (6, '(A,3F10.3)') + + ' Elapsed total, user, system time (ETIME): ', + + r1, tarray1 + write (6, *) '(Clock-tick detected after ', i, ' 1K loops.)' + + call idate (i,j,k) + call idate (idat) + write (6,*) 'IDATE (date,month,year): ',idat + print *, '... and the VXT version (month,date,year): ', i,j,k + if (i/=idat(2) .or. j/=idat(1) .or. k/=mod(idat(3),100)) then + print *, '*** VXT and U77 versions don''t agree' + call doabort + end if + + call date (ctim) + write (6,*) 'DATE (dd-mmm-yy): ', ctim(:lenstr (ctim)) + + call itime (idat) + write (6,*) 'ITIME (hour,minutes,seconds): ', idat + + call time(line(:8)) + print *, 'TIME: ', line(:8) + + write (6,*) 'SECNDS(0.0) returns: ',secnds(0.0) + + write (6,*) 'SECOND returns: ', second() + call dumdum(r1) + call second(r1) + write (6,*) 'CALL SECOND returns: ', r1 + +* compiler crash fixed by 1998-10-01 com.c change + if (rand(0).lt.0.0 .or. rand(0).gt.1.0) then + write (6,*) '*** rand(0) error' + call doabort() + end if + + i = getcwd(wd) + if (i.ne.0) then + call perror ('*** getcwd') + call doabort + else + write (6,*) 'Current directory is "'//wd(:lenstr(wd))//'"' + end if + call chdir ('.',i) + if (i.ne.0) then + write (6,*) '***CHDIR to ".": ', i + call doabort + end if + + i=hostnm(wd) + if(i.ne.0) then + call perror ('*** hostnm') + call doabort + else + write (6,*) 'Host name is ', wd(:lenstr(wd)) + end if + + i = access('/dev/null ', 'rw') + if (i.ne.0) write (6,*) '***Read/write ACCESS to /dev/null: ', i + write (6,*) 'Creating file "foo" for testing...' + open (3,file='foo',status='UNKNOWN') + rewind 3 + call fputc(3, 'c',i) + call fputc(3, 'd',j) + if (i+j.ne.0) write(6,*) '***FPUTC: ', i +C why is it necessary to reopen? (who wrote this?) +C the better to test with, my dear! (-- burley) + close(3) + open(3,file='foo',status='old') + call fseek(3,0,0,*10) + go to 20 + 10 write(6,*) '***FSEEK failed' + call doabort + 20 call fgetc(3, c,i) + if (i.ne.0) then + write(6,*) '***FGETC: ', i + call doabort + end if + if (c.ne.'c') then + write(6,*) '***FGETC read the wrong thing: ', ichar(c) + call doabort + end if + i= ftell(3) + if (i.ne.1) then + write(6,*) '***FTELL offset: ', i + call doabort + end if + call ftell(3, i) + if (i.ne.1) then + write(6,*) '***CALL FTELL offset: ', i + call doabort + end if + call chmod ('foo', 'a+w',i) + if (i.ne.0) then + write (6,*) '***CHMOD of "foo": ', i + call doabort + end if + i = fstat (3, fstatb) + if (i.ne.0) then + write (6,*) '***FSTAT of "foo": ', i + call doabort + end if + i = stat ('foo', statb) + if (i.ne.0) then + write (6,*) '***STAT of "foo": ', i + call doabort + end if + write (6,*) ' with stat array ', statb + if (statb(6) .ne. getgid ()) then + write (6,*) 'Note: FSTAT gid wrong (happens on some systems).' + end if + if (statb(5) .ne. getuid () .or. statb(4) .ne. 1) then + write (6,*) '*** FSTAT uid or nlink is wrong' + call doabort + end if + do i=1,13 + if (fstatb (i) .ne. statb (i)) then + write (6,*) '*** FSTAT and STAT don''t agree on '// ' + + array element ', i, ' value ', fstatb (i), statb (i) + call doabort + end if + end do + i = lstat ('foo', fstatb) + do i=1,13 + if (fstatb (i) .ne. statb (i)) then + write (6,*) '*** LSTAT and STAT don''t agree on '// + + 'array element ', i, ' value ', fstatb (i), statb (i) + call doabort + end if + end do + +C in case it exists already: + call unlink ('bar',i) + call link ('foo ', 'bar ',i) + if (i.ne.0) then + write (6,*) '***LINK "foo" to "bar" failed: ', i + call doabort + end if + call unlink ('foo',i) + if (i.ne.0) then + write (6,*) '***UNLINK "foo" failed: ', i + call doabort + end if + call unlink ('foo',i) + if (i.eq.0) then + write (6,*) '***UNLINK "foo" again: ', i + call doabort + end if + + call gerror (gerr) + i = ierrno() + write (6,'(A,I3,A/1X,A)') ' The current error number is: ', + + i, + + ' and the corresponding message is:', gerr(:lenstr(gerr)) + write (6,*) 'This is sent to stderr prefixed by the program name' + call getarg (0, line) + call perror (line (:lenstr (line))) + call unlink ('bar') + + print *, 'MCLOCK returns ', mclock () + print *, 'MCLOCK8 returns ', mclock8 () + + call cpu_time (d1) + print *, 'CPU_TIME returns ', d1 + + WRITE (6,*) 'You should see exit status 1' + CALL EXIT(1) + 99 END + +* Return length of STR not including trailing blanks, but always > 0. + integer function lenstr (str) + character*(*) str + if (str.eq.' ') then + lenstr=1 + else + lenstr = lnblnk (str) + end if + end + +* Just make sure SECOND() doesn't "magically" work the second time. + subroutine dumdum(r) + r = 3.14159 + end + +* Test whether sum is approximately left+right. + logical function issum (sum, left, right) + implicit none + real sum, left, right + real mysum, delta, width + mysum = left + right + delta = abs (mysum - sum) + width = abs (left) + abs (right) + issum = (delta .le. .0001 * width) + end + +* Signal handler + subroutine ctrlc + print *, 'Got ^C' + call doabort + end + +* A problem has been noticed, so maybe abort the test. + subroutine doabort +* For this version, print out all problems noticed. +* intrinsic abort +* call abort + end diff --git a/gnu/lib/libf2c/libU77/umask_.c b/gnu/lib/libf2c/libU77/umask_.c new file mode 100644 index 00000000000..203acfa916f --- /dev/null +++ b/gnu/lib/libf2c/libU77/umask_.c @@ -0,0 +1,34 @@ +/* Copyright (C) 1996 Free Software Foundation, Inc. +This file is part of GNU Fortran libU77 library. + +This library is free software; you can redistribute it and/or modify it +under the terms of the GNU Library General Public License as published +by the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +GNU Fortran is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with GNU Fortran; see the file COPYING.LIB. If +not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif +#include <sys/types.h> +#include <sys/stat.h> +#include "f2c.h" + +#ifdef KR_headers +integer G77_umask_0 (mask) + integer *mask; +#else +integer G77_umask_0 (integer *mask) +#endif +{ + return umask ((mode_t) *mask); +} diff --git a/gnu/lib/libf2c/libU77/unlink_.c b/gnu/lib/libf2c/libU77/unlink_.c new file mode 100644 index 00000000000..cd00559b29a --- /dev/null +++ b/gnu/lib/libf2c/libU77/unlink_.c @@ -0,0 +1,57 @@ +/* Copyright (C) 1995, 1997 Free Software Foundation, Inc. +This file is part of GNU Fortran libU77 library. + +This library is free software; you can redistribute it and/or modify it +under the terms of the GNU Library General Public License as published +by the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +GNU Fortran is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with GNU Fortran; see the file COPYING.LIB. If +not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif +#if HAVE_STDLIB_H +# include <stdlib.h> +#else +# include <stdio.h> +#endif +#if HAVE_UNISTD_H +# include <unistd.h> +#endif +#include <errno.h> +#if HAVE_SYS_PARAM_H +# include <sys/param.h> +#endif +#include "f2c.h" + +#ifdef KR_headers +void g_char (); + +integer G77_unlink_0 (str, Lstr) + char *str; ftnlen Lstr; +#else +void g_char(const char *a, ftnlen alen, char *b); + +integer G77_unlink_0 (const char *str, const ftnlen Lstr) +#endif +{ + char *buff; + char *bp, *blast; + int i; + + buff = malloc (Lstr+1); + if (buff == NULL) return -1; + g_char (str, Lstr, buff); + i = unlink (buff); + free (buff); + return i ? errno : 0; /* SGI version returns -1 on failure. */ +} diff --git a/gnu/lib/libf2c/libU77/vxtidate_.c b/gnu/lib/libf2c/libU77/vxtidate_.c new file mode 100644 index 00000000000..e5963af42e6 --- /dev/null +++ b/gnu/lib/libf2c/libU77/vxtidate_.c @@ -0,0 +1,71 @@ +/* Copyright (C) 1995, 1996, 2001 Free Software Foundation, Inc. +This file is part of GNU Fortran libU77 library. + +This library is free software; you can redistribute it and/or modify it +under the terms of the GNU Library General Public License as published +by the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +GNU Fortran is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with GNU Fortran; see the file COPYING.LIB. If +not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif +#include <stdio.h> +#include <sys/types.h> +#if TIME_WITH_SYS_TIME +# include <sys/time.h> +# include <time.h> +#else +# if HAVE_SYS_TIME_H +# include <sys/time.h> +# else +# include <time.h> +# endif +#endif +#include "f2c.h" + +/* VMS and Irix versions (at least) differ from libU77 elsewhere */ + +/* VMS style: */ + +/* Subroutine */ +#ifdef KR_headers +int G77_vxtidate_y2kbug_0 (m, d, y) + integer *y, *m, *d; +#else +int G77_vxtidate_y2kbug_0 (integer *m, integer *d, integer *y) +#endif +{ + struct tm *lt; + time_t tim; + tim = time(NULL); + lt = localtime(&tim); + *y = lt->tm_year % 100; + *m = lt->tm_mon+1; + *d = lt->tm_mday; + return 0; +} + +#ifdef PIC +extern const char *G77_Non_Y2K_Compliance_Message; +# ifdef KR_headers +int G77_vxtidate_y2kbuggy_0 (m, d, y) + integer *y, *m, *d; +# else +int G77_vxtidate_y2kbuggy_0 (integer *m, integer *d, integer *y) +# endif +{ + extern int G77_abort_0(); + fprintf (stderr, "%s\n", G77_Non_Y2K_Compliance_Message); + G77_abort_0(); +} +#endif diff --git a/gnu/lib/libf2c/libU77/vxttime_.c b/gnu/lib/libf2c/libU77/vxttime_.c new file mode 100644 index 00000000000..e45cc05d055 --- /dev/null +++ b/gnu/lib/libf2c/libU77/vxttime_.c @@ -0,0 +1,55 @@ +/* Copyright (C) 1995, 2001 Free Software Foundation, Inc. +This file is part of GNU Fortran libU77 library. + +This library is free software; you can redistribute it and/or modify it +under the terms of the GNU Library General Public License as published +by the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +GNU Fortran is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with GNU Fortran; see the file COPYING.LIB. If +not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif +#include <stdio.h> +#include <sys/types.h> +#if TIME_WITH_SYS_TIME +# include <sys/time.h> +# include <time.h> +#else +# if HAVE_SYS_TIME_H +# include <sys/time.h> +# else +# include <time.h> +# endif +#endif +#if HAVE_STRING_H +# include <string.h> +#else +# include <strings.h> +#endif +#include "f2c.h" + +/* Subroutine */ +#ifdef KR_headers +void G77_vxttime_0 (chtime, Lchtime) + char chtime[8]; + ftnlen Lchtime; +#else +void G77_vxttime_0 (char chtime[8], const ftnlen Lchtime) +#endif +{ + time_t tim; + char *ctim; + tim = time(NULL); + ctim = ctime (&tim); + strncpy (chtime, ctim+11, 8); +} |