mirror of
https://github.com/mirror/make.git
synced 2026-08-21 01:13:27 +08:00
Compare commits
110 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2de9513b20 | ||
|
|
8eb20e9d92 | ||
|
|
32979e8122 | ||
|
|
490f35dda4 | ||
|
|
a579af186b | ||
|
|
01d08292bc | ||
|
|
f9c4aae3bf | ||
|
|
74e456e107 | ||
|
|
f8b096b9fd | ||
|
|
527201342c | ||
|
|
5f1e98e59b | ||
|
|
f4020bfba8 | ||
|
|
4792e6f5c0 | ||
|
|
514eda2bda | ||
|
|
310f677b84 | ||
|
|
f323abd6b3 | ||
|
|
b07e961db1 | ||
|
|
5958f28900 | ||
|
|
fd504b4d84 | ||
|
|
1bb24cbbbb | ||
|
|
b255a75bab | ||
|
|
0569ceb303 | ||
|
|
8021c41954 | ||
|
|
edd7981e49 | ||
|
|
715363eb49 | ||
|
|
c36430699e | ||
|
|
5f99dee5b5 | ||
|
|
9521ecc573 | ||
|
|
cb69b06199 | ||
|
|
21fed1fbcc | ||
|
|
17aef36902 | ||
|
|
98f8d6286e | ||
|
|
d96d52d27d | ||
|
|
625b9f6ba2 | ||
|
|
8756e81616 | ||
|
|
3e141c8277 | ||
|
|
aaed50ac3f | ||
|
|
a89eb21084 | ||
|
|
4356ddddbc | ||
|
|
b8db661c24 | ||
|
|
a54c552d39 | ||
|
|
25d48503eb | ||
|
|
5df0d41985 | ||
|
|
737e056a89 | ||
|
|
8c13a20895 | ||
|
|
2a0707e1b8 | ||
|
|
d116acac75 | ||
|
|
6ab25d18b2 | ||
|
|
4061695ef6 | ||
|
|
e3200b9303 | ||
|
|
18a7013e55 | ||
|
|
624552badd | ||
|
|
76d037cb95 | ||
|
|
dfdf1bec21 | ||
|
|
caa2fe5d39 | ||
|
|
2f506a6d52 | ||
|
|
856d83462f | ||
|
|
e9fcf7ea88 | ||
|
|
bfa6ab6a0c | ||
|
|
4e6de57b8f | ||
|
|
41e6704efd | ||
|
|
ffea662953 | ||
|
|
db5cc03f75 | ||
|
|
cd851988e7 | ||
|
|
fb39f49937 | ||
|
|
dccc12dbee | ||
|
|
1305447ace | ||
|
|
5ed1a6399a | ||
|
|
3f614c58ed | ||
|
|
37cf6fdc18 | ||
|
|
808f1c1cd2 | ||
|
|
06021f945f | ||
|
|
ad61285598 | ||
|
|
10d6808977 | ||
|
|
21fbad8602 | ||
|
|
fa6d6f9150 | ||
|
|
ed02723506 | ||
|
|
692858922f | ||
|
|
9da3bccd89 | ||
|
|
16a5d4cf48 | ||
|
|
b1e6353edd | ||
|
|
e1c593016b | ||
|
|
10124ce95b | ||
|
|
6e19c6febb | ||
|
|
4314e2f987 | ||
|
|
0eab889a28 | ||
|
|
c51dd24814 | ||
|
|
41ea0f1556 | ||
|
|
ee6b27b728 | ||
|
|
af72fc38fe | ||
|
|
294c429f93 | ||
|
|
9409f5c54a | ||
|
|
78ac5bd9c7 | ||
|
|
030d31ba93 | ||
|
|
70465ffcfb | ||
|
|
ee2b67af6d | ||
|
|
0afe62e255 | ||
|
|
ee14af651f | ||
|
|
9fd3c2453b | ||
|
|
a4e66c61c0 | ||
|
|
8cfdca3e72 | ||
|
|
2c27d8dbdc | ||
|
|
d02b26a4b8 | ||
|
|
8b3f13f6ec | ||
|
|
e74b6ae5c2 | ||
|
|
f21ec15ffa | ||
|
|
3f49392b9c | ||
|
|
f9a914c035 | ||
|
|
b2fc502c55 | ||
|
|
d091a08961 |
@@ -12,6 +12,6 @@ makebook*
|
||||
*.cp *.cps *.fn *.fns *.vr *.vrs *.tp *.tps *.ky *.kys *.pg *.pgs
|
||||
|
||||
sun4 i386 i386-netbsd hp300-netbsd hp300 rs6000 sun3 news800 amiga
|
||||
hp700 hp834 mips
|
||||
hp700 hp834 mips sol2 i486-linux
|
||||
|
||||
customs
|
||||
|
||||
339
COPYING
Normal file
339
COPYING
Normal file
@@ -0,0 +1,339 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
|
||||
675 Mass Ave, Cambridge, MA 02139, USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
License is intended to guarantee your freedom to share and change free
|
||||
software--to make sure the software is free for all its users. This
|
||||
General Public License applies to most of the Free Software
|
||||
Foundation's software and to any other program whose authors commit to
|
||||
using it. (Some other Free Software Foundation software is covered by
|
||||
the GNU Library General Public License instead.) You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
this service if you wish), that you receive source code or can get it
|
||||
if you want it, that you can change the software or use pieces of it
|
||||
in new free programs; and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
anyone to deny you these rights or to ask you to surrender the rights.
|
||||
These restrictions translate to certain responsibilities for you if you
|
||||
distribute copies of the software, or if you modify it.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must give the recipients all the rights that
|
||||
you have. You must make sure that they, too, receive or can get the
|
||||
source code. And you must show them these terms so they know their
|
||||
rights.
|
||||
|
||||
We protect your rights with two steps: (1) copyright the software, and
|
||||
(2) offer you this license which gives you legal permission to copy,
|
||||
distribute and/or modify the software.
|
||||
|
||||
Also, for each author's protection and ours, we want to make certain
|
||||
that everyone understands that there is no warranty for this free
|
||||
software. If the software is modified by someone else and passed on, we
|
||||
want its recipients to know that what they have is not the original, so
|
||||
that any problems introduced by others will not reflect on the original
|
||||
authors' reputations.
|
||||
|
||||
Finally, any free program is threatened constantly by software
|
||||
patents. We wish to avoid the danger that redistributors of a free
|
||||
program will individually obtain patent licenses, in effect making the
|
||||
program proprietary. To prevent this, we have made it clear that any
|
||||
patent must be licensed for everyone's free use or not licensed at all.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License applies to any program or other work which contains
|
||||
a notice placed by the copyright holder saying it may be distributed
|
||||
under the terms of this General Public License. The "Program", below,
|
||||
refers to any such program or work, and a "work based on the Program"
|
||||
means either the Program or any derivative work under copyright law:
|
||||
that is to say, a work containing the Program or a portion of it,
|
||||
either verbatim or with modifications and/or translated into another
|
||||
language. (Hereinafter, translation is included without limitation in
|
||||
the term "modification".) Each licensee is addressed as "you".
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running the Program is not restricted, and the output from the Program
|
||||
is covered only if its contents constitute a work based on the
|
||||
Program (independent of having been made by running the Program).
|
||||
Whether that is true depends on what the Program does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Program's
|
||||
source code as you receive it, in any medium, provided that you
|
||||
conspicuously and appropriately publish on each copy an appropriate
|
||||
copyright notice and disclaimer of warranty; keep intact all the
|
||||
notices that refer to this License and to the absence of any warranty;
|
||||
and give any other recipients of the Program a copy of this License
|
||||
along with the Program.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy, and
|
||||
you may at your option offer warranty protection in exchange for a fee.
|
||||
|
||||
2. You may modify your copy or copies of the Program or any portion
|
||||
of it, thus forming a work based on the Program, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) You must cause the modified files to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
b) You must cause any work that you distribute or publish, that in
|
||||
whole or in part contains or is derived from the Program or any
|
||||
part thereof, to be licensed as a whole at no charge to all third
|
||||
parties under the terms of this License.
|
||||
|
||||
c) If the modified program normally reads commands interactively
|
||||
when run, you must cause it, when started running for such
|
||||
interactive use in the most ordinary way, to print or display an
|
||||
announcement including an appropriate copyright notice and a
|
||||
notice that there is no warranty (or else, saying that you provide
|
||||
a warranty) and that users may redistribute the program under
|
||||
these conditions, and telling the user how to view a copy of this
|
||||
License. (Exception: if the Program itself is interactive but
|
||||
does not normally print such an announcement, your work based on
|
||||
the Program is not required to print an announcement.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Program,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Program, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Program.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Program
|
||||
with the Program (or with a work based on the Program) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may copy and distribute the Program (or a work based on it,
|
||||
under Section 2) in object code or executable form under the terms of
|
||||
Sections 1 and 2 above provided that you also do one of the following:
|
||||
|
||||
a) Accompany it with the complete corresponding machine-readable
|
||||
source code, which must be distributed under the terms of Sections
|
||||
1 and 2 above on a medium customarily used for software interchange; or,
|
||||
|
||||
b) Accompany it with a written offer, valid for at least three
|
||||
years, to give any third party, for a charge no more than your
|
||||
cost of physically performing source distribution, a complete
|
||||
machine-readable copy of the corresponding source code, to be
|
||||
distributed under the terms of Sections 1 and 2 above on a medium
|
||||
customarily used for software interchange; or,
|
||||
|
||||
c) Accompany it with the information you received as to the offer
|
||||
to distribute corresponding source code. (This alternative is
|
||||
allowed only for noncommercial distribution and only if you
|
||||
received the program in object code or executable form with such
|
||||
an offer, in accord with Subsection b above.)
|
||||
|
||||
The source code for a work means the preferred form of the work for
|
||||
making modifications to it. For an executable work, complete source
|
||||
code means all the source code for all modules it contains, plus any
|
||||
associated interface definition files, plus the scripts used to
|
||||
control compilation and installation of the executable. However, as a
|
||||
special exception, the source code distributed need not include
|
||||
anything that is normally distributed (in either source or binary
|
||||
form) with the major components (compiler, kernel, and so on) of the
|
||||
operating system on which the executable runs, unless that component
|
||||
itself accompanies the executable.
|
||||
|
||||
If distribution of executable or object code is made by offering
|
||||
access to copy from a designated place, then offering equivalent
|
||||
access to copy the source code from the same place counts as
|
||||
distribution of the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
4. You may not copy, modify, sublicense, or distribute the Program
|
||||
except as expressly provided under this License. Any attempt
|
||||
otherwise to copy, modify, sublicense or distribute the Program is
|
||||
void, and will automatically terminate your rights under this License.
|
||||
However, parties who have received copies, or rights, from you under
|
||||
this License will not have their licenses terminated so long as such
|
||||
parties remain in full compliance.
|
||||
|
||||
5. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Program or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Program (or any work based on the
|
||||
Program), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Program or works based on it.
|
||||
|
||||
6. Each time you redistribute the Program (or any work based on the
|
||||
Program), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute or modify the Program subject to
|
||||
these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties to
|
||||
this License.
|
||||
|
||||
7. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Program at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Program by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Program.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under
|
||||
any particular circumstance, the balance of the section is intended to
|
||||
apply and the section as a whole is intended to apply in other
|
||||
circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system, which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
8. If the distribution and/or use of the Program is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Program under this License
|
||||
may add an explicit geographical distribution limitation excluding
|
||||
those countries, so that distribution is permitted only in or among
|
||||
countries not thus excluded. In such case, this License incorporates
|
||||
the limitation as if written in the body of this License.
|
||||
|
||||
9. The Free Software Foundation may publish revised and/or new versions
|
||||
of the General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Program
|
||||
specifies a version number of this License which applies to it and "any
|
||||
later version", you have the option of following the terms and conditions
|
||||
either of that version or of any later version published by the Free
|
||||
Software Foundation. If the Program does not specify a version number of
|
||||
this License, you may choose any version ever published by the Free Software
|
||||
Foundation.
|
||||
|
||||
10. If you wish to incorporate parts of the Program into other free
|
||||
programs whose distribution conditions are different, write to the author
|
||||
to ask for permission. For software which is copyrighted by the Free
|
||||
Software Foundation, write to the Free Software Foundation; we sometimes
|
||||
make exceptions for this. Our decision will be guided by the two goals
|
||||
of preserving the free status of all derivatives of our free software and
|
||||
of promoting the sharing and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
||||
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
||||
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
||||
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
|
||||
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
|
||||
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
|
||||
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
||||
REPAIR OR CORRECTION.
|
||||
|
||||
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
||||
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
||||
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
|
||||
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
||||
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
||||
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
Appendix: How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
convey the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) 19yy <name of author>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program is interactive, make it output a short notice like this
|
||||
when it starts in an interactive mode:
|
||||
|
||||
Gnomovision version 69, Copyright (C) 19yy name of author
|
||||
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, the commands you use may
|
||||
be called something other than `show w' and `show c'; they could even be
|
||||
mouse-clicks or menu items--whatever suits your program.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the program, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
|
||||
`Gnomovision' (which makes passes at compilers) written by James Hacker.
|
||||
|
||||
<signature of Ty Coon>, 1 April 1989
|
||||
Ty Coon, President of Vice
|
||||
|
||||
This General Public License does not permit incorporating your program into
|
||||
proprietary programs. If your program is a subroutine library, you may
|
||||
consider it more useful to permit linking proprietary applications with the
|
||||
library. If this is what you want to do, use the GNU Library General
|
||||
Public License instead of this License.
|
||||
162
ChangeLog
162
ChangeLog
@@ -1,3 +1,155 @@
|
||||
Fri Mar 1 12:04:47 1996 Roland McGrath <roland@charlie-brown.gnu.ai.mit.edu>
|
||||
|
||||
* remake.c (f_mtime): Move future modtime check before FILE is
|
||||
clobbered by :: loop.
|
||||
|
||||
* Version 3.74.3.
|
||||
|
||||
* dir.c: Use canonical code from autoconf manual for dirent include.
|
||||
[_D_NAMLEN]: Redefine NAMLEN using this.
|
||||
(dir_contents_file_exists_p): Use NAMLEN macro.
|
||||
(read_dirstream) [_DIRENT_HAVE_D_NAMLEN]: Only set d_namlen #if this.
|
||||
|
||||
* compatMakefile (objs): Add missing backslash.
|
||||
|
||||
Wed Feb 28 03:56:20 1996 Roland McGrath <roland@charlie-brown.gnu.ai.mit.edu>
|
||||
|
||||
* default.c (default_terminal_rules): Remove + prefix from RCS cmds.
|
||||
(default_variables): Put + prefix in $(CHECKOUT,v) value instead.
|
||||
|
||||
* remake.c (f_mtime): Check for future timestamps; give error and mark
|
||||
file as "failed to update".
|
||||
|
||||
Fri Jan 12 18:09:36 1996 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
|
||||
|
||||
* job.c: Don't declare unblock_sigs; job.h already does.
|
||||
|
||||
Sat Jan 6 16:24:44 1996 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
|
||||
|
||||
* acconfig.h (HAVE_SYSCONF_OPEN_MAX): #undef removed.
|
||||
|
||||
* job.c (NGROUPS_MAX): Don't try to define this macro.
|
||||
|
||||
Fri Dec 22 18:44:44 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
|
||||
|
||||
* compatMakefile (GETOPT, GETOPT_SRC, GLOB): Variables removed.
|
||||
(objs, srcs): Include their values here instead of references.
|
||||
|
||||
Thu Dec 14 06:21:29 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
|
||||
|
||||
* Version 3.74.2.
|
||||
|
||||
* job.c (reap_children): Call unblock_sigs after start_job_command.
|
||||
|
||||
Thu Dec 14 07:22:03 1995 Roland McGrath <roland@duality.gnu.ai.mit.edu>
|
||||
|
||||
* dir.c (dir_setup_glob): Don't use lstat; glob never calls it anyway.
|
||||
Avoid & before function names to silence bogus sunos4 compiler.
|
||||
|
||||
* configure.in: Remove check for `sysconf (_SC_OPEN_MAX)'.
|
||||
|
||||
Tue Dec 12 00:48:42 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
|
||||
|
||||
* Version 3.74.1.
|
||||
|
||||
* dir.c (read_dirstream): Fix braino: fill in the buffer when not
|
||||
reallocating it!
|
||||
|
||||
Mon Dec 11 22:26:15 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
|
||||
|
||||
* misc.c (collapse_continuations): Fix skipping of trailing \s so
|
||||
it can never dereference before the beginning of the array.
|
||||
|
||||
* read.c (find_semicolon): Function removed.
|
||||
(read_makefile): Don't use find_semicolon or remove_comments for
|
||||
rule lines. Use find_char_unquote directly and handle quoted comments
|
||||
properly.
|
||||
|
||||
* default.c: Remove all [M_XENIX] code.
|
||||
|
||||
* dir.c [HAVE_D_NAMLEN]: Define this for __GNU_LIBRARY__ > 1.
|
||||
(D_NAMLEN): Macro removed.
|
||||
(FAKE_DIR_ENTRY): New macro.
|
||||
(dir_contents_file_exists_p): Test HAVE_D_NAMLEN instead of using
|
||||
D_NAMLEN.
|
||||
(read_dirstream): Return a struct dirent * for new glob interface.
|
||||
(init_dir): Function removed.
|
||||
(dir_setup_glob): New function.
|
||||
* main.c (main): Don't call init_dir.
|
||||
* read.c (multi_glob): Call dir_setup_glob on our glob_t and use
|
||||
GLOB_ALTDIRFUNC flag.
|
||||
|
||||
* misc.c (safe_stat): Function removed.
|
||||
* read.c, commands.c, remake.c, vpath.c: Use plain stat instead of
|
||||
safe_stat.
|
||||
|
||||
Sat Nov 25 20:35:18 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
|
||||
|
||||
* job.c [HAVE_UNION_WAIT]: Include sys/wait.h.
|
||||
|
||||
* main.c (log_working_directory): Made global.
|
||||
Print entering msg only once.
|
||||
* make.h (log_working_directory): Declare it.
|
||||
* misc.c (message): Take new arg PREFIX. Print "make: " only if
|
||||
nonzero. Call log_working_directory.
|
||||
* remake.c: Pass new arg in `message' calls.
|
||||
* job.c (start_job_command): Pass new arg to `message'; fix
|
||||
inverted test in that call.
|
||||
|
||||
Tue Nov 21 19:01:12 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
|
||||
|
||||
* job.c (start_job_command): Use `message' to print the command,
|
||||
and call it with null if the command is silent.
|
||||
* remake.c (touch_file): Use message instead of printf.
|
||||
|
||||
Tue Oct 10 14:59:30 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
|
||||
|
||||
* main.c (enter_command_line_file): Barf if NAME is "".
|
||||
|
||||
Sat Sep 9 06:33:20 1995 Roland McGrath <roland@whiz-bang.gnu.ai.mit.edu>
|
||||
|
||||
* commands.c (delete_target): Ignore unlink failure if it is ENOENT.
|
||||
|
||||
Thu Aug 17 15:08:57 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
|
||||
|
||||
* configure.in: Don't check for getdtablesize.
|
||||
* job.c (getdtablesize): Remove decls and macros.
|
||||
|
||||
Thu Aug 10 19:10:03 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
|
||||
|
||||
* main.c (define_makeflags): Omit command line variable
|
||||
definitions from MFLAGS value.
|
||||
|
||||
* arscan.c (ar_scan) [AIAMAG]: Check for zero MEMBER_OFFSET,
|
||||
indicating a valid, but empty, archive.
|
||||
|
||||
Mon Aug 7 15:40:03 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
|
||||
|
||||
* dir.c (file_impossible_p): Correctly reset FILENAME to name
|
||||
within directory before hash search.
|
||||
|
||||
* job.c (child_error): Do nothing if IGNORED under -s.
|
||||
|
||||
* job.c (exec_command): Correctly use ARGV[0] for script name when
|
||||
running shell directly.
|
||||
|
||||
Tue Aug 1 14:39:14 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
|
||||
|
||||
* job.c (child_execute_job): Close STDIN_FD and STDOUT_FD after
|
||||
dup'ing from them. Don't try to close all excess descriptors;
|
||||
getdtablesize might return a huge value. Any open descriptors in
|
||||
the parent should have FD_CLOEXEC set.
|
||||
(start_job_command): Set FD_CLOEXEC flag on BAD_STDIN descriptor.
|
||||
|
||||
Tue Jun 20 03:47:15 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
|
||||
|
||||
* read.c (read_all_makefiles): Properly append default makefiles
|
||||
to the end of the `read_makefiles' chain.
|
||||
|
||||
Fri May 19 16:36:32 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
|
||||
|
||||
* Version 3.74 released.
|
||||
|
||||
Wed May 10 17:43:34 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
|
||||
|
||||
* Version 3.73.3.
|
||||
@@ -18,7 +170,7 @@ Thu Apr 27 12:39:35 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
|
||||
Wed Apr 26 17:15:57 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
|
||||
|
||||
* file.c (remove_intermediates): Fix inverted test to bail under
|
||||
-n for signal case. Bail under -q or -t.
|
||||
-n for signal case. Bail under -q or -t.
|
||||
Skip files with update_status==-1.
|
||||
|
||||
* job.c (job_next_command): Skip empty lines.
|
||||
@@ -1904,7 +2056,7 @@ Mon Jan 18 14:53:54 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
|
||||
* Version 3.62.30.
|
||||
|
||||
* job.c (start_waiting_jobs): Return when job_slots_used is equal to
|
||||
job_slots.
|
||||
job_slots.
|
||||
|
||||
* configure.in: Add AC_CONST for the sake of getopt.
|
||||
|
||||
@@ -2203,7 +2355,7 @@ Mon Nov 9 17:50:16 1992 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
|
||||
(notice_finished_file): Don't increment files_remade here; this
|
||||
function gets called in many situations where no remaking was in
|
||||
fact done.
|
||||
* job.c (reap_children): Do it here instead, when we know that
|
||||
* job.c (reap_children): Do it here instead, when we know that
|
||||
actual commands have been run for the file.
|
||||
* make.h (files_remade): Declare it.
|
||||
|
||||
@@ -2901,7 +3053,7 @@ Sat May 9 00:21:05 1992 Roland McGrath (roland@geech.gnu.ai.mit.edu)
|
||||
|
||||
Fri May 8 21:55:35 1992 Roland McGrath (roland@geech.gnu.ai.mit.edu)
|
||||
|
||||
* main.c (struct command_switch): Added elts `long_name',
|
||||
* main.c (struct command_switch): Added elts `long_name',
|
||||
`description', and `argdesc'.
|
||||
(switches): Added initializers for new members.
|
||||
(decode_switches): Rewritten to use getopt_long.
|
||||
@@ -2919,7 +3071,7 @@ Fri May 8 21:55:35 1992 Roland McGrath (roland@geech.gnu.ai.mit.edu)
|
||||
on the child being reaped, instead set its command_state to
|
||||
cs_finished.
|
||||
(reap_children, child_handler, new_job): I added several
|
||||
debugging printf's while fixing this. I left them in if (debug_flag)
|
||||
debugging printf's while fixing this. I left them in if (debug_flag)
|
||||
because they may be useful for debugging this stuff again.
|
||||
|
||||
Wed May 6 22:02:37 1992 Roland McGrath (roland@albert.gnu.ai.mit.edu)
|
||||
|
||||
20
GNUmakefile
20
GNUmakefile
@@ -2,7 +2,7 @@
|
||||
|
||||
# Copyright (C) 1990, 91, 92, 93, 94, 95 Free Software Foundation, Inc.
|
||||
# This file is part of GNU Make.
|
||||
#
|
||||
#
|
||||
# GNU Make is free software; you can redistribute 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)
|
||||
@@ -12,7 +12,7 @@
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with GNU Make; see the file COPYING. If not, write to
|
||||
# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
@@ -89,7 +89,7 @@ GETOPT =
|
||||
#GETOPT_SRC = Don't clear this or dist will break.
|
||||
|
||||
# glob is in libc too.
|
||||
GLOB =
|
||||
GLOB =
|
||||
|
||||
else
|
||||
|
||||
@@ -113,7 +113,7 @@ $(archpfx)load.o: load.c
|
||||
$(archpfx)load.dep: load.c
|
||||
$(mkdep) $(LOAD_AVG) $< | sed 's,$*\.o,& $@,' > $@
|
||||
|
||||
CPPFLAGS := -I$(ARCH) -DHAVE_CONFIG_H $(filter-out @%@,$(CPPFLAGS))
|
||||
CPPFLAGS := -I$(ARCH) -Iglob -DHAVE_CONFIG_H $(filter-out @%@,$(CPPFLAGS))
|
||||
|
||||
ifneq "$(wildcard $(ARCH)/makefile)" ""
|
||||
include $(ARCH)/makefile
|
||||
@@ -125,7 +125,8 @@ prog := make
|
||||
endif
|
||||
|
||||
ifneq "$(findstring gcc,$(CC))" ""
|
||||
CFLAGS = -g -W -Wunused -Wpointer-arith -Wreturn-type -Wswitch
|
||||
CFLAGS = -g -Wall -Wtraditional -Wid-clash-31 -Wpointer-arith \
|
||||
-Wbad-function-cast -Wconversion
|
||||
else
|
||||
CFLAGS = -g
|
||||
endif
|
||||
@@ -150,15 +151,16 @@ $(prog): $(objs) $(globdep) #$(addprefix $(ARCH)/,gmalloc.o mcheck.o)
|
||||
$(CC) $(LDFLAGS) $^ $(globlib) $(LOADLIBES) -o $@.new
|
||||
mv -f $@.new $@
|
||||
|
||||
libc-srcdir = /home/gd/gnu/libc
|
||||
globfiles = $(addprefix glob/,COPYING.LIB configure.in configure Makefile.in \
|
||||
configure.bat glob.c fnmatch.c glob.h fnmatch.h)
|
||||
$(globfiles): stamp-glob ;
|
||||
stamp-glob: /home/gd/gnu/libc/posix/glob.tar
|
||||
-rm -f $(globfiles)
|
||||
stamp-glob: $(libc-srcdir)/posix/glob.tar
|
||||
-rm -f stamp-glob glob/*
|
||||
tar xvf $< glob
|
||||
cvs commit -m'Updated from libc' glob
|
||||
touch $@
|
||||
/home/gd/gnu/libc/posix/glob.tar: force
|
||||
$(libc-srcdir)/posix/glob.tar: force
|
||||
$(MAKE) -C $(@D) $(@F) no_deps=t
|
||||
.PHONY: force
|
||||
force:
|
||||
@@ -223,7 +225,7 @@ tarfiles: $(tarfiles)
|
||||
distfiles=README INSTALL COPYING ChangeLog NEWS \
|
||||
configure Makefile.in configure.in build.sh.in mkinstalldirs \
|
||||
configh.dos configure.bat \
|
||||
acconfig.h $(srcs) remote-*.c $(globfiles) \
|
||||
aclocal.m4 acconfig.h $(srcs) remote-*.c $(globfiles) \
|
||||
make.texinfo make-stds.texi \
|
||||
make.?? make.??s make.toc make.aux make.man texinfo.tex TAGS tags \
|
||||
install-sh \
|
||||
|
||||
181
INSTALL
Normal file
181
INSTALL
Normal file
@@ -0,0 +1,181 @@
|
||||
Basic Installation
|
||||
==================
|
||||
|
||||
These are generic installation instructions.
|
||||
|
||||
The `configure' shell script attempts to guess correct values for
|
||||
various system-dependent variables used during compilation. It uses
|
||||
those values to create a `Makefile' in each directory of the package.
|
||||
It may also create one or more `.h' files containing system-dependent
|
||||
definitions. Finally, it creates a shell script `config.status' that
|
||||
you can run in the future to recreate the current configuration, a file
|
||||
`config.cache' that saves the results of its tests to speed up
|
||||
reconfiguring, and a file `config.log' containing compiler output
|
||||
(useful mainly for debugging `configure').
|
||||
|
||||
If you need to do unusual things to compile the package, please try
|
||||
to figure out how `configure' could check whether to do them, and mail
|
||||
diffs or instructions to the address given in the `README' so they can
|
||||
be considered for the next release. If at some point `config.cache'
|
||||
contains results you don't want to keep, you may remove or edit it.
|
||||
|
||||
The file `configure.in' is used to create `configure' by a program
|
||||
called `autoconf'. You only need `configure.in' if you want to change
|
||||
it or regenerate `configure' using a newer version of `autoconf'.
|
||||
|
||||
The simplest way to compile this package is:
|
||||
|
||||
1. `cd' to the directory containing the package's source code and type
|
||||
`./configure' to configure the package for your system. If you're
|
||||
using `csh' on an old version of System V, you might need to type
|
||||
`sh ./configure' instead to prevent `csh' from trying to execute
|
||||
`configure' itself.
|
||||
|
||||
Running `configure' takes awhile. While running, it prints some
|
||||
messages telling which features it is checking for.
|
||||
|
||||
2. Type `make' to compile the package.
|
||||
|
||||
3. Optionally, type `make check' to run any self-tests that come with
|
||||
the package.
|
||||
|
||||
4. Type `make install' to install the programs and any data files and
|
||||
documentation.
|
||||
|
||||
5. You can remove the program binaries and object files from the
|
||||
source code directory by typing `make clean'. To also remove the
|
||||
files that `configure' created (so you can compile the package for
|
||||
a different kind of computer), type `make distclean'. There is
|
||||
also a `make maintainer-clean' target, but that is intended mainly
|
||||
for the package's developers. If you use it, you may have to get
|
||||
all sorts of other programs in order to regenerate files that came
|
||||
with the distribution.
|
||||
|
||||
Compilers and Options
|
||||
=====================
|
||||
|
||||
Some systems require unusual options for compilation or linking that
|
||||
the `configure' script does not know about. You can give `configure'
|
||||
initial values for variables by setting them in the environment. Using
|
||||
a Bourne-compatible shell, you can do that on the command line like
|
||||
this:
|
||||
CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure
|
||||
|
||||
Or on systems that have the `env' program, you can do it like this:
|
||||
env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure
|
||||
|
||||
Compiling For Multiple Architectures
|
||||
====================================
|
||||
|
||||
You can compile the package for more than one kind of computer at the
|
||||
same time, by placing the object files for each architecture in their
|
||||
own directory. To do this, you must use a version of `make' that
|
||||
supports the `VPATH' variable, such as GNU `make'. `cd' to the
|
||||
directory where you want the object files and executables to go and run
|
||||
the `configure' script. `configure' automatically checks for the
|
||||
source code in the directory that `configure' is in and in `..'.
|
||||
|
||||
If you have to use a `make' that does not supports the `VPATH'
|
||||
variable, you have to compile the package for one architecture at a time
|
||||
in the source code directory. After you have installed the package for
|
||||
one architecture, use `make distclean' before reconfiguring for another
|
||||
architecture.
|
||||
|
||||
Installation Names
|
||||
==================
|
||||
|
||||
By default, `make install' will install the package's files in
|
||||
`/usr/local/bin', `/usr/local/man', etc. You can specify an
|
||||
installation prefix other than `/usr/local' by giving `configure' the
|
||||
option `--prefix=PATH'.
|
||||
|
||||
You can specify separate installation prefixes for
|
||||
architecture-specific files and architecture-independent files. If you
|
||||
give `configure' the option `--exec-prefix=PATH', the package will use
|
||||
PATH as the prefix for installing programs and libraries.
|
||||
Documentation and other data files will still use the regular prefix.
|
||||
|
||||
In addition, if you use an unusual directory layout you can give
|
||||
options like `--bindir=PATH' to specify different values for particular
|
||||
kinds of files. Run `configure --help' for a list of the directories
|
||||
you can set and what kinds of files go in them.
|
||||
|
||||
If the package supports it, you can cause programs to be installed
|
||||
with an extra prefix or suffix on their names by giving `configure' the
|
||||
option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
|
||||
|
||||
Optional Features
|
||||
=================
|
||||
|
||||
Some packages pay attention to `--enable-FEATURE' options to
|
||||
`configure', where FEATURE indicates an optional part of the package.
|
||||
They may also pay attention to `--with-PACKAGE' options, where PACKAGE
|
||||
is something like `gnu-as' or `x' (for the X Window System). The
|
||||
`README' should mention any `--enable-' and `--with-' options that the
|
||||
package recognizes.
|
||||
|
||||
For packages that use the X Window System, `configure' can usually
|
||||
find the X include and library files automatically, but if it doesn't,
|
||||
you can use the `configure' options `--x-includes=DIR' and
|
||||
`--x-libraries=DIR' to specify their locations.
|
||||
|
||||
Specifying the System Type
|
||||
==========================
|
||||
|
||||
There may be some features `configure' can not figure out
|
||||
automatically, but needs to determine by the type of host the package
|
||||
will run on. Usually `configure' can figure that out, but if it prints
|
||||
a message saying it can not guess the host type, give it the
|
||||
`--host=TYPE' option. TYPE can either be a short name for the system
|
||||
type, such as `sun4', or a canonical name with three fields:
|
||||
CPU-COMPANY-SYSTEM
|
||||
|
||||
See the file `config.sub' for the possible values of each field. If
|
||||
`config.sub' isn't included in this package, then this package doesn't
|
||||
need to know the host type.
|
||||
|
||||
If you are building compiler tools for cross-compiling, you can also
|
||||
use the `--target=TYPE' option to select the type of system they will
|
||||
produce code for and the `--build=TYPE' option to select the type of
|
||||
system on which you are compiling the package.
|
||||
|
||||
Sharing Defaults
|
||||
================
|
||||
|
||||
If you want to set default values for `configure' scripts to share,
|
||||
you can create a site shell script called `config.site' that gives
|
||||
default values for variables like `CC', `cache_file', and `prefix'.
|
||||
`configure' looks for `PREFIX/share/config.site' if it exists, then
|
||||
`PREFIX/etc/config.site' if it exists. Or, you can set the
|
||||
`CONFIG_SITE' environment variable to the location of the site script.
|
||||
A warning: not all `configure' scripts look for a site script.
|
||||
|
||||
Operation Controls
|
||||
==================
|
||||
|
||||
`configure' recognizes the following options to control how it
|
||||
operates.
|
||||
|
||||
`--cache-file=FILE'
|
||||
Use and save the results of the tests in FILE instead of
|
||||
`./config.cache'. Set FILE to `/dev/null' to disable caching, for
|
||||
debugging `configure'.
|
||||
|
||||
`--help'
|
||||
Print a summary of the options to `configure', and exit.
|
||||
|
||||
`--quiet'
|
||||
`--silent'
|
||||
`-q'
|
||||
Do not print messages saying which checks are being made.
|
||||
|
||||
`--srcdir=DIR'
|
||||
Look for the package's source code in directory DIR. Usually
|
||||
`configure' can determine that directory automatically.
|
||||
|
||||
`--version'
|
||||
Print the version of Autoconf used to generate the `configure'
|
||||
script, and exit.
|
||||
|
||||
`configure' also accepts some other, not widely useful, options.
|
||||
|
||||
45
Makefile.in
45
Makefile.in
@@ -1,9 +1,9 @@
|
||||
# NOTE: If you have no `make' program at all to process this makefile, run
|
||||
# `build.sh' instead.
|
||||
#
|
||||
# Copyright (C) 1988, 89, 91, 92, 93, 94, 1995 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1988,89,91,92,93,94,95,96 Free Software Foundation, Inc.
|
||||
# This file is part of GNU Make.
|
||||
#
|
||||
#
|
||||
# GNU Make is free software; you can redistribute 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)
|
||||
@@ -13,7 +13,7 @@
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with GNU Make; see the file COPYING. If not, write to
|
||||
# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
@@ -48,19 +48,6 @@ defines = @DEFS@ -DLIBDIR=\"$(libdir)\" -DINCLUDEDIR=\"$(includedir)\"
|
||||
# The code is found in `remote-$(REMOTE).c'.
|
||||
REMOTE = @REMOTE@
|
||||
|
||||
# If you are using the GNU C library, or have the GNU getopt functions in
|
||||
# your C library, you can comment these out.
|
||||
GETOPT = getopt.o getopt1.o
|
||||
GETOPT_SRC = $(srcdir)/getopt.c $(srcdir)/getopt1.c $(srcdir)/getopt.h
|
||||
|
||||
# If you are using the GNU C library, or have the GNU glob functions in
|
||||
# your C library, you can comment this out. GNU make uses special hooks
|
||||
# into the glob functions to be more efficient (by using make's directory
|
||||
# cache for globbing), so you must use the GNU functions even if your
|
||||
# system's C library has the 1003.2 glob functions already. Also, the glob
|
||||
# functions in the AIX and HPUX C libraries are said to be buggy.
|
||||
GLOB = glob/libglob.a
|
||||
|
||||
# If your system doesn't have alloca, or the one provided is bad, define this.
|
||||
ALLOCA = @ALLOCA@
|
||||
ALLOCA_SRC = $(srcdir)/alloca.c
|
||||
@@ -123,7 +110,8 @@ CTAGS = ctags -w
|
||||
objs = commands.o job.o dir.o file.o misc.o main.o read.o remake.o \
|
||||
rule.o implicit.o default.o variable.o expand.o function.o \
|
||||
vpath.o version.o ar.o arscan.o signame.o remote-$(REMOTE).o \
|
||||
$(GLOB) $(GETOPT) $(ALLOCA) $(extras)
|
||||
getopt.o getopt1.o glob/libglob.a \
|
||||
$(ALLOCA) $(extras)
|
||||
srcs = $(srcdir)/commands.c $(srcdir)/job.c $(srcdir)/dir.c \
|
||||
$(srcdir)/file.c $(srcdir)/getloadavg.c $(srcdir)/misc.c \
|
||||
$(srcdir)/main.c $(srcdir)/read.c $(srcdir)/remake.c \
|
||||
@@ -132,7 +120,7 @@ srcs = $(srcdir)/commands.c $(srcdir)/job.c $(srcdir)/dir.c \
|
||||
$(srcdir)/vpath.c $(srcdir)/version.c \
|
||||
$(srcdir)/remote-$(REMOTE).c \
|
||||
$(srcdir)/ar.c $(srcdir)/arscan.c \
|
||||
$(srcdir)/signame.c $(srcdir)/signame.h $(GETOPT_SRC) \
|
||||
$(srcdir)/signame.c $(srcdir)/signame.h getopt.c getopt1.c \
|
||||
$(srcdir)/commands.h $(srcdir)/dep.h $(srcdir)/file.h \
|
||||
$(srcdir)/job.h $(srcdir)/make.h $(srcdir)/rule.h \
|
||||
$(srcdir)/variable.h $(ALLOCA_SRC) $(srcdir)/config.h.in
|
||||
@@ -282,26 +270,27 @@ $(objs): config.h
|
||||
# Automatically generated dependencies will be put at the end of the file.
|
||||
|
||||
# Automatically generated dependencies.
|
||||
commands.o : commands.c make.h dep.h commands.h file.h variable.h job.h
|
||||
commands.o: commands.c make.h dep.h commands.h file.h variable.h job.h
|
||||
job.o: job.c make.h commands.h job.h file.h variable.h
|
||||
dir.o: dir.c make.h
|
||||
file.o: file.c make.h commands.h dep.h file.h variable.h
|
||||
misc.o: misc.c make.h dep.h
|
||||
main.o: main.c make.h commands.h dep.h file.h variable.h job.h getopt.h
|
||||
main.o: main.c make.h commands.h dep.h file.h variable.h job.h \
|
||||
getopt.h
|
||||
read.o: read.c make.h commands.h dep.h file.h variable.h glob/glob.h
|
||||
remake.o: remake.c make.h commands.h job.h dep.h file.h
|
||||
rule.o : rule.c make.h config.h commands.h dep.h file.h variable.h rule.h
|
||||
implicit.o : implicit.c make.h rule.h dep.h file.h
|
||||
rule.o: rule.c make.h commands.h dep.h file.h variable.h rule.h
|
||||
implicit.o: implicit.c make.h rule.h dep.h file.h
|
||||
default.o: default.c make.h rule.h dep.h file.h commands.h variable.h
|
||||
variable.o : variable.c make.h commands.h variable.h dep.h file.h
|
||||
variable.o: variable.c make.h commands.h variable.h dep.h file.h
|
||||
expand.o: expand.c make.h commands.h file.h variable.h
|
||||
function.o: function.c make.h variable.h dep.h commands.h job.h
|
||||
vpath.o : vpath.c make.h file.h variable.h
|
||||
vpath.o: vpath.c make.h file.h variable.h
|
||||
version.o: version.c
|
||||
ar.o : ar.c make.h file.h dep.h
|
||||
ar.o: ar.c make.h file.h dep.h
|
||||
arscan.o: arscan.c make.h
|
||||
signame.o: signame.c signame.h
|
||||
remote-stub.o : remote-stub.c make.h commands.h
|
||||
getopt.o: getopt.c getopt.h
|
||||
getopt1.o : getopt1.c getopt.h
|
||||
remote-stub.o: remote-stub.c make.h commands.h
|
||||
getopt.o: getopt.c
|
||||
getopt1.o: getopt1.c getopt.h
|
||||
getloadavg.o: getloadavg.c
|
||||
|
||||
21
NEWS
21
NEWS
@@ -1,17 +1,28 @@
|
||||
GNU make NEWS -- history of user-visible changes. 26 January 1995
|
||||
GNU make NEWS -- history of user-visible changes. 28 February 1996
|
||||
|
||||
Copyright (C) 1992, 1993, 1994, 1995 Free Software Foundation, Inc.
|
||||
Copyright (C) 1992, 1993, 1994, 1995, 1996 Free Software Foundation, Inc.
|
||||
See the end for copying conditions.
|
||||
|
||||
Please send GNU make bug reports to bug-gnu-utils@prep.ai.mit.edu.
|
||||
|
||||
Version 3.75
|
||||
|
||||
* The directory messages printed by `-w' and implicitly in sub-makes,
|
||||
are now omitted if Make runs no commands and has no other messages to print.
|
||||
|
||||
* Make now detects files that for whatever reason have modification times
|
||||
in the future and gives an error. Files with such impossible timestamps
|
||||
can result from unsynchronized clocks, or archived distributions
|
||||
containing bogus timestamps; they confuse Make's dependency engine
|
||||
thoroughly.
|
||||
|
||||
Version 3.73
|
||||
|
||||
* Converted to use Autoconf version 2, so `configure' has some new options.
|
||||
See INSTALL for details.
|
||||
|
||||
* You can now send a SIGUSR1 signal to Make to toggle printing of debugging
|
||||
output enable by -d, at any time during the run.
|
||||
output enabled by -d, at any time during the run.
|
||||
|
||||
Version 3.72
|
||||
|
||||
@@ -222,7 +233,7 @@ Version 3.63
|
||||
include, like this:
|
||||
include file1 file2
|
||||
You can also use shell file name patterns in an `include' directive:
|
||||
include *.mk
|
||||
include *.mk
|
||||
|
||||
* The default directories to search for included makefiles, and for
|
||||
libraries specified with `-lNAME', are now set by configuration.
|
||||
@@ -540,7 +551,7 @@ Version 3.05
|
||||
----------------------------------------------------------------------
|
||||
Copyright information:
|
||||
|
||||
Copyright (C) 1992, 1993, 1994, 1995 Free Software Foundation, Inc.
|
||||
Copyright (C) 1992, 1993, 1994, 1995, 1996 Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to anyone to make or distribute verbatim copies
|
||||
of this document as received, in any medium, provided that the
|
||||
|
||||
6
README
6
README
@@ -1,4 +1,4 @@
|
||||
This directory contains the 3.73.3 test release of GNU Make.
|
||||
This directory contains the 3.74.3 test release of GNU Make.
|
||||
All bugs reported for previous test releases have been fixed.
|
||||
Some bugs surely remain.
|
||||
|
||||
@@ -10,6 +10,10 @@ build the program, type `sh build.sh'. This should compile the program
|
||||
in the current directory. Then you will have a Make program that you can
|
||||
use for `make install', or whatever else.
|
||||
|
||||
Some systems' Make programs are broken and cannot process the Makefile for
|
||||
GNU Make. If you get errors from your system's Make when building GNU
|
||||
Make, try using `build.sh' instead.
|
||||
|
||||
It has been reported that the XLC 1.2 compiler on AIX 3.2 is buggy such
|
||||
that if you compile make with `cc -O' on AIX 3.2, it will not work correctly.
|
||||
It is said that using `cc' without `-O' does work.
|
||||
|
||||
@@ -10,6 +10,10 @@ build the program, type `sh build.sh'. This should compile the program
|
||||
in the current directory. Then you will have a Make program that you can
|
||||
use for `make install', or whatever else.
|
||||
|
||||
Some systems' Make programs are broken and cannot process the Makefile for
|
||||
GNU Make. If you get errors from your system's Make when building GNU
|
||||
Make, try using `build.sh' instead.
|
||||
|
||||
It has been reported that the XLC 1.2 compiler on AIX 3.2 is buggy such
|
||||
that if you compile make with `cc -O' on AIX 3.2, it will not work correctly.
|
||||
It is said that using `cc' without `-O' does work.
|
||||
|
||||
@@ -12,6 +12,3 @@
|
||||
|
||||
/* Define this if you have the `union wait' type in <sys/wait.h>. */
|
||||
#undef HAVE_UNION_WAIT
|
||||
|
||||
/* Define this if the POSIX.1 call `sysconf (_SC_OPEN_MAX)' works properly. */
|
||||
#undef HAVE_SYSCONF_OPEN_MAX
|
||||
|
||||
3
alloca.c
3
alloca.c
@@ -209,6 +209,9 @@ alloca (size)
|
||||
register pointer new = malloc (sizeof (header) + size);
|
||||
/* Address of header. */
|
||||
|
||||
if (new == 0)
|
||||
abort();
|
||||
|
||||
((header *) new)->h.next = last_alloca_header;
|
||||
((header *) new)->h.deep = depth;
|
||||
|
||||
|
||||
9
arscan.c
9
arscan.c
@@ -1,5 +1,5 @@
|
||||
/* Library function for scanning an archive file.
|
||||
Copyright (C) 1987, 89, 91, 92, 93, 94 Free Software Foundation, Inc.
|
||||
Copyright (C) 1987, 89, 91, 92, 93, 94, 95 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@@ -144,6 +144,13 @@ ar_scan (archive, function, arg)
|
||||
|
||||
sscanf (fl_header.fl_fstmoff, "%12ld", &member_offset);
|
||||
sscanf (fl_header.fl_lstmoff, "%12ld", &last_member_offset);
|
||||
|
||||
if (member_offset == 0)
|
||||
{
|
||||
/* Empty archive. */
|
||||
close (desc);
|
||||
return 0;
|
||||
}
|
||||
#else
|
||||
#ifndef M_XENIX
|
||||
register long int member_offset = sizeof (int);
|
||||
|
||||
@@ -45,7 +45,7 @@ includedir=${prefix}/include
|
||||
set -e
|
||||
|
||||
# These are all the objects we need to link together.
|
||||
objs="commands.o job.o dir.o file.o misc.o main.o read.o remake.o rule.o implicit.o default.o variable.o expand.o function.o vpath.o version.o ar.o arscan.o signame.o getopt.o getopt1.o glob/glob.o glob/fnmatch.o remote-${REMOTE}.o ${extras} ${ALLOCA}"
|
||||
objs="commands.o job.o dir.o file.o misc.o main.o read.o remake.o rule.o implicit.o default.o variable.o expand.o function.o vpath.o version.o ar.o arscan.o signame.o getopt.o getopt1.o glob/libglob.a glob/glob.o glob/fnmatch.o remote-${REMOTE}.o ${extras} ${ALLOCA}"
|
||||
|
||||
# Compile the source files into those objects.
|
||||
for file in `echo ${objs} | sed 's/\.o/.c/g'`; do
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Command processing for GNU Make.
|
||||
Copyright (C) 1988, 1989, 1991, 1992, 1993, 1994 Free Software Foundation, Inc.
|
||||
Copyright (C) 1988, 89, 91, 92, 93, 94, 95 Free Software Foundation, Inc.
|
||||
This file is part of GNU Make.
|
||||
|
||||
GNU Make is free software; you can redistribute it and/or modify
|
||||
@@ -451,7 +451,7 @@ delete_target (file, on_behalf_of)
|
||||
}
|
||||
#endif
|
||||
|
||||
if (safe_stat (file->name, &st) == 0
|
||||
if (stat (file->name, &st) == 0
|
||||
&& S_ISREG (st.st_mode)
|
||||
&& (time_t) st.st_mtime != file->last_mtime)
|
||||
{
|
||||
@@ -459,11 +459,12 @@ delete_target (file, on_behalf_of)
|
||||
error ("*** [%s] Deleting file `%s'", on_behalf_of, file->name);
|
||||
else
|
||||
error ("*** Deleting file `%s'", file->name);
|
||||
if (unlink (file->name) < 0)
|
||||
if (unlink (file->name) < 0
|
||||
&& errno != ENOENT) /* It disappeared; so what. */
|
||||
perror_with_name ("unlink: ", file->name);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* Delete all non-precious targets of CHILD unless they were already deleted.
|
||||
Set the flag in CHILD to say they've been deleted. */
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
# NOTE: If you have no `make' program at all to process this makefile, run
|
||||
# `build.sh' instead.
|
||||
#
|
||||
# Copyright (C) 1988, 89, 91, 92, 93, 94, 1995 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1988,89,91,92,93,94,95,96 Free Software Foundation, Inc.
|
||||
# This file is part of GNU Make.
|
||||
#
|
||||
#
|
||||
# GNU Make is free software; you can redistribute 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)
|
||||
@@ -13,7 +13,7 @@
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with GNU Make; see the file COPYING. If not, write to
|
||||
# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
@@ -48,19 +48,6 @@ defines = @DEFS@ -DLIBDIR=\"$(libdir)\" -DINCLUDEDIR=\"$(includedir)\"
|
||||
# The code is found in `remote-$(REMOTE).c'.
|
||||
REMOTE = @REMOTE@
|
||||
|
||||
# If you are using the GNU C library, or have the GNU getopt functions in
|
||||
# your C library, you can comment these out.
|
||||
GETOPT = getopt.o getopt1.o
|
||||
GETOPT_SRC = $(srcdir)/getopt.c $(srcdir)/getopt1.c $(srcdir)/getopt.h
|
||||
|
||||
# If you are using the GNU C library, or have the GNU glob functions in
|
||||
# your C library, you can comment this out. GNU make uses special hooks
|
||||
# into the glob functions to be more efficient (by using make's directory
|
||||
# cache for globbing), so you must use the GNU functions even if your
|
||||
# system's C library has the 1003.2 glob functions already. Also, the glob
|
||||
# functions in the AIX and HPUX C libraries are said to be buggy.
|
||||
GLOB = glob/libglob.a
|
||||
|
||||
# If your system doesn't have alloca, or the one provided is bad, define this.
|
||||
ALLOCA = @ALLOCA@
|
||||
ALLOCA_SRC = $(srcdir)/alloca.c
|
||||
@@ -123,7 +110,8 @@ CTAGS = ctags -w
|
||||
objs = commands.o job.o dir.o file.o misc.o main.o read.o remake.o \
|
||||
rule.o implicit.o default.o variable.o expand.o function.o \
|
||||
vpath.o version.o ar.o arscan.o signame.o remote-$(REMOTE).o \
|
||||
$(GLOB) $(GETOPT) $(ALLOCA) $(extras)
|
||||
getopt.o getopt1.o glob/libglob.a \
|
||||
$(ALLOCA) $(extras)
|
||||
srcs = $(srcdir)/commands.c $(srcdir)/job.c $(srcdir)/dir.c \
|
||||
$(srcdir)/file.c $(srcdir)/getloadavg.c $(srcdir)/misc.c \
|
||||
$(srcdir)/main.c $(srcdir)/read.c $(srcdir)/remake.c \
|
||||
@@ -132,7 +120,7 @@ srcs = $(srcdir)/commands.c $(srcdir)/job.c $(srcdir)/dir.c \
|
||||
$(srcdir)/vpath.c $(srcdir)/version.c \
|
||||
$(srcdir)/remote-$(REMOTE).c \
|
||||
$(srcdir)/ar.c $(srcdir)/arscan.c \
|
||||
$(srcdir)/signame.c $(srcdir)/signame.h $(GETOPT_SRC) \
|
||||
$(srcdir)/signame.c $(srcdir)/signame.h getopt.c getopt1.c \
|
||||
$(srcdir)/commands.h $(srcdir)/dep.h $(srcdir)/file.h \
|
||||
$(srcdir)/job.h $(srcdir)/make.h $(srcdir)/rule.h \
|
||||
$(srcdir)/variable.h $(ALLOCA_SRC) $(srcdir)/config.h.in
|
||||
|
||||
@@ -173,18 +173,12 @@
|
||||
/* Define this if you have the `union wait' type in <sys/wait.h>. */
|
||||
#undef HAVE_UNION_WAIT
|
||||
|
||||
/* Define this if the POSIX.1 call `sysconf (_SC_OPEN_MAX)' works properly. */
|
||||
#undef HAVE_SYSCONF_OPEN_MAX
|
||||
|
||||
/* Define if you have the dup2 function. */
|
||||
#undef HAVE_DUP2
|
||||
|
||||
/* Define if you have the getcwd function. */
|
||||
#undef HAVE_GETCWD
|
||||
|
||||
/* Define if you have the getdtablesize function. */
|
||||
#undef HAVE_GETDTABLESIZE
|
||||
|
||||
/* Define if you have the getgroups function. */
|
||||
#undef HAVE_GETGROUPS
|
||||
|
||||
|
||||
13
configure.in
13
configure.in
@@ -38,7 +38,7 @@ changequote([,])dnl
|
||||
fi
|
||||
AC_MSG_RESULT($ac_cv_check_symbol_$1)])dnl
|
||||
|
||||
AC_CHECK_FUNCS(getdtablesize psignal mktemp \
|
||||
AC_CHECK_FUNCS(psignal mktemp \
|
||||
dup2 getcwd sigsetmask getgroups setlinebuf \
|
||||
seteuid setegid setreuid setregid strerror strsignal)
|
||||
AC_CHECK_SYMBOL(sys_siglist)
|
||||
@@ -49,17 +49,6 @@ AC_FUNC_SETVBUF_REVERSED
|
||||
AC_FUNC_GETLOADAVG
|
||||
AC_FUNC_STRCOLL
|
||||
|
||||
if test $ac_cv_func_getdtablesize = no; then
|
||||
AC_MSG_CHECKING(for sysconf (_SC_OPEN_MAX))
|
||||
AC_CACHE_VAL(make_cv_sysconf_open_max, [dnl
|
||||
AC_TRY_LINK([#include <unistd.h>], [int max = sysconf (_SC_OPEN_MAX);],
|
||||
[make_cv_sysconf_open_max=yes], [make_cv_sysconf_open_max=no])])
|
||||
if test $make_cv_sysconf_open_max = yes; then
|
||||
AC_DEFINE(HAVE_SYSCONF_OPEN_MAX)
|
||||
fi
|
||||
AC_MSG_RESULT($make_cv_sysconf_open_max)
|
||||
fi
|
||||
|
||||
# Check out the wait reality.
|
||||
AC_CHECK_HEADERS(sys/wait.h) AC_CHECK_FUNCS(waitpid wait3)
|
||||
AC_MSG_CHECKING(for union wait)
|
||||
|
||||
32
default.c
32
default.c
@@ -1,5 +1,5 @@
|
||||
/* Data base of default implicit rules for GNU Make.
|
||||
Copyright (C) 1988, 89, 90, 91, 92, 93, 94, 1995 Free Software Foundation, Inc.
|
||||
Copyright (C) 1988,89,90,91,92,93,94,95,96 Free Software Foundation, Inc.
|
||||
This file is part of GNU Make.
|
||||
|
||||
GNU Make is free software; you can redistribute it and/or modify
|
||||
@@ -63,9 +63,9 @@ static struct pspec default_terminal_rules[] =
|
||||
{
|
||||
/* RCS. */
|
||||
{ "%", "%,v",
|
||||
"+$(CHECKOUT,v)" },
|
||||
"$(CHECKOUT,v)" },
|
||||
{ "%", "RCS/%,v",
|
||||
"+$(CHECKOUT,v)" },
|
||||
"$(CHECKOUT,v)" },
|
||||
|
||||
/* SCCS. */
|
||||
{ "%", "s.%",
|
||||
@@ -101,24 +101,16 @@ static char *default_suffix_rules[] =
|
||||
".mod",
|
||||
"$(COMPILE.mod) -o $@ -e $@ $^",
|
||||
|
||||
".def.sym",
|
||||
".def.sym",
|
||||
"$(COMPILE.def) -o $@ $<",
|
||||
|
||||
".sh",
|
||||
"cat $< >$@ \n chmod a+x $@",
|
||||
|
||||
".s.o",
|
||||
#if !defined(M_XENIX) || defined(__GNUC__)
|
||||
"$(COMPILE.s) -o $@ $<",
|
||||
#else /* Xenix. */
|
||||
"$(COMPILE.s) -o$@ $<",
|
||||
#endif /* Not Xenix. */
|
||||
".S.o",
|
||||
#if !defined(M_XENIX) || defined(__GNUC__)
|
||||
"$(COMPILE.S) -o $@ $<",
|
||||
#else /* Xenix. */
|
||||
"$(COMPILE.S) -o$@ $<",
|
||||
#endif /* Not Xenix. */
|
||||
".c.o",
|
||||
"$(COMPILE.c) $< $(OUTPUT_OPTION)",
|
||||
".cc.o",
|
||||
@@ -222,8 +214,8 @@ static char *default_variables[] =
|
||||
/* This expands to $(CO) $(COFLAGS) $< $@ if $@ does not exist,
|
||||
and to the empty string if $@ does exist. */
|
||||
"CHECKOUT,v",
|
||||
"$(patsubst $@-noexist,$(CO) $(COFLAGS) $< $@,\
|
||||
$(filter-out $@,$(firstword $(wildcard $@) $@-noexist)))",
|
||||
"+$(patsubst $@-noexist,$(CO) $(COFLAGS) $< $@,\
|
||||
$(filter-out $@,$(firstword $(wildcard $@) $@-noexist)))",
|
||||
|
||||
"CO", "co",
|
||||
"CPP", "$(CC) -E",
|
||||
@@ -305,21 +297,13 @@ static char *default_variables[] =
|
||||
"COMPILE.s", "$(AS) $(ASFLAGS) $(TARGET_MACH)",
|
||||
"LINK.S", "$(CC) $(ASFLAGS) $(CPPFLAGS) $(LDFLAGS) $(TARGET_MACH)",
|
||||
"COMPILE.S", "$(CC) $(ASFLAGS) $(CPPFLAGS) $(TARGET_MACH) -c",
|
||||
#if !defined(M_XENIX) || defined(__GNUC__)
|
||||
"PREPROCESS.S", "$(CC) -E $(CPPFLAGS)",
|
||||
#else /* Xenix. */
|
||||
"PREPROCESS.S", "$(CC) -EP $(CPPFLAGS)",
|
||||
#endif /* Not Xenix. */
|
||||
"PREPROCESS.F", "$(FC) $(FFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -F",
|
||||
"PREPROCESS.r", "$(FC) $(FFLAGS) $(RFLAGS) $(TARGET_ARCH) -F",
|
||||
"LINT.c", "$(LINT) $(LINTFLAGS) $(CPPFLAGS) $(TARGET_ARCH)",
|
||||
|
||||
#ifndef NO_MINUS_C_MINUS_O
|
||||
#if !defined(M_XENIX) || defined(__GNUC__)
|
||||
"OUTPUT_OPTION", "-o $@",
|
||||
#else /* Xenix. */
|
||||
"OUTPUT_OPTION", "-Fo$@",
|
||||
#endif /* Not Xenix. */
|
||||
#endif
|
||||
|
||||
#ifdef SCCS_GET_MINUS_G
|
||||
@@ -357,7 +341,7 @@ void
|
||||
install_default_suffix_rules ()
|
||||
{
|
||||
register char **s;
|
||||
|
||||
|
||||
if (no_builtin_rules_flag)
|
||||
return;
|
||||
|
||||
@@ -382,7 +366,7 @@ void
|
||||
install_default_implicit_rules ()
|
||||
{
|
||||
register struct pspec *p;
|
||||
|
||||
|
||||
if (no_builtin_rules_flag)
|
||||
return;
|
||||
|
||||
|
||||
99
dir.c
99
dir.c
@@ -1,5 +1,5 @@
|
||||
/* Directory hashing for GNU Make.
|
||||
Copyright (C) 1988, 1989, 1991, 1992, 1993, 1994 Free Software Foundation, Inc.
|
||||
Copyright (C) 1988, 89, 91, 92, 93, 94, 95, 96 Free Software Foundation, Inc.
|
||||
This file is part of GNU Make.
|
||||
|
||||
GNU Make is free software; you can redistribute it and/or modify
|
||||
@@ -18,33 +18,37 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||
|
||||
#include "make.h"
|
||||
|
||||
#if defined (POSIX) || defined (HAVE_DIRENT_H) || defined (__GNU_LIBRARY__)
|
||||
#include <dirent.h>
|
||||
#ifndef __GNU_LIBRARY__
|
||||
#define D_NAMLEN(d) strlen((d)->d_name)
|
||||
#else /* GNU C library. */
|
||||
#define D_NAMLEN(d) ((d)->d_namlen)
|
||||
#endif /* Not GNU C library. */
|
||||
#else /* Not POSIX or HAVE_DIRENT_H. */
|
||||
#define direct dirent
|
||||
#define D_NAMLEN(d) ((d)->d_namlen)
|
||||
#ifdef HAVE_SYS_NDIR_H
|
||||
#include <sys/ndir.h>
|
||||
#endif /* HAVE_SYS_NDIR_H */
|
||||
#ifdef HAVE_SYS_DIR_H
|
||||
#include <sys/dir.h>
|
||||
#endif /* HAVE_SYS_DIR_H */
|
||||
#ifdef HAVE_NDIR_H
|
||||
#include <ndir.h>
|
||||
#endif /* HAVE_NDIR_H */
|
||||
#endif /* POSIX or HAVE_DIRENT_H or __GNU_LIBRARY__. */
|
||||
#ifdef HAVE_DIRENT_H
|
||||
# include <dirent.h>
|
||||
# define NAMLEN(dirent) strlen((dirent)->d_name)
|
||||
#else
|
||||
# define dirent direct
|
||||
# define NAMLEN(dirent) (dirent)->d_namlen
|
||||
# ifdef HAVE_SYS_NDIR_H
|
||||
# include <sys/ndir.h>
|
||||
# endif
|
||||
# ifdef HAVE_SYS_DIR_H
|
||||
# include <sys/dir.h>
|
||||
# endif
|
||||
# ifdef HAVE_NDIR_H
|
||||
# include <ndir.h>
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* In GNU systems, <dirent.h> defines this macro for us. */
|
||||
#ifdef _D_NAMLEN
|
||||
#undef NAMLEN
|
||||
#define NAMLEN(d) _D_NAMLEN(d)
|
||||
#endif
|
||||
|
||||
#if defined (POSIX) && !defined (__GNU_LIBRARY__)
|
||||
/* Posix does not require that the d_ino field be present, and some
|
||||
systems do not provide it. */
|
||||
#define REAL_DIR_ENTRY(dp) 1
|
||||
#define FAKE_DIR_ENTRY(dp)
|
||||
#else
|
||||
#define REAL_DIR_ENTRY(dp) (dp->d_ino != 0)
|
||||
#define FAKE_DIR_ENTRY(dp) (dp->d_ino = 1)
|
||||
#endif /* POSIX */
|
||||
|
||||
#ifdef __MSDOS__
|
||||
@@ -179,7 +183,7 @@ find_directory (name)
|
||||
/* The directory is not in the name hash table.
|
||||
Find its device and inode numbers, and look it up by them. */
|
||||
|
||||
if (safe_stat (name, &st) < 0)
|
||||
if (stat (name, &st) < 0)
|
||||
/* Couldn't stat the directory. Mark this by
|
||||
setting the `contents' member to a nil pointer. */
|
||||
dir->contents = 0;
|
||||
@@ -295,10 +299,7 @@ dir_contents_file_exists_p (dir, filename)
|
||||
if (!REAL_DIR_ENTRY (d))
|
||||
continue;
|
||||
|
||||
len = D_NAMLEN (d);
|
||||
while (d->d_name[len - 1] == '\0')
|
||||
--len;
|
||||
|
||||
len = NAMLEN (d);
|
||||
for (i = 0; i < len; ++i)
|
||||
HASH (newhash, d->d_name[i]);
|
||||
newhash %= DIRFILE_BUCKETS;
|
||||
@@ -444,7 +445,7 @@ file_impossible_p (filename)
|
||||
bcopy (p, dirname, dirend - p);
|
||||
dirname[dirend - p] = '\0';
|
||||
dir = find_directory (dirname)->contents;
|
||||
p = dirend + 1;
|
||||
p = filename = dirend + 1;
|
||||
}
|
||||
|
||||
if (dir == 0 || dir->files == 0)
|
||||
@@ -557,7 +558,7 @@ struct dirstream
|
||||
|
||||
/* Forward declarations. */
|
||||
static __ptr_t open_dirstream __P ((const char *));
|
||||
static const char *read_dirstream __P ((__ptr_t));
|
||||
static struct dirent *read_dirstream __P ((__ptr_t));
|
||||
|
||||
static __ptr_t
|
||||
open_dirstream (directory)
|
||||
@@ -584,12 +585,14 @@ open_dirstream (directory)
|
||||
return (__ptr_t) new;
|
||||
}
|
||||
|
||||
static const char *
|
||||
static struct dirent *
|
||||
read_dirstream (stream)
|
||||
__ptr_t stream;
|
||||
{
|
||||
struct dirstream *const ds = (struct dirstream *) stream;
|
||||
register struct dirfile *df;
|
||||
static char *buf;
|
||||
static unsigned int bufsz;
|
||||
|
||||
while (ds->bucket < DIRFILE_BUCKETS)
|
||||
{
|
||||
@@ -597,7 +600,28 @@ read_dirstream (stream)
|
||||
{
|
||||
ds->elt = df->next;
|
||||
if (!df->impossible)
|
||||
return df->name;
|
||||
{
|
||||
/* The glob interface wants a `struct dirent',
|
||||
so mock one up. */
|
||||
struct dirent *d;
|
||||
unsigned int len = strlen (df->name) + 1;
|
||||
if (sizeof *d - sizeof d->d_name + len > bufsz)
|
||||
{
|
||||
if (buf != 0)
|
||||
free (buf);
|
||||
bufsz *= 2;
|
||||
if (sizeof *d - sizeof d->d_name + len > bufsz)
|
||||
bufsz = sizeof *d - sizeof d->d_name + len;
|
||||
buf = xmalloc (bufsz);
|
||||
}
|
||||
d = (struct dirent *) buf;
|
||||
FAKE_DIR_ENTRY (d);
|
||||
#ifdef _DIRENT_HAVE_D_NAMLEN
|
||||
d->d_namlen = len - 1;
|
||||
#endif
|
||||
memcpy (d->d_name, df->name, len);
|
||||
return d;
|
||||
}
|
||||
}
|
||||
if (++ds->bucket == DIRFILE_BUCKETS)
|
||||
break;
|
||||
@@ -608,9 +632,16 @@ read_dirstream (stream)
|
||||
}
|
||||
|
||||
void
|
||||
init_dir ()
|
||||
dir_setup_glob (gl)
|
||||
glob_t *gl;
|
||||
{
|
||||
__glob_opendir_hook = open_dirstream;
|
||||
__glob_readdir_hook = read_dirstream;
|
||||
__glob_closedir_hook = (void (*) __P ((__ptr_t stream))) free;
|
||||
extern int stat ();
|
||||
|
||||
/* Bogus sunos4 compiler complains (!) about & before functions. */
|
||||
gl->gl_opendir = open_dirstream;
|
||||
gl->gl_readdir = read_dirstream;
|
||||
gl->gl_closedir = free;
|
||||
gl->gl_stat = stat;
|
||||
/* We don't bother setting gl_lstat, since glob never calls it.
|
||||
The slot is only there for compatibility with 4.4 BSD. */
|
||||
}
|
||||
|
||||
35
getloadavg.c
35
getloadavg.c
@@ -14,7 +14,8 @@
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
USA. */
|
||||
|
||||
/* Compile-time symbols that this file uses:
|
||||
|
||||
@@ -38,6 +39,7 @@
|
||||
|
||||
apollo
|
||||
BSD Real BSD, not just BSD-like.
|
||||
convex
|
||||
DGUX
|
||||
eunice UNIX emulator under VMS.
|
||||
hpux
|
||||
@@ -214,6 +216,13 @@ extern int errno;
|
||||
#define LOAD_AVE_TYPE long
|
||||
#endif
|
||||
|
||||
#ifdef convex
|
||||
#define LOAD_AVE_TYPE double
|
||||
#ifndef LDAV_CVT
|
||||
#define LDAV_CVT(n) (n)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif /* No LOAD_AVE_TYPE. */
|
||||
|
||||
#ifdef OSF_ALPHA
|
||||
@@ -724,6 +733,16 @@ getloadavg (loadavg, nelem)
|
||||
: (load_ave.tl_avenrun.l[0] / (double) load_ave.tl_lscale));
|
||||
#endif /* OSF_MIPS */
|
||||
|
||||
#if !defined (LDAV_DONE) && defined(MSDOS)
|
||||
#define LDAV_DONE
|
||||
|
||||
/* A faithful emulation is going to have to be saved for a rainy day. */
|
||||
for ( ; elem < nelem; elem++)
|
||||
{
|
||||
loadavg[elem] = 0.0;
|
||||
}
|
||||
#endif /* MSDOS */
|
||||
|
||||
#if !defined (LDAV_DONE) && defined (OSF_ALPHA)
|
||||
#define LDAV_DONE
|
||||
|
||||
@@ -803,7 +822,7 @@ getloadavg (loadavg, nelem)
|
||||
|
||||
#ifndef SUNOS_5
|
||||
if (
|
||||
#ifndef _AIX
|
||||
#if !(defined (_AIX) && !defined (ps2))
|
||||
nlist (KERNEL_FILE, nl)
|
||||
#else /* _AIX */
|
||||
knlist (nl, 1, sizeof (nl[0]))
|
||||
@@ -832,7 +851,17 @@ getloadavg (loadavg, nelem)
|
||||
#ifndef SUNOS_5
|
||||
channel = open ("/dev/kmem", 0);
|
||||
if (channel >= 0)
|
||||
getloadavg_initialized = 1;
|
||||
{
|
||||
/* Set the channel to close on exec, so it does not
|
||||
litter any child's descriptor table. */
|
||||
#ifdef FD_SETFD
|
||||
#ifndef FD_CLOEXEC
|
||||
#define FD_CLOEXEC 1
|
||||
#endif
|
||||
(void) fcntl (channel, F_SETFD, FD_CLOEXEC);
|
||||
#endif
|
||||
getloadavg_initialized = 1;
|
||||
}
|
||||
#else /* SUNOS_5 */
|
||||
/* We pass 0 for the kernel, corefile, and swapfile names
|
||||
to use the currently running kernel. */
|
||||
|
||||
@@ -133,7 +133,7 @@ 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
|
||||
|
||||
@@ -1,3 +1,61 @@
|
||||
Fri Mar 1 10:09:46 1996 Roland McGrath <roland@charlie-brown.gnu.ai.mit.edu>
|
||||
|
||||
* posix/glob.c: Use canonical code from autoconf manual for dirent
|
||||
include.
|
||||
[_D_NAMLEN]: Redefine NAMLEN using this.
|
||||
(glob_in_dir): Use NAMLEN macro.
|
||||
|
||||
Fri Jan 19 13:28:59 1996 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
|
||||
|
||||
* posix/glob.c (glob): Use prototype in getlogin decl.
|
||||
|
||||
Thu Jan 18 00:32:43 1996 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
|
||||
|
||||
* posix/glob.c (_GNU_SOURCE): Define if undefined, so glob.h
|
||||
defines GNU extensions.
|
||||
* posix/fnmatch.c: Likewise.
|
||||
|
||||
Fri Jan 12 13:40:01 1996 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
|
||||
|
||||
* posix/glob.c (glob): Add parens in glob call flags arg for
|
||||
GLOB_BRACE case.
|
||||
|
||||
Thu Dec 14 02:28:22 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
|
||||
|
||||
* posix/glob.c (glob_in_dir): Cast result of opendir to __ptr_t,
|
||||
and cast STREAM to DIR * before passing to readdir and closedir.
|
||||
|
||||
Mon Dec 11 20:07:54 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
|
||||
|
||||
* posix/glob.c [! STDC_HEADERS]: Declare getenv.
|
||||
(glob): Avoid using function as value.
|
||||
|
||||
Fri Dec 8 13:04:51 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
|
||||
|
||||
* posix/glob.c: Implement new options GLOB_ALTDIRFUNC, GLOB_BRACE,
|
||||
GLOB_TILDE, GLOB_NOMAGIC.
|
||||
(glob): Use stat instead of lstat to determine directoriness.
|
||||
* posix/glob.h (GLOB_ALTDIRFUNC, GLOB_BRACE, GLOB_NOMAGIC, GLOB_TILDE):
|
||||
New flag bits.
|
||||
(__GLOB_FLAGS): Include them.
|
||||
(glob_t): New members gl_closedir, gl_readdir, gl_opendir, gl_lstat,
|
||||
gl_stat.
|
||||
|
||||
Mon Sep 11 14:00:14 1995 Roland McGrath <roland@whiz-bang.gnu.ai.mit.edu>
|
||||
|
||||
* posix/glob.c (glob): Comment fix.
|
||||
|
||||
Wed Aug 30 16:44:55 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
|
||||
|
||||
* posix/glob.c (glob): Use realloc to extend strings for GLOB_MARK
|
||||
slash.
|
||||
(glob_in_dir): Don't allocate extra byte here.
|
||||
|
||||
Mon Aug 7 14:04:36 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
|
||||
|
||||
* posix/glob.c (glob_in_dir): Allocate GLOB_MARK byte in case when
|
||||
(NFOUND == 0 && (FLAGS & GLOB_NOCHECK)).
|
||||
|
||||
Sat Apr 29 15:46:57 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
|
||||
|
||||
* posix/glob.c (S_ISDIR): Define if undefined.
|
||||
|
||||
473
glob/configure
vendored
473
glob/configure
vendored
@@ -1,7 +1,7 @@
|
||||
#! /bin/sh
|
||||
|
||||
# Guess values for system-dependent variables and create Makefiles.
|
||||
# Generated automatically using autoconf version 2.1.2
|
||||
# Generated automatically using autoconf version 2.7
|
||||
# Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc.
|
||||
#
|
||||
# This configure script is free software; the Free Software Foundation
|
||||
@@ -33,9 +33,22 @@ 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=
|
||||
|
||||
ac_prev=
|
||||
for ac_option
|
||||
@@ -57,9 +70,14 @@ do
|
||||
|
||||
case "$ac_option" in
|
||||
|
||||
-build | --build | --buil | --bui | --bu | --b)
|
||||
-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=* | --b=*)
|
||||
-build=* | --build=* | --buil=* | --bui=* | --bu=*)
|
||||
build="$ac_optarg" ;;
|
||||
|
||||
-cache-file | --cache-file | --cache-fil | --cache-fi \
|
||||
@@ -69,6 +87,12 @@ do
|
||||
| --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.
|
||||
@@ -119,12 +143,29 @@ Configuration:
|
||||
Directory and file names:
|
||||
--prefix=PREFIX install architecture-independent files in PREFIX
|
||||
[$ac_default_prefix]
|
||||
--exec-prefix=PREFIX install architecture-dependent files in 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
|
||||
--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]
|
||||
@@ -136,8 +177,10 @@ Features and packages:
|
||||
--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
|
||||
--enable and --with options recognized:$ac_help
|
||||
EOF
|
||||
if test -n "$ac_help"; then
|
||||
echo "--enable and --with options recognized:$ac_help"
|
||||
fi
|
||||
exit 0 ;;
|
||||
|
||||
-host | --host | --hos | --ho)
|
||||
@@ -145,6 +188,44 @@ EOF
|
||||
-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 ;;
|
||||
@@ -157,6 +238,15 @@ EOF
|
||||
| --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=*)
|
||||
@@ -197,6 +287,23 @@ EOF
|
||||
| -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=*)
|
||||
@@ -207,6 +314,13 @@ EOF
|
||||
-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=*)
|
||||
@@ -216,7 +330,7 @@ EOF
|
||||
verbose=yes ;;
|
||||
|
||||
-version | --version | --versio | --versi | --vers)
|
||||
echo "configure generated by autoconf version 2.1.2"
|
||||
echo "configure generated by autoconf version 2.7"
|
||||
exit 0 ;;
|
||||
|
||||
-with-* | --with-*)
|
||||
@@ -262,7 +376,7 @@ EOF
|
||||
-*) { 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
|
||||
@@ -382,8 +496,8 @@ 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} conftest.$ac_ext $CFLAGS $CPPFLAGS -c 1>&5 2>&5'
|
||||
ac_link='${CC-cc} conftest.$ac_ext $CFLAGS $CPPFLAGS $LDFLAGS -o conftest $LIBS 1>&5 2>&5'
|
||||
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
|
||||
ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
|
||||
|
||||
if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
|
||||
# Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
|
||||
@@ -415,7 +529,6 @@ else
|
||||
fi
|
||||
done
|
||||
IFS="$ac_save_ifs"
|
||||
test -z "$ac_cv_prog_CC" && ac_cv_prog_CC="cc"
|
||||
fi
|
||||
fi
|
||||
CC="$ac_cv_prog_CC"
|
||||
@@ -425,6 +538,55 @@ 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
|
||||
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="${IFS}:"
|
||||
ac_prog_rejected=no
|
||||
for ac_dir in $PATH; 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
|
||||
|
||||
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
|
||||
if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
|
||||
@@ -435,12 +597,13 @@ else
|
||||
yes;
|
||||
#endif
|
||||
EOF
|
||||
if ${CC-cc} -E conftest.c 2>&5 | egrep yes >/dev/null 2>&1; then
|
||||
if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:601: \"$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
|
||||
@@ -458,7 +621,8 @@ fi
|
||||
rm -f conftest*
|
||||
|
||||
fi
|
||||
echo "$ac_t""$ac_cv_prog_gcc_g" 1>&6
|
||||
|
||||
echo "$ac_t""$ac_cv_prog_gcc_g" 1>&6
|
||||
if test $ac_cv_prog_gcc_g = yes; then
|
||||
CFLAGS="-g -O"
|
||||
else
|
||||
@@ -541,12 +705,13 @@ else
|
||||
# On the NeXT, cc -E runs the code through the compiler's parser,
|
||||
# not just through cpp.
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 545 "configure"
|
||||
#line 709 "configure"
|
||||
#include "confdefs.h"
|
||||
#include <assert.h>
|
||||
Syntax Error
|
||||
EOF
|
||||
eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
|
||||
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
|
||||
{ (eval echo configure:715: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
|
||||
ac_err=`grep -v '^ *+' conftest.out`
|
||||
if test -z "$ac_err"; then
|
||||
:
|
||||
@@ -555,12 +720,13 @@ else
|
||||
rm -rf conftest*
|
||||
CPP="${CC-cc} -E -traditional-cpp"
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 559 "configure"
|
||||
#line 724 "configure"
|
||||
#include "confdefs.h"
|
||||
#include <assert.h>
|
||||
Syntax Error
|
||||
EOF
|
||||
eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
|
||||
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
|
||||
{ (eval echo configure:730: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
|
||||
ac_err=`grep -v '^ *+' conftest.out`
|
||||
if test -z "$ac_err"; then
|
||||
:
|
||||
@@ -574,12 +740,14 @@ fi
|
||||
rm -f conftest*
|
||||
ac_cv_prog_CPP="$CPP"
|
||||
fi
|
||||
CPP="$ac_cv_prog_CPP"
|
||||
else
|
||||
ac_cv_prog_CPP="$CPP"
|
||||
fi
|
||||
CPP="$ac_cv_prog_CPP"
|
||||
echo "$ac_t""$CPP" 1>&6
|
||||
echo $ac_n "checking for AIX""... $ac_c" 1>&6
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 583 "configure"
|
||||
#line 751 "configure"
|
||||
#include "confdefs.h"
|
||||
#ifdef _AIX
|
||||
yes
|
||||
@@ -606,11 +774,12 @@ 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 610 "configure"
|
||||
#line 778 "configure"
|
||||
#include "confdefs.h"
|
||||
#include <minix/config.h>
|
||||
EOF
|
||||
eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
|
||||
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
|
||||
{ (eval echo configure:783: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
|
||||
ac_err=`grep -v '^ *+' conftest.out`
|
||||
if test -z "$ac_err"; then
|
||||
rm -rf conftest*
|
||||
@@ -670,7 +839,7 @@ 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 674 "configure"
|
||||
#line 843 "configure"
|
||||
#include "confdefs.h"
|
||||
|
||||
int main() { return 0; }
|
||||
@@ -683,7 +852,7 @@ char const *const *ccp;
|
||||
char **p;
|
||||
/* NEC SVR4.0.2 mips cc rejects this. */
|
||||
struct point {int x, y;};
|
||||
static struct point const zero;
|
||||
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 */
|
||||
@@ -720,7 +889,7 @@ ccp = (char const *const *) p;
|
||||
|
||||
; return 0; }
|
||||
EOF
|
||||
if eval $ac_compile; then
|
||||
if { (eval echo configure:893: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
|
||||
rm -rf conftest*
|
||||
ac_cv_c_const=yes
|
||||
else
|
||||
@@ -730,6 +899,7 @@ 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
|
||||
@@ -747,11 +917,11 @@ else
|
||||
ac_cv_c_cross=yes
|
||||
else
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 751 "configure"
|
||||
#line 921 "configure"
|
||||
#include "confdefs.h"
|
||||
main(){return(0);}
|
||||
EOF
|
||||
eval $ac_link
|
||||
{ (eval echo configure:925: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }
|
||||
if test -s conftest && (./conftest; exit) 2>/dev/null; then
|
||||
ac_cv_c_cross=no
|
||||
else
|
||||
@@ -760,22 +930,24 @@ fi
|
||||
fi
|
||||
rm -fr conftest*
|
||||
fi
|
||||
cross_compiling=$ac_cv_c_cross
|
||||
|
||||
echo "$ac_t""$ac_cv_c_cross" 1>&6
|
||||
cross_compiling=$ac_cv_c_cross
|
||||
|
||||
echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
|
||||
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 772 "configure"
|
||||
#line 943 "configure"
|
||||
#include "confdefs.h"
|
||||
#include <stdlib.h>
|
||||
#include <stdarg.h>
|
||||
#include <string.h>
|
||||
#include <float.h>
|
||||
EOF
|
||||
eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
|
||||
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
|
||||
{ (eval echo configure:951: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
|
||||
ac_err=`grep -v '^ *+' conftest.out`
|
||||
if test -z "$ac_err"; then
|
||||
rm -rf conftest*
|
||||
@@ -790,7 +962,7 @@ 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 794 "configure"
|
||||
#line 966 "configure"
|
||||
#include "confdefs.h"
|
||||
#include <string.h>
|
||||
EOF
|
||||
@@ -808,7 +980,7 @@ 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 812 "configure"
|
||||
#line 984 "configure"
|
||||
#include "confdefs.h"
|
||||
#include <stdlib.h>
|
||||
EOF
|
||||
@@ -826,10 +998,10 @@ 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
|
||||
ac_cv_header_stdc=no
|
||||
:
|
||||
else
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 833 "configure"
|
||||
#line 1005 "configure"
|
||||
#include "confdefs.h"
|
||||
#include <ctype.h>
|
||||
#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
|
||||
@@ -840,7 +1012,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
|
||||
exit (0); }
|
||||
|
||||
EOF
|
||||
eval $ac_link
|
||||
{ (eval echo configure:1016: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }
|
||||
if test -s conftest && (./conftest; exit) 2>/dev/null; then
|
||||
:
|
||||
else
|
||||
@@ -850,6 +1022,7 @@ fi
|
||||
rm -fr conftest*
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "$ac_t""$ac_cv_header_stdc" 1>&6
|
||||
if test $ac_cv_header_stdc = yes; then
|
||||
cat >> confdefs.h <<\EOF
|
||||
@@ -866,11 +1039,12 @@ 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 870 "configure"
|
||||
#line 1043 "configure"
|
||||
#include "confdefs.h"
|
||||
#include <$ac_hdr>
|
||||
EOF
|
||||
eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
|
||||
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
|
||||
{ (eval echo configure:1048: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
|
||||
ac_err=`grep -v '^ *+' conftest.out`
|
||||
if test -z "$ac_err"; then
|
||||
rm -rf conftest*
|
||||
@@ -884,7 +1058,7 @@ 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 | tr '[a-z]./\055' '[A-Z]___'`
|
||||
ac_tr_hdr=HAVE_`echo $ac_hdr | tr 'abcdefghijklmnopqrstuvwxyz./\055' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ___'`
|
||||
cat >> confdefs.h <<EOF
|
||||
#define $ac_tr_hdr 1
|
||||
EOF
|
||||
@@ -903,7 +1077,7 @@ if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 907 "configure"
|
||||
#line 1081 "configure"
|
||||
#include "confdefs.h"
|
||||
#include <sys/types.h>
|
||||
#include <$ac_hdr>
|
||||
@@ -912,7 +1086,7 @@ int t() {
|
||||
DIR *dirp = 0;
|
||||
; return 0; }
|
||||
EOF
|
||||
if eval $ac_compile; then
|
||||
if { (eval echo configure:1090: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
|
||||
rm -rf conftest*
|
||||
eval "ac_cv_header_dirent_$ac_safe=yes"
|
||||
else
|
||||
@@ -924,7 +1098,7 @@ rm -f conftest*
|
||||
fi
|
||||
if eval "test \"`echo '$ac_cv_header_dirent_'$ac_safe`\" = yes"; then
|
||||
echo "$ac_t""yes" 1>&6
|
||||
ac_tr_hdr=HAVE_`echo $ac_hdr | tr '[a-z]./\055' '[A-Z]___'`
|
||||
ac_tr_hdr=HAVE_`echo $ac_hdr | tr 'abcdedfghijklmnopqrstuvwxyz./\055' 'ABCDEDFGHIJKLMNOPQRSTUVWXYZ___'`
|
||||
cat >> confdefs.h <<EOF
|
||||
#define $ac_tr_hdr 1
|
||||
EOF
|
||||
@@ -936,13 +1110,14 @@ done
|
||||
# Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
|
||||
if test $ac_header_dirent = dirent.h; then
|
||||
echo $ac_n "checking for -ldir""... $ac_c" 1>&6
|
||||
if eval "test \"`echo '$''{'ac_cv_lib_dir'+set}'`\" = set"; then
|
||||
ac_lib_var=`echo dir | tr '.-/+' '___p'`
|
||||
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
ac_save_LIBS="$LIBS"
|
||||
LIBS="-ldir $LIBS"
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 946 "configure"
|
||||
#line 1121 "configure"
|
||||
#include "confdefs.h"
|
||||
|
||||
int main() { return 0; }
|
||||
@@ -950,18 +1125,18 @@ int t() {
|
||||
opendir()
|
||||
; return 0; }
|
||||
EOF
|
||||
if eval $ac_link; then
|
||||
if { (eval echo configure:1129: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
|
||||
rm -rf conftest*
|
||||
eval "ac_cv_lib_dir=yes"
|
||||
eval "ac_cv_lib_$ac_lib_var=yes"
|
||||
else
|
||||
rm -rf conftest*
|
||||
eval "ac_cv_lib_dir=no"
|
||||
eval "ac_cv_lib_$ac_lib_var=no"
|
||||
fi
|
||||
rm -f conftest*
|
||||
LIBS="$ac_save_LIBS"
|
||||
|
||||
fi
|
||||
if eval "test \"`echo '$ac_cv_lib_'dir`\" = yes"; then
|
||||
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
|
||||
echo "$ac_t""yes" 1>&6
|
||||
LIBS="$LIBS -ldir"
|
||||
else
|
||||
@@ -970,13 +1145,14 @@ fi
|
||||
|
||||
else
|
||||
echo $ac_n "checking for -lx""... $ac_c" 1>&6
|
||||
if eval "test \"`echo '$''{'ac_cv_lib_x'+set}'`\" = set"; then
|
||||
ac_lib_var=`echo x | tr '.-/+' '___p'`
|
||||
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
ac_save_LIBS="$LIBS"
|
||||
LIBS="-lx $LIBS"
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 980 "configure"
|
||||
#line 1156 "configure"
|
||||
#include "confdefs.h"
|
||||
|
||||
int main() { return 0; }
|
||||
@@ -984,18 +1160,18 @@ int t() {
|
||||
opendir()
|
||||
; return 0; }
|
||||
EOF
|
||||
if eval $ac_link; then
|
||||
if { (eval echo configure:1164: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
|
||||
rm -rf conftest*
|
||||
eval "ac_cv_lib_x=yes"
|
||||
eval "ac_cv_lib_$ac_lib_var=yes"
|
||||
else
|
||||
rm -rf conftest*
|
||||
eval "ac_cv_lib_x=no"
|
||||
eval "ac_cv_lib_$ac_lib_var=no"
|
||||
fi
|
||||
rm -f conftest*
|
||||
LIBS="$ac_save_LIBS"
|
||||
|
||||
fi
|
||||
if eval "test \"`echo '$ac_cv_lib_'x`\" = yes"; then
|
||||
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
|
||||
echo "$ac_t""yes" 1>&6
|
||||
LIBS="$LIBS -lx"
|
||||
else
|
||||
@@ -1009,16 +1185,16 @@ if eval "test \"`echo '$''{'ac_cv_func_closedir_void'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
if test "$cross_compiling" = yes; then
|
||||
{ echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
|
||||
ac_cv_func_closedir_void=yes
|
||||
else
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 1016 "configure"
|
||||
#line 1192 "configure"
|
||||
#include "confdefs.h"
|
||||
#include <sys/types.h>
|
||||
#include <$ac_header_dirent>
|
||||
int closedir(); main() { exit(closedir(opendir(".")) != 0); }
|
||||
EOF
|
||||
eval $ac_link
|
||||
{ (eval echo configure:1198: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }
|
||||
if test -s conftest && (./conftest; exit) 2>/dev/null; then
|
||||
ac_cv_func_closedir_void=no
|
||||
else
|
||||
@@ -1027,6 +1203,7 @@ fi
|
||||
fi
|
||||
rm -fr conftest*
|
||||
fi
|
||||
|
||||
echo "$ac_t""$ac_cv_func_closedir_void" 1>&6
|
||||
if test $ac_cv_func_closedir_void = yes; then
|
||||
cat >> confdefs.h <<\EOF
|
||||
@@ -1042,7 +1219,7 @@ if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 1046 "configure"
|
||||
#line 1223 "configure"
|
||||
#include "confdefs.h"
|
||||
#include <alloca.h>
|
||||
int main() { return 0; }
|
||||
@@ -1050,7 +1227,7 @@ int t() {
|
||||
char *p = alloca(2 * sizeof(int));
|
||||
; return 0; }
|
||||
EOF
|
||||
if eval $ac_link; then
|
||||
if { (eval echo configure:1231: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
|
||||
rm -rf conftest*
|
||||
ac_cv_header_alloca_h=yes
|
||||
else
|
||||
@@ -1060,6 +1237,7 @@ fi
|
||||
rm -f conftest*
|
||||
|
||||
fi
|
||||
|
||||
echo "$ac_t""$ac_cv_header_alloca_h" 1>&6
|
||||
if test $ac_cv_header_alloca_h = yes; then
|
||||
cat >> confdefs.h <<\EOF
|
||||
@@ -1073,7 +1251,7 @@ if eval "test \"`echo '$''{'ac_cv_func_alloca'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 1077 "configure"
|
||||
#line 1255 "configure"
|
||||
#include "confdefs.h"
|
||||
|
||||
#ifdef __GNUC__
|
||||
@@ -1097,7 +1275,7 @@ int t() {
|
||||
char *p = (char *) alloca(1);
|
||||
; return 0; }
|
||||
EOF
|
||||
if eval $ac_link; then
|
||||
if { (eval echo configure:1279: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
|
||||
rm -rf conftest*
|
||||
ac_cv_func_alloca=yes
|
||||
else
|
||||
@@ -1107,6 +1285,7 @@ fi
|
||||
rm -f conftest*
|
||||
|
||||
fi
|
||||
|
||||
echo "$ac_t""$ac_cv_func_alloca" 1>&6
|
||||
if test $ac_cv_func_alloca = yes; then
|
||||
cat >> confdefs.h <<\EOF
|
||||
@@ -1131,7 +1310,7 @@ if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 1135 "configure"
|
||||
#line 1314 "configure"
|
||||
#include "confdefs.h"
|
||||
#if defined(CRAY) && ! defined(CRAY2)
|
||||
webecray
|
||||
@@ -1151,18 +1330,22 @@ fi
|
||||
rm -f conftest*
|
||||
|
||||
fi
|
||||
|
||||
echo "$ac_t""$ac_cv_os_cray" 1>&6
|
||||
if test $ac_cv_os_cray = yes; then
|
||||
echo $ac_n "checking for _getb67""... $ac_c" 1>&6
|
||||
if eval "test \"`echo '$''{'ac_cv_func__getb67'+set}'`\" = set"; then
|
||||
for ac_func in _getb67 GETB67 getb67; do
|
||||
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
|
||||
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 1162 "configure"
|
||||
#line 1343 "configure"
|
||||
#include "confdefs.h"
|
||||
#include <ctype.h> /* Arbitrary system header to define __stub macros. */
|
||||
/* 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. */
|
||||
char _getb67();
|
||||
char $ac_func();
|
||||
|
||||
int main() { return 0; }
|
||||
int t() {
|
||||
@@ -1170,124 +1353,36 @@ int t() {
|
||||
/* 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__getb67) || defined (__stub____getb67)
|
||||
#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
|
||||
choke me
|
||||
#else
|
||||
_getb67();
|
||||
$ac_func();
|
||||
#endif
|
||||
|
||||
; return 0; }
|
||||
EOF
|
||||
if eval $ac_link; then
|
||||
if { (eval echo configure:1365: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
|
||||
rm -rf conftest*
|
||||
eval "ac_cv_func__getb67=yes"
|
||||
eval "ac_cv_func_$ac_func=yes"
|
||||
else
|
||||
rm -rf conftest*
|
||||
eval "ac_cv_func__getb67=no"
|
||||
eval "ac_cv_func_$ac_func=no"
|
||||
fi
|
||||
rm -f conftest*
|
||||
|
||||
fi
|
||||
if eval "test \"`echo '$ac_cv_func_'_getb67`\" = yes"; then
|
||||
if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
|
||||
echo "$ac_t""yes" 1>&6
|
||||
cat >> confdefs.h <<\EOF
|
||||
#define CRAY_STACKSEG_END _getb67
|
||||
EOF
|
||||
|
||||
else
|
||||
echo "$ac_t""no" 1>&6
|
||||
echo $ac_n "checking for GETB67""... $ac_c" 1>&6
|
||||
if eval "test \"`echo '$''{'ac_cv_func_GETB67'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 1205 "configure"
|
||||
#include "confdefs.h"
|
||||
#include <ctype.h> /* Arbitrary system header to define __stub macros. */
|
||||
/* Override any gcc2 internal prototype to avoid an error. */
|
||||
char GETB67();
|
||||
|
||||
int main() { return 0; }
|
||||
int t() {
|
||||
|
||||
/* 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_GETB67) || defined (__stub___GETB67)
|
||||
choke me
|
||||
#else
|
||||
GETB67();
|
||||
#endif
|
||||
|
||||
; return 0; }
|
||||
EOF
|
||||
if eval $ac_link; then
|
||||
rm -rf conftest*
|
||||
eval "ac_cv_func_GETB67=yes"
|
||||
else
|
||||
rm -rf conftest*
|
||||
eval "ac_cv_func_GETB67=no"
|
||||
fi
|
||||
rm -f conftest*
|
||||
|
||||
fi
|
||||
if eval "test \"`echo '$ac_cv_func_'GETB67`\" = yes"; then
|
||||
echo "$ac_t""yes" 1>&6
|
||||
cat >> confdefs.h <<\EOF
|
||||
#define CRAY_STACKSEG_END GETB67
|
||||
EOF
|
||||
|
||||
else
|
||||
echo "$ac_t""no" 1>&6
|
||||
echo $ac_n "checking for getb67""... $ac_c" 1>&6
|
||||
if eval "test \"`echo '$''{'ac_cv_func_getb67'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 1248 "configure"
|
||||
#include "confdefs.h"
|
||||
#include <ctype.h> /* Arbitrary system header to define __stub macros. */
|
||||
/* Override any gcc2 internal prototype to avoid an error. */
|
||||
char getb67();
|
||||
|
||||
int main() { return 0; }
|
||||
int t() {
|
||||
|
||||
/* 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_getb67) || defined (__stub___getb67)
|
||||
choke me
|
||||
#else
|
||||
getb67();
|
||||
#endif
|
||||
|
||||
; return 0; }
|
||||
EOF
|
||||
if eval $ac_link; then
|
||||
rm -rf conftest*
|
||||
eval "ac_cv_func_getb67=yes"
|
||||
else
|
||||
rm -rf conftest*
|
||||
eval "ac_cv_func_getb67=no"
|
||||
fi
|
||||
rm -f conftest*
|
||||
|
||||
fi
|
||||
if eval "test \"`echo '$ac_cv_func_'getb67`\" = yes"; then
|
||||
echo "$ac_t""yes" 1>&6
|
||||
cat >> confdefs.h <<\EOF
|
||||
#define CRAY_STACKSEG_END getb67
|
||||
cat >> confdefs.h <<EOF
|
||||
#define CRAY_STACKSEG_END $ac_func
|
||||
EOF
|
||||
|
||||
break
|
||||
else
|
||||
echo "$ac_t""no" 1>&6
|
||||
fi
|
||||
|
||||
fi
|
||||
|
||||
fi
|
||||
|
||||
done
|
||||
fi
|
||||
|
||||
echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6
|
||||
@@ -1298,7 +1393,7 @@ else
|
||||
ac_cv_c_stack_direction=0
|
||||
else
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 1302 "configure"
|
||||
#line 1397 "configure"
|
||||
#include "confdefs.h"
|
||||
find_stack_direction ()
|
||||
{
|
||||
@@ -1317,7 +1412,7 @@ main ()
|
||||
exit (find_stack_direction() < 0);
|
||||
}
|
||||
EOF
|
||||
eval $ac_link
|
||||
{ (eval echo configure:1416: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }
|
||||
if test -s conftest && (./conftest; exit) 2>/dev/null; then
|
||||
ac_cv_c_stack_direction=1
|
||||
else
|
||||
@@ -1326,6 +1421,7 @@ fi
|
||||
fi
|
||||
rm -fr conftest*
|
||||
fi
|
||||
|
||||
echo "$ac_t""$ac_cv_c_stack_direction" 1>&6
|
||||
cat >> confdefs.h <<EOF
|
||||
#define STACK_DIRECTION $ac_cv_c_stack_direction
|
||||
@@ -1341,7 +1437,7 @@ else
|
||||
ac_cv_func_strcoll=no
|
||||
else
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 1345 "configure"
|
||||
#line 1441 "configure"
|
||||
#include "confdefs.h"
|
||||
#include <string.h>
|
||||
main ()
|
||||
@@ -1351,7 +1447,7 @@ main ()
|
||||
strcoll ("123", "456") >= 0);
|
||||
}
|
||||
EOF
|
||||
eval $ac_link
|
||||
{ (eval echo configure:1451: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }
|
||||
if test -s conftest && (./conftest; exit) 2>/dev/null; then
|
||||
ac_cv_func_strcoll=yes
|
||||
else
|
||||
@@ -1360,6 +1456,7 @@ fi
|
||||
fi
|
||||
rm -fr conftest*
|
||||
fi
|
||||
|
||||
echo "$ac_t""$ac_cv_func_strcoll" 1>&6
|
||||
if test $ac_cv_func_strcoll = yes; then
|
||||
cat >> confdefs.h <<\EOF
|
||||
@@ -1369,9 +1466,7 @@ EOF
|
||||
fi
|
||||
|
||||
trap '' 1 2 15
|
||||
if test -w $cache_file; then
|
||||
echo "updating cache $cache_file"
|
||||
cat > $cache_file <<\EOF
|
||||
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.
|
||||
@@ -1391,10 +1486,18 @@ EOF
|
||||
# and sets the high bit in the cache file unless we assign to the vars.
|
||||
(set) 2>&1 |
|
||||
sed -n "s/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=\${\1='\2'}/p" \
|
||||
>> $cache_file
|
||||
>> confcache
|
||||
if cmp -s $cache_file confcache; then
|
||||
:
|
||||
else
|
||||
echo "not updating unwritable cache $cache_file"
|
||||
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
|
||||
|
||||
@@ -1415,7 +1518,7 @@ trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
|
||||
# Protect against shell expansion while executing Makefile rules.
|
||||
# Protect against Makefile macro expansion.
|
||||
cat > conftest.defs <<\EOF
|
||||
s%#define \([A-Za-z_][A-Za-z0-9_]*\) \(.*\)%-D\1=\2%g
|
||||
s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%-D\1=\2%g
|
||||
s%[ `~#$^&*(){}\\|;'"<>?]%\\&%g
|
||||
s%\[%\\&%g
|
||||
s%\]%\\&%g
|
||||
@@ -1450,7 +1553,7 @@ do
|
||||
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.1.2"
|
||||
echo "$CONFIG_STATUS generated by autoconf version 2.7"
|
||||
exit 0 ;;
|
||||
-help | --help | --hel | --he | --h)
|
||||
echo "\$ac_cs_usage"; exit 0 ;;
|
||||
@@ -1460,11 +1563,13 @@ done
|
||||
|
||||
ac_given_srcdir=$srcdir
|
||||
|
||||
trap 'rm -f Makefile; exit 1' 1 2 15
|
||||
trap 'rm -fr `echo "Makefile" | 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
|
||||
# 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%@CFLAGS@%$CFLAGS%g
|
||||
@@ -1476,6 +1581,18 @@ 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%@AR@%$AR%g
|
||||
s%@RANLIB@%$RANLIB%g
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 1991, 1992, 1993 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1991, 1992, 1993, 1996 Free Software Foundation, Inc.
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
@@ -19,6 +19,11 @@ Cambridge, MA 02139, USA. */
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
/* Enable GNU extensions in fnmatch.h. */
|
||||
#ifndef _GNU_SOURCE
|
||||
#define _GNU_SOURCE 1
|
||||
#endif
|
||||
|
||||
#include <errno.h>
|
||||
#include <fnmatch.h>
|
||||
#include <ctype.h>
|
||||
|
||||
231
glob/glob.c
231
glob/glob.c
@@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 1991, 1992, 1993, 1994, 1995 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1991, 92, 93, 94, 95, 96 Free Software Foundation, Inc.
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
@@ -24,6 +24,11 @@ Cambridge, MA 02139, USA. */
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
/* Enable GNU extensions in glob.h. */
|
||||
#ifndef _GNU_SOURCE
|
||||
#define _GNU_SOURCE 1
|
||||
#endif
|
||||
|
||||
#include <errno.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
@@ -37,8 +42,15 @@ Cambridge, MA 02139, USA. */
|
||||
program understand `configure --with-gnu-libc' and omit the object files,
|
||||
it is simpler to just do this in the source for each such file. */
|
||||
|
||||
#if defined (_LIBC) || !defined (__GNU_LIBRARY__)
|
||||
#define GLOB_INTERFACE_VERSION 1
|
||||
#if !defined (_LIBC) && defined (__GNU_LIBRARY__) && __GNU_LIBRARY__ > 1
|
||||
#include <gnu-versions.h>
|
||||
#if _GNU_GLOB_INTERFACE_VERSION == GLOB_INTERFACE_VERSION
|
||||
#define ELIDE_CODE
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef ELIDE_CODE
|
||||
|
||||
#ifdef STDC_HEADERS
|
||||
#include <stddef.h>
|
||||
@@ -53,6 +65,8 @@ Cambridge, MA 02139, USA. */
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include <pwd.h>
|
||||
|
||||
#if !defined(__GNU_LIBRARY__) && !defined(STDC_HEADERS)
|
||||
extern int errno;
|
||||
#endif
|
||||
@@ -62,26 +76,30 @@ extern int errno;
|
||||
#endif
|
||||
|
||||
|
||||
#if defined (POSIX) || defined (HAVE_DIRENT_H) || defined (__GNU_LIBRARY__)
|
||||
#include <dirent.h>
|
||||
#ifndef __GNU_LIBRARY__
|
||||
#define D_NAMLEN(d) strlen((d)->d_name)
|
||||
#else /* GNU C library. */
|
||||
#define D_NAMLEN(d) ((d)->d_namlen)
|
||||
#endif /* Not GNU C library. */
|
||||
#else /* Not POSIX or HAVE_DIRENT_H. */
|
||||
#define direct dirent
|
||||
#define D_NAMLEN(d) ((d)->d_namlen)
|
||||
#ifdef HAVE_SYS_NDIR_H
|
||||
#include <sys/ndir.h>
|
||||
#endif /* HAVE_SYS_NDIR_H */
|
||||
#ifdef HAVE_SYS_DIR_H
|
||||
#include <sys/dir.h>
|
||||
#endif /* HAVE_SYS_DIR_H */
|
||||
#ifdef HAVE_NDIR_H
|
||||
#include <ndir.h>
|
||||
#endif /* HAVE_NDIR_H */
|
||||
#endif /* POSIX or HAVE_DIRENT_H or __GNU_LIBRARY__. */
|
||||
#if defined (HAVE_DIRENT_H) || defined (__GNU_LIBRARY__)
|
||||
# include <dirent.h>
|
||||
# define NAMLEN(dirent) strlen((dirent)->d_name)
|
||||
#else
|
||||
# define dirent direct
|
||||
# define NAMLEN(dirent) (dirent)->d_namlen
|
||||
# ifdef HAVE_SYS_NDIR_H
|
||||
# include <sys/ndir.h>
|
||||
# endif
|
||||
# ifdef HAVE_SYS_DIR_H
|
||||
# include <sys/dir.h>
|
||||
# endif
|
||||
# ifdef HAVE_NDIR_H
|
||||
# include <ndir.h>
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
||||
/* In GNU systems, <dirent.h> defines this macro for us. */
|
||||
#ifdef _D_NAMLEN
|
||||
#undef NAMLEN
|
||||
#define NAMLEN(d) _D_NAMLEN(d)
|
||||
#endif
|
||||
|
||||
|
||||
#if defined (POSIX) && !defined (__GNU_LIBRARY__)
|
||||
/* Posix does not require that the d_ino field be present, and some
|
||||
@@ -97,6 +115,8 @@ extern int errno;
|
||||
#define ANSI_STRING
|
||||
#else /* No standard headers. */
|
||||
|
||||
extern char *getenv ();
|
||||
|
||||
#ifdef HAVE_STRING_H
|
||||
#include <string.h>
|
||||
#define ANSI_STRING
|
||||
@@ -175,10 +195,7 @@ extern char *alloca ();
|
||||
#endif
|
||||
|
||||
#ifndef __GNU_LIBRARY__
|
||||
#define __lstat lstat
|
||||
#ifndef HAVE_LSTAT
|
||||
#define lstat stat
|
||||
#endif
|
||||
#define __stat stat
|
||||
#ifdef STAT_MACROS_BROKEN
|
||||
#undef S_ISDIR
|
||||
#endif
|
||||
@@ -211,10 +228,6 @@ extern char *alloca ();
|
||||
#undef GLOB_PERIOD
|
||||
#include <glob.h>
|
||||
|
||||
__ptr_t (*__glob_opendir_hook) __P ((const char *directory));
|
||||
const char *(*__glob_readdir_hook) __P ((__ptr_t stream));
|
||||
void (*__glob_closedir_hook) __P ((__ptr_t stream));
|
||||
|
||||
static int glob_pattern_p __P ((const char *pattern, int quote));
|
||||
static int glob_in_dir __P ((const char *pattern, const char *directory,
|
||||
int flags,
|
||||
@@ -250,6 +263,56 @@ glob (pattern, flags, errfunc, pglob)
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (flags & GLOB_BRACE)
|
||||
{
|
||||
const char *begin = strchr (pattern, '{');
|
||||
if (begin != NULL)
|
||||
{
|
||||
const char *end = strchr (begin + 1, '}');
|
||||
if (end != NULL && end != begin + 1)
|
||||
{
|
||||
size_t restlen = strlen (end + 1) + 1;
|
||||
const char *p, *comma;
|
||||
char *buf;
|
||||
size_t bufsz = 0;
|
||||
int firstc;
|
||||
if (!(flags & GLOB_APPEND))
|
||||
{
|
||||
pglob->gl_pathc = 0;
|
||||
pglob->gl_pathv = NULL;
|
||||
}
|
||||
firstc = pglob->gl_pathc;
|
||||
for (p = begin + 1;; p = comma + 1)
|
||||
{
|
||||
int result;
|
||||
comma = strchr (p, ',');
|
||||
if (comma == NULL)
|
||||
comma = strchr (p, '\0');
|
||||
if ((begin - pattern) + (comma - p) + 1 > bufsz)
|
||||
{
|
||||
if (bufsz * 2 < comma - p + 1)
|
||||
bufsz *= 2;
|
||||
else
|
||||
bufsz = comma - p + 1;
|
||||
buf = __alloca (bufsz);
|
||||
}
|
||||
memcpy (buf, pattern, begin - pattern);
|
||||
memcpy (buf + (begin - pattern), p, comma - p);
|
||||
memcpy (buf + (begin - pattern) + (comma - p), end, restlen);
|
||||
result = glob (buf, ((flags & ~(GLOB_NOCHECK|GLOB_NOMAGIC)) |
|
||||
GLOB_APPEND), errfunc, pglob);
|
||||
if (result && result != GLOB_NOMATCH)
|
||||
return result;
|
||||
if (*comma == '\0')
|
||||
break;
|
||||
}
|
||||
if (pglob->gl_pathc == firstc &&
|
||||
!(flags & (GLOB_NOCHECK|GLOB_NOMAGIC)))
|
||||
return GLOB_NOMATCH;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Find the filename. */
|
||||
filename = strrchr (pattern, '/');
|
||||
if (filename == NULL)
|
||||
@@ -291,6 +354,35 @@ glob (pattern, flags, errfunc, pglob)
|
||||
|
||||
oldcount = pglob->gl_pathc;
|
||||
|
||||
if ((flags & GLOB_TILDE) && dirname[0] == '~')
|
||||
{
|
||||
if (dirname[1] == '\0')
|
||||
{
|
||||
/* Look up home directory. */
|
||||
dirname = getenv ("HOME");
|
||||
if (dirname == NULL || dirname[0] == '\0')
|
||||
{
|
||||
extern char *getlogin __P ((void));
|
||||
char *name = getlogin ();
|
||||
if (name != NULL)
|
||||
{
|
||||
struct passwd *p = getpwnam (name);
|
||||
if (p != NULL)
|
||||
dirname = p->pw_dir;
|
||||
}
|
||||
}
|
||||
if (dirname == NULL || dirname[0] == '\0')
|
||||
dirname = (char *) "~"; /* No luck. */
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Look up specific user's home directory. */
|
||||
struct passwd *p = getpwnam (dirname + 1);
|
||||
if (p != NULL)
|
||||
dirname = p->pw_dir;
|
||||
}
|
||||
}
|
||||
|
||||
if (glob_pattern_p (dirname, !(flags & GLOB_NOESCAPE)))
|
||||
{
|
||||
/* The directory name contains metacharacters, so we
|
||||
@@ -410,14 +502,25 @@ glob (pattern, flags, errfunc, pglob)
|
||||
|
||||
if (flags & GLOB_MARK)
|
||||
{
|
||||
/* Append slashes to directory names. glob_in_dir has already
|
||||
allocated the extra character for us. */
|
||||
/* Append slashes to directory names. */
|
||||
int i;
|
||||
struct stat st;
|
||||
for (i = oldcount; i < pglob->gl_pathc; ++i)
|
||||
if (__lstat (pglob->gl_pathv[i], &st) == 0 &&
|
||||
if (((flags & GLOB_ALTDIRFUNC) ?
|
||||
(*pglob->gl_stat) (pglob->gl_pathv[i], &st) :
|
||||
__stat (pglob->gl_pathv[i], &st)) == 0 &&
|
||||
S_ISDIR (st.st_mode))
|
||||
strcat (pglob->gl_pathv[i], "/");
|
||||
{
|
||||
size_t len = strlen (pglob->gl_pathv[i]) + 2;
|
||||
char *new = realloc (pglob->gl_pathv[i], len);
|
||||
if (new == NULL)
|
||||
{
|
||||
globfree (pglob);
|
||||
return GLOB_NOSPACE;
|
||||
}
|
||||
strcpy (&new[len - 2], "/");
|
||||
pglob->gl_pathv[i] = new;
|
||||
}
|
||||
}
|
||||
|
||||
if (!(flags & GLOB_NOSORT))
|
||||
@@ -572,8 +675,9 @@ glob_in_dir (pattern, directory, flags, errfunc, pglob)
|
||||
{
|
||||
flags |= GLOB_MAGCHAR;
|
||||
|
||||
stream = (__glob_opendir_hook ? (*__glob_opendir_hook) (directory)
|
||||
: (__ptr_t) opendir (directory));
|
||||
stream = ((flags & GLOB_ALTDIRFUNC) ?
|
||||
(*pglob->gl_opendir) (directory) :
|
||||
(__ptr_t) opendir (directory));
|
||||
if (stream == NULL)
|
||||
{
|
||||
if ((errfunc != NULL && (*errfunc) (directory, errno)) ||
|
||||
@@ -585,39 +689,25 @@ glob_in_dir (pattern, directory, flags, errfunc, pglob)
|
||||
{
|
||||
const char *name;
|
||||
size_t len;
|
||||
struct dirent *d = ((flags & GLOB_ALTDIRFUNC) ?
|
||||
(*pglob->gl_readdir) (stream) :
|
||||
readdir ((DIR *) stream));
|
||||
if (d == NULL)
|
||||
break;
|
||||
if (! REAL_DIR_ENTRY (d))
|
||||
continue;
|
||||
|
||||
name = d->d_name;
|
||||
|
||||
if (__glob_readdir_hook)
|
||||
{
|
||||
name = (*__glob_readdir_hook) (stream);
|
||||
if (name == NULL)
|
||||
break;
|
||||
len = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
struct dirent *d = readdir ((DIR *) stream);
|
||||
if (d == NULL)
|
||||
break;
|
||||
if (! REAL_DIR_ENTRY (d))
|
||||
continue;
|
||||
name = d->d_name;
|
||||
#ifdef HAVE_D_NAMLEN
|
||||
len = d->d_namlen;
|
||||
#else
|
||||
len = 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
if (fnmatch (pattern, name,
|
||||
(!(flags & GLOB_PERIOD) ? FNM_PERIOD : 0) |
|
||||
((flags & GLOB_NOESCAPE) ? FNM_NOESCAPE : 0)) == 0)
|
||||
{
|
||||
struct globlink *new
|
||||
= (struct globlink *) __alloca (sizeof (struct globlink));
|
||||
if (len == 0)
|
||||
len = strlen (name);
|
||||
len = NAMLEN (d);
|
||||
new->name
|
||||
= (char *) malloc (len + ((flags & GLOB_MARK) ? 1 : 0) + 1);
|
||||
= (char *) malloc (len + 1);
|
||||
if (new->name == NULL)
|
||||
goto memory_error;
|
||||
memcpy ((__ptr_t) new->name, name, len);
|
||||
@@ -629,6 +719,10 @@ glob_in_dir (pattern, directory, flags, errfunc, pglob)
|
||||
}
|
||||
}
|
||||
|
||||
if (nfound == 0 && (flags & GLOB_NOMAGIC) &&
|
||||
! glob_pattern_p (pattern, !(flags & GLOB_NOESCAPE)))
|
||||
flags |= GLOB_NOCHECK;
|
||||
|
||||
if (nfound == 0 && (flags & GLOB_NOCHECK))
|
||||
{
|
||||
size_t len = strlen (pattern);
|
||||
@@ -664,10 +758,10 @@ glob_in_dir (pattern, directory, flags, errfunc, pglob)
|
||||
if (stream != NULL)
|
||||
{
|
||||
int save = errno;
|
||||
if (__glob_closedir_hook)
|
||||
(*__glob_closedir_hook) (stream);
|
||||
if (flags & GLOB_ALTDIRFUNC)
|
||||
(*pglob->gl_closedir) (stream);
|
||||
else
|
||||
(void) closedir ((DIR *) stream);
|
||||
closedir ((DIR *) stream);
|
||||
errno = save;
|
||||
}
|
||||
return nfound == 0 ? GLOB_NOMATCH : 0;
|
||||
@@ -675,10 +769,10 @@ glob_in_dir (pattern, directory, flags, errfunc, pglob)
|
||||
memory_error:
|
||||
{
|
||||
int save = errno;
|
||||
if (__glob_closedir_hook)
|
||||
(*__glob_closedir_hook) (stream);
|
||||
if (flags & GLOB_ALTDIRFUNC)
|
||||
(*pglob->gl_closedir) (stream);
|
||||
else
|
||||
(void) closedir ((DIR *) stream);
|
||||
closedir ((DIR *) stream);
|
||||
errno = save;
|
||||
}
|
||||
while (names != NULL)
|
||||
@@ -690,4 +784,5 @@ glob_in_dir (pattern, directory, flags, errfunc, pglob)
|
||||
return GLOB_NOSPACE;
|
||||
}
|
||||
|
||||
#endif /* _LIBC or not __GNU_LIBRARY__. */
|
||||
#endif /* Not ELIDE_CODE. */
|
||||
|
||||
|
||||
19
glob/glob.h
19
glob/glob.h
@@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 1991, 1992 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1991, 1992, 1995 Free Software Foundation, Inc.
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
@@ -47,10 +47,16 @@ extern "C"
|
||||
#define GLOB_NOESCAPE (1 << 6)/* Backslashes don't quote metacharacters. */
|
||||
#define GLOB_PERIOD (1 << 7)/* Leading `.' can be matched by metachars. */
|
||||
#define __GLOB_FLAGS (GLOB_ERR|GLOB_MARK|GLOB_NOSORT|GLOB_DOOFFS| \
|
||||
GLOB_NOESCAPE|GLOB_NOCHECK|GLOB_APPEND|GLOB_PERIOD)
|
||||
GLOB_NOESCAPE|GLOB_NOCHECK|GLOB_APPEND| \
|
||||
GLOB_PERIOD|GLOB_ALTDIRFUNC|GLOB_BRACE| \
|
||||
GLOB_NOMAGIC|GLOB_TILDE)
|
||||
|
||||
#if !defined (_POSIX_C_SOURCE) || _POSIX_C_SOURCE < 2 || defined (_BSD_SOURCE)
|
||||
#define GLOB_MAGCHAR (1 << 8)/* Set in gl_flags if any metachars seen. */
|
||||
#define GLOB_ALTDIRFUNC (1 << 9)/* Use gl_opendir et al functions. */
|
||||
#define GLOB_BRACE (1 << 10)/* Expand "{a,b}" to "a" "b". */
|
||||
#define GLOB_NOMAGIC (1 << 11)/* If no magic chars, return the pattern. */
|
||||
#define GLOB_TILDE (1 <<12)/* Expand ~user and ~ to home directories. */
|
||||
#endif
|
||||
|
||||
/* Error returns from `glob'. */
|
||||
@@ -59,12 +65,21 @@ extern "C"
|
||||
#define GLOB_NOMATCH 3 /* No matches found. */
|
||||
|
||||
/* Structure describing a globbing run. */
|
||||
struct stat;
|
||||
typedef struct
|
||||
{
|
||||
int gl_pathc; /* Count of paths matched by the pattern. */
|
||||
char **gl_pathv; /* List of matched pathnames. */
|
||||
int gl_offs; /* Slots to reserve in `gl_pathv'. */
|
||||
int gl_flags; /* Set to FLAGS, maybe | GLOB_MAGCHAR. */
|
||||
|
||||
/* If the GLOB_ALTDIRFUNC flag is set, the following functions
|
||||
are used instead of the normal file access functions. */
|
||||
void (*gl_closedir) __P ((void *));
|
||||
struct dirent *(*gl_readdir) __P ((void *));
|
||||
__ptr_t (*gl_opendir) __P ((const char *));
|
||||
int (*gl_lstat) __P ((const char *, struct stat *));
|
||||
int (*gl_stat) __P ((const char *, struct stat *));
|
||||
} glob_t;
|
||||
|
||||
/* Do glob searching for PATTERN, placing results in PGLOB.
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
@display
|
||||
Copyright @copyright{} 1989, 1991 Free Software Foundation, Inc.
|
||||
675 Mass Ave, Cambridge, MA 02139, USA
|
||||
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.
|
||||
|
||||
102
job.c
102
job.c
@@ -1,5 +1,6 @@
|
||||
/* Job execution and handling for GNU Make.
|
||||
Copyright (C) 1988, 89, 90, 91, 92, 93, 94, 1995 Free Software Foundation, Inc.
|
||||
Copyright (C) 1988, 89, 90, 91, 92, 93, 94, 95, 96
|
||||
Free Software Foundation, Inc.
|
||||
This file is part of GNU Make.
|
||||
|
||||
GNU Make is free software; you can redistribute it and/or modify
|
||||
@@ -35,21 +36,13 @@ static char *dos_bename;
|
||||
static int dos_batch_file;
|
||||
#endif /* MSDOS. */
|
||||
|
||||
|
||||
/* If NGROUPS_MAX == 0 then try other methods for finding a real value. */
|
||||
#if defined (NGROUPS_MAX) && NGROUPS_MAX == 0
|
||||
#undef NGROUPS_MAX
|
||||
#endif /* NGROUPS_MAX == 0 */
|
||||
|
||||
#ifndef NGROUPS_MAX
|
||||
#ifdef POSIX
|
||||
#define GET_NGROUPS_MAX sysconf (_SC_NGROUPS_MAX)
|
||||
#else /* Not POSIX. */
|
||||
#define NGROUPS_MAX NGROUPS
|
||||
#endif /* POSIX. */
|
||||
#ifdef HAVE_FCNTL_H
|
||||
#include <fcntl.h>
|
||||
#else
|
||||
#include <sys/file.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_SYS_WAIT_H
|
||||
#if defined (HAVE_SYS_WAIT_H) || defined (HAVE_UNION_WAIT)
|
||||
#include <sys/wait.h>
|
||||
#endif
|
||||
|
||||
@@ -118,23 +111,6 @@ extern int geteuid (), getegid ();
|
||||
extern int setgid (), getgid ();
|
||||
#endif
|
||||
|
||||
#ifndef getdtablesize
|
||||
#ifdef HAVE_GETDTABLESIZE
|
||||
extern int getdtablesize ();
|
||||
#else
|
||||
#ifdef HAVE_SYSCONF_OPEN_MAX
|
||||
#define getdtablesize() ((int) sysconf (_SC_OPEN_MAX))
|
||||
#else
|
||||
#include <sys/param.h>
|
||||
#define getdtablesize() NOFILE
|
||||
#if !defined (NOFILE) && defined (NOFILES_MAX)
|
||||
/* SCO 3.2 "devsys 4.2" defines NOFILES_{MIN,MAX} in lieu of NOFILE. */
|
||||
#define NOFILE NOFILES_MAX
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
extern int getloadavg ();
|
||||
extern int start_remote_job_p ();
|
||||
extern int start_remote_job (), remote_status ();
|
||||
@@ -169,6 +145,9 @@ child_error (target_name, exit_code, exit_sig, coredump, ignored)
|
||||
int exit_code, exit_sig, coredump;
|
||||
int ignored;
|
||||
{
|
||||
if (ignored && silent_flag)
|
||||
return;
|
||||
|
||||
if (exit_sig == 0)
|
||||
error (ignored ? "[%s] Error %d (ignored)" :
|
||||
"*** [%s] Error %d",
|
||||
@@ -415,6 +394,11 @@ reap_children (block, err)
|
||||
by start_remote_job_p. */
|
||||
c->remote = start_remote_job_p ();
|
||||
start_job_command (c);
|
||||
/* Fatal signals are left blocked in case we were
|
||||
about to put that child on the chain. But it is
|
||||
already there, so it is safe for a fatal signal to
|
||||
arrive now; it will clean up this child's targets. */
|
||||
unblock_sigs ();
|
||||
if (c->file->command_state == cs_running)
|
||||
/* We successfully started the new command.
|
||||
Loop to reap more children. */
|
||||
@@ -517,7 +501,11 @@ unblock_sigs ()
|
||||
#endif
|
||||
|
||||
/* Start a job to run the commands specified in CHILD.
|
||||
CHILD is updated to reflect the commands and ID of the child process. */
|
||||
CHILD is updated to reflect the commands and ID of the child process.
|
||||
|
||||
NOTE: On return fatal signals are blocked! The caller is responsible
|
||||
for calling `unblock_sigs', once the new child is safely on the chain so
|
||||
it can be cleaned up in the event of a fatal signal. */
|
||||
|
||||
static void
|
||||
start_job_command (child)
|
||||
@@ -552,7 +540,7 @@ start_job_command (child)
|
||||
1 tells the user that -q is saying `something to do'; the exit status
|
||||
for a random error is 2. */
|
||||
if (question_flag && !(flags & COMMANDS_RECURSE))
|
||||
{
|
||||
{
|
||||
child->file->update_status = 1;
|
||||
notice_finished_file (child->file);
|
||||
return;
|
||||
@@ -561,9 +549,9 @@ start_job_command (child)
|
||||
/* There may be some preceding whitespace left if there
|
||||
was nothing but a backslash on the first line. */
|
||||
p = next_token (p);
|
||||
|
||||
|
||||
/* Figure out an argument list from this command line. */
|
||||
|
||||
|
||||
{
|
||||
char *end;
|
||||
argv = construct_command_argv (p, &end, child->file);
|
||||
@@ -600,10 +588,12 @@ start_job_command (child)
|
||||
return;
|
||||
}
|
||||
|
||||
/* Print out the command. */
|
||||
/* Print out the command. If silent, we call `message' with null so it
|
||||
can log the working directory before the command's own error messages
|
||||
appear. */
|
||||
|
||||
if (just_print_flag || (!(flags & COMMANDS_SILENT) && !silent_flag))
|
||||
puts (p);
|
||||
message (0, (just_print_flag || (!(flags & COMMANDS_SILENT) && !silent_flag))
|
||||
? "%s" : (char *) 0, p);
|
||||
|
||||
/* Tell update_goal_chain that a command has been started on behalf of
|
||||
this target. It is important that this happens here and not in
|
||||
@@ -627,7 +617,7 @@ start_job_command (child)
|
||||
|
||||
fflush (stdout);
|
||||
fflush (stderr);
|
||||
|
||||
|
||||
/* Set up a bad standard input that reads from a broken pipe. */
|
||||
|
||||
if (bad_stdin == -1)
|
||||
@@ -641,6 +631,16 @@ start_job_command (child)
|
||||
(void) close (pd[1]);
|
||||
/* Save the read side. */
|
||||
bad_stdin = pd[0];
|
||||
|
||||
/* Set the descriptor to close on exec, so it does not litter any
|
||||
child's descriptor table. When it is dup2'd onto descriptor 0,
|
||||
that descriptor will not close on exec. */
|
||||
#ifdef FD_SETFD
|
||||
#ifndef FD_CLOEXEC
|
||||
#define FD_CLOEXEC 1
|
||||
#endif
|
||||
(void) fcntl (bad_stdin, F_SETFD, FD_CLOEXEC);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1052,14 +1052,10 @@ child_execute_job (stdin_fd, stdout_fd, argv, envp)
|
||||
(void) dup2 (stdin_fd, 0);
|
||||
if (stdout_fd != 1)
|
||||
(void) dup2 (stdout_fd, 1);
|
||||
|
||||
/* Free up file descriptors. */
|
||||
{
|
||||
register int d;
|
||||
int max = getdtablesize ();
|
||||
for (d = 3; d < max; ++d)
|
||||
(void) close (d);
|
||||
}
|
||||
if (stdin_fd != 0)
|
||||
(void) close (stdin_fd);
|
||||
if (stdout_fd != 1)
|
||||
(void) close (stdout_fd);
|
||||
|
||||
/* Run the command. */
|
||||
exec_command (argv, envp);
|
||||
@@ -1078,7 +1074,7 @@ exec_command (argv, envp)
|
||||
/* Run the program. */
|
||||
environ = envp;
|
||||
execvp (argv[0], argv);
|
||||
|
||||
|
||||
switch (errno)
|
||||
{
|
||||
case ENOENT:
|
||||
@@ -1102,7 +1098,7 @@ exec_command (argv, envp)
|
||||
|
||||
new_argv = (char **) alloca ((1 + argc + 1) * sizeof (char *));
|
||||
new_argv[0] = shell;
|
||||
new_argv[1] = program;
|
||||
new_argv[1] = argv[0];
|
||||
while (argc > 0)
|
||||
{
|
||||
new_argv[1 + argc] = argv[argc];
|
||||
@@ -1404,14 +1400,14 @@ construct_command_argv_internal (line, restp, shell, ifs)
|
||||
"SHELL -c LINE", with all special chars in LINE escaped.
|
||||
Then recurse, expanding this command line to get the final
|
||||
argument list. */
|
||||
|
||||
|
||||
unsigned int shell_len = strlen (shell);
|
||||
static char minus_c[] = " -c ";
|
||||
unsigned int line_len = strlen (line);
|
||||
|
||||
|
||||
char *new_line = (char *) alloca (shell_len + (sizeof (minus_c) - 1)
|
||||
+ (line_len * 2) + 1);
|
||||
|
||||
|
||||
ap = new_line;
|
||||
bcopy (shell, ap, shell_len);
|
||||
ap += shell_len;
|
||||
@@ -1452,7 +1448,7 @@ construct_command_argv_internal (line, restp, shell, ifs)
|
||||
*ap++ = *p;
|
||||
}
|
||||
*ap = '\0';
|
||||
|
||||
|
||||
new_argv = construct_command_argv_internal (new_line, (char **) NULL,
|
||||
(char *) 0, (char *) 0);
|
||||
}
|
||||
|
||||
70
main.c
70
main.c
@@ -43,7 +43,6 @@ extern double atof ();
|
||||
#endif
|
||||
extern char *mktemp ();
|
||||
|
||||
static void log_working_directory ();
|
||||
static void print_data_base (), print_version ();
|
||||
static void decode_switches (), decode_env_switches ();
|
||||
static void define_makeflags ();
|
||||
@@ -367,6 +366,9 @@ static struct file *
|
||||
enter_command_line_file (name)
|
||||
char *name;
|
||||
{
|
||||
if (name[0] == '\0')
|
||||
fatal ("empty string invalid as file name");
|
||||
|
||||
if (name[0] == '~')
|
||||
{
|
||||
char *expanded = tilde_expand (name);
|
||||
@@ -384,7 +386,7 @@ enter_command_line_file (name)
|
||||
/* Skip following slashes: ".//foo" is "foo", not "/foo". */
|
||||
++name;
|
||||
}
|
||||
|
||||
|
||||
if (*name == '\0')
|
||||
{
|
||||
/* It was all slashes! Move back to the dot and truncate
|
||||
@@ -413,7 +415,6 @@ main (argc, argv, envp)
|
||||
char **argv;
|
||||
char **envp;
|
||||
{
|
||||
extern void init_dir ();
|
||||
extern RETSIGTYPE fatal_error_signal (), child_handler ();
|
||||
register struct file *f;
|
||||
register unsigned int i;
|
||||
@@ -424,7 +425,7 @@ main (argc, argv, envp)
|
||||
default_goal_file = 0;
|
||||
reading_filename = 0;
|
||||
reading_lineno_ptr = 0;
|
||||
|
||||
|
||||
#if !defined (HAVE_STRSIGNAL) && !defined (HAVE_SYS_SIGLIST)
|
||||
signame_init ();
|
||||
#endif
|
||||
@@ -477,16 +478,13 @@ main (argc, argv, envp)
|
||||
#endif /* setvbuf reversed. */
|
||||
#endif /* setlinebuf missing. */
|
||||
|
||||
/* Initialize the directory hashing code. */
|
||||
init_dir ();
|
||||
|
||||
/* Figure out where this program lives. */
|
||||
|
||||
if (argv[0] == 0)
|
||||
argv[0] = "";
|
||||
if (argv[0][0] == '\0')
|
||||
program = "make";
|
||||
else
|
||||
else
|
||||
{
|
||||
program = rindex (argv[0], '/');
|
||||
#ifdef __MSDOS__
|
||||
@@ -685,10 +683,6 @@ main (argc, argv, envp)
|
||||
starting_directory = current_directory;
|
||||
}
|
||||
|
||||
/* Tell the user where he is. */
|
||||
|
||||
if (print_directory_flag)
|
||||
log_working_directory (1);
|
||||
|
||||
/* Read any stdin makefiles into temporary files. */
|
||||
|
||||
@@ -917,7 +911,7 @@ main (argc, argv, envp)
|
||||
d = d->next;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Set up `MAKEFLAGS' specially while remaking makefiles. */
|
||||
define_makeflags (1, 1);
|
||||
@@ -929,11 +923,11 @@ main (argc, argv, envp)
|
||||
#define BOGUS_UPDATE_STATUS 0
|
||||
assert (BOGUS_UPDATE_STATUS);
|
||||
break;
|
||||
|
||||
|
||||
case -1:
|
||||
/* Did nothing. */
|
||||
break;
|
||||
|
||||
|
||||
case 2:
|
||||
/* Failed to update. Figure out if we care. */
|
||||
{
|
||||
@@ -1007,8 +1001,7 @@ main (argc, argv, envp)
|
||||
if (print_data_base_flag)
|
||||
print_data_base ();
|
||||
|
||||
if (print_directory_flag)
|
||||
log_working_directory (0);
|
||||
log_working_directory (0);
|
||||
|
||||
if (makefiles != 0)
|
||||
{
|
||||
@@ -1230,7 +1223,7 @@ handle_non_switch_argument (arg, env)
|
||||
goals. */
|
||||
struct file *f = enter_command_line_file (arg);
|
||||
f->cmd_target = 1;
|
||||
|
||||
|
||||
if (goals == 0)
|
||||
{
|
||||
goals = (struct dep *) xmalloc (sizeof (struct dep));
|
||||
@@ -1372,13 +1365,13 @@ positive integral argument",
|
||||
optarg = argv[optind++];
|
||||
|
||||
if (doit)
|
||||
*(double *) cs->value_ptr
|
||||
*(double *) cs->value_ptr
|
||||
= (optarg != 0 ? atof (optarg)
|
||||
: *(double *) cs->noarg_value);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
/* We've found the switch. Stop looking. */
|
||||
break;
|
||||
}
|
||||
@@ -1778,6 +1771,24 @@ define_makeflags (all, makefile)
|
||||
flags = flags->next;
|
||||
}
|
||||
|
||||
|
||||
/* Define MFLAGS before appending variable definitions. */
|
||||
|
||||
if (p == &flagstring[1])
|
||||
/* No flags. */
|
||||
flagstring[0] = '\0';
|
||||
else if (p[-1] == '-')
|
||||
/* Kill the final space and dash. */
|
||||
p[-2] = '\0';
|
||||
else
|
||||
/* Terminate the string. */
|
||||
*p = '\0';
|
||||
|
||||
/* Since MFLAGS is not parsed for flags, there is no reason to
|
||||
override any makefile redefinition. */
|
||||
(void) define_variable ("MFLAGS", 6, flagstring, o_env, 1);
|
||||
|
||||
|
||||
if (all && command_variables != 0)
|
||||
{
|
||||
/* Now write a reference to $(MAKEOVERRIDES), which contains all the
|
||||
@@ -1842,9 +1853,6 @@ define_makeflags (all, makefile)
|
||||
We should not do this again on the second call, because that is
|
||||
after reading makefiles which might have done `unexport MAKEFLAGS'. */
|
||||
v->export = v_export;
|
||||
/* Since MFLAGS is not parsed for flags, there is no reason to
|
||||
override any makefile redefinition. */
|
||||
(void) define_variable ("MFLAGS", 6, flagstring, o_env, 1);
|
||||
}
|
||||
|
||||
/* Print version information. */
|
||||
@@ -1932,8 +1940,7 @@ die (status)
|
||||
if (print_data_base_flag)
|
||||
print_data_base ();
|
||||
|
||||
if (print_directory_flag)
|
||||
log_working_directory (0);
|
||||
log_working_directory (0);
|
||||
}
|
||||
|
||||
exit (status);
|
||||
@@ -1942,20 +1949,21 @@ die (status)
|
||||
/* Write a message indicating that we've just entered or
|
||||
left (according to ENTERING) the current directory. */
|
||||
|
||||
static void
|
||||
void
|
||||
log_working_directory (entering)
|
||||
int entering;
|
||||
{
|
||||
static int entered = 0;
|
||||
char *message = entering ? "Entering" : "Leaving";
|
||||
|
||||
if (entering)
|
||||
entered = 1;
|
||||
else if (!entered)
|
||||
/* Don't print the leaving message if we
|
||||
haven't printed the entering message. */
|
||||
/* Print nothing without the flag. Don't print the entering message
|
||||
again if we already have. Don't print the leaving message if we
|
||||
haven't printed the entering message. */
|
||||
if (! print_directory_flag || entering == entered)
|
||||
return;
|
||||
|
||||
entered = entering;
|
||||
|
||||
if (print_data_base_flag)
|
||||
fputs ("# ", stdout);
|
||||
|
||||
|
||||
539
make-stds.texi
539
make-stds.texi
@@ -8,14 +8,26 @@
|
||||
@cindex conventions for makefiles
|
||||
@cindex standards for makefiles
|
||||
|
||||
This chapter describes conventions for writing the Makefiles for GNU programs.
|
||||
This
|
||||
@ifinfo
|
||||
node
|
||||
@end ifinfo
|
||||
@iftex
|
||||
@ifset CODESTD
|
||||
section
|
||||
@end ifset
|
||||
@ifclear CODESTD
|
||||
chapter
|
||||
@end ifclear
|
||||
@end iftex
|
||||
describes conventions for writing the Makefiles for GNU programs.
|
||||
|
||||
@menu
|
||||
* Makefile Basics::
|
||||
* Utilities in Makefiles::
|
||||
* Standard Targets::
|
||||
* Command Variables::
|
||||
* Directory Variables::
|
||||
* Makefile Basics:: General Conventions for Makefiles
|
||||
* Utilities in Makefiles:: Utilities in Makefiles
|
||||
* Command Variables:: Variables for Specifying Commands
|
||||
* Directory Variables:: Variables for Installation Directories
|
||||
* Standard Targets:: Standard Targets for Users
|
||||
@end menu
|
||||
|
||||
@node Makefile Basics
|
||||
@@ -69,9 +81,9 @@ directory.
|
||||
|
||||
When using GNU @code{make}, relying on @samp{VPATH} to find the source
|
||||
file will work in the case where there is a single dependency file,
|
||||
since the @file{make} automatic variable @samp{$<} will represent the
|
||||
since the @code{make} automatic variable @samp{$<} will represent the
|
||||
source file wherever it is. (Many versions of @code{make} set @samp{$<}
|
||||
only in implicit rules.) A makefile target like
|
||||
only in implicit rules.) A Makefile target like
|
||||
|
||||
@smallexample
|
||||
foo.o : bar.c
|
||||
@@ -97,6 +109,9 @@ foo.1 : foo.man sedscript
|
||||
sed -e $(srcdir)/sedscript $(srcdir)/foo.man > $@@
|
||||
@end smallexample
|
||||
|
||||
Try to make the build and installation targets, at least (and all their
|
||||
subtargets) work correctly with a parallel @code{make}.
|
||||
|
||||
@node Utilities in Makefiles
|
||||
@section Utilities in Makefiles
|
||||
|
||||
@@ -108,8 +123,8 @@ The @code{configure} script and the Makefile rules for building and
|
||||
installation should not use any utilities directly except these:
|
||||
|
||||
@example
|
||||
cat cmp cp echo egrep expr grep
|
||||
ln mkdir mv pwd rm rmdir sed test touch
|
||||
cat cmp cp echo egrep expr false grep
|
||||
ln mkdir mv pwd rm rmdir sed test touch true
|
||||
@end example
|
||||
|
||||
Stick to the generally supported options for these programs. For
|
||||
@@ -137,226 +152,15 @@ When you use @code{ranlib}, you should make sure nothing bad happens if
|
||||
the system does not have @code{ranlib}. Arrange to ignore an error
|
||||
from that command, and print a message before the command to tell the
|
||||
user that failure of the @code{ranlib} command does not mean a problem.
|
||||
(The Autoconf @samp{AC_PROG_RANLIB} macro can help with this.)
|
||||
|
||||
If you use symbolic links, you should implement a fallback for systems
|
||||
that don't have symbolic links.
|
||||
|
||||
It is ok to use other utilities in Makefile portions (or scripts)
|
||||
intended only for particular systems where you know those utilities to
|
||||
intended only for particular systems where you know those utilities
|
||||
exist.
|
||||
|
||||
@node Standard Targets
|
||||
@section Standard Targets for Users
|
||||
|
||||
All GNU programs should have the following targets in their Makefiles:
|
||||
|
||||
@table @samp
|
||||
@item all
|
||||
Compile the entire program. This should be the default target. This
|
||||
target need not rebuild any documentation files; Info files should
|
||||
normally be included in the distribution, and DVI files should be made
|
||||
only when explicitly asked for.
|
||||
|
||||
@item install
|
||||
Compile the program and copy the executables, libraries, and so on to
|
||||
the file names where they should reside for actual use. If there is a
|
||||
simple test to verify that a program is properly installed, this target
|
||||
should run that test.
|
||||
|
||||
If possible, write the @code{install} target rule so that it does not
|
||||
modify anything in the directory where the program was built, provided
|
||||
@samp{make all} has just been done. This is convenient for building the
|
||||
program under one user name and installing it under another.
|
||||
|
||||
The commands should create all the directories in which files are to be
|
||||
installed, if they don't already exist. This includes the directories
|
||||
specified as the values of the variables @code{prefix} and
|
||||
@code{exec_prefix}, as well as all subdirectories that are needed.
|
||||
One way to do this is by means of an @code{installdirs} target
|
||||
as described below.
|
||||
|
||||
Use @samp{-} before any command for installing a man page, so that
|
||||
@code{make} will ignore any errors. This is in case there are systems
|
||||
that don't have the Unix man page documentation system installed.
|
||||
|
||||
The way to install Info files is to copy them into @file{$(infodir)}
|
||||
with @code{$(INSTALL_DATA)} (@pxref{Command Variables}), and then run
|
||||
the @code{install-info} program if it is present. @code{install-info}
|
||||
is a script that edits the Info @file{dir} file to add or update the
|
||||
menu entry for the given Info file; it will be part of the Texinfo package.
|
||||
Here is a sample rule to install an Info file:
|
||||
|
||||
@comment This example has been carefully formatted for the Make manual.
|
||||
@comment Please do not reformat it without talking to roland@gnu.ai.mit.edu.
|
||||
@smallexample
|
||||
$(infodir)/foo.info: foo.info
|
||||
# There may be a newer info file in . than in srcdir.
|
||||
-if test -f foo.info; then d=.; \
|
||||
else d=$(srcdir); fi; \
|
||||
$(INSTALL_DATA) $$d/foo.info $@@; \
|
||||
# Run install-info only if it exists.
|
||||
# Use `if' instead of just prepending `-' to the
|
||||
# line so we notice real errors from install-info.
|
||||
# We use `$(SHELL) -c' because some shells do not
|
||||
# fail gracefully when there is an unknown command.
|
||||
if $(SHELL) -c 'install-info --version' \
|
||||
>/dev/null 2>&1; then \
|
||||
install-info --infodir=$(infodir) $$d/foo.info; \
|
||||
else true; fi
|
||||
@end smallexample
|
||||
|
||||
@item uninstall
|
||||
Delete all the installed files that the @samp{install} target would
|
||||
create (but not the noninstalled files such as @samp{make all} would
|
||||
create).
|
||||
|
||||
This rule should not modify the directories where compilation is done,
|
||||
only the directories where files are installed.
|
||||
|
||||
@comment The gratuitous blank line here is to make the table look better
|
||||
@comment in the printed Make manual. Please leave it in.
|
||||
@item clean
|
||||
|
||||
Delete all files from the current directory that are normally created by
|
||||
building the program. Don't delete the files that record the
|
||||
configuration. Also preserve files that could be made by building, but
|
||||
normally aren't because the distribution comes with them.
|
||||
|
||||
Delete @file{.dvi} files here if they are not part of the distribution.
|
||||
|
||||
@item distclean
|
||||
Delete all files from the current directory that are created by
|
||||
configuring or building the program. If you have unpacked the source
|
||||
and built the program without creating any other files, @samp{make
|
||||
distclean} should leave only the files that were in the distribution.
|
||||
|
||||
@item mostlyclean
|
||||
Like @samp{clean}, but may refrain from deleting a few files that people
|
||||
normally don't want to recompile. For example, the @samp{mostlyclean}
|
||||
target for GCC does not delete @file{libgcc.a}, because recompiling it
|
||||
is rarely necessary and takes a lot of time.
|
||||
|
||||
@item maintainer-clean
|
||||
Delete almost everything from the current directory that can be
|
||||
reconstructed with this Makefile. This typically includes everything
|
||||
deleted by @code{distclean}, plus more: C source files produced by
|
||||
Bison, tags tables, Info files, and so on.
|
||||
|
||||
The reason we say ``almost everything'' is that @samp{make
|
||||
maintainer-clean} should not delete @file{configure} even if
|
||||
@file{configure} can be remade using a rule in the Makefile. More
|
||||
generally, @samp{make maintainer-clean} should not delete anything that
|
||||
needs to exist in order to run @file{configure} and then begin to build
|
||||
the program. This is the only exception; @code{maintainer-clean} should
|
||||
delete everything else that can be rebuilt.
|
||||
|
||||
The @samp{maintainer-clean} is intended to be used by a maintainer of
|
||||
the package, not by ordinary users. You may need special tools to
|
||||
reconstruct some of the files that @samp{make maintainer-clean} deletes.
|
||||
Since these files are normally included in the distribution, we don't
|
||||
take care to make them easy to reconstruct. If you find you need to
|
||||
unpack the full distribution again, don't blame us.
|
||||
|
||||
To help make users aware of this, the commands for
|
||||
@code{maintainer-clean} should start with these two:
|
||||
|
||||
@example
|
||||
@@echo "This command is intended for maintainers to use;"
|
||||
@@echo "it deletes files that may require special tools to rebuild."
|
||||
@end example
|
||||
|
||||
@item TAGS
|
||||
Update a tags table for this program.
|
||||
|
||||
@item info
|
||||
Generate any Info files needed. The best way to write the rules is as
|
||||
follows:
|
||||
|
||||
@smallexample
|
||||
info: foo.info
|
||||
|
||||
foo.info: foo.texi chap1.texi chap2.texi
|
||||
$(MAKEINFO) $(srcdir)/foo.texi
|
||||
@end smallexample
|
||||
|
||||
@noindent
|
||||
You must define the variable @code{MAKEINFO} in the Makefile. It should
|
||||
run the @code{makeinfo} program, which is part of the Texinfo
|
||||
distribution.
|
||||
|
||||
@item dvi
|
||||
Generate DVI files for all TeXinfo documentation.
|
||||
For example:
|
||||
|
||||
@smallexample
|
||||
dvi: foo.dvi
|
||||
|
||||
foo.dvi: foo.texi chap1.texi chap2.texi
|
||||
$(TEXI2DVI) $(srcdir)/foo.texi
|
||||
@end smallexample
|
||||
|
||||
@noindent
|
||||
You must define the variable @code{TEXI2DVI} in the Makefile. It should
|
||||
run the program @code{texi2dvi}, which is part of the Texinfo
|
||||
distribution. Alternatively, write just the dependencies, and allow GNU
|
||||
Make to provide the command.
|
||||
|
||||
@item dist
|
||||
Create a distribution tar file for this program. The tar file should be
|
||||
set up so that the file names in the tar file start with a subdirectory
|
||||
name which is the name of the package it is a distribution for. This
|
||||
name can include the version number.
|
||||
|
||||
For example, the distribution tar file of GCC version 1.40 unpacks into
|
||||
a subdirectory named @file{gcc-1.40}.
|
||||
|
||||
The easiest way to do this is to create a subdirectory appropriately
|
||||
named, use @code{ln} or @code{cp} to install the proper files in it, and
|
||||
then @code{tar} that subdirectory.
|
||||
|
||||
The @code{dist} target should explicitly depend on all non-source files
|
||||
that are in the distribution, to make sure they are up to date in the
|
||||
distribution.
|
||||
@xref{Releases, , Making Releases, standards, GNU Coding Standards}.
|
||||
|
||||
@item check
|
||||
Perform self-tests (if any). The user must build the program before
|
||||
running the tests, but need not install the program; you should write
|
||||
the self-tests so that they work when the program is built but not
|
||||
installed.
|
||||
@end table
|
||||
|
||||
The following targets are suggested as conventional names, for programs
|
||||
in which they are useful.
|
||||
|
||||
@table @code
|
||||
@item installcheck
|
||||
Perform installation tests (if any). The user must build and install
|
||||
the program before running the tests. You should not assume that
|
||||
@file{$(bindir)} is in the search path.
|
||||
|
||||
@item installdirs
|
||||
It's useful to add a target named @samp{installdirs} to create the
|
||||
directories where files are installed, and their parent directories.
|
||||
There is a script called @file{mkinstalldirs} which is convenient for
|
||||
this; find it in the Texinfo package.@c It's in /gd/gnu/lib/mkinstalldirs.
|
||||
You can use a rule like this:
|
||||
|
||||
@comment This has been carefully formatted to look decent in the Make manual.
|
||||
@comment Please be sure not to make it extend any further to the right.--roland
|
||||
@smallexample
|
||||
# Make sure all installation directories (e.g. $(bindir))
|
||||
# actually exist by making them if necessary.
|
||||
installdirs: mkinstalldirs
|
||||
$(srcdir)/mkinstalldirs $(bindir) $(datadir) \
|
||||
$(libdir) $(infodir) \
|
||||
$(mandir)
|
||||
@end smallexample
|
||||
|
||||
This rule should not modify the directories where compilation is done.
|
||||
It should do nothing but create installation directories.
|
||||
@end table
|
||||
|
||||
@node Command Variables
|
||||
@section Variables for Specifying Commands
|
||||
|
||||
@@ -440,14 +244,16 @@ and nothing should be directly installed into these two directories.
|
||||
@table @samp
|
||||
@item prefix
|
||||
A prefix used in constructing the default values of the variables listed
|
||||
below. The default value of @code{prefix} should be @file{/usr/local}
|
||||
below. The default value of @code{prefix} should be @file{/usr/local}.
|
||||
When building the complete GNU system, the prefix will be empty and
|
||||
@file{/usr} will be a symbolic link to @file{/}.
|
||||
(If you are using Autoconf, write it as @samp{@@prefix@@}.)
|
||||
|
||||
@item exec_prefix
|
||||
A prefix used in constructing the default values of some of the
|
||||
variables listed below. The default value of @code{exec_prefix} should
|
||||
be @code{$(prefix)}.
|
||||
(If you are using Autoconf, write it as @samp{@@exec_prefix@@}.)
|
||||
|
||||
Generally, @code{$(exec_prefix)} is used for directories that contain
|
||||
machine-specific files (such as executables and subroutine libraries),
|
||||
@@ -461,18 +267,21 @@ Executable programs are installed in one of the following directories.
|
||||
The directory for installing executable programs that users can run.
|
||||
This should normally be @file{/usr/local/bin}, but write it as
|
||||
@file{$(exec_prefix)/bin}.
|
||||
(If you are using Autoconf, write it as @samp{@@bindir@@}.)
|
||||
|
||||
@item sbindir
|
||||
The directory for installing executable programs that can be run from
|
||||
the shell, but are only generally useful to system administrators. This
|
||||
should normally be @file{/usr/local/sbin}, but write it as
|
||||
@file{$(exec_prefix)/sbin}.
|
||||
(If you are using Autoconf, write it as @samp{@@sbindir@@}.)
|
||||
|
||||
@item libexecdir
|
||||
@comment This paragraph adjusted to avoid overfull hbox --roland 5jul94
|
||||
The directory for installing executable programs to be run by other
|
||||
programs rather than by users. This directory should normally be
|
||||
@file{/usr/local/libexec}, but write it as @file{$(exec_prefix)/libexec}.
|
||||
(If you are using Autoconf, write it as @samp{@@libexecdir@@}.)
|
||||
@end table
|
||||
|
||||
Data files used by the program during its execution are divided into
|
||||
@@ -491,18 +300,20 @@ be shared between two machines.
|
||||
@end itemize
|
||||
|
||||
This makes for six different possibilities. However, we want to
|
||||
discourage the use of architecture-dependent files, aside from of object
|
||||
discourage the use of architecture-dependent files, aside from object
|
||||
files and libraries. It is much cleaner to make other data files
|
||||
architecture-independent, and it is generally not hard.
|
||||
|
||||
Therefore, here are the variables makefiles should use to specify
|
||||
Therefore, here are the variables Makefiles should use to specify
|
||||
directories:
|
||||
|
||||
@table @samp
|
||||
@item datadir
|
||||
The directory for installing read-only architecture independent data
|
||||
files. This should normally be @file{/usr/local/share}, but write it as
|
||||
@file{$(prefix)/share}. As a special exception, see @file{$(infodir)}
|
||||
@file{$(prefix)/share}.
|
||||
(If you are using Autoconf, write it as @samp{@@datadir@@}.)
|
||||
As a special exception, see @file{$(infodir)}
|
||||
and @file{$(includedir)} below.
|
||||
|
||||
@item sysconfdir
|
||||
@@ -512,12 +323,13 @@ and network configuration files, @file{/etc/passwd}, and so forth belong
|
||||
here. All the files in this directory should be ordinary ASCII text
|
||||
files. This directory should normally be @file{/usr/local/etc}, but
|
||||
write it as @file{$(prefix)/etc}.
|
||||
(If you are using Autoconf, write it as @samp{@@sysconfdir@@}.)
|
||||
|
||||
@c rewritten to avoid overfull hbox --tower
|
||||
Do not install executables
|
||||
@c here
|
||||
in this directory (they probably
|
||||
belong in @file{$(libexecdir)} or @file{$(sbindir))}. Also do not
|
||||
belong in @file{$(libexecdir)} or @file{$(sbindir)}). Also do not
|
||||
install files that are modified in the normal course of their use
|
||||
(programs whose purpose is to change the configuration of the system
|
||||
excluded). Those probably belong in @file{$(localstatedir)}.
|
||||
@@ -526,26 +338,30 @@ excluded). Those probably belong in @file{$(localstatedir)}.
|
||||
The directory for installing architecture-independent data files which
|
||||
the programs modify while they run. This should normally be
|
||||
@file{/usr/local/com}, but write it as @file{$(prefix)/com}.
|
||||
(If you are using Autoconf, write it as @samp{@@sharedstatedir@@}.)
|
||||
|
||||
@item localstatedir
|
||||
The directory for installing data files which the programs modify while
|
||||
they run, and that pertain to one specific machine. Users should never
|
||||
need to modify files in this directory to configure the package's
|
||||
operation; put such configuration information in separate files that go
|
||||
in @file{datadir} or @file{$(sysconfdir)}. @file{$(localstatedir)}
|
||||
in @file{$(datadir)} or @file{$(sysconfdir)}. @file{$(localstatedir)}
|
||||
should normally be @file{/usr/local/var}, but write it as
|
||||
@file{$(prefix)/var}.
|
||||
(If you are using Autoconf, write it as @samp{@@localstatedir@@}.)
|
||||
|
||||
@item libdir
|
||||
The directory for object files and libraries of object code. Do not
|
||||
install executables here, they probably belong in @file{$(libexecdir)}
|
||||
instead. The value of @code{libdir} should normally be
|
||||
@file{/usr/local/lib}, but write it as @file{$(exec_prefix)/lib}.
|
||||
(If you are using Autoconf, write it as @samp{@@libdir@@}.)
|
||||
|
||||
@item infodir
|
||||
The directory for installing the Info files for this package. By
|
||||
default, it should be @file{/usr/local/info}, but it should be written
|
||||
as @file{$(prefix)/info}.
|
||||
(If you are using Autoconf, write it as @samp{@@infodir@@}.)
|
||||
|
||||
@item includedir
|
||||
@c rewritten to avoid overfull hbox --roland
|
||||
@@ -553,6 +369,7 @@ The directory for installing header files to be included by user
|
||||
programs with the C @samp{#include} preprocessor directive. This
|
||||
should normally be @file{/usr/local/include}, but write it as
|
||||
@file{$(prefix)/include}.
|
||||
(If you are using Autoconf, write it as @samp{@@includedir@@}.)
|
||||
|
||||
Most compilers other than GCC do not look for header files in
|
||||
@file{/usr/local/include}. So installing the header files this way is
|
||||
@@ -565,6 +382,7 @@ specified by @code{oldincludedir}.
|
||||
@item oldincludedir
|
||||
The directory for installing @samp{#include} header files for use with
|
||||
compilers other than GCC. This should normally be @file{/usr/include}.
|
||||
(If you are using Autoconf, you can write it as @samp{@@oldincludedir@@}.)
|
||||
|
||||
The Makefile commands should check whether the value of
|
||||
@code{oldincludedir} is empty. If it is, they should not try to use
|
||||
@@ -578,26 +396,25 @@ file in the @code{oldincludedir} directory if either (1) there is no
|
||||
package.
|
||||
|
||||
To tell whether @file{foo.h} came from the Foo package, put a magic
|
||||
string in the file---part of a comment---and grep for that string.
|
||||
string in the file---part of a comment---and @code{grep} for that string.
|
||||
@end table
|
||||
|
||||
Unix-style man pages are installed in one of the following:
|
||||
|
||||
@table @samp
|
||||
@item mandir
|
||||
The directory for installing the man pages (if any) for this package.
|
||||
It should include the suffix for the proper section of the
|
||||
manual---usually @samp{1} for a utility. It will normally be
|
||||
@file{/usr/local/man/man1}, but you should write it as
|
||||
@file{$(prefix)/man/man1}.
|
||||
The top-level directory for installing the man pages (if any) for this
|
||||
package. It will normally be @file{/usr/local/man}, but you should
|
||||
write it as @file{$(prefix)/man}.
|
||||
(If you are using Autoconf, write it as @samp{@@mandir@@}.)
|
||||
|
||||
@item man1dir
|
||||
The directory for installing section 1 man pages.
|
||||
The directory for installing section 1 man pages. Write it as
|
||||
@file{$(mandir)/man1}.
|
||||
@item man2dir
|
||||
The directory for installing section 2 man pages.
|
||||
The directory for installing section 2 man pages. Write it as
|
||||
@file{$(mandir)/man2}
|
||||
@item @dots{}
|
||||
Use these names instead of @samp{mandir} if the package needs to install man
|
||||
pages in more than one section of the manual.
|
||||
|
||||
@strong{Don't make the primary documentation for any GNU software be a
|
||||
man page. Write a manual in Texinfo instead. Man pages are just for
|
||||
@@ -623,6 +440,7 @@ And finally, you should set the following variable:
|
||||
@item srcdir
|
||||
The directory for the sources being compiled. The value of this
|
||||
variable is normally inserted by the @code{configure} shell script.
|
||||
(If you are using Autconf, use @samp{srcdir = @@srcdir@@}.)
|
||||
@end table
|
||||
|
||||
For example:
|
||||
@@ -654,3 +472,246 @@ specify the exact same values for several different GNU packages. In
|
||||
order for this to be useful, all the packages must be designed so that
|
||||
they will work sensibly when the user does so.
|
||||
|
||||
@node Standard Targets
|
||||
@section Standard Targets for Users
|
||||
|
||||
All GNU programs should have the following targets in their Makefiles:
|
||||
|
||||
@table @samp
|
||||
@item all
|
||||
Compile the entire program. This should be the default target. This
|
||||
target need not rebuild any documentation files; Info files should
|
||||
normally be included in the distribution, and DVI files should be made
|
||||
only when explicitly asked for.
|
||||
|
||||
By default, the Make rules should compile and link with @samp{-g}, so
|
||||
that executable programs have debugging symbols. Users who don't mind
|
||||
being helpless can strip the executables later if they wish.
|
||||
|
||||
@item install
|
||||
Compile the program and copy the executables, libraries, and so on to
|
||||
the file names where they should reside for actual use. If there is a
|
||||
simple test to verify that a program is properly installed, this target
|
||||
should run that test.
|
||||
|
||||
Do not strip executables when installing them. Devil-may-care users can
|
||||
use the @code{install-strip} target to do that.
|
||||
|
||||
If possible, write the @code{install} target rule so that it does not
|
||||
modify anything in the directory where the program was built, provided
|
||||
@samp{make all} has just been done. This is convenient for building the
|
||||
program under one user name and installing it under another.
|
||||
|
||||
The commands should create all the directories in which files are to be
|
||||
installed, if they don't already exist. This includes the directories
|
||||
specified as the values of the variables @code{prefix} and
|
||||
@code{exec_prefix}, as well as all subdirectories that are needed.
|
||||
One way to do this is by means of an @code{installdirs} target
|
||||
as described below.
|
||||
|
||||
Use @samp{-} before any command for installing a man page, so that
|
||||
@code{make} will ignore any errors. This is in case there are systems
|
||||
that don't have the Unix man page documentation system installed.
|
||||
|
||||
The way to install Info files is to copy them into @file{$(infodir)}
|
||||
with @code{$(INSTALL_DATA)} (@pxref{Command Variables}), and then run
|
||||
the @code{install-info} program if it is present. @code{install-info}
|
||||
is a program that edits the Info @file{dir} file to add or update the
|
||||
menu entry for the given Info file; it is part of the Texinfo package.
|
||||
Here is a sample rule to install an Info file:
|
||||
|
||||
@comment This example has been carefully formatted for the Make manual.
|
||||
@comment Please do not reformat it without talking to roland@gnu.ai.mit.edu.
|
||||
@smallexample
|
||||
$(infodir)/foo.info: foo.info
|
||||
# There may be a newer info file in . than in srcdir.
|
||||
-if test -f foo.info; then d=.; \
|
||||
else d=$(srcdir); fi; \
|
||||
$(INSTALL_DATA) $$d/foo.info $@@; \
|
||||
# Run install-info only if it exists.
|
||||
# Use `if' instead of just prepending `-' to the
|
||||
# line so we notice real errors from install-info.
|
||||
# We use `$(SHELL) -c' because some shells do not
|
||||
# fail gracefully when there is an unknown command.
|
||||
if $(SHELL) -c 'install-info --version' \
|
||||
>/dev/null 2>&1; then \
|
||||
install-info --dir-file=$(infodir)/dir $(infodir)/foo.info; \
|
||||
else true; fi
|
||||
@end smallexample
|
||||
|
||||
@item uninstall
|
||||
Delete all the installed files that the @samp{install} target would
|
||||
create (but not the noninstalled files such as @samp{make all} would
|
||||
create).
|
||||
|
||||
This rule should not modify the directories where compilation is done,
|
||||
only the directories where files are installed.
|
||||
|
||||
@item install-strip
|
||||
Like @code{install}, but strip the executable files while installing
|
||||
them. The definition of this target can be very simple:
|
||||
|
||||
@example
|
||||
install-strip:
|
||||
$(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' install
|
||||
@end example
|
||||
|
||||
Normally we do not recommend stripping an executable unless you are sure
|
||||
the program has no bugs. However, it can be reasonable to install a
|
||||
stripped executable for actual execution while saving the unstripped
|
||||
executable elsewhere in case there is a bug.
|
||||
|
||||
@comment The gratuitous blank line here is to make the table look better
|
||||
@comment in the printed Make manual. Please leave it in.
|
||||
@item clean
|
||||
|
||||
Delete all files from the current directory that are normally created by
|
||||
building the program. Don't delete the files that record the
|
||||
configuration. Also preserve files that could be made by building, but
|
||||
normally aren't because the distribution comes with them.
|
||||
|
||||
Delete @file{.dvi} files here if they are not part of the distribution.
|
||||
|
||||
@item distclean
|
||||
Delete all files from the current directory that are created by
|
||||
configuring or building the program. If you have unpacked the source
|
||||
and built the program without creating any other files, @samp{make
|
||||
distclean} should leave only the files that were in the distribution.
|
||||
|
||||
@item mostlyclean
|
||||
Like @samp{clean}, but may refrain from deleting a few files that people
|
||||
normally don't want to recompile. For example, the @samp{mostlyclean}
|
||||
target for GCC does not delete @file{libgcc.a}, because recompiling it
|
||||
is rarely necessary and takes a lot of time.
|
||||
|
||||
@item maintainer-clean
|
||||
Delete almost everything from the current directory that can be
|
||||
reconstructed with this Makefile. This typically includes everything
|
||||
deleted by @code{distclean}, plus more: C source files produced by
|
||||
Bison, tags tables, Info files, and so on.
|
||||
|
||||
The reason we say ``almost everything'' is that running the command
|
||||
@samp{make maintainer-clean} should not delete @file{configure} even if
|
||||
@file{configure} can be remade using a rule in the Makefile. More generally,
|
||||
@samp{make maintainer-clean} should not delete anything that needs to
|
||||
exist in order to run @file{configure} and then begin to build the
|
||||
program. This is the only exception; @code{maintainer-clean} should
|
||||
delete everything else that can be rebuilt.
|
||||
|
||||
The @samp{maintainer-clean} target is intended to be used by a maintainer of
|
||||
the package, not by ordinary users. You may need special tools to
|
||||
reconstruct some of the files that @samp{make maintainer-clean} deletes.
|
||||
Since these files are normally included in the distribution, we don't
|
||||
take care to make them easy to reconstruct. If you find you need to
|
||||
unpack the full distribution again, don't blame us.
|
||||
|
||||
To help make users aware of this, the commands for the special
|
||||
@code{maintainer-clean} target should start with these two:
|
||||
|
||||
@smallexample
|
||||
@@echo "This command is intended for maintainers to use; it"
|
||||
@@echo "deletes files that may require special tools to rebuild."
|
||||
@end smallexample
|
||||
|
||||
@item TAGS
|
||||
Update a tags table for this program.
|
||||
@c ADR: how?
|
||||
|
||||
@item info
|
||||
Generate any Info files needed. The best way to write the rules is as
|
||||
follows:
|
||||
|
||||
@smallexample
|
||||
info: foo.info
|
||||
|
||||
foo.info: foo.texi chap1.texi chap2.texi
|
||||
$(MAKEINFO) $(srcdir)/foo.texi
|
||||
@end smallexample
|
||||
|
||||
@noindent
|
||||
You must define the variable @code{MAKEINFO} in the Makefile. It should
|
||||
run the @code{makeinfo} program, which is part of the Texinfo
|
||||
distribution.
|
||||
|
||||
@item dvi
|
||||
Generate DVI files for all Texinfo documentation.
|
||||
For example:
|
||||
|
||||
@smallexample
|
||||
dvi: foo.dvi
|
||||
|
||||
foo.dvi: foo.texi chap1.texi chap2.texi
|
||||
$(TEXI2DVI) $(srcdir)/foo.texi
|
||||
@end smallexample
|
||||
|
||||
@noindent
|
||||
You must define the variable @code{TEXI2DVI} in the Makefile. It should
|
||||
run the program @code{texi2dvi}, which is part of the Texinfo
|
||||
distribution.@footnote{@code{texi2dvi} uses @TeX{} to do the real work
|
||||
of formatting. @TeX{} is not distributed with Texinfo.} Alternatively,
|
||||
write just the dependencies, and allow GNU Make to provide the command.
|
||||
|
||||
@item dist
|
||||
Create a distribution tar file for this program. The tar file should be
|
||||
set up so that the file names in the tar file start with a subdirectory
|
||||
name which is the name of the package it is a distribution for. This
|
||||
name can include the version number.
|
||||
|
||||
For example, the distribution tar file of GCC version 1.40 unpacks into
|
||||
a subdirectory named @file{gcc-1.40}.
|
||||
|
||||
The easiest way to do this is to create a subdirectory appropriately
|
||||
named, use @code{ln} or @code{cp} to install the proper files in it, and
|
||||
then @code{tar} that subdirectory.
|
||||
|
||||
Compress the tar file file with @code{gzip}. For example, the actual
|
||||
distribution file for GCC version 1.40 is called @file{gcc-1.40.tar.gz}.
|
||||
|
||||
The @code{dist} target should explicitly depend on all non-source files
|
||||
that are in the distribution, to make sure they are up to date in the
|
||||
distribution.
|
||||
@ifset CODESTD
|
||||
@xref{Releases, , Making Releases}.
|
||||
@end ifset
|
||||
@ifclear CODESTD
|
||||
@xref{Releases, , Making Releases, standards, GNU Coding Standards}.
|
||||
@end ifclear
|
||||
|
||||
@item check
|
||||
Perform self-tests (if any). The user must build the program before
|
||||
running the tests, but need not install the program; you should write
|
||||
the self-tests so that they work when the program is built but not
|
||||
installed.
|
||||
@end table
|
||||
|
||||
The following targets are suggested as conventional names, for programs
|
||||
in which they are useful.
|
||||
|
||||
@table @code
|
||||
@item installcheck
|
||||
Perform installation tests (if any). The user must build and install
|
||||
the program before running the tests. You should not assume that
|
||||
@file{$(bindir)} is in the search path.
|
||||
|
||||
@item installdirs
|
||||
It's useful to add a target named @samp{installdirs} to create the
|
||||
directories where files are installed, and their parent directories.
|
||||
There is a script called @file{mkinstalldirs} which is convenient for
|
||||
this; you can find it in the Texinfo package.
|
||||
@c It's in /gd/gnu/lib/mkinstalldirs.
|
||||
You can use a rule like this:
|
||||
|
||||
@comment This has been carefully formatted to look decent in the Make manual.
|
||||
@comment Please be sure not to make it extend any further to the right.--roland
|
||||
@smallexample
|
||||
# Make sure all installation directories (e.g. $(bindir))
|
||||
# actually exist by making them if necessary.
|
||||
installdirs: mkinstalldirs
|
||||
$(srcdir)/mkinstalldirs $(bindir) $(datadir) \
|
||||
$(libdir) $(infodir) \
|
||||
$(mandir)
|
||||
@end smallexample
|
||||
|
||||
This rule should not modify the directories where compilation is done.
|
||||
It should do nothing but create installation directories.
|
||||
@end table
|
||||
|
||||
1
make.h
1
make.h
@@ -259,6 +259,7 @@ extern char *alloca ();
|
||||
|
||||
extern void die ();
|
||||
extern void message (), fatal (), error ();
|
||||
extern void log_working_directory ();
|
||||
extern void makefile_error (), makefile_fatal ();
|
||||
extern void pfatal_with_name (), perror_with_name ();
|
||||
extern char *savestring (), *concat ();
|
||||
|
||||
327
make.texinfo
327
make.texinfo
@@ -1,5 +1,5 @@
|
||||
\input texinfo @c -*- Texinfo -*-
|
||||
@c %**start of header
|
||||
@c %**start of header
|
||||
@setfilename make.info
|
||||
@settitle GNU @code{make}
|
||||
@setchapternewpage odd
|
||||
@@ -8,12 +8,12 @@
|
||||
@c FSF publishers: format makebook.texi instead of using this file directly.
|
||||
|
||||
@set RCSID $Id$
|
||||
@set EDITION 0.48
|
||||
@set VERSION 3.73 Beta
|
||||
@set UPDATED 4 April 1995
|
||||
@set UPDATE-MONTH April 1995
|
||||
@set EDITION 0.50
|
||||
@set VERSION 3.75 Beta
|
||||
@set UPDATED 28 February 1996
|
||||
@set UPDATE-MONTH February 1996
|
||||
@comment The ISBN number might need to change on next publication.
|
||||
@set ISBN 1-882114-50-7
|
||||
@set ISBN 1-882114-78-7
|
||||
|
||||
@c finalout
|
||||
|
||||
@@ -71,8 +71,8 @@ by the Free Software Foundation.
|
||||
Copyright @copyright{} 1988, '89, '90, '91, '92, '93, '94, '95 Free Software Foundation, Inc.
|
||||
@sp 2
|
||||
Published by the Free Software Foundation @*
|
||||
675 Massachusetts Avenue, @*
|
||||
Cambridge, MA 02139 USA @*
|
||||
59 Temple Place -- Suite 330, @*
|
||||
Boston, MA 02111-1307 USA @*
|
||||
Printed copies are available for $20 each. @*
|
||||
ISBN @value{ISBN} @*
|
||||
|
||||
@@ -168,7 +168,7 @@ Writing Rules
|
||||
* Directory Search:: Searching other directories for source files.
|
||||
* Phony Targets:: Using a target that is not a real file's name.
|
||||
* Force Targets:: You can use a target without commands
|
||||
or dependencies to mark other
|
||||
or dependencies to mark other
|
||||
targets as phony.
|
||||
* Empty Targets:: When only the date matters and the
|
||||
files are empty.
|
||||
@@ -176,7 +176,7 @@ Writing Rules
|
||||
* Multiple Targets:: When to make use of several targets in a rule.
|
||||
* Multiple Rules:: How to use several rules with the same target.
|
||||
* Static Pattern:: Static pattern rules apply to multiple targets
|
||||
and can vary the dependencies according to
|
||||
and can vary the dependencies according to
|
||||
the target name.
|
||||
* Double-Colon:: How to use a special kind of rule to allow
|
||||
several independent rules for one target.
|
||||
@@ -192,9 +192,9 @@ Using Wildcard Characters in File Names
|
||||
|
||||
Searching Directories for Dependencies
|
||||
|
||||
* General Search:: Specifying a search path that applies
|
||||
* General Search:: Specifying a search path that applies
|
||||
to every dependency.
|
||||
* Selective Search:: Specifying a search path
|
||||
* Selective Search:: Specifying a search path
|
||||
for a specified class of names.
|
||||
* Commands/Search:: How to write shell commands that work together
|
||||
with search paths.
|
||||
@@ -211,7 +211,7 @@ Writing the Commands in Rules
|
||||
* Echoing:: How to control when commands are echoed.
|
||||
* Execution:: How commands are executed.
|
||||
* Parallel:: How commands can be executed in parallel.
|
||||
* Errors:: What happens after a command execution error.
|
||||
* Errors:: What happens after a command execution error.
|
||||
* Interrupts:: What happens when a command is interrupted.
|
||||
* Recursion:: Invoking @code{make} from makefiles.
|
||||
* Sequences:: Defining canned sequences of commands.
|
||||
@@ -236,13 +236,13 @@ How to Use Variables
|
||||
of a variable.
|
||||
* Override Directive:: How to set a variable in the makefile even if
|
||||
the user has set it with a command argument.
|
||||
* Defining:: An alternate way to set a variable
|
||||
* Defining:: An alternate way to set a variable
|
||||
to a verbatim string.
|
||||
* Environment:: Variable values can come from the environment.
|
||||
|
||||
Advanced Features for Reference to Variables
|
||||
|
||||
* Substitution Refs:: Referencing a variable with
|
||||
* Substitution Refs:: Referencing a variable with
|
||||
substitutions on the value.
|
||||
* Computed Names:: Computing the name of the variable to refer to.
|
||||
|
||||
@@ -264,16 +264,16 @@ Functions for Transforming Text
|
||||
How to Run @code{make}
|
||||
|
||||
* Makefile Arguments:: How to specify which makefile to use.
|
||||
* Goals:: How to use goal arguments to specify which
|
||||
* Goals:: How to use goal arguments to specify which
|
||||
parts of the makefile to use.
|
||||
* Instead of Execution:: How to use mode flags to specify what
|
||||
kind of thing to do with the commands
|
||||
in the makefile other than simply
|
||||
kind of thing to do with the commands
|
||||
in the makefile other than simply
|
||||
execute them.
|
||||
* Avoiding Compilation:: How to avoid recompiling certain files.
|
||||
* Overriding:: How to override a variable to specify
|
||||
* Overriding:: How to override a variable to specify
|
||||
an alternate compiler and other things.
|
||||
* Testing:: How to proceed past some errors, to
|
||||
* Testing:: How to proceed past some errors, to
|
||||
test compilation.
|
||||
* Options Summary:: Summary of Options
|
||||
|
||||
@@ -285,10 +285,10 @@ Using Implicit Rules
|
||||
* Implicit Variables:: How to change what predefined rules do.
|
||||
* Chained Rules:: How to use a chain of implicit rules.
|
||||
* Pattern Rules:: How to define new implicit rules.
|
||||
* Last Resort:: How to defining commands for rules
|
||||
* Last Resort:: How to defining commands for rules
|
||||
which cannot find any.
|
||||
* Suffix Rules:: The old-fashioned style of implicit rule.
|
||||
* Search Algorithm:: The precise algorithm for applying
|
||||
* Search Algorithm:: The precise algorithm for applying
|
||||
implicit rules.
|
||||
|
||||
Defining and Redefining Pattern Rules
|
||||
@@ -376,11 +376,11 @@ introduction, read the first few sections of each chapter, skipping the
|
||||
later sections. In each chapter, the first few sections contain
|
||||
introductory or general information and the later sections contain
|
||||
specialized or technical information.
|
||||
@ifinfo
|
||||
@ifinfo
|
||||
The exception is the second chapter, @ref{Introduction, ,An
|
||||
Introduction to Makefiles}, all of which is introductory.
|
||||
@end ifinfo
|
||||
@iftex
|
||||
@iftex
|
||||
The exception is @ref{Introduction, ,An Introduction to Makefiles},
|
||||
all of which is introductory.
|
||||
@end iftex
|
||||
@@ -436,14 +436,6 @@ Be sure also to include the type of machine and operating system you are
|
||||
using. If possible, include the contents of the file @file{config.h}
|
||||
that is generated by the configuration process.
|
||||
|
||||
Non-bug suggestions are always welcome as well. If you have questions
|
||||
about things that are unclear in the documentation or are just obscure
|
||||
features, send a message to the bug reporting address. We cannot
|
||||
guarantee you'll get help with your problem, but many seasoned
|
||||
@code{make} users read the mailing list and they will probably try to
|
||||
help you out. The maintainers sometimes answer such questions as well,
|
||||
when time permits.
|
||||
|
||||
@node Introduction, Makefiles, Overview, Top
|
||||
@comment node-name, next, previous, up
|
||||
@chapter An Introduction to Makefiles
|
||||
@@ -507,7 +499,7 @@ can also be the name of an action to carry out, such as @samp{clean}
|
||||
(@pxref{Phony Targets}).
|
||||
|
||||
A @dfn{dependency} is a file that is used as input to create the
|
||||
target. A target often depends on several files.
|
||||
target. A target often depends on several files.
|
||||
|
||||
@cindex tabs in rules
|
||||
A @dfn{command} is an action that @code{make} carries out.
|
||||
@@ -607,7 +599,7 @@ of its dependencies change. In addition, any dependencies that are
|
||||
themselves automatically generated should be updated first. In this
|
||||
example, @file{edit} depends on each of the eight object files; the
|
||||
object file @file{main.o} depends on the source file @file{main.c} and
|
||||
on the header file @file{defs.h}.
|
||||
on the header file @file{defs.h}.
|
||||
|
||||
A shell command follows each line that contains a target and
|
||||
dependencies. These shell commands say how to update the target file.
|
||||
@@ -620,7 +612,7 @@ you have specified when the target file needs to be updated.)
|
||||
@cindex shell command
|
||||
|
||||
The target @samp{clean} is not a file, but merely the name of an
|
||||
action. Since you
|
||||
action. Since you
|
||||
normally
|
||||
do not want to carry out the actions in this rule, @samp{clean} is not a dependency of any other rule.
|
||||
Consequently, @code{make} never does anything with it unless you tell
|
||||
@@ -640,11 +632,10 @@ from @code{rm} or any other command.
|
||||
@cindex processing a makefile
|
||||
@cindex makefile, how @code{make} processes
|
||||
|
||||
By default, @code{make} starts with the first rule (not counting rules
|
||||
whose target names start with @samp{.}). This is called the
|
||||
@dfn{default goal}. (@dfn{Goals} are the targets that @code{make}
|
||||
strives ultimately to update. @xref{Goals, , Arguments to Specify the
|
||||
Goals}.)
|
||||
By default, @code{make} starts with the first target (not targets whose
|
||||
names start with @samp{.}). This is called the @dfn{default goal}.
|
||||
(@dfn{Goals} are the targets that @code{make} strives ultimately to
|
||||
update. @xref{Goals, , Arguments to Specify the Goals}.)
|
||||
@cindex default goal
|
||||
@cindex goal, default
|
||||
@cindex goal
|
||||
@@ -742,7 +733,7 @@ objects = main.o kbd.o command.o display.o \
|
||||
@noindent
|
||||
Then, each place we want to put a list of the object file names, we can
|
||||
substitute the variable's value by writing @samp{$(objects)}
|
||||
(@pxref{Using Variables, ,How to Use Variables}).
|
||||
(@pxref{Using Variables, ,How to Use Variables}).
|
||||
|
||||
Here is how the complete simple makefile looks when you use a variable
|
||||
for the object files:
|
||||
@@ -1065,7 +1056,7 @@ comment starting with @samp{#} is allowed at the end of the line. If
|
||||
the file names contain any variable or function references, they are
|
||||
expanded. @xref{Using Variables, ,How to Use Variables}.
|
||||
|
||||
For example, if you have three @file{.mk} files, @file{a.mk},
|
||||
For example, if you have three @file{.mk} files, @file{a.mk},
|
||||
@file{b.mk}, and @file{c.mk}, and @code{$(bar)} expands to
|
||||
@code{bish bash}, then the following expression
|
||||
|
||||
@@ -1086,7 +1077,7 @@ makefile in which the directive appears.
|
||||
|
||||
One occasion for using @code{include} directives is when several programs,
|
||||
handled by individual makefiles in various directories, need to use a
|
||||
common set of variable definitions
|
||||
common set of variable definitions
|
||||
(@pxref{Setting, ,Setting Variables}) or pattern rules
|
||||
(@pxref{Pattern Rules, ,Defining and Redefining Pattern Rules}).
|
||||
|
||||
@@ -1111,10 +1102,10 @@ First, any directories you have specified with the @samp{-I} or
|
||||
@samp{--include-dir} option are searched
|
||||
(@pxref{Options Summary, ,Summary of Options}).
|
||||
Then the following directories (if they exist)
|
||||
are searched, in this order:
|
||||
are searched, in this order:
|
||||
@file{@var{prefix}/include} (normally @file{/usr/local/include})
|
||||
@file{/usr/gnu/include},
|
||||
@file{/usr/local/include}, @file{/usr/include}.
|
||||
@file{/usr/local/include}, @file{/usr/include}.
|
||||
|
||||
If an included makefile cannot be found in any of these directories, a
|
||||
warning message is generated, but it is not an immediately fatal error;
|
||||
@@ -1323,7 +1314,7 @@ the makefile (often with a target called @samp{all}).
|
||||
* Directory Search:: Searching other directories for source files.
|
||||
* Phony Targets:: Using a target that is not a real file's name.
|
||||
* Force Targets:: You can use a target without commands
|
||||
or dependencies to mark other
|
||||
or dependencies to mark other
|
||||
targets as phony.
|
||||
* Empty Targets:: When only the date matters and the
|
||||
files are empty.
|
||||
@@ -1331,7 +1322,7 @@ the makefile (often with a target called @samp{all}).
|
||||
* Multiple Targets:: When to make use of several targets in a rule.
|
||||
* Multiple Rules:: How to use several rules with the same target.
|
||||
* Static Pattern:: Static pattern rules apply to multiple targets
|
||||
and can vary the dependencies according to
|
||||
and can vary the dependencies according to
|
||||
the target name.
|
||||
* Double-Colon:: How to use a special kind of rule to allow
|
||||
several independent rules for one target.
|
||||
@@ -1397,8 +1388,8 @@ or like this:
|
||||
The @var{targets} are file names, separated by spaces. Wildcard
|
||||
characters may be used (@pxref{Wildcards, ,Using Wildcard Characters
|
||||
in File Names}) and a name of the form @file{@var{a}(@var{m})}
|
||||
represents member @var{m} in archive file @var{a}
|
||||
(@pxref{Archive Members, ,Archive Members as Targets}).
|
||||
represents member @var{m} in archive file @var{a}
|
||||
(@pxref{Archive Members, ,Archive Members as Targets}).
|
||||
Usually there is only one
|
||||
target per rule, but occasionally there is a reason to have more
|
||||
(@pxref{Multiple Targets, , Multiple Targets in a Rule}).@refill
|
||||
@@ -1415,7 +1406,7 @@ same. @xref{Commands, ,Writing the Commands in Rules}.
|
||||
@cindex rule, and @code{$}
|
||||
Because dollar signs are used to start variable references, if you really
|
||||
want a dollar sign in a rule you must write two of them, @samp{$$}
|
||||
(@pxref{Using Variables, ,How to Use Variables}).
|
||||
(@pxref{Using Variables, ,How to Use Variables}).
|
||||
You may split a long line by inserting a backslash
|
||||
followed by a newline, but this is not required, as @code{make} places no
|
||||
limit on the length of a line in a makefile.
|
||||
@@ -1636,7 +1627,7 @@ there is no need to write explicit rules for compiling the files.
|
||||
@section Searching Directories for Dependencies
|
||||
@vindex VPATH
|
||||
@findex vpath
|
||||
@cindex vpath
|
||||
@cindex vpath
|
||||
@cindex search path for dependencies (@code{VPATH})
|
||||
@cindex directory search (@code{VPATH})
|
||||
|
||||
@@ -1648,9 +1639,9 @@ among directories, you do not need to change the individual rules,
|
||||
just the search paths.
|
||||
|
||||
@menu
|
||||
* General Search:: Specifying a search path that applies
|
||||
* General Search:: Specifying a search path that applies
|
||||
to every dependency.
|
||||
* Selective Search:: Specifying a search path
|
||||
* Selective Search:: Specifying a search path
|
||||
for a specified class of names.
|
||||
* Commands/Search:: How to write shell commands that work together
|
||||
with search paths.
|
||||
@@ -1723,7 +1714,7 @@ There are three forms of the @code{vpath} directive:
|
||||
@table @code
|
||||
@item vpath @var{pattern} @var{directories}
|
||||
Specify the search path @var{directories} for file names that match
|
||||
@var{pattern}.
|
||||
@var{pattern}.
|
||||
|
||||
The search path, @var{directories}, is a list of directories to be
|
||||
searched, separated by colons or blanks, just like the search path used
|
||||
@@ -1761,7 +1752,7 @@ that are not in danger of quoting @samp{%} characters go unmolested.@refill
|
||||
When a dependency fails to exist in the current directory, if the
|
||||
@var{pattern} in a @code{vpath} directive matches the name of the
|
||||
dependency file, then the @var{directories} in that directive are searched
|
||||
just like (and before) the directories in the @code{VPATH} variable.
|
||||
just like (and before) the directories in the @code{VPATH} variable.
|
||||
|
||||
For example,
|
||||
|
||||
@@ -1782,7 +1773,7 @@ appear in the makefile; multiple directives with the same pattern are
|
||||
independent of each other.
|
||||
|
||||
@need 750
|
||||
Thus,
|
||||
Thus,
|
||||
|
||||
@example
|
||||
@group
|
||||
@@ -1818,7 +1809,7 @@ Therefore, you must write the commands with care so that they will look for
|
||||
the dependency in the directory where @code{make} finds it.
|
||||
|
||||
This is done with the @dfn{automatic variables} such as @samp{$^}
|
||||
(@pxref{Automatic, ,Automatic Variables}).
|
||||
(@pxref{Automatic, ,Automatic Variables}).
|
||||
For instance, the value of @samp{$^} is a
|
||||
list of all the dependencies of the rule, including the names of
|
||||
the directories in which they were found, and the value of
|
||||
@@ -1874,9 +1865,9 @@ directory search with no extra effort.
|
||||
@subsection Directory Search for Link Libraries
|
||||
@cindex link libraries, and directory search
|
||||
@cindex libraries for linking, directory search
|
||||
@cindex directory search (@code{VPATH}), and link libraries
|
||||
@cindex @code{VPATH}, and link libraries
|
||||
@cindex search path for dependencies (@code{VPATH}), and link libraries
|
||||
@cindex directory search (@code{VPATH}), and link libraries
|
||||
@cindex @code{VPATH}, and link libraries
|
||||
@cindex search path for dependencies (@code{VPATH}), and link libraries
|
||||
@cindex @code{-l} (library search)
|
||||
|
||||
Directory search applies in a special way to libraries used with the
|
||||
@@ -2045,7 +2036,7 @@ There is nothing special about the name @samp{FORCE}, but that is one name
|
||||
commonly used this way.
|
||||
|
||||
As you can see, using @samp{FORCE} this way has the same results as using
|
||||
@samp{.PHONY: clean}.
|
||||
@samp{.PHONY: clean}.
|
||||
|
||||
Using @samp{.PHONY} is more explicit and more efficient. However,
|
||||
other versions of @code{make} do not support @samp{.PHONY}; thus
|
||||
@@ -2109,7 +2100,7 @@ time is. @xref{Phony Targets, ,Phony Targets}.
|
||||
@item .SUFFIXES
|
||||
|
||||
The dependencies of the special target @code{.SUFFIXES} are the list
|
||||
of suffixes to be used in checking for suffix rules.
|
||||
of suffixes to be used in checking for suffix rules.
|
||||
@xref{Suffix Rules, , Old-Fashioned Suffix Rules}.
|
||||
|
||||
@findex .DEFAULT
|
||||
@@ -2265,11 +2256,11 @@ the target. If the target is older than any dependency from any rule,
|
||||
the commands are executed.
|
||||
|
||||
There can only be one set of commands to be executed for a file.
|
||||
If more than one rule gives commands for the same file,
|
||||
If more than one rule gives commands for the same file,
|
||||
@code{make} uses the last set given and prints an error message.
|
||||
(As a special case, if the file's name begins with a dot, no
|
||||
error message is printed. This odd behavior is only for
|
||||
compatibility with other implementations of @code{make}.)
|
||||
compatibility with other implementations of @code{make}.)
|
||||
There is no reason to
|
||||
write your makefiles this way; that is why @code{make} gives you
|
||||
an error message.@refill
|
||||
@@ -2511,7 +2502,7 @@ differs depending on which dependency files caused the update, and such
|
||||
cases are rare.
|
||||
|
||||
Each double-colon rule should specify commands; if it does not, an
|
||||
implicit rule will be used if one applies.
|
||||
implicit rule will be used if one applies.
|
||||
@xref{Implicit Rules, ,Using Implicit Rules}.
|
||||
|
||||
@node Automatic Dependencies, , Double-Colon, Rules
|
||||
@@ -2585,13 +2576,13 @@ the new dependencies.
|
||||
Here is the pattern rule to generate a file of dependencies (i.e., a makefile)
|
||||
called @file{@var{name}.d} from a C source file called @file{@var{name}.c}:
|
||||
|
||||
@example
|
||||
@smallexample
|
||||
@group
|
||||
%.d: %.c
|
||||
$(SHELL) -ec '$(CC) -M $(CPPFLAGS) $< \
|
||||
| sed '\''s/$*\\.o[ :]*/& $@@/g'\'' > $@@'
|
||||
| sed '\''s/\($*\)\.o[ :]*/\1 $@@/g'\'' > $@@'
|
||||
@end group
|
||||
@end example
|
||||
@end smallexample
|
||||
|
||||
@noindent
|
||||
@xref{Pattern Rules}, for information on defining pattern rules. The
|
||||
@@ -2605,7 +2596,7 @@ status from the compiler.
|
||||
@cindex @code{-MM} (to GNU compiler)
|
||||
With the GNU C compiler, you may wish to use the @samp{-MM} flag instead
|
||||
of @samp{-M}. This omits dependencies on system header files.
|
||||
@xref{Preprocessor Options, , Options Controlling the Preprocessor,
|
||||
@xref{Preprocessor Options, , Options Controlling the Preprocessor,
|
||||
gcc.info, Using GNU CC}, for details.
|
||||
|
||||
@cindex @code{sed} (shell command)
|
||||
@@ -2680,7 +2671,7 @@ Text on a line before a @samp{#} is not part of the comment.
|
||||
* Echoing:: How to control when commands are echoed.
|
||||
* Execution:: How commands are executed.
|
||||
* Parallel:: How commands can be executed in parallel.
|
||||
* Errors:: What happens after a command execution error.
|
||||
* Errors:: What happens after a command execution error.
|
||||
* Interrupts:: What happens when a command is interrupted.
|
||||
* Recursion:: Invoking @code{make} from makefiles.
|
||||
* Sequences:: Defining canned sequences of commands.
|
||||
@@ -2727,7 +2718,7 @@ actually doing them.
|
||||
The @samp{-s} or @samp{--silent}
|
||||
flag to @code{make} prevents all echoing, as if all commands
|
||||
started with @samp{@@}. A rule in the makefile for the special target
|
||||
@code{.SILENT} without dependencies has the same effect
|
||||
@code{.SILENT} without dependencies has the same effect
|
||||
(@pxref{Special Targets, ,Special Built-in Target Names}).
|
||||
@code{.SILENT} is essentially obsolete since @samp{@@} is more flexible.@refill
|
||||
|
||||
@@ -2841,7 +2832,7 @@ status), and errors are not ignored for that command
|
||||
the remaining command lines to remake the same target will not be run.
|
||||
If a command fails and the @samp{-k} or @samp{--keep-going}
|
||||
option was not given
|
||||
(@pxref{Options Summary, ,Summary of Options}),
|
||||
(@pxref{Options Summary, ,Summary of Options}),
|
||||
@code{make} aborts execution. If make
|
||||
terminates for any reason (including a signal) with child processes
|
||||
running, it waits for them to finish before actually exiting.@refill
|
||||
@@ -2884,7 +2875,7 @@ By default, there is no load limit.
|
||||
After each shell command returns, @code{make} looks at its exit status.
|
||||
If the command completed successfully, the next command line is executed
|
||||
in a new shell; after the last command line is finished, the rule is
|
||||
finished.
|
||||
finished.
|
||||
|
||||
If there is an error (the exit status is nonzero), @code{make} gives up on
|
||||
the current rule, and perhaps on all rules.
|
||||
@@ -2897,7 +2888,7 @@ report an error, but you probably want @code{make} to continue regardless.
|
||||
@cindex @code{-} (in commands)
|
||||
To ignore errors in a command line, write a @samp{-} at the beginning of
|
||||
the line's text (after the initial tab). The @samp{-} is discarded before
|
||||
the command is passed to the shell for execution.
|
||||
the command is passed to the shell for execution.
|
||||
|
||||
For example,
|
||||
|
||||
@@ -3327,14 +3318,6 @@ no more than one.@refill
|
||||
If you do not want to pass the other flags down, you must change the
|
||||
value of @code{MAKEFLAGS}, like this:
|
||||
|
||||
@example
|
||||
MAKEFLAGS=
|
||||
subsystem:
|
||||
cd subdir; $(MAKE)
|
||||
@end example
|
||||
|
||||
or like this:
|
||||
|
||||
@example
|
||||
subsystem:
|
||||
cd subdir; $(MAKE) MAKEFLAGS=
|
||||
@@ -3493,7 +3476,7 @@ always named @file{y.tab.c}. The second command moves the output to the
|
||||
rule's target file name.
|
||||
|
||||
To use the canned sequence, substitute the variable into the commands of a
|
||||
rule. You can substitute it like any other variable
|
||||
rule. You can substitute it like any other variable
|
||||
(@pxref{Reference, ,Basics of Variable References}).
|
||||
Because variables defined by @code{define} are recursively expanded
|
||||
variables, all the variable references you wrote inside the @code{define}
|
||||
@@ -3510,7 +3493,7 @@ foo.c : foo.y
|
||||
|
||||
This is a realistic example, but this particular one is not needed in
|
||||
practice because @code{make} has an implicit rule to figure out these
|
||||
commands based on the file names involved
|
||||
commands based on the file names involved
|
||||
(@pxref{Implicit Rules, ,Using Implicit Rules}).
|
||||
|
||||
@cindex @@, and @code{define}
|
||||
@@ -3570,9 +3553,17 @@ but this would be confusing because such a line looks empty.
|
||||
You may be wondering why you would want to define a command string that
|
||||
does nothing. The only reason this is useful is to prevent a target
|
||||
from getting implicit commands (from implicit rules or the
|
||||
@code{.DEFAULT} special target; @pxref{Implicit Rules} and
|
||||
@code{.DEFAULT} special target; @pxref{Implicit Rules} and
|
||||
@pxref{Last Resort, ,Defining Last-Resort Default Rules}).@refill
|
||||
|
||||
@c !!! another reason is for canonical stamp files:
|
||||
@ignore
|
||||
foo: stamp-foo ;
|
||||
stamp-foo: foo.in
|
||||
create foo frm foo.in
|
||||
touch $@
|
||||
@end ignore
|
||||
|
||||
You may be inclined to define empty command strings for targets that are
|
||||
not actual files, but only exist so that their dependencies can be
|
||||
remade. However, this is not the best way to do that, because the
|
||||
@@ -3607,7 +3598,7 @@ A variable name may be any sequence of characters not containing @samp{:},
|
||||
variable names containing characters other than letters, numbers, and
|
||||
underscores should be avoided, as they may be given special meanings in the
|
||||
future, and with some shells they cannot be passed through the environment to a
|
||||
sub-@code{make}
|
||||
sub-@code{make}
|
||||
(@pxref{Variables/Recursion, ,Communicating Variables to a Sub-@code{make}}).
|
||||
|
||||
Variable names are case-sensitive. The names @samp{foo}, @samp{FOO},
|
||||
@@ -3633,7 +3624,7 @@ they have particular specialized uses. @xref{Automatic, ,Automatic Variables}.
|
||||
of a variable.
|
||||
* Override Directive:: How to set a variable in the makefile even if
|
||||
the user has set it with a command argument.
|
||||
* Defining:: An alternate way to set a variable
|
||||
* Defining:: An alternate way to set a variable
|
||||
to a verbatim string.
|
||||
* Environment:: Variable values can come from the environment.
|
||||
* Automatic:: Some special variables have predefined
|
||||
@@ -3750,7 +3741,7 @@ because it will cause an infinite loop in the variable expansion.
|
||||
@cindex loops in variable expansion
|
||||
@cindex variables, loops in expansion
|
||||
|
||||
Another disadvantage is that any functions
|
||||
Another disadvantage is that any functions
|
||||
(@pxref{Functions, ,Functions for Transforming Text})
|
||||
referenced in the definition will be executed every time the variable is
|
||||
expanded. This makes @code{make} run slower; worse, it causes the
|
||||
@@ -3765,7 +3756,7 @@ variables, there is another flavor: simply expanded variables.
|
||||
@cindex variables, simply expanded
|
||||
@cindex :=
|
||||
@dfn{Simply expanded variables} are defined by lines using @samp{:=}
|
||||
(@pxref{Setting, ,Setting Variables}).
|
||||
(@pxref{Setting, ,Setting Variables}).
|
||||
The value of a simply expanded variable is scanned
|
||||
once and for all, expanding any references to other variables and
|
||||
functions, when the variable is defined. The actual value of the simply
|
||||
@@ -3811,7 +3802,7 @@ endif
|
||||
@end group
|
||||
@end example
|
||||
|
||||
@noindent
|
||||
@noindent
|
||||
An advantage of this use of @samp{:=} is that a typical
|
||||
`descend into a directory' command then looks like this:
|
||||
|
||||
@@ -3826,7 +3817,7 @@ Simply expanded variables generally make complicated makefile programming
|
||||
more predictable because they work like variables in most programming
|
||||
languages. They allow you to redefine a variable using its own value (or
|
||||
its value processed in some way by one of the expansion functions) and to
|
||||
use the expansion functions much more efficiently
|
||||
use the expansion functions much more efficiently
|
||||
(@pxref{Functions, ,Functions for Transforming Text}).
|
||||
|
||||
@cindex spaces, in variable values
|
||||
@@ -3872,7 +3863,7 @@ This section describes some advanced features you can use to reference
|
||||
variables in more flexible ways.
|
||||
|
||||
@menu
|
||||
* Substitution Refs:: Referencing a variable with
|
||||
* Substitution Refs:: Referencing a variable with
|
||||
substitutions on the value.
|
||||
* Computed Names:: Computing the name of the variable to refer to.
|
||||
@end menu
|
||||
@@ -3998,7 +3989,7 @@ which becomes @samp{$(z)} which becomes @samp{Hello}.
|
||||
Nested variable references can also contain modified references and
|
||||
function invocations (@pxref{Functions, ,Functions for Transforming Text}),
|
||||
just like any other reference.
|
||||
For example, using the @code{subst} function
|
||||
For example, using the @code{subst} function
|
||||
(@pxref{Text Functions, ,Functions for String Substitution and Analysis}):
|
||||
|
||||
@example
|
||||
@@ -4192,7 +4183,7 @@ to read.
|
||||
Most variable names are considered to have the empty string as a value if
|
||||
you have never set them. Several variables have built-in initial values
|
||||
that are not empty, but you can set them in the usual ways
|
||||
(@pxref{Implicit Variables, ,Variables Used by Implicit Rules}).
|
||||
(@pxref{Implicit Variables, ,Variables Used by Implicit Rules}).
|
||||
Several special variables are set
|
||||
automatically to a new value for each rule; these are called the
|
||||
@dfn{automatic} variables (@pxref{Automatic, ,Automatic Variables}).
|
||||
@@ -4334,7 +4325,7 @@ value.
|
||||
@cindex overriding with @code{override}
|
||||
@cindex variables, overriding
|
||||
|
||||
If a variable has been set with a command argument
|
||||
If a variable has been set with a command argument
|
||||
(@pxref{Overriding, ,Overriding Variables}),
|
||||
then ordinary assignments in the makefile are ignored. If you want to set
|
||||
the variable in the makefile even though it was set with a command
|
||||
@@ -4402,7 +4393,7 @@ See the next section for information about @code{define}.
|
||||
Another way to set the value of a variable is to use the @code{define}
|
||||
directive. This directive has an unusual syntax which allows newline
|
||||
characters to be included in the value, which is convenient for defining
|
||||
canned sequences of commands
|
||||
canned sequences of commands
|
||||
(@pxref{Sequences, ,Defining Canned Command Sequences}).
|
||||
|
||||
The @code{define} directive is followed on the same line by the name of the
|
||||
@@ -4749,7 +4740,7 @@ not attempt to terminate the conditional inside the included file.
|
||||
|
||||
You can write a conditional that tests @code{make} command flags such as
|
||||
@samp{-t} by using the variable @code{MAKEFLAGS} together with the
|
||||
@code{findstring} function
|
||||
@code{findstring} function
|
||||
(@pxref{Text Functions, , Functions for String Substitution and Analysis}).
|
||||
This is useful when @code{touch} is not enough to make a file appear up
|
||||
to date.
|
||||
@@ -4922,11 +4913,11 @@ References}) are a simpler way to get the effect of the @code{patsubst}
|
||||
function:
|
||||
|
||||
@example
|
||||
$(@var{var}:@var{pattern}=@var{replacement})
|
||||
$(@var{var}:@var{pattern}=@var{replacement})
|
||||
@end example
|
||||
|
||||
@noindent
|
||||
is equivalent to
|
||||
is equivalent to
|
||||
|
||||
@example
|
||||
$(patsubst @var{pattern},@var{replacement},$(@var{var}))
|
||||
@@ -4936,11 +4927,11 @@ The second shorthand simplifies one of the most common uses of
|
||||
@code{patsubst}: replacing the suffix at the end of file names.
|
||||
|
||||
@example
|
||||
$(@var{var}:@var{suffix}=@var{replacement})
|
||||
$(@var{var}:@var{suffix}=@var{replacement})
|
||||
@end example
|
||||
|
||||
@noindent
|
||||
is equivalent to
|
||||
is equivalent to
|
||||
|
||||
@example
|
||||
$(patsubst %@var{suffix},%@var{replacement},$(@var{var}))
|
||||
@@ -5093,8 +5084,8 @@ it for this purpose even if you don't care about the sort order.
|
||||
Here is a realistic example of the use of @code{subst} and
|
||||
@code{patsubst}. Suppose that a makefile uses the @code{VPATH} variable
|
||||
to specify a list of directories that @code{make} should search for
|
||||
dependency files
|
||||
(@pxref{General Search, , @code{VPATH} Search Path for All Dependencies}).
|
||||
dependency files
|
||||
(@pxref{General Search, , @code{VPATH} Search Path for All Dependencies}).
|
||||
This example shows how to
|
||||
tell the C compiler to search for header files in the same list of
|
||||
directories.@refill
|
||||
@@ -5287,7 +5278,7 @@ returns @samp{bar}.
|
||||
@item $(words @var{text})
|
||||
@findex words
|
||||
@cindex words, finding number
|
||||
Returns the number of words in @var{text}.
|
||||
Returns the number of words in @var{text}.
|
||||
Thus, the last word of @var{text} is
|
||||
@w{@code{$(word $(words @var{text}),@var{text})}}.@refill
|
||||
|
||||
@@ -5524,7 +5515,7 @@ Here the redefinition takes place if @samp{$(origin bletch)} returns either
|
||||
@cindex shell command, function for
|
||||
|
||||
The @code{shell} function is unlike any other function except the
|
||||
@code{wildcard} function
|
||||
@code{wildcard} function
|
||||
(@pxref{Wildcard Function, ,The Function @code{wildcard}}) in that it
|
||||
communicates with the world outside of @code{make}.
|
||||
|
||||
@@ -5590,16 +5581,16 @@ determines that some target is not already up to date.
|
||||
|
||||
@menu
|
||||
* Makefile Arguments:: How to specify which makefile to use.
|
||||
* Goals:: How to use goal arguments to specify which
|
||||
* Goals:: How to use goal arguments to specify which
|
||||
parts of the makefile to use.
|
||||
* Instead of Execution:: How to use mode flags to specify what
|
||||
kind of thing to do with the commands
|
||||
in the makefile other than simply
|
||||
kind of thing to do with the commands
|
||||
in the makefile other than simply
|
||||
execute them.
|
||||
* Avoiding Compilation:: How to avoid recompiling certain files.
|
||||
* Overriding:: How to override a variable to specify
|
||||
* Overriding:: How to override a variable to specify
|
||||
an alternate compiler and other things.
|
||||
* Testing:: How to proceed past some errors, to
|
||||
* Testing:: How to proceed past some errors, to
|
||||
test compilation.
|
||||
* Options Summary:: Summary of Options
|
||||
@end menu
|
||||
@@ -5794,7 +5785,7 @@ words, neither compilation nor output will occur.
|
||||
|
||||
``What if''. Each @samp{-W} flag is followed by a file name. The given
|
||||
files' modification times are recorded by @code{make} as being the present
|
||||
time, although the actual modification times remain the same.
|
||||
time, although the actual modification times remain the same.
|
||||
You can use the @samp{-W} flag in conjunction with the @samp{-n} flag
|
||||
to see what would happen if you were to modify specific files.@refill
|
||||
@end table
|
||||
@@ -6295,10 +6286,10 @@ retained for compatibility.
|
||||
* Implicit Variables:: How to change what predefined rules do.
|
||||
* Chained Rules:: How to use a chain of implicit rules.
|
||||
* Pattern Rules:: How to define new implicit rules.
|
||||
* Last Resort:: How to defining commands for rules
|
||||
* Last Resort:: How to defining commands for rules
|
||||
which cannot find any.
|
||||
* Suffix Rules:: The old-fashioned style of implicit rule.
|
||||
* Search Algorithm:: The precise algorithm for applying
|
||||
* Search Algorithm:: The precise algorithm for applying
|
||||
implicit rules.
|
||||
@end menu
|
||||
|
||||
@@ -6580,8 +6571,8 @@ the list of implicit rule suffixes with:@refill
|
||||
@cindex @code{lint}, rule to run
|
||||
@pindex .ln
|
||||
@file{@var{n}.ln} is made from @file{@var{n}.c} by running @code{lint}.
|
||||
The precise command is @w{@samp{$(LINT) $(LINTFLAGS) $(CPPFLAGS) -i}}.
|
||||
The same command is used on the C code produced from
|
||||
The precise command is @w{@samp{$(LINT) $(LINTFLAGS) $(CPPFLAGS) -i}}.
|
||||
The same command is used on the C code produced from
|
||||
@file{@var{n}.y} or @file{@var{n}.l}.@refill
|
||||
|
||||
@item @TeX{} and Web
|
||||
@@ -6628,8 +6619,8 @@ Any file @file{@var{n}} is extracted if necessary from an RCS file
|
||||
named either @file{@var{n},v} or @file{RCS/@var{n},v}. The precise
|
||||
command used is @w{@samp{$(CO) $(COFLAGS)}}. @file{@var{n}} will not be
|
||||
extracted from RCS if it already exists, even if the RCS file is
|
||||
newer. The rules for RCS are terminal
|
||||
(@pxref{Match-Anything Rules, ,Match-Anything Pattern Rules}),
|
||||
newer. The rules for RCS are terminal
|
||||
(@pxref{Match-Anything Rules, ,Match-Anything Pattern Rules}),
|
||||
so RCS files cannot be generated from another source; they must
|
||||
actually exist.@refill
|
||||
|
||||
@@ -6913,7 +6904,7 @@ deletion is reported to you by printing a @samp{rm -f} command that
|
||||
shows what @code{make} is doing. (You can list the target pattern of an
|
||||
implicit rule (such as @samp{%.o}) as a dependency of the special
|
||||
target @code{.PRECIOUS} to preserve intermediate files made by implicit
|
||||
rules whose target patterns match that file's name;
|
||||
rules whose target patterns match that file's name;
|
||||
see @ref{Interrupts}.)@refill
|
||||
@cindex intermediate files, preserving
|
||||
@cindex preserving intermediate files
|
||||
@@ -7798,7 +7789,7 @@ named @file{file.o}. In connection with such usage, the automatic variables
|
||||
@cindex @code{__.SYMDEF}
|
||||
@cindex updating archive symbol directories
|
||||
@cindex archive symbol directory updating
|
||||
@cindex symbol directories, updating archive
|
||||
@cindex symbol directories, updating archive
|
||||
@cindex directories, updating archive symbol
|
||||
|
||||
An archive file that is used as a library usually contains a special member
|
||||
@@ -7914,8 +7905,8 @@ Many features come from the version of @code{make} in System V.
|
||||
|
||||
@itemize @bullet
|
||||
@item
|
||||
The @code{VPATH} variable and its special meaning.
|
||||
@xref{Directory Search, , Searching Directories for Dependencies}.
|
||||
The @code{VPATH} variable and its special meaning.
|
||||
@xref{Directory Search, , Searching Directories for Dependencies}.
|
||||
This feature exists in System V @code{make}, but is undocumented.
|
||||
It is documented in 4.3 BSD @code{make} (which says it mimics System V's
|
||||
@code{VPATH} feature).@refill
|
||||
@@ -7999,7 +7990,7 @@ did. @xref{Automatic, ,Automatic Variables}. The automatic variable
|
||||
|
||||
@item
|
||||
The ``what if'' flag (@samp{-W} in GNU @code{make}) was (as far as we know)
|
||||
invented by Andrew Hume in @code{mk}.
|
||||
invented by Andrew Hume in @code{mk}.
|
||||
@xref{Instead of Execution, ,Instead of Executing the Commands}.
|
||||
|
||||
@item
|
||||
@@ -8045,7 +8036,7 @@ The remaining features are inventions new in GNU @code{make}:
|
||||
Use the @samp{-v} or @samp{--version} option to print version and
|
||||
copyright information.
|
||||
|
||||
@item
|
||||
@item
|
||||
Use the @samp{-h} or @samp{--help} option to summarize the options to
|
||||
@code{make}.
|
||||
|
||||
@@ -8062,7 +8053,7 @@ Use the @samp{-C} or @samp{--directory} command option to change
|
||||
directory. @xref{Options Summary, ,Summary of Options}.
|
||||
|
||||
@item
|
||||
Make verbatim variable definitions with @code{define}.
|
||||
Make verbatim variable definitions with @code{define}.
|
||||
@xref{Defining, ,Defining Variables Verbatim}.
|
||||
|
||||
@item
|
||||
@@ -8073,7 +8064,7 @@ different syntax in his @code{mk} program. This seems to be a case of
|
||||
parallel discovery. @xref{Phony Targets, ,Phony Targets}.
|
||||
|
||||
@item
|
||||
Manipulate text by calling functions.
|
||||
Manipulate text by calling functions.
|
||||
@xref{Functions, ,Functions for Transforming Text}.
|
||||
|
||||
@item
|
||||
@@ -8104,11 +8095,11 @@ same file.@refill
|
||||
|
||||
@item
|
||||
Use a special search method for library dependencies written in the
|
||||
form @samp{-l@var{name}}.
|
||||
form @samp{-l@var{name}}.
|
||||
@xref{Libraries/Search, ,Directory Search for Link Libraries}.
|
||||
|
||||
@item
|
||||
Allow suffixes for suffix rules
|
||||
Allow suffixes for suffix rules
|
||||
(@pxref{Suffix Rules, ,Old-Fashioned Suffix Rules}) to contain any
|
||||
characters. In other versions of @code{make}, they must begin with
|
||||
@samp{.} and not contain any @samp{/} characters.
|
||||
@@ -8121,11 +8112,11 @@ variable @code{MAKELEVEL}. @xref{Recursion, ,Recursive Use of @code{make}}.
|
||||
Specify static pattern rules. @xref{Static Pattern, ,Static Pattern Rules}.
|
||||
|
||||
@item
|
||||
Provide selective @code{vpath} search.
|
||||
Provide selective @code{vpath} search.
|
||||
@xref{Directory Search, ,Searching Directories for Dependencies}.
|
||||
|
||||
@item
|
||||
Provide computed variable references.
|
||||
Provide computed variable references.
|
||||
@xref{Reference, ,Basics of Variable References}.
|
||||
|
||||
@item
|
||||
@@ -8134,7 +8125,7 @@ System V @code{make} has a very, very limited form of this
|
||||
functionality in that it will check out SCCS files for makefiles.
|
||||
|
||||
@item
|
||||
Various new built-in implicit rules.
|
||||
Various new built-in implicit rules.
|
||||
@xref{Catalogue of Rules, ,Catalogue of Implicit Rules}.
|
||||
|
||||
@item
|
||||
@@ -8144,7 +8135,7 @@ The built-in variable @samp{MAKE_VERSION} gives the version number of
|
||||
|
||||
@node Missing, Makefile Conventions, Features, Top
|
||||
@chapter Incompatibilities and Missing Features
|
||||
@cindex incompatibilities
|
||||
@cindex incompatibilities
|
||||
@cindex missing features
|
||||
@cindex features, missing
|
||||
|
||||
@@ -8161,22 +8152,22 @@ being an object file which defines the linker symbol @var{entry}.@refill
|
||||
|
||||
This feature was not put into GNU @code{make} because of the
|
||||
nonmodularity of putting knowledge into @code{make} of the internal
|
||||
format of archive file symbol tables.
|
||||
format of archive file symbol tables.
|
||||
@xref{Archive Symbols, ,Updating Archive Symbol Directories}.
|
||||
|
||||
@item
|
||||
Suffixes (used in suffix rules) that end with the character @samp{~}
|
||||
have a special meaning to System V @code{make};
|
||||
have a special meaning to System V @code{make};
|
||||
they refer to the SCCS file that corresponds
|
||||
to the file one would get without the @samp{~}. For example, the
|
||||
suffix rule @samp{.c~.o} would make the file @file{@var{n}.o} from
|
||||
the SCCS file @file{s.@var{n}.c}. For complete coverage, a whole
|
||||
series of such suffix rules is required.
|
||||
series of such suffix rules is required.
|
||||
@xref{Suffix Rules, ,Old-Fashioned Suffix Rules}.
|
||||
|
||||
In GNU @code{make}, this entire series of cases is handled by two
|
||||
pattern rules for extraction from SCCS, in combination with the
|
||||
general feature of rule chaining.
|
||||
general feature of rule chaining.
|
||||
@xref{Chained Rules, ,Chains of Implicit Rules}.
|
||||
|
||||
@item
|
||||
@@ -8188,7 +8179,7 @@ This is not defined in GNU @code{make} because @samp{$$} should always
|
||||
stand for an ordinary @samp{$}.
|
||||
|
||||
It is possible to get this functionality through the use of static pattern
|
||||
rules (@pxref{Static Pattern, ,Static Pattern Rules}).
|
||||
rules (@pxref{Static Pattern, ,Static Pattern Rules}).
|
||||
The System V @code{make} rule:
|
||||
|
||||
@example
|
||||
@@ -8470,7 +8461,7 @@ dependencies which are archive members, only the member named is used
|
||||
dependencies, while @code{$+} retains them and preserves their order.
|
||||
|
||||
@item $*
|
||||
The stem with which an implicit rule matches
|
||||
The stem with which an implicit rule matches
|
||||
(@pxref{Pattern Match, ,How Patterns Match}).
|
||||
|
||||
@item $(@@D)
|
||||
@@ -8513,7 +8504,7 @@ Makefiles to be read on every invocation of @code{make}.@*
|
||||
@item VPATH
|
||||
|
||||
Directory search path for files not found in the current directory.@*
|
||||
@xref{General Search, , @code{VPATH} Search Path for All Dependencies}.
|
||||
@xref{General Search, , @code{VPATH} Search Path for All Dependencies}.
|
||||
|
||||
@item SHELL
|
||||
|
||||
@@ -8616,60 +8607,60 @@ INSTALLDATA = /usr/local/bin/install -c -m 644
|
||||
# Things you might add to DEFS:
|
||||
# -DSTDC_HEADERS If you have ANSI C headers and
|
||||
# libraries.
|
||||
# -DPOSIX If you have POSIX.1 headers and
|
||||
# -DPOSIX If you have POSIX.1 headers and
|
||||
# libraries.
|
||||
# -DBSD42 If you have sys/dir.h (unless
|
||||
# you use -DPOSIX), sys/file.h,
|
||||
# -DBSD42 If you have sys/dir.h (unless
|
||||
# you use -DPOSIX), sys/file.h,
|
||||
# and st_blocks in `struct stat'.
|
||||
# -DUSG If you have System V/ANSI C
|
||||
# string and memory functions
|
||||
# and headers, sys/sysmacros.h,
|
||||
# fcntl.h, getcwd, no valloc,
|
||||
# and ndir.h (unless
|
||||
# -DUSG If you have System V/ANSI C
|
||||
# string and memory functions
|
||||
# and headers, sys/sysmacros.h,
|
||||
# fcntl.h, getcwd, no valloc,
|
||||
# and ndir.h (unless
|
||||
# you use -DDIRENT).
|
||||
# -DNO_MEMORY_H If USG or STDC_HEADERS but do not
|
||||
# -DNO_MEMORY_H If USG or STDC_HEADERS but do not
|
||||
# include memory.h.
|
||||
# -DDIRENT If USG and you have dirent.h
|
||||
# -DDIRENT If USG and you have dirent.h
|
||||
# instead of ndir.h.
|
||||
# -DSIGTYPE=int If your signal handlers
|
||||
# -DSIGTYPE=int If your signal handlers
|
||||
# return int, not void.
|
||||
# -DNO_MTIO If you lack sys/mtio.h
|
||||
# -DNO_MTIO If you lack sys/mtio.h
|
||||
# (magtape ioctls).
|
||||
# -DNO_REMOTE If you do not have a remote shell
|
||||
# -DNO_REMOTE If you do not have a remote shell
|
||||
# or rexec.
|
||||
# -DUSE_REXEC To use rexec for remote tape
|
||||
# operations instead of
|
||||
# operations instead of
|
||||
# forking rsh or remsh.
|
||||
# -DVPRINTF_MISSING If you lack vprintf function
|
||||
# -DVPRINTF_MISSING If you lack vprintf function
|
||||
# (but have _doprnt).
|
||||
# -DDOPRNT_MISSING If you lack _doprnt function.
|
||||
# Also need to define
|
||||
# -DDOPRNT_MISSING If you lack _doprnt function.
|
||||
# Also need to define
|
||||
# -DVPRINTF_MISSING.
|
||||
# -DFTIME_MISSING If you lack ftime system call.
|
||||
# -DSTRSTR_MISSING If you lack strstr function.
|
||||
# -DVALLOC_MISSING If you lack valloc function.
|
||||
# -DMKDIR_MISSING If you lack mkdir and
|
||||
# -DMKDIR_MISSING If you lack mkdir and
|
||||
# rmdir system calls.
|
||||
# -DRENAME_MISSING If you lack rename system call.
|
||||
# -DFTRUNCATE_MISSING If you lack ftruncate
|
||||
# -DFTRUNCATE_MISSING If you lack ftruncate
|
||||
# system call.
|
||||
# -DV7 On Version 7 Unix (not
|
||||
# -DV7 On Version 7 Unix (not
|
||||
# tested in a long time).
|
||||
# -DEMUL_OPEN3 If you lack a 3-argument version
|
||||
# of open, and want to emulate it
|
||||
# -DEMUL_OPEN3 If you lack a 3-argument version
|
||||
# of open, and want to emulate it
|
||||
# with system calls you do have.
|
||||
# -DNO_OPEN3 If you lack the 3-argument open
|
||||
# and want to disable the tar -k
|
||||
# and want to disable the tar -k
|
||||
# option instead of emulating open.
|
||||
# -DXENIX If you have sys/inode.h
|
||||
# -DXENIX If you have sys/inode.h
|
||||
# and need it 94 to be included.
|
||||
|
||||
DEFS = -DSIGTYPE=int -DDIRENT -DSTRSTR_MISSING \
|
||||
-DVPRINTF_MISSING -DBSD42
|
||||
# Set this to rtapelib.o unless you defined NO_REMOTE,
|
||||
# Set this to rtapelib.o unless you defined NO_REMOTE,
|
||||
# in which case make it empty.
|
||||
RTAPELIB = rtapelib.o
|
||||
LIBS =
|
||||
LIBS =
|
||||
DEF_AR_FILE = /dev/rmt8
|
||||
DEFBLOCKING = 20
|
||||
|
||||
@@ -8683,9 +8674,9 @@ LDFLAGS = -g
|
||||
|
||||
@group
|
||||
prefix = /usr/local
|
||||
# Prefix for each installed program,
|
||||
# Prefix for each installed program,
|
||||
# normally empty or `g'.
|
||||
binprefix =
|
||||
binprefix =
|
||||
|
||||
# The directory to install tar in.
|
||||
bindir = $(prefix)/bin
|
||||
@@ -8783,7 +8774,7 @@ shar: $(SRCS) $(AUX)
|
||||
shar $(SRCS) $(AUX) | compress \
|
||||
> tar-`sed -e '/version_string/!d' \
|
||||
-e 's/[^0-9.]*\([0-9.]*\).*/\1/' \
|
||||
-e q
|
||||
-e q
|
||||
version.c`.shar.Z
|
||||
@end group
|
||||
|
||||
@@ -8792,7 +8783,7 @@ dist: $(SRCS) $(AUX)
|
||||
echo tar-`sed \
|
||||
-e '/version_string/!d' \
|
||||
-e 's/[^0-9.]*\([0-9.]*\).*/\1/' \
|
||||
-e q
|
||||
-e q
|
||||
version.c` > .fname
|
||||
-rm -rf `cat .fname`
|
||||
mkdir `cat .fname`
|
||||
|
||||
57
misc.c
57
misc.c
@@ -50,9 +50,8 @@ collapse_continuations (line)
|
||||
return;
|
||||
|
||||
out = in;
|
||||
if (out > line)
|
||||
while (out[-1] == '\\')
|
||||
--out;
|
||||
while (out > line && out[-1] == '\\')
|
||||
--out;
|
||||
|
||||
while (*in != '\0')
|
||||
{
|
||||
@@ -174,15 +173,25 @@ concat (s1, s2, s3)
|
||||
/* Print a message on stdout. */
|
||||
|
||||
void
|
||||
message (s1, s2, s3, s4, s5, s6)
|
||||
message (prefix, s1, s2, s3, s4, s5, s6)
|
||||
int prefix;
|
||||
char *s1, *s2, *s3, *s4, *s5, *s6;
|
||||
{
|
||||
if (makelevel == 0)
|
||||
printf ("%s: ", program);
|
||||
else
|
||||
printf ("%s[%u]: ", program, makelevel);
|
||||
printf (s1, s2, s3, s4, s5, s6);
|
||||
putchar ('\n');
|
||||
log_working_directory (1);
|
||||
|
||||
if (s1 != 0)
|
||||
{
|
||||
if (prefix)
|
||||
{
|
||||
if (makelevel == 0)
|
||||
printf ("%s: ", program);
|
||||
else
|
||||
printf ("%s[%u]: ", program, makelevel);
|
||||
}
|
||||
printf (s1, s2, s3, s4, s5, s6);
|
||||
putchar ('\n');
|
||||
}
|
||||
|
||||
fflush (stdout);
|
||||
}
|
||||
|
||||
@@ -193,6 +202,8 @@ void
|
||||
fatal (s1, s2, s3, s4, s5, s6)
|
||||
char *s1, *s2, *s3, *s4, *s5, *s6;
|
||||
{
|
||||
log_working_directory (1);
|
||||
|
||||
if (makelevel == 0)
|
||||
fprintf (stderr, "%s: *** ", program);
|
||||
else
|
||||
@@ -211,6 +222,8 @@ void
|
||||
error (s1, s2, s3, s4, s5, s6)
|
||||
char *s1, *s2, *s3, *s4, *s5, *s6;
|
||||
{
|
||||
log_working_directory (1);
|
||||
|
||||
if (makelevel == 0)
|
||||
fprintf (stderr, "%s: ", program);
|
||||
else
|
||||
@@ -226,6 +239,8 @@ makefile_error (file, lineno, s1, s2, s3, s4, s5, s6)
|
||||
unsigned int lineno;
|
||||
char *s1, *s2, *s3, *s4, *s5, *s6;
|
||||
{
|
||||
log_working_directory (1);
|
||||
|
||||
fprintf (stderr, "%s:%u: ", file, lineno);
|
||||
fprintf (stderr, s1, s2, s3, s4, s5, s6);
|
||||
putc ('\n', stderr);
|
||||
@@ -238,6 +253,8 @@ makefile_fatal (file, lineno, s1, s2, s3, s4, s5, s6)
|
||||
unsigned int lineno;
|
||||
char *s1, *s2, *s3, *s4, *s5, *s6;
|
||||
{
|
||||
log_working_directory (1);
|
||||
|
||||
fprintf (stderr, "%s:%u: *** ", file, lineno);
|
||||
fprintf (stderr, s1, s2, s3, s4, s5, s6);
|
||||
fputs (". Stop.\n", stderr);
|
||||
@@ -716,23 +733,3 @@ get_path_max ()
|
||||
return value;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* On some systems, stat can return EINTR. */
|
||||
|
||||
int
|
||||
safe_stat (name, buf)
|
||||
char *name;
|
||||
struct stat *buf;
|
||||
{
|
||||
int ret;
|
||||
|
||||
#ifdef EINTR
|
||||
do
|
||||
#endif
|
||||
ret = stat (name, buf);
|
||||
#ifdef EINTR
|
||||
while (ret < 0 && errno == EINTR);
|
||||
#endif
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
56
read.c
56
read.c
@@ -37,7 +37,6 @@ static int read_makefile ();
|
||||
static unsigned int readline (), do_define ();
|
||||
static int conditional_line ();
|
||||
static void record_files ();
|
||||
static char *find_semicolon ();
|
||||
|
||||
|
||||
/* A `struct linebuffer' is a structure which holds a line of text.
|
||||
@@ -75,7 +74,7 @@ struct conditionals
|
||||
|
||||
static struct conditionals toplevel_conditionals;
|
||||
static struct conditionals *conditionals = &toplevel_conditionals;
|
||||
|
||||
|
||||
|
||||
/* Default directories to search for include files in */
|
||||
|
||||
@@ -192,6 +191,9 @@ read_all_makefiles (makefiles)
|
||||
/* No default makefile was found. Add the default makefiles to the
|
||||
`read_makefiles' chain so they will be updated if possible. */
|
||||
struct dep *tail = read_makefiles;
|
||||
/* Add them to the tail, after any MAKEFILES variable makefiles. */
|
||||
while (tail != 0 && tail->next != 0)
|
||||
tail = tail->next;
|
||||
for (p = default_makefiles; *p != 0; ++p)
|
||||
{
|
||||
struct dep *d = (struct dep *) xmalloc (sizeof (struct dep));
|
||||
@@ -654,9 +656,16 @@ read_makefile (filename, flags)
|
||||
|
||||
record_waiting_files ();
|
||||
|
||||
/* Look for a semicolon in the unexpanded line. */
|
||||
cmdleft = find_semicolon (lb.buffer);
|
||||
if (cmdleft != 0)
|
||||
/* Search the line for an unquoted ; that is not after an
|
||||
unquoted #. */
|
||||
cmdleft = find_char_unquote (lb.buffer, ";#", 0);
|
||||
if (cmdleft != 0 && *cmdleft == '#')
|
||||
{
|
||||
/* We found a comment before a semicolon. */
|
||||
*cmdleft = '\0';
|
||||
cmdleft = 0;
|
||||
}
|
||||
else if (cmdleft != 0)
|
||||
/* Found one. Cut the line short there before expanding it. */
|
||||
*cmdleft = '\0';
|
||||
|
||||
@@ -668,15 +677,12 @@ read_makefile (filename, flags)
|
||||
|
||||
if (cmdleft == 0)
|
||||
/* Look for a semicolon in the expanded line. */
|
||||
cmdleft = find_semicolon (p);
|
||||
cmdleft = find_char_unquote (p, ";", 0);
|
||||
|
||||
if (cmdleft != 0)
|
||||
/* Cut the line short at the semicolon. */
|
||||
*cmdleft = '\0';
|
||||
|
||||
/* Remove comments from the line. */
|
||||
remove_comments (p);
|
||||
|
||||
p2 = next_token (p);
|
||||
if (*p2 == '\0')
|
||||
{
|
||||
@@ -1248,7 +1254,7 @@ record_files (filenames, pattern, pattern_percent, deps, commands_started,
|
||||
d->name = savestring (buffer, o - buffer);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (!two_colon)
|
||||
{
|
||||
/* Single-colon. Combine these dependencies
|
||||
@@ -1488,19 +1494,6 @@ find_percent (pattern)
|
||||
{
|
||||
return find_char_unquote (pattern, "%", 0);
|
||||
}
|
||||
|
||||
/* Search STRING for an unquoted ; that is not after an unquoted #. */
|
||||
|
||||
static char *
|
||||
find_semicolon (string)
|
||||
char *string;
|
||||
{
|
||||
char *match = find_char_unquote (string, ";#", 0);
|
||||
if (match != 0 && *match == '#')
|
||||
/* We found a comment before a semicolon. No match. */
|
||||
match = 0;
|
||||
return match;
|
||||
}
|
||||
|
||||
/* Parse a string into a sequence of filenames represented as a
|
||||
chain of struct nameseq's in reverse order and return that chain.
|
||||
@@ -1659,7 +1652,7 @@ parse_file_seq (stringp, stopchar, size, strip)
|
||||
/* Trace back from NEW1 (the end of the list) until N
|
||||
(the beginning of the list), rewriting each name
|
||||
with the full archive reference. */
|
||||
|
||||
|
||||
while (new1 != n)
|
||||
{
|
||||
name = concat (libname, new1->name, ")");
|
||||
@@ -1761,7 +1754,7 @@ readline (linebuffer, stream, filename, lineno)
|
||||
else
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
if (!backslash)
|
||||
{
|
||||
p[-1] = '\0';
|
||||
@@ -1819,7 +1812,7 @@ construct_include_path (arg_dirs)
|
||||
dir = expanded;
|
||||
}
|
||||
|
||||
if (safe_stat (dir, &stbuf) == 0 && S_ISDIR (stbuf.st_mode))
|
||||
if (stat (dir, &stbuf) == 0 && S_ISDIR (stbuf.st_mode))
|
||||
{
|
||||
if (idx == max - 1)
|
||||
{
|
||||
@@ -1836,7 +1829,7 @@ construct_include_path (arg_dirs)
|
||||
/* Now add at the end the standard default dirs. */
|
||||
|
||||
for (i = 0; default_include_directories[i] != 0; ++i)
|
||||
if (safe_stat (default_include_directories[i], &stbuf) == 0
|
||||
if (stat (default_include_directories[i], &stbuf) == 0
|
||||
&& S_ISDIR (stbuf.st_mode))
|
||||
dirs[idx++] = default_include_directories[i];
|
||||
|
||||
@@ -1882,7 +1875,7 @@ tilde_expand (name)
|
||||
|
||||
warn_undefined_variables_flag = save;
|
||||
}
|
||||
|
||||
|
||||
is_variable = home_dir[0] != '\0';
|
||||
if (!is_variable)
|
||||
{
|
||||
@@ -1945,13 +1938,16 @@ multi_glob (chain, size)
|
||||
struct nameseq *chain;
|
||||
unsigned int size;
|
||||
{
|
||||
extern void dir_setup_glob ();
|
||||
register struct nameseq *new = 0;
|
||||
register struct nameseq *old;
|
||||
struct nameseq *nexto;
|
||||
glob_t gl;
|
||||
|
||||
dir_setup_glob (&gl);
|
||||
|
||||
for (old = chain; old != 0; old = nexto)
|
||||
{
|
||||
glob_t gl;
|
||||
#ifndef NO_ARCHIVES
|
||||
char *memname;
|
||||
#endif
|
||||
@@ -1985,7 +1981,7 @@ multi_glob (chain, size)
|
||||
memname = 0;
|
||||
#endif
|
||||
|
||||
switch (glob (old->name, GLOB_NOCHECK, NULL, &gl))
|
||||
switch (glob (old->name, GLOB_NOCHECK|GLOB_ALTDIRFUNC, NULL, &gl))
|
||||
{
|
||||
case 0: /* Success. */
|
||||
{
|
||||
|
||||
44
remake.c
44
remake.c
@@ -1,5 +1,5 @@
|
||||
/* Basic dependency engine for GNU Make.
|
||||
Copyright (C) 1988, 89, 90, 91, 92, 93, 94, 1995 Free Software Foundation, Inc.
|
||||
Copyright (C) 1988,89,90,91,92,93,94,95,96 Free Software Foundation, Inc.
|
||||
This file is part of GNU Make.
|
||||
|
||||
GNU Make is free software; you can redistribute it and/or modify
|
||||
@@ -133,7 +133,7 @@ update_goal_chain (goals, makefiles)
|
||||
by calling update_file above. We check this flag below to
|
||||
decide when to give an "up to date" diagnostic. */
|
||||
g->changed += commands_started - ocommands_started;
|
||||
|
||||
|
||||
stop = 0;
|
||||
if (x != 0 || file->updated)
|
||||
{
|
||||
@@ -195,14 +195,10 @@ update_goal_chain (goals, makefiles)
|
||||
&& file->update_status == 0 && !g->changed
|
||||
/* Never give a message under -s or -q. */
|
||||
&& !silent_flag && !question_flag)
|
||||
{
|
||||
if (file->phony || file->cmds == 0)
|
||||
message ("Nothing to be done for `%s'.",
|
||||
file->name);
|
||||
else
|
||||
message ("`%s' is up to date.", file->name);
|
||||
fflush (stdout);
|
||||
}
|
||||
message (1, ((file->phony || file->cmds == 0)
|
||||
? "Nothing to be done for `%s'."
|
||||
: "`%s' is up to date."),
|
||||
file->name);
|
||||
|
||||
/* This goal is finished. Remove it from the chain. */
|
||||
if (lastgoal == 0)
|
||||
@@ -769,10 +765,7 @@ touch_file (file)
|
||||
register struct file *file;
|
||||
{
|
||||
if (!silent_flag)
|
||||
{
|
||||
printf ("touch %s\n", file->name);
|
||||
fflush (stdout);
|
||||
}
|
||||
message (0, "touch %s", file->name);
|
||||
|
||||
#ifndef NO_ARCHIVES
|
||||
if (ar_name (file->name))
|
||||
@@ -986,6 +979,27 @@ f_mtime (file, search)
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
/* Files can have bogus timestamps that nothing newly made will be
|
||||
"newer" than. Updating their dependents could just result in loops.
|
||||
So notify the user of the anomaly by treating future files as
|
||||
unrecoverably absent. */
|
||||
|
||||
static time_t now;
|
||||
if (mtime > now && ! file->updated)
|
||||
{
|
||||
/* This file's time appears to be in the future.
|
||||
Update our concept of the present, and compare again. */
|
||||
extern time_t time ();
|
||||
if (mtime > time (&now))
|
||||
{
|
||||
error ("*** File `%s' has modification time in the future",
|
||||
file->name);
|
||||
file->update_status = 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Store the mtime into all the entries for this file. */
|
||||
if (file->double_colon)
|
||||
file = file->double_colon;
|
||||
@@ -1007,7 +1021,7 @@ name_mtime (name)
|
||||
{
|
||||
struct stat st;
|
||||
|
||||
if (safe_stat (name, &st) < 0)
|
||||
if (stat (name, &st) < 0)
|
||||
return (time_t) -1;
|
||||
|
||||
return (time_t) st.st_mtime;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
char *version_string = "3.73.3";
|
||||
char *version_string = "3.74.3";
|
||||
|
||||
/*
|
||||
Local variables:
|
||||
|
||||
4
vpath.c
4
vpath.c
@@ -1,5 +1,5 @@
|
||||
/* Implementation of pattern-matching file search paths for GNU Make.
|
||||
Copyright (C) 1988, 1989, 1991, 1992, 1993, 1994 Free Software Foundation, Inc.
|
||||
Copyright (C) 1988, 89, 91, 92, 93, 94, 95 Free Software Foundation, Inc.
|
||||
This file is part of GNU Make.
|
||||
|
||||
GNU Make is free software; you can redistribute it and/or modify
|
||||
@@ -419,7 +419,7 @@ selective_vpath_search (path, file, mtime_ptr)
|
||||
*n = '/';
|
||||
|
||||
if (!exists_in_cache /* Makefile-mentioned file need not exist. */
|
||||
|| safe_stat (name, &st) == 0) /* Does it really exist? */
|
||||
|| stat (name, &st) == 0) /* Does it really exist? */
|
||||
{
|
||||
/* We have found a file.
|
||||
Store the name we found into *FILE for the caller. */
|
||||
|
||||
Reference in New Issue
Block a user