mirror of
https://github.com/mirror/make.git
synced 2026-08-20 00:43:29 +08:00
Compare commits
206 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a22f67aaf7 | ||
|
|
9fc574683d | ||
|
|
c8e016d07a | ||
|
|
c396f06a21 | ||
|
|
fc47a2c83c | ||
|
|
561b384313 | ||
|
|
88942403a6 | ||
|
|
8733fbd646 | ||
|
|
cf2db2cf3c | ||
|
|
f0cea20864 | ||
|
|
fcb18b988b | ||
|
|
8b24ec18b0 | ||
|
|
df5ba0ef96 | ||
|
|
74475bb939 | ||
|
|
22ffba3660 | ||
|
|
9603eb13a0 | ||
|
|
fde68d03f3 | ||
|
|
56162c4968 | ||
|
|
f78bcc2e72 | ||
|
|
0c23819036 | ||
|
|
91a7257252 | ||
|
|
d5f0b88095 | ||
|
|
3024918fcd | ||
|
|
bdc49369eb | ||
|
|
610526fee7 | ||
|
|
3f60c36245 | ||
|
|
bd88059c38 | ||
|
|
63f3cf925b | ||
|
|
8541e3345d | ||
|
|
d86e4a26c8 | ||
|
|
2c973c0b46 | ||
|
|
e0620ee179 | ||
|
|
dac23b2d0b | ||
|
|
783e6680b2 | ||
|
|
2529deb2bf | ||
|
|
3d3252b8de | ||
|
|
b14b16769c | ||
|
|
e7a525c5d5 | ||
|
|
d369e0531a | ||
|
|
6701f24bbb | ||
|
|
e76076e334 | ||
|
|
673e04af3a | ||
|
|
bc8ac28654 | ||
|
|
95744a1491 | ||
|
|
78f280d541 | ||
|
|
44811ac351 | ||
|
|
6cf0e549f7 | ||
|
|
25d9818333 | ||
|
|
2a905c5e5a | ||
|
|
0ddf0df13c | ||
|
|
b4dcc6f6bd | ||
|
|
c8484a6170 | ||
|
|
7431536bed | ||
|
|
678b14fb7e | ||
|
|
efbe1b6411 | ||
|
|
5fb14db85f | ||
|
|
df99d7af1f | ||
|
|
db561cfc3e | ||
|
|
0feb1dd25f | ||
|
|
e2d8bf4aa4 | ||
|
|
dc27ebc311 | ||
|
|
989d9ecaae | ||
|
|
b0098dfd6a | ||
|
|
40a08e8a62 | ||
|
|
5e728dfa57 | ||
|
|
085eac4c74 | ||
|
|
085caaa900 | ||
|
|
cc28a52f40 | ||
|
|
1e38c11f3c | ||
|
|
58af8d9dd1 | ||
|
|
abe5f64440 | ||
|
|
68b9650616 | ||
|
|
5dfa403ec8 | ||
|
|
f7ecda9a35 | ||
|
|
e99a3aca7e | ||
|
|
73c52a3b12 | ||
|
|
4679c702de | ||
|
|
59cb26b58b | ||
|
|
386e27b622 | ||
|
|
68db062e1e | ||
|
|
a67e842fb1 | ||
|
|
712c43dde1 | ||
|
|
c0e8c1012d | ||
|
|
c97502625c | ||
|
|
9e443adaf6 | ||
|
|
dfefc77263 | ||
|
|
ee7af57e3c | ||
|
|
46a1497b8e | ||
|
|
4603f9f8c6 | ||
|
|
b2a22df721 | ||
|
|
89785948f6 | ||
|
|
8b2aca5930 | ||
|
|
b8ea37e31c | ||
|
|
e044fe76f6 | ||
|
|
557392f016 | ||
|
|
eaecc11501 | ||
|
|
b25f811f51 | ||
|
|
34b0c6b3b4 | ||
|
|
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 |
@@ -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.
|
||||
499
ChangeLog
499
ChangeLog
@@ -1,3 +1,492 @@
|
||||
Fri Jul 19 16:57:27 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
|
||||
|
||||
* Version 3.74.6.
|
||||
|
||||
* GNUmakefile (win32files): New variable.
|
||||
(distfiles): Add it.
|
||||
* w32: Updated by Rob Tulloh.
|
||||
|
||||
* makefile.vms (LOADLIBES): Fix typo.
|
||||
|
||||
Sun Jul 14 12:59:27 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
|
||||
|
||||
* job.c (construct_command_argv_internal): Fix up #else, #endifs.
|
||||
|
||||
* configh.dos: Define HAVE_DIRENT_H instead of DIRENT.
|
||||
|
||||
* remake.c (f_mtime): Don't compare MTIME to NOW if MTIME == -1.
|
||||
|
||||
* Version 3.74.5.
|
||||
|
||||
* main.c (main): Exit with status 2 when update_goal_chain returns 2.
|
||||
|
||||
Sat Jun 22 14:56:05 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
|
||||
|
||||
* configure.in: Don't check for _sys_siglist.
|
||||
* make.h [HAVE__SYS_SIGLIST]: Don't test this; just punt if there is
|
||||
no strsignal or sys_siglist.
|
||||
|
||||
* read.c (conditional_line): Strip ws in `ifeq (a , b)' so it is the
|
||||
same as `ifeq (a, b)'.
|
||||
|
||||
* job.c (reap_children): Don't call die if handling_fatal_signal.
|
||||
|
||||
* file.c (file_hash_enter): Allow renaming :: to : when latter is
|
||||
non-target, or : to :: when former is non-target.
|
||||
|
||||
* job.c (start_job_command): Call block_sigs.
|
||||
(block_sigs): New function, broken out of start_job_command.
|
||||
(reap_children): Block fatal signals around removing dead child from
|
||||
chain and adjusting job_slots_used.
|
||||
* job.h: Declare block_sigs.
|
||||
|
||||
* remote-stub.c (remote_setup, remote_cleanup): New (empty) functions.
|
||||
* main.c (main): Call remote_setup.
|
||||
(die): Call remote_cleanup.
|
||||
|
||||
* job.c (reap_children): Quiescent value of shell_function_pid is
|
||||
zero, not -1.
|
||||
|
||||
* main.c (print_version): Add 96 to copyright years.
|
||||
|
||||
Sat Jun 15 20:30:01 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
|
||||
|
||||
* read.c (find_char_unquote): Avoid calling strlen on every call
|
||||
just to throw away the value most of the time.
|
||||
|
||||
Sun Jun 2 12:24:01 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
|
||||
|
||||
* main.c (decode_env_switches): Prepend '-' to ARGV[1] if it contains
|
||||
no '=', regardless of ARGC.
|
||||
(define_makeflags): Elide leading '-' from MAKEFLAGS value if first
|
||||
word is short option, regardless of WORDS.
|
||||
|
||||
Wed May 22 17:24:51 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
|
||||
|
||||
* makefile.vms: Set LOADLIBES.
|
||||
* makefile.com (link_using_library): Fix typo.
|
||||
|
||||
Wed May 15 17:37:26 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
|
||||
|
||||
* dir.c (print_dir_data_base): Use %ld dev and ino and cast them to
|
||||
long.
|
||||
|
||||
Wed May 15 10:14:14 CDT 1996 Rob Tulloh <tulloh@tivoli.com>
|
||||
|
||||
* dir.c: WIN32 does not support inode. For now, fully qualified
|
||||
pathname along with st_mtime will be keys for files.
|
||||
Fixed problem where vpath can be confused when files
|
||||
are added to a directory after the directory has already been
|
||||
read in. The code now attempts to reread the directory if it
|
||||
discovers that the datestamp on the directory has changed since
|
||||
it was cached by make. This problem only seems to occur on WIN32
|
||||
right now so it is lumped under port #ifdef WIN32.
|
||||
|
||||
* function.c: WIN32: call subproc library (CreateProcess()) instead of
|
||||
fork/exec.
|
||||
|
||||
* job.c: WIN32: Added the code to do fork/exec/waitpid style processing
|
||||
on WIN32 systems via calls to subproc library.
|
||||
|
||||
* main.c: WIN32: Several things added here. First, there is code
|
||||
for dealing with PATH and SHELL defaults. Make tries to figure
|
||||
out if the user has %PATH% set in the environment and sets it to
|
||||
%Path% if it is not set already. Make also looks to see if sh.exe
|
||||
is anywhere to be found. Code path through job.c will change
|
||||
based on existence of a working Bourne shell. The checking for
|
||||
default shell is done twice: once before makefiles are read in
|
||||
and again after. Fall back to MSDOS style execution mode if no sh.exe
|
||||
is found. Also added some debug support that allows user to pause make
|
||||
with -D switch and attach a debugger. This is especially useful for
|
||||
debugging recursive calls to make where problems appear only in the
|
||||
sub-make.
|
||||
|
||||
* make.h: WIN32: A few macros and header files for WIN32 support.
|
||||
|
||||
* misc.c: WIN32: Added a function end_of_token_w32() to assist
|
||||
in parsing code in read.c.
|
||||
|
||||
* read.c: WIN32: Fixes similar to MSDOS which allow colon to
|
||||
appear in filenames. Use of colon in filenames would otherwise
|
||||
confuse make.
|
||||
|
||||
* remake.c: WIN32: Added include of io.h to eliminate compiler
|
||||
warnings. Added some code to default LIBDIR if it is not set
|
||||
on WIN32.
|
||||
|
||||
* variable.c: WIN32: Added support for detecting Path/PATH
|
||||
and converting them to semicolon separated lists for make's
|
||||
internal use. New function sync_Path_environment()
|
||||
which is called in job.c and function.c before creating a new
|
||||
process. Caller must set Path in environment since we don't
|
||||
have fork() to do this for us.
|
||||
|
||||
* vpath.c: WIN32: Added detection for filenames containing
|
||||
forward or backward slashes.
|
||||
|
||||
* NMakefile: WIN32: Visual C compatible makefile for use with nmake.
|
||||
Use this to build GNU make the first time on Windows NT or Windows 95.
|
||||
|
||||
* README.WIN32: WIN32: Contains some helpful notes.
|
||||
|
||||
* build_w32.bat: WIN32: If you don't like nmake, use this the first
|
||||
time you build GNU make on Windows NT or Windows 95.
|
||||
|
||||
* config.h.WIN32: WIN32 version of config.h
|
||||
|
||||
* subproc.bat: WIN32: A bat file used to build the
|
||||
subproc library from the top-level NMakefile. Needed because
|
||||
WIndows 95 (nmake) doesn't allow you to cd in a make rule.
|
||||
|
||||
* w32/include/dirent.h
|
||||
* w32/compat/dirent.c: WIN32: opendir, readdir, closedir, etc.
|
||||
|
||||
* w32/include/pathstuff.h: WIN32: used by files needed functions
|
||||
defined in pathstuff.c (prototypes).
|
||||
|
||||
* w32/include/sub_proc.h: WIN32: prototypes for subproc.lib functions.
|
||||
|
||||
* w32/include/w32err.h: WIN32: prototypes for w32err.c.
|
||||
|
||||
* w32/pathstuff.c: WIN32: File and Path/Path conversion functions.
|
||||
|
||||
* w32/subproc/build.bat: WIN32: build script for subproc library
|
||||
if you don't wish to use nmake.
|
||||
|
||||
* w32/subproc/NMakefile: WIN32: Visual C compatible makefile for use
|
||||
with nmake. Used to build subproc library.
|
||||
|
||||
* w32/subproc/misc.c: WIN32: subproc library support code
|
||||
* w32/subproc/proc.h: WIN32: subproc library support code
|
||||
* w32/subproc/sub_proc.c: WIN32: subproc library source code
|
||||
* w32/subproc/w32err.c: WIN32: subproc library support code
|
||||
|
||||
Mon May 13 14:37:42 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
|
||||
|
||||
* Version 3.74.4.
|
||||
|
||||
* GNUmakefile (vmsfiles): Fix typo.
|
||||
|
||||
* GNUmakefile (amigafiles): Add amiga.h.
|
||||
|
||||
Sun May 12 19:19:43 1996 Aaron Digulla <digulla@fh-konstanz.de>
|
||||
|
||||
* dir.c: New function: amigafy() to fold filenames
|
||||
Changes HASH() to HASHI() to fold filenames on Amiga.
|
||||
Stringcompares use strieq() instead of streq()
|
||||
The current directory on Amiga is "" instead of "."
|
||||
* file.c: Likewise.
|
||||
|
||||
* amiga.c: New function wildcard_expansion(). Allows to use
|
||||
Amiga wildcards with $(wildcard )
|
||||
|
||||
* amiga.h: New file. Prototypes for amiga.c
|
||||
|
||||
* function.c: Use special function wildcard_expansion() for
|
||||
$(wildcard ) to allow Amiga wildcards
|
||||
The current directory on Amiga is "" instead of "."
|
||||
|
||||
* job.c: No Pipes on Amiga, too
|
||||
(load_too_high) Neither on Amiga
|
||||
ENV variable on Amiga are in a special directory and are not
|
||||
passed as third argument to main().
|
||||
|
||||
* job.h: No envp on Amiga
|
||||
|
||||
* make.h: Added HASHI(). This is the same as HASH() but converts
|
||||
it's second parameter to lowercase on Amiga to fold filenames.
|
||||
|
||||
* main.c: (main), variable.c Changed handling of ENV-vars. Make
|
||||
stores now the names of the variables only and reads their contents
|
||||
when they are accessed to reflect that these variables are really
|
||||
global (ie. they CAN change WHILE make runs !) This handling is
|
||||
made in lookup_variable()
|
||||
|
||||
* Makefile.ami: renamed file.h to filedep.h
|
||||
Updated dependencies
|
||||
|
||||
* read.c: "find_semicolon" is declared as static but never defined.
|
||||
No difference between Makefile and makefile on Amiga; added
|
||||
SMakefile to *default_makefiles[].
|
||||
(read_makefile) SAS/C want's two_colon and pattern_percent be set
|
||||
before use.
|
||||
The current directory on Amiga is "" instead of "."
|
||||
Strange #endif moved.
|
||||
|
||||
* README.Amiga: updated feature list
|
||||
|
||||
* SMakefile: Updated dependencies
|
||||
|
||||
* variable.c: Handling of ENV variable happens inside lookup_variable()
|
||||
|
||||
Sat May 11 17:58:32 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
|
||||
|
||||
* variable.c (try_variable_definition): Count parens in lhs variable
|
||||
refs to avoid seeing =/:=/+= inside a ref.
|
||||
|
||||
Thu May 9 13:54:49 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
|
||||
|
||||
* commands.c (fatal_error_signal) [SIGQUIT]: Make SIGQUIT check
|
||||
conditional.
|
||||
|
||||
* main.c (main): Use unsigned for fread return.
|
||||
|
||||
* read.c (parse_file_seq): Use `int' for char arg to avoid widening
|
||||
conflict issues.
|
||||
* dep.h: Fix prototype.
|
||||
|
||||
* function.c (expand_function) [_AMIGA]: Fix some typos.
|
||||
(patsubst_expand): Make len vars unsigned.
|
||||
|
||||
* GNUmakefile (globfiles): Add AmigaDOS support files.
|
||||
(distfiles): Add $(amigafiles).
|
||||
(amigafiles): New variable.
|
||||
|
||||
Thu Nov 7 10:18:16 1995 Aaron Digulla <digulla@fh-konstanz.de>
|
||||
|
||||
* Added Amiga support in commands.c, dir.c, function.c,
|
||||
job.c, main.c, make.h, read.c, remake.c
|
||||
* commands.c: Amiga has neither SIGHUP nor SIGQUIT
|
||||
* dir.c: Amiga has filenames with Upper- and Lowercase,
|
||||
but "FileName" is the same as "filename". Added strieq()
|
||||
which is use to compare filenames. This is like streq()
|
||||
on all other systems. Also there is no such thing as
|
||||
"." under AmigaDOS.
|
||||
* function.c: On Amiga, the environment is not passed as envp,
|
||||
there are no pipes and Amiga can't fork. Use my own function
|
||||
to create a new child.
|
||||
* job.c: default_shell is "" (The system automatically chooses
|
||||
a shell for me). Have to use the same workaround as MSDOS for
|
||||
running batch commands. Added HAVE_SYS_PARAM_H. NOFILE isn't
|
||||
known on Amiga. Cloned code to run children from MSDOS. Own
|
||||
version of sh_chars[] and sh_cmds[]. No dup2() or dup() on Amiga.
|
||||
* main.c: Force stack to 20000 bytes. Read environment from ENV:
|
||||
device. On Amiga, exec_command() does return, so I exit()
|
||||
afterwards.
|
||||
* make.h: Added strieq() to compare filenames.
|
||||
* read.c: Amiga needs special extension to have passwd. Only
|
||||
one include-dir. "Makefile" and "makefile" are the same.
|
||||
Added "SMakefile". Added special code to handle device names (xxx:)
|
||||
and "./" in rules.
|
||||
* remake.c: Only one lib-dir. Amiga link-libs are named "%s.lib"
|
||||
instead of "lib%s.a".
|
||||
* main.c, rule.c, variable.c: Avoid floats at all costs.
|
||||
* vpath.c: Get rid of as many alloca()s as possible.
|
||||
|
||||
Thu May 9 13:20:43 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
|
||||
|
||||
* read.c (read_makefile): Grok `sinclude' as alias for `-include'.
|
||||
|
||||
Wed Mar 20 09:52:27 1996 Roland McGrath <roland@charlie-brown.gnu.ai.mit.edu>
|
||||
|
||||
* GNUmakefile (vmsfiles): New variable.
|
||||
(distfiles): Include $(vmsfiles).
|
||||
|
||||
Tue Mar 19 20:21:34 1996 Roland McGrath <roland@charlie-brown.gnu.ai.mit.edu>
|
||||
|
||||
Merged VMS port from Klaus Kaempf <kkaempf@didymus.rmi.de>.
|
||||
* make.h (PARAMS): New macro.
|
||||
* config.h-vms: New file.
|
||||
* makefile.com: New file.
|
||||
* makefile.vms: New file.
|
||||
* readme.vms: New file.
|
||||
* vmsdir.h: New file.
|
||||
* vmsfunctions.c: New file.
|
||||
* vmsify.c: New file.
|
||||
* file.h: Renamed to filedef.h to avoid conflict with VMS system hdr.
|
||||
* ar.c: Added prototypes and changes for VMS.
|
||||
* commands.c: Likewise.
|
||||
* commands.h: Likewise.
|
||||
* default.c: Likewise.
|
||||
* dep.h: Likewise.
|
||||
* dir.c: Likewise.
|
||||
* expand.c: Likewise.
|
||||
* file.c: Likewise.
|
||||
* function.c: Likewise.
|
||||
* implicit.c: Likewise.
|
||||
* job.c: Likewise.
|
||||
* job.h: Likewise.
|
||||
* main.c: Likewise.
|
||||
* make.h: Likewise.
|
||||
* misc.c: Likewise.
|
||||
* read.c: Likewise.
|
||||
* remake.c: Likewise.
|
||||
* remote-stub.c: Likewise.
|
||||
* rule.c: Likewise.
|
||||
* rule.h: Likewise.
|
||||
* variable.c: Likewise.
|
||||
* variable.h: Likewise.
|
||||
* vpath.c: Likewise.
|
||||
* compatMakefile (srcs): Rename file.h to filedef.h.
|
||||
|
||||
Sat Aug 19 23:11:00 1995 Richard Stallman <rms@mole.gnu.ai.mit.edu>
|
||||
|
||||
* remake.c (check_dep): For a secondary file, try implicit and
|
||||
default rules if appropriate.
|
||||
|
||||
Wed Aug 2 04:29:42 1995 Richard Stallman <rms@mole.gnu.ai.mit.edu>
|
||||
|
||||
* remake.c (check_dep): If an intermediate file exists,
|
||||
do consider its actual date.
|
||||
|
||||
Sun Jul 30 00:49:53 1995 Richard Stallman <rms@mole.gnu.ai.mit.edu>
|
||||
|
||||
* file.h (struct file): New field `secondary'.
|
||||
* file.c (snap_deps): Check for .INTERMEDIATE and .SECONDARY.
|
||||
(remove_intermediates): Don't delete .SECONDARY files.
|
||||
|
||||
Sat Mar 2 16:26:52 1996 Roland McGrath <roland@charlie-brown.gnu.ai.mit.edu>
|
||||
|
||||
* compatMakefile (srcs): Add getopt.h; prepend $(srcdir)/ to getopt*.
|
||||
|
||||
Fri Mar 1 12:04:47 1996 Roland McGrath <roland@charlie-brown.gnu.ai.mit.edu>
|
||||
|
||||
* Version 3.74.3.
|
||||
|
||||
* remake.c (f_mtime): Move future modtime check before FILE is
|
||||
clobbered by :: loop.
|
||||
|
||||
* 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.
|
||||
@@ -22,7 +511,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.
|
||||
@@ -1908,7 +2397,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.
|
||||
|
||||
@@ -2207,7 +2696,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.
|
||||
|
||||
@@ -2905,7 +3394,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.
|
||||
@@ -2923,7 +3412,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)
|
||||
|
||||
37
GNUmakefile
37
GNUmakefile
@@ -1,8 +1,8 @@
|
||||
# GNU Make-specific makefile for GNU Make.
|
||||
|
||||
# Copyright (C) 1990, 91, 92, 93, 94, 95 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1990, 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)
|
||||
@@ -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,17 @@ $(prog): $(objs) $(globdep) #$(addprefix $(ARCH)/,gmalloc.o mcheck.o)
|
||||
$(CC) $(LDFLAGS) $^ $(globlib) $(LOADLIBES) -o $@.new
|
||||
mv -f $@.new $@
|
||||
|
||||
libc-srcdir = ../libc
|
||||
globfiles = $(addprefix glob/,COPYING.LIB configure.in configure Makefile.in \
|
||||
Makefile.ami SCOPTIONS SMakefile \
|
||||
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:
|
||||
@@ -184,7 +187,7 @@ Makefile.in: compatMakefile $(nolib-deps:remote-%.dep=remote-stub.dep)
|
||||
.SUFFIXES: .dep
|
||||
# Maintain the automatically-generated dependencies.
|
||||
ifndef no_deps
|
||||
include $(depfiles)
|
||||
-include $(depfiles)
|
||||
endif
|
||||
$(archpfx)%.dep: %.c
|
||||
$(mkdep) $< | sed 's,$*\.o,$(@:.dep=.o) $@,' > $@
|
||||
@@ -220,10 +223,22 @@ dist: cvs-mark default info dvi tests tarfiles
|
||||
.PHONY: tarfiles
|
||||
tarfiles: $(tarfiles)
|
||||
|
||||
vmsfiles = config.h-vms makefile.com makefile.vms readme.vms \
|
||||
vmsdir.h vmsfunctions.c vmsify.c
|
||||
amigafiles = README.Amiga config.ami Makefile.ami SCOPTIONS SMakefile \
|
||||
amiga.c amiga.h make.lnk
|
||||
win32files = README.WIN32 build_w32.bat config.h.WIN32 subproc.bat \
|
||||
$(addprefix w32/,pathstuff.c compat/dirent.c include/dirent.h \
|
||||
include/pathstuff.h include/sub_proc.h \
|
||||
include/w32err.h subproc/NMakefile \
|
||||
subproc/build.bat subproc/misc.c \
|
||||
subproc/proc.h subproc/sub_proc.c \
|
||||
subproc/w32err.c)
|
||||
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) \
|
||||
$(amigafiles) $(vmsfiles) $(win32files) \
|
||||
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.
|
||||
|
||||
309
Makefile.ami
Normal file
309
Makefile.ami
Normal file
@@ -0,0 +1,309 @@
|
||||
# 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.
|
||||
# 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)
|
||||
# any later version.
|
||||
#
|
||||
# GNU Make 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 GNU Make; see the file COPYING. If not, write to
|
||||
# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
#
|
||||
# Makefile for GNU Make
|
||||
#
|
||||
|
||||
# Ultrix 2.2 make doesn't expand the value of VPATH.
|
||||
VPATH = /make-3.74/
|
||||
# This must repeat the value, because configure will remove `VPATH = .'.
|
||||
srcdir = /make-3.74/
|
||||
|
||||
CC = sc
|
||||
RM = delete
|
||||
|
||||
CFLAGS =
|
||||
CPPFLAGS =
|
||||
LDFLAGS =
|
||||
|
||||
# Define these for your system as follows:
|
||||
# -DNO_ARCHIVES To disable `ar' archive support.
|
||||
# -DNO_FLOAT To avoid using floating-point numbers.
|
||||
# -DENUM_BITFIELDS If the compiler isn't GCC but groks enum foo:2.
|
||||
# Some compilers apparently accept this
|
||||
# without complaint but produce losing code,
|
||||
# so beware.
|
||||
# NeXT 1.0a uses an old version of GCC, which required -D__inline=inline.
|
||||
# See also `config.h'.
|
||||
defines =
|
||||
|
||||
# Which flavor of remote job execution support to use.
|
||||
# The code is found in `remote-$(REMOTE).c'.
|
||||
REMOTE = stub
|
||||
|
||||
# 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/glob.lib
|
||||
|
||||
# If your system doesn't have alloca, or the one provided is bad, define this.
|
||||
ALLOCA = alloca.o
|
||||
ALLOCA_SRC = $(srcdir)alloca.c
|
||||
|
||||
# If your system needs extra libraries loaded in, define them here.
|
||||
# System V probably need -lPW for alloca. HP-UX 7.0's alloca in
|
||||
# libPW.a is broken on HP9000s300 and HP9000s400 machines. Use
|
||||
# alloca.c instead on those machines.
|
||||
LOADLIBES =
|
||||
|
||||
# Any extra object files your system needs.
|
||||
extras = amiga.o
|
||||
|
||||
# Common prefix for machine-independent installed files.
|
||||
prefix =
|
||||
# Common prefix for machine-dependent installed files.
|
||||
exec_prefix =
|
||||
|
||||
# Directory to install `make' in.
|
||||
bindir = sc:c
|
||||
# Directory to find libraries in for `-lXXX'.
|
||||
libdir = lib:
|
||||
# Directory to search by default for included makefiles.
|
||||
includedir = include:
|
||||
# Directory to install the Info files in.
|
||||
infodir = doc:
|
||||
# Directory to install the man page in.
|
||||
mandir = t:
|
||||
# Number to put on the man page filename.
|
||||
manext = 1
|
||||
# Prefix to put on installed `make' binary file name.
|
||||
binprefix =
|
||||
# Prefix to put on installed `make' man page file name.
|
||||
manprefix = $(binprefix)
|
||||
|
||||
# Whether or not make needs to be installed setgid.
|
||||
# The value should be either `true' or `false'.
|
||||
# On many systems, the getloadavg function (used to implement the `-l'
|
||||
# switch) will not work unless make is installed setgid kmem.
|
||||
install_setgid = false
|
||||
# Install make setgid to this group so it can read /dev/kmem.
|
||||
group = sys
|
||||
|
||||
# Program to install `make'.
|
||||
INSTALL_PROGRAM = copy
|
||||
# Program to install the man page.
|
||||
INSTALL_DATA = copy
|
||||
# Generic install program.
|
||||
INSTALL = copy
|
||||
|
||||
# Program to format Texinfo source into Info files.
|
||||
MAKEINFO = makeinfo
|
||||
# Program to format Texinfo source into DVI files.
|
||||
TEXI2DVI = texi2dvi
|
||||
|
||||
# Programs to make tags files.
|
||||
ETAGS = etags -w
|
||||
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 \
|
||||
$(GETOPT) $(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 \
|
||||
$(srcdir)rule.c $(srcdir)implicit.c $(srcdir)default.c \
|
||||
$(srcdir)variable.c $(srcdir)expand.c $(srcdir)function.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)commands.h $(srcdir)dep.h $(srcdir)filedep.h \
|
||||
$(srcdir)job.h $(srcdir)make.h $(srcdir)rule.h \
|
||||
$(srcdir)variable.h $(ALLOCA_SRC) $(srcdir)config.h.in
|
||||
|
||||
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .o .c .h .ps .dvi .info .texinfo
|
||||
|
||||
all: make
|
||||
info: make.info
|
||||
dvi: make.dvi
|
||||
# Some makes apparently use .PHONY as the default goal if it is before `all'.
|
||||
.PHONY: all check info dvi
|
||||
|
||||
make.info: make.texinfo
|
||||
$(MAKEINFO) -I$(srcdir) $(srcdir)make.texinfo -o make.info
|
||||
|
||||
make.dvi: make.texinfo
|
||||
$(TEXI2DVI) $(srcdir)make.texinfo
|
||||
|
||||
make.ps: make.dvi
|
||||
dvi2ps make.dvi > make.ps
|
||||
|
||||
make: $(objs) $(GLOB)
|
||||
$(CC) Link $(LDFLAGS) $(objs) Lib $(GLOB) $(LOADLIBES) To make.new
|
||||
-delete make
|
||||
rename make.new make
|
||||
|
||||
TMPFILE = t:Make$$
|
||||
|
||||
$(GLOB):
|
||||
cd glob @@\
|
||||
$(MAKE) -$(MAKEFLAGS) -f Makefile
|
||||
|
||||
# -I. is needed to find config.h in the build directory.
|
||||
OUTPUT_OPTION =
|
||||
.c.o:
|
||||
$(CC) $(defines) IDir "" IDir glob \
|
||||
$(CPPFLAGS) $(CFLAGS) $< $(OUTPUT_OPTION)
|
||||
|
||||
# For some losing Unix makes.
|
||||
SHELL = /bin/sh
|
||||
#@SET_MAKE@
|
||||
|
||||
glob/libglob.a: FORCE config.h
|
||||
cd glob; $(MAKE) libglob.a
|
||||
FORCE:
|
||||
|
||||
tagsrcs = $(srcs) $(srcdir)remote-*.c
|
||||
|
||||
.PHONY: install installdirs
|
||||
install: installdirs \
|
||||
$(bindir)$(binprefix)make $(infodir)make.info \
|
||||
$(mandir)$(manprefix)make.$(manext)
|
||||
|
||||
installdirs:
|
||||
$(SHELL) ${srcdir}/mkinstalldirs $(bindir) $(infodir) $(mandir)
|
||||
|
||||
$(bindir)$(binprefix)make: make
|
||||
$(INSTALL_PROGRAM) make $@.new
|
||||
@if $(install_setgid); then \
|
||||
if chgrp $(group) $@.new && chmod g+s $@.new; then \
|
||||
echo "chgrp $(group) $@.new && chmod g+s $@.new"; \
|
||||
else \
|
||||
echo "$@ needs to be owned by group $(group) and setgid;"; \
|
||||
echo "otherwise the \`-l' option will probably not work."; \
|
||||
echo "You may need special privileges to install $@."; \
|
||||
fi; \
|
||||
else true; fi
|
||||
# Some systems can't deal with renaming onto a running binary.
|
||||
-$(RM) $@.old
|
||||
-mv $@ $@.old
|
||||
mv $@.new $@
|
||||
|
||||
$(infodir)make.info: make.info
|
||||
if [ -r ./make.info ]; then dir=.; else dir=$(srcdir); fi; \
|
||||
for file in $${dir}/make.info*; do \
|
||||
name="`basename $$file`"; \
|
||||
$(INSTALL_DATA) $$file \
|
||||
`echo $@ | sed "s,make.info\$$,$$name,"`; \
|
||||
done
|
||||
# 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 \
|
||||
if [ -r ./make.info ]; then dir=.; else dir=$(srcdir); fi; \
|
||||
install-info --infodir=$(infodir) $$dir/make.info; \
|
||||
else true; fi
|
||||
|
||||
$(mandir)$(manprefix)make.$(manext): make.man
|
||||
$(INSTALL_DATA) $(srcdir)make.man $@
|
||||
|
||||
|
||||
loadavg: loadavg.c config.h
|
||||
$(CC) $(defines) -DTEST -I. -I$(srcdir) $(CFLAGS) $(LDFLAGS) \
|
||||
loadavg.c $(LOADLIBES) -o $@
|
||||
# We copy getloadavg.c into a different file rather than compiling it
|
||||
# directly because some compilers clobber getloadavg.o in the process.
|
||||
loadavg.c: getloadavg.c
|
||||
ln $(srcdir)getloadavg.c loadavg.c || \
|
||||
cp $(srcdir)getloadavg.c loadavg.c
|
||||
check-loadavg: loadavg
|
||||
@echo The system uptime program believes the load average to be:
|
||||
-uptime
|
||||
@echo The GNU load average checking code believes:
|
||||
./loadavg
|
||||
check: check-loadavg
|
||||
|
||||
|
||||
.PHONY: clean realclean distclean mostlyclean
|
||||
clean: glob-clean
|
||||
-$(RM) make loadavg "#?.o" core make.dvi
|
||||
|
||||
distclean: clean glob-realclean
|
||||
-$(RM) Makefile config.h config.status build.sh stamp-config
|
||||
-$(RM) config.log config.cache
|
||||
-$(RM) TAGS tags
|
||||
-$(RM) make.?? make.??s make.log make.toc make.*aux
|
||||
-$(RM) loadavg.c
|
||||
|
||||
realclean: distclean
|
||||
-$(RM) make.info*
|
||||
mostlyclean: clean
|
||||
|
||||
.PHONY: glob-clean glob-realclean
|
||||
glob-clean glob-realclean:
|
||||
cd glob @@\
|
||||
$(MAKE) $@
|
||||
|
||||
# This tells versions [3.59,3.63) of GNU make not to export all variables.
|
||||
.NOEXPORT:
|
||||
|
||||
# The automatically generated dependencies below may omit config.h
|
||||
# because it is included with ``#include <config.h>'' rather than
|
||||
# ``#include "config.h"''. So we add the explicit dependency to make sure.
|
||||
$(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 filedef.h variable.h job.h \
|
||||
commands.h
|
||||
job.o: job.c make.h job.h filedef.h commands.h variable.h
|
||||
dir.o: dir.c make.h
|
||||
file.o: file.c make.h dep.h filedef.h job.h commands.h variable.h
|
||||
misc.o: misc.c make.h dep.h
|
||||
main.o: main.c make.h dep.h filedef.h variable.h job.h commands.h \
|
||||
getopt.h
|
||||
read.o: read.c make.h dep.h filedef.h job.h commands.h variable.h \
|
||||
glob/glob.h
|
||||
remake.o: remake.c make.h filedef.h job.h commands.h dep.h
|
||||
rule.o: rule.c make.h dep.h filedef.h job.h commands.h variable.h \
|
||||
rule.h
|
||||
implicit.o: implicit.c make.h rule.h dep.h filedef.h
|
||||
default.o: default.c make.h rule.h dep.h filedef.h job.h commands.h \
|
||||
variable.h
|
||||
variable.o: variable.c make.h dep.h filedef.h job.h commands.h \
|
||||
variable.h
|
||||
expand.o: expand.c make.h filedef.h job.h commands.h variable.h
|
||||
function.o: function.c make.h filedef.h variable.h dep.h job.h \
|
||||
commands.h amiga.h
|
||||
vpath.o: vpath.c make.h filedef.h variable.h
|
||||
version.o: version.c
|
||||
ar.o: ar.c make.h filedef.h dep.h
|
||||
arscan.o: arscan.c make.h
|
||||
signame.o: signame.c signame.h
|
||||
remote-stub.o: remote-stub.c make.h filedef.h job.h commands.h
|
||||
getopt.o: getopt.c
|
||||
getopt1.o : getopt1.c getopt.h
|
||||
getloadavg.o: getloadavg.c
|
||||
amiga.o: amiga.c make.h variable.h amiga.h
|
||||
68
Makefile.in
68
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,8 +120,9 @@ 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)/commands.h $(srcdir)/dep.h $(srcdir)/file.h \
|
||||
$(srcdir)/signame.c $(srcdir)/signame.h \
|
||||
$(srcdir)/getopt.c $(srcdir)/getopt1.c $(srcdir)/getopt.h \
|
||||
$(srcdir)/commands.h $(srcdir)/dep.h $(srcdir)/filedef.h \
|
||||
$(srcdir)/job.h $(srcdir)/make.h $(srcdir)/rule.h \
|
||||
$(srcdir)/variable.h $(ALLOCA_SRC) $(srcdir)/config.h.in
|
||||
|
||||
@@ -282,26 +271,33 @@ $(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
|
||||
job.o: job.c make.h commands.h job.h file.h variable.h
|
||||
commands.o: commands.c make.h dep.h filedef.h variable.h job.h \
|
||||
commands.h
|
||||
job.o: job.c make.h job.h filedef.h commands.h variable.h
|
||||
dir.o: dir.c make.h
|
||||
file.o: file.c make.h commands.h dep.h file.h variable.h
|
||||
file.o: file.c make.h dep.h filedef.h job.h commands.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
|
||||
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
|
||||
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
|
||||
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
|
||||
main.o: main.c make.h dep.h filedef.h variable.h job.h commands.h \
|
||||
getopt.h
|
||||
read.o: read.c make.h dep.h filedef.h job.h commands.h variable.h \
|
||||
glob/glob.h
|
||||
remake.o: remake.c make.h filedef.h job.h commands.h dep.h
|
||||
rule.o: rule.c make.h dep.h filedef.h job.h commands.h variable.h \
|
||||
rule.h
|
||||
implicit.o: implicit.c make.h rule.h dep.h filedef.h
|
||||
default.o: default.c make.h rule.h dep.h filedef.h job.h commands.h \
|
||||
variable.h
|
||||
variable.o: variable.c make.h dep.h filedef.h job.h commands.h \
|
||||
variable.h
|
||||
expand.o: expand.c make.h filedef.h job.h commands.h variable.h
|
||||
function.o: function.c make.h filedef.h variable.h dep.h job.h \
|
||||
commands.h
|
||||
vpath.o: vpath.c make.h filedef.h variable.h
|
||||
version.o: version.c
|
||||
ar.o : ar.c make.h file.h dep.h
|
||||
ar.o: ar.c make.h filedef.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 filedef.h job.h commands.h
|
||||
getopt.o: getopt.c
|
||||
getopt1.o: getopt1.c getopt.h
|
||||
getloadavg.o: getloadavg.c
|
||||
|
||||
34
NEWS
34
NEWS
@@ -1,24 +1,46 @@
|
||||
GNU make NEWS -- history of user-visible changes. 26 January 1995
|
||||
GNU make NEWS -- history of user-visible changes. 9 May 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.
|
||||
|
||||
* The new directive `sinclude' is now recognized as another name for
|
||||
`-include', for compatibility with some other Makes.
|
||||
|
||||
* Aaron Digulla has contributed a port to AmigaDOS. See README.Amiga for
|
||||
details, and direct all Amiga-related questions to <digulla@fh-konstanz.de>.
|
||||
|
||||
* Rob Tulloh of Tivoli Systems has contributed a port to Windows NT or 95.
|
||||
See README.WIN32 for details, and direct all Windows-related questions to
|
||||
<rob_tulloh@tivoli.com>.
|
||||
|
||||
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
|
||||
|
||||
* DJ Delorie has ported Make to MS-DOS using the GO32 extender.
|
||||
He is maintaining the DOS port, not the GNU Make maintainer;
|
||||
please direct bugs and questions for DOS to <djgpp@sun.soe.clarkson.edu>.
|
||||
MS-DOS binaries are available for FTP from oak.oakland.edu:pub/msdos/djgpp.
|
||||
MS-DOS binaries are available for FTP from ftp.simtel.net in
|
||||
/pub/simtelnet/gnu/djgpp/.
|
||||
|
||||
* The `MAKEFLAGS' variable (in the environment or in a makefile) can now
|
||||
contain variable definitions itself; these are treated just like
|
||||
@@ -222,7 +244,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 +562,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
|
||||
|
||||
138
NMakefile.template
Normal file
138
NMakefile.template
Normal file
@@ -0,0 +1,138 @@
|
||||
# NOTE: If you have no `make' program at all to process this makefile, run
|
||||
# `build_w32.bat' instead.
|
||||
#
|
||||
# Copyright (C) 1988, 89, 91, 92, 93, 94, 95, 1996 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)
|
||||
# any later version.
|
||||
#
|
||||
# GNU Make 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 GNU Make; see the file COPYING. If not, write to
|
||||
# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
#
|
||||
# NMakefile for GNU Make
|
||||
#
|
||||
|
||||
LINK = link
|
||||
CC = cl
|
||||
|
||||
OUTDIR=.
|
||||
MAKEFILE=NMakefile
|
||||
SUBPROC_MAKEFILE=NMakefile
|
||||
|
||||
CFLAGS_any = /nologo /MT /W3 /GX /Zi /YX /I . /I glob /I w32/include /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES
|
||||
CFLAGS_debug = $(CFLAGS_any) /Od /D _DEBUG /FR.\WinDebug/ /Fp.\WinDebug/make.pch /Fo.\WinDebug/ /Fd.\WinDebug/make.pdb
|
||||
CFLAGS_release = $(CFLAGS_any) /O2 /D NDEBUG /FR.\WinRel/ /Fp.\WinRel/make.pch /Fo.\WinRel/
|
||||
|
||||
LDFLAGS_debug = w32\subproc\WinDebug\subproc.lib /NOLOGO /SUBSYSTEM:console\
|
||||
/INCREMENTAL:no /PDB:WinRel/make.pdb /MACHINE:I386 /OUT:WinDebug/make.exe /DEBUG
|
||||
LDFLAGS_release = w32\subproc\WinRel\subproc.lib /NOLOGO /SUBSYSTEM:console\
|
||||
/INCREMENTAL:no /MACHINE:I386 /OUT:WinRel/make.exe
|
||||
|
||||
all: config.h subproc Release Debug
|
||||
|
||||
#
|
||||
# Make sure we build the subproc library first. It has it's own
|
||||
# makefile. To be portable to Windows 95, we put the instructions
|
||||
# on how to build the library into a batch file. On NT, we could
|
||||
# simply have done foo && bar && dog, but this doesn't port.
|
||||
#
|
||||
subproc: w32/subproc/WinDebug/subproc.lib w32/subproc/WinRel/subproc.lib
|
||||
|
||||
w32/subproc/WinDebug/subproc.lib w32/subproc/WinRel/subproc.lib:
|
||||
subproc.bat $(SUBPROC_MAKEFILE)
|
||||
|
||||
config.h: config.h.WIN32
|
||||
copy $? $@
|
||||
|
||||
Release:
|
||||
nmake /f $(MAKEFILE) LDFLAGS="$(LDFLAGS_release)" CFLAGS="$(CFLAGS_release)" OUTDIR=WinRel WinRel/make.exe
|
||||
Debug:
|
||||
nmake /f $(MAKEFILE) LDFLAGS="$(LDFLAGS_debug)" CFLAGS="$(CFLAGS_debug)" OUTDIR=WinDebug WinDebug/make.exe
|
||||
|
||||
clean:
|
||||
rmdir /s /q WinDebug WinRel
|
||||
|
||||
$(OUTDIR):
|
||||
if not exist .\$@\nul mkdir .\$@
|
||||
|
||||
LIBS = kernel32.lib user32.lib advapi32.lib
|
||||
|
||||
OBJS = \
|
||||
$(OUTDIR)/ar.obj \
|
||||
$(OUTDIR)/arscan.obj \
|
||||
$(OUTDIR)/commands.obj \
|
||||
$(OUTDIR)/default.obj \
|
||||
$(OUTDIR)/dir.obj \
|
||||
$(OUTDIR)/expand.obj \
|
||||
$(OUTDIR)/file.obj \
|
||||
$(OUTDIR)/function.obj \
|
||||
$(OUTDIR)/getloadavg.obj \
|
||||
$(OUTDIR)/getopt.obj \
|
||||
$(OUTDIR)/getopt1.obj \
|
||||
$(OUTDIR)/implicit.obj \
|
||||
$(OUTDIR)/job.obj \
|
||||
$(OUTDIR)/main.obj \
|
||||
$(OUTDIR)/misc.obj \
|
||||
$(OUTDIR)/read.obj \
|
||||
$(OUTDIR)/remake.obj \
|
||||
$(OUTDIR)/remote-stub.obj \
|
||||
$(OUTDIR)/rule.obj \
|
||||
$(OUTDIR)/signame.obj \
|
||||
$(OUTDIR)/variable.obj \
|
||||
$(OUTDIR)/version.obj \
|
||||
$(OUTDIR)/vpath.obj \
|
||||
$(OUTDIR)/glob.obj \
|
||||
$(OUTDIR)/fnmatch.obj \
|
||||
$(OUTDIR)/dirent.obj \
|
||||
$(OUTDIR)/pathstuff.obj
|
||||
|
||||
$(OUTDIR)/make.exe: $(OUTDIR) $(OBJS)
|
||||
$(LINK) @<<
|
||||
$(LDFLAGS) $(LIBS) $(OBJS)
|
||||
<<
|
||||
|
||||
.c{$(OUTDIR)}.obj:
|
||||
$(CC) $(CFLAGS) /c $<
|
||||
|
||||
$(OUTDIR)/ar.obj : ar.c make.h filedef.h dep.h
|
||||
$(OUTDIR)/arscan.obj : arscan.c make.h
|
||||
$(OUTDIR)/commands.obj : commands.c
|
||||
$(OUTDIR)/default.obj : default.c make.h rule.h dep.h filedef.h job.h commands.h variable.h
|
||||
$(OUTDIR)/dir.obj : dir.c make.h
|
||||
$(OUTDIR)/expand.obj : expand.c make.h filedef.h job.h commands.h variable.h
|
||||
$(OUTDIR)/file.obj : file.c make.h dep.h filedef.h job.h commands.h variable.h
|
||||
$(OUTDIR)/function.obj : function.c make.h filedef.h variable.h dep.h job.h commands.h
|
||||
$(OUTDIR)/getloadavg.obj : getloadavg.c
|
||||
$(OUTDIR)/getopt.obj : getopt.c
|
||||
$(OUTDIR)/getopt1.obj : getopt1.c getopt.h
|
||||
$(OUTDIR)/implicit.obj : implicit.c make.h rule.h dep.h filedef.h
|
||||
$(OUTDIR)/job.obj : job.c make.h job.h filedef.h commands.h variable.h
|
||||
$(OUTDIR)/main.obj : main.c make.h dep.h filedef.h variable.h job.h commands.h getopt.h
|
||||
$(OUTDIR)/misc.obj : misc.c make.h dep.h
|
||||
$(OUTDIR)/read.obj : read.c make.h dep.h filedef.h job.h commands.h variable.h glob/glob.h
|
||||
$(OUTDIR)/remake.obj : remake.c make.h filedef.h job.h commands.h dep.h
|
||||
$(OUTDIR)/remote-stub.obj : remote-stub.c make.h filedef.h job.h commands.h
|
||||
$(OUTDIR)/rule.obj : rule.c make.h dep.h filedef.h job.h commands.h variable.h rule.h
|
||||
$(OUTDIR)/signame.obj : signame.c signame.h
|
||||
$(OUTDIR)/variable.obj : variable.c make.h dep.h filedef.h job.h commands.h variable.h
|
||||
$(OUTDIR)/version.obj : version.c
|
||||
$(OUTDIR)/vpath.obj : vpath.c make.h filedef.h variable.h
|
||||
$(OUTDIR)/glob.obj : glob/glob.c
|
||||
$(CC) $(CFLAGS) /c $?
|
||||
$(OUTDIR)/fnmatch.obj : glob/fnmatch.c
|
||||
$(CC) $(CFLAGS) /c $?
|
||||
$(OUTDIR)/dirent.obj : w32/compat/dirent.c
|
||||
$(CC) $(CFLAGS) /c $?
|
||||
$(OUTDIR)/pathstuff.obj : w32/pathstuff.c
|
||||
$(CC) $(CFLAGS) /c $?
|
||||
|
||||
11
README
11
README
@@ -1,4 +1,4 @@
|
||||
This directory contains the 3.74 test release of GNU Make.
|
||||
This directory contains the 3.74.6 test release of GNU Make.
|
||||
All bugs reported for previous test releases have been fixed.
|
||||
Some bugs surely remain.
|
||||
|
||||
@@ -10,6 +10,15 @@ 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.
|
||||
|
||||
See README.WIN32 for details about GNU Make on Windows NT or 95.
|
||||
See README.Amiga for details about GNU Make on AmigaDOS.
|
||||
The MSDOS port of GNU Make is available as part of DJGPP; see the
|
||||
WWW page http://www.delorie.com/djgpp/ for more information.
|
||||
|
||||
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.
|
||||
|
||||
61
README.Amiga
Normal file
61
README.Amiga
Normal file
@@ -0,0 +1,61 @@
|
||||
Short: Port of GNU make with SAS/C (no ixemul.library required)
|
||||
Author: GNU, Amiga port by Aaron "Optimizer" Digulla
|
||||
Uploader: Aaron "Optimizer" Digulla (digulla@fh-konstanz.de)
|
||||
Type: dev/c
|
||||
|
||||
This is a pure Amiga port of GNU make 3.74. It needs no extra libraries or
|
||||
anything. It has the following features (in addition to any features of
|
||||
GNU make):
|
||||
|
||||
- Runs Amiga-Commands with SystemTags() (Execute)
|
||||
- Can run multi-line statements
|
||||
- Allows to use Device-Names in targets:
|
||||
|
||||
c:make : make.o
|
||||
|
||||
is ok. To distinguish between device-names and target : or ::, MAKE
|
||||
looks for spaces. If there are any around :, it's taken as a target
|
||||
delimiter, if there are none, it's taken as the name of a device. Note
|
||||
that "make:make.o" tries to create "make.o" on the device "make:".
|
||||
- Replaces @@ by a newline in any command line:
|
||||
|
||||
if exists make @@\
|
||||
delete make.bak quiet @@\
|
||||
rename make make.bak @@\
|
||||
endif @@\
|
||||
$(CC) Link Make.o To make
|
||||
|
||||
works. Note that the @@ must stand alone (ie. "make@@\" is illegal).
|
||||
Also be carefull that there is a space after the "\" (ie, at the
|
||||
beginning of the next line).
|
||||
- Can be made resident to save space and time
|
||||
- Amiga specific wildcards can be used in $(wildcard ...)
|
||||
|
||||
BUGS:
|
||||
- The line
|
||||
|
||||
dummy.h : src/*.c
|
||||
|
||||
tries to make dummy.h from "src/*.c" (ie. no wildcard-expansion takes
|
||||
place). You have to use "$(wildcard src/*.c)" instead.
|
||||
|
||||
COMPILING FROM SCRATCH
|
||||
----------------------
|
||||
|
||||
To recompile, you need SAS/C 6.51. make itself is not neccessary, there
|
||||
is an smakefile.
|
||||
|
||||
1. Copy config.ami to config.h
|
||||
2. If you use make to compie, copy Makefile.ami to Makefile and
|
||||
glob/Makefile.ami to glob/Makefile. Copy make into the current
|
||||
directory.
|
||||
|
||||
3. Run smake/make
|
||||
|
||||
INSTALLATION
|
||||
|
||||
Copy make somewhere in your search path (eg. sc:c or sc:bin).
|
||||
If you plan to use recursive makes, install make resident:
|
||||
|
||||
Resident make Add
|
||||
|
||||
49
README.W32
Normal file
49
README.W32
Normal file
@@ -0,0 +1,49 @@
|
||||
Port of GNU make to Windows NT and Windows 95
|
||||
Builds natively with MSVC 2.x or MSVC 4.x compilers.
|
||||
|
||||
To build with nmake on Windows NT or Windows 95:
|
||||
|
||||
1. Make sure cl.exe is in your %Path%. Example:
|
||||
|
||||
set Path=%Path%;c:/msdev/bin
|
||||
|
||||
2. Make sure %include% is set to msvc include directory. Example:
|
||||
|
||||
set include=c:/msdev/include
|
||||
|
||||
3. Make sure %lib% is set to msvc lib directory. Example:
|
||||
|
||||
set lib=c:/msdev/lib
|
||||
|
||||
4. nmake /f NMakefile
|
||||
|
||||
|
||||
There is a bat file (build_w32.bat) for folks who have fear of nmake.
|
||||
|
||||
Outputs:
|
||||
|
||||
WinDebug/make.exe
|
||||
WinRel/make.exe
|
||||
|
||||
Notes:
|
||||
|
||||
This port prefers you have a working sh.exe somewhere on your
|
||||
system. If you don't have sh.exe, port falls back to
|
||||
MSDOS mode for launching programs (via a batch file).
|
||||
The MSDOS mode style execution has not been tested too
|
||||
carefully though (I use GNU bash as sh.exe).
|
||||
|
||||
I verified all functionality with a slightly modified version
|
||||
of make-test-0.4.5 (modifications to get test suite to run
|
||||
on Windows NT). All tests pass in an environment that includes
|
||||
sh.exe.
|
||||
|
||||
I did not provide a Visual C project file with this port as
|
||||
the project file would not be considered freely distributable
|
||||
(or so I think). It is easy enough to create one though if
|
||||
you know how to use Visual C.
|
||||
|
||||
I build the program statically to avoid problems locating DLL's
|
||||
on machines that may not have MSVC runtime installed. If you
|
||||
prefer, you can change make to build with shared libraries by
|
||||
changing /MT to /MD in the NMakefile (or build_w32.bat).
|
||||
49
README.WIN32
Normal file
49
README.WIN32
Normal file
@@ -0,0 +1,49 @@
|
||||
Port of GNU make to Windows NT and Windows 95
|
||||
Builds natively with MSVC 2.x or MSVC 4.x compilers.
|
||||
|
||||
To build with nmake on Windows NT or Windows 95:
|
||||
|
||||
1. Make sure cl.exe is in your %Path%. Example:
|
||||
|
||||
set Path=%Path%;c:/msdev/bin
|
||||
|
||||
2. Make sure %include% is set to msvc include directory. Example:
|
||||
|
||||
set include=c:/msdev/include
|
||||
|
||||
3. Make sure %lib% is set to msvc lib directory. Example:
|
||||
|
||||
set lib=c:/msdev/lib
|
||||
|
||||
4. nmake /f NMakefile
|
||||
|
||||
|
||||
There is a bat file (build_w32.bat) for folks who have fear of nmake.
|
||||
|
||||
Outputs:
|
||||
|
||||
WinDebug/make.exe
|
||||
WinRel/make.exe
|
||||
|
||||
Notes:
|
||||
|
||||
This port prefers you have a working sh.exe somewhere on your
|
||||
system. If you don't have sh.exe, port falls back to
|
||||
MSDOS mode for launching programs (via a batch file).
|
||||
The MSDOS mode style execution has not been tested too
|
||||
carefully though (I use GNU bash as sh.exe).
|
||||
|
||||
I verified all functionality with a slightly modified version
|
||||
of make-test-0.4.5 (modifications to get test suite to run
|
||||
on Windows NT). All tests pass in an environment that includes
|
||||
sh.exe.
|
||||
|
||||
I did not provide a Visual C project file with this port as
|
||||
the project file would not be considered freely distributable
|
||||
(or so I think). It is easy enough to create one though if
|
||||
you know how to use Visual C.
|
||||
|
||||
I build the program statically to avoid problems locating DLL's
|
||||
on machines that may not have MSVC runtime installed. If you
|
||||
prefer, you can change make to build with shared libraries by
|
||||
changing /MT to /MD in the NMakefile (or build_w32.bat).
|
||||
@@ -10,6 +10,15 @@ 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.
|
||||
|
||||
See README.WIN32 for details about GNU Make on Windows NT or 95.
|
||||
See README.Amiga for details about GNU Make on AmigaDOS.
|
||||
The MSDOS port of GNU Make is available as part of DJGPP; see the
|
||||
WWW page http://www.delorie.com/djgpp/ for more information.
|
||||
|
||||
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.
|
||||
|
||||
13
SCOPTIONS
Normal file
13
SCOPTIONS
Normal file
@@ -0,0 +1,13 @@
|
||||
ERRORREXX
|
||||
OPTIMIZE
|
||||
NOVERSION
|
||||
OPTIMIZERTIME
|
||||
OPTIMIZERALIAS
|
||||
DEFINE INCLUDEDIR="include:"
|
||||
DEFINE LIBDIR="lib:"
|
||||
DEFINE NO_ALLOCA
|
||||
DEFINE NO_FLOAT
|
||||
DEFINE NO_ARCHIVES
|
||||
IGNORE=161
|
||||
IGNORE=100
|
||||
STARTUP=cres
|
||||
276
SMakefile.template
Normal file
276
SMakefile.template
Normal file
@@ -0,0 +1,276 @@
|
||||
# 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.
|
||||
# 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)
|
||||
# any later version.
|
||||
#
|
||||
# GNU Make 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 GNU Make; see the file COPYING. If not, write to
|
||||
# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
#
|
||||
# Makefile for GNU Make
|
||||
#
|
||||
|
||||
# Ultrix 2.2 make doesn't expand the value of VPATH.
|
||||
VPATH = /make-3.74/
|
||||
# This must repeat the value, because configure will remove `VPATH = .'.
|
||||
srcdir = /make-3.74/
|
||||
|
||||
CC = sc
|
||||
RM = delete
|
||||
MAKE = smake
|
||||
|
||||
CFLAGS =
|
||||
CPPFLAGS =
|
||||
LDFLAGS =
|
||||
|
||||
# Define these for your system as follows:
|
||||
# -DNO_ARCHIVES To disable `ar' archive support.
|
||||
# -DNO_FLOAT To avoid using floating-point numbers.
|
||||
# -DENUM_BITFIELDS If the compiler isn't GCC but groks enum foo:2.
|
||||
# Some compilers apparently accept this
|
||||
# without complaint but produce losing code,
|
||||
# so beware.
|
||||
# NeXT 1.0a uses an old version of GCC, which required -D__inline=inline.
|
||||
# See also `config.h'.
|
||||
defines =
|
||||
|
||||
# Which flavor of remote job execution support to use.
|
||||
# The code is found in `remote-$(REMOTE).c'.
|
||||
REMOTE = stub
|
||||
|
||||
# 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 = Lib glob/glob.lib
|
||||
|
||||
# If your system doesn't have alloca, or the one provided is bad, define this.
|
||||
ALLOCA = alloca.o
|
||||
ALLOCA_SRC = $(srcdir)alloca.c
|
||||
|
||||
# If your system needs extra libraries loaded in, define them here.
|
||||
# System V probably need -lPW for alloca. HP-UX 7.0's alloca in
|
||||
# libPW.a is broken on HP9000s300 and HP9000s400 machines. Use
|
||||
# alloca.c instead on those machines.
|
||||
LOADLIBES =
|
||||
|
||||
# Any extra object files your system needs.
|
||||
extras = amiga.o
|
||||
|
||||
# Common prefix for machine-independent installed files.
|
||||
prefix =
|
||||
# Common prefix for machine-dependent installed files.
|
||||
exec_prefix =
|
||||
|
||||
# Directory to install `make' in.
|
||||
bindir = sc:c
|
||||
# Directory to find libraries in for `-lXXX'.
|
||||
libdir = lib:
|
||||
# Directory to search by default for included makefiles.
|
||||
includedir = include:
|
||||
# Directory to install the Info files in.
|
||||
infodir = doc:
|
||||
# Directory to install the man page in.
|
||||
mandir = t:
|
||||
# Number to put on the man page filename.
|
||||
manext = 1
|
||||
# Prefix to put on installed `make' binary file name.
|
||||
binprefix =
|
||||
# Prefix to put on installed `make' man page file name.
|
||||
manprefix = $(binprefix)
|
||||
|
||||
# Whether or not make needs to be installed setgid.
|
||||
# The value should be either `true' or `false'.
|
||||
# On many systems, the getloadavg function (used to implement the `-l'
|
||||
# switch) will not work unless make is installed setgid kmem.
|
||||
install_setgid = false
|
||||
# Install make setgid to this group so it can read /dev/kmem.
|
||||
group = sys
|
||||
|
||||
# Program to install `make'.
|
||||
INSTALL_PROGRAM = copy
|
||||
# Program to install the man page.
|
||||
INSTALL_DATA = copy
|
||||
# Generic install program.
|
||||
INSTALL = copy
|
||||
|
||||
# Program to format Texinfo source into Info files.
|
||||
MAKEINFO = makeinfo
|
||||
# Program to format Texinfo source into DVI files.
|
||||
TEXI2DVI = texi2dvi
|
||||
|
||||
# Programs to make tags files.
|
||||
ETAGS = etags -w
|
||||
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)
|
||||
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 \
|
||||
$(srcdir)rule.c $(srcdir)implicit.c $(srcdir)default.c \
|
||||
$(srcdir)variable.c $(srcdir)expand.c $(srcdir)function.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)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
|
||||
|
||||
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .o .c .h .ps .dvi .info .texinfo
|
||||
|
||||
all: make
|
||||
info: make.info
|
||||
dvi: make.dvi
|
||||
# Some makes apparently use .PHONY as the default goal if it is before `all'.
|
||||
.PHONY: all check info dvi
|
||||
|
||||
make.info: make.texinfo
|
||||
$(MAKEINFO) -I$(srcdir) $(srcdir)make.texinfo -o make.info
|
||||
|
||||
make.dvi: make.texinfo
|
||||
$(TEXI2DVI) $(srcdir)make.texinfo
|
||||
|
||||
make.ps: make.dvi
|
||||
dvi2ps make.dvi > make.ps
|
||||
|
||||
make: $(objs) glob/glob.lib
|
||||
$(CC) Link $(LDFLAGS) $(objs) $(LOADLIBES) To make.new
|
||||
-delete quiet make
|
||||
rename make.new make
|
||||
|
||||
# -I. is needed to find config.h in the build directory.
|
||||
.c.o:
|
||||
$(CC) $(defines) IDir "" IDir $(srcdir)glob \
|
||||
$(CPPFLAGS) $(CFLAGS) $< $(OUTPUT_OPTION)
|
||||
|
||||
glob/glob.lib:
|
||||
execute <<
|
||||
cd glob
|
||||
smake
|
||||
<
|
||||
|
||||
tagsrcs = $(srcs) $(srcdir)remote-*.c
|
||||
TAGS: $(tagsrcs)
|
||||
$(ETAGS) $(tagsrcs)
|
||||
tags: $(tagsrcs)
|
||||
$(CTAGS) $(tagsrcs)
|
||||
|
||||
.PHONY: install installdirs
|
||||
install:
|
||||
copy make sc:c
|
||||
|
||||
loadavg: loadavg.c config.h
|
||||
$(CC) $(defines) -DTEST -I. -I$(srcdir) $(CFLAGS) $(LDFLAGS) \
|
||||
loadavg.c $(LOADLIBES) -o $@
|
||||
|
||||
clean: glob-clean
|
||||
-$(RM) -f make loadavg *.o core make.dvi
|
||||
|
||||
distclean: clean glob-realclean
|
||||
-$(RM) -f Makefile config.h config.status build.sh stamp-config
|
||||
-$(RM) -f config.log config.cache
|
||||
-$(RM) -f TAGS tags
|
||||
-$(RM) -f make.?? make.??s make.log make.toc make.*aux
|
||||
-$(RM) -f loadavg.c
|
||||
|
||||
realclean: distclean
|
||||
-$(RM) -f make.info*
|
||||
|
||||
mostlyclean: clean
|
||||
|
||||
.PHONY: glob-clean glob-realclean
|
||||
|
||||
glob-clean glob-realclean:
|
||||
execute <<
|
||||
cd glob
|
||||
smake $@
|
||||
<
|
||||
|
||||
# The automatically generated dependencies below may omit config.h
|
||||
# because it is included with ``#include <config.h>'' rather than
|
||||
# ``#include "config.h"''. So we add the explicit dependency to make sure.
|
||||
$(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 filedef.h variable.h job.h \
|
||||
commands.h
|
||||
|
||||
job.o: job.c make.h job.h filedef.h commands.h variable.h
|
||||
|
||||
dir.o: dir.c make.h
|
||||
|
||||
file.o: file.c make.h dep.h filedef.h job.h commands.h variable.h
|
||||
|
||||
misc.o: misc.c make.h dep.h
|
||||
|
||||
main.o: main.c make.h dep.h filedef.h variable.h job.h commands.h \
|
||||
getopt.h
|
||||
|
||||
read.o: read.c make.h dep.h filedef.h job.h commands.h variable.h \
|
||||
glob/glob.h
|
||||
|
||||
remake.o: remake.c make.h filedef.h job.h commands.h dep.h
|
||||
|
||||
rule.o: rule.c make.h dep.h filedef.h job.h commands.h variable.h \
|
||||
rule.h
|
||||
|
||||
implicit.o: implicit.c make.h rule.h dep.h filedef.h
|
||||
|
||||
default.o: default.c make.h rule.h dep.h filedef.h job.h commands.h \
|
||||
variable.h
|
||||
|
||||
variable.o: variable.c make.h dep.h filedef.h job.h commands.h \
|
||||
variable.h
|
||||
|
||||
expand.o: expand.c make.h filedef.h job.h commands.h variable.h
|
||||
|
||||
function.o: function.c make.h filedef.h variable.h dep.h job.h \
|
||||
commands.h amiga.h
|
||||
|
||||
vpath.o: vpath.c make.h filedef.h variable.h
|
||||
|
||||
version.o: version.c
|
||||
|
||||
ar.o: ar.c make.h filedef.h dep.h
|
||||
|
||||
arscan.o: arscan.c make.h
|
||||
|
||||
signame.o: signame.c signame.h
|
||||
|
||||
remote-stub.o: remote-stub.c make.h filedef.h job.h commands.h
|
||||
|
||||
getopt.o: getopt.c
|
||||
|
||||
getopt1.o : getopt1.c getopt.h
|
||||
|
||||
getloadavg.o: getloadavg.c
|
||||
|
||||
amiga.o: amiga.c make.h variable.h amiga.h
|
||||
|
||||
@@ -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
|
||||
|
||||
16
alloca.c
16
alloca.c
@@ -25,6 +25,13 @@
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_STRING_H
|
||||
#include <string.h>
|
||||
#endif
|
||||
#ifdef HAVE_STDLIB_H
|
||||
#include <stdlib.h>
|
||||
#endif
|
||||
|
||||
#ifdef emacs
|
||||
#include "blockinput.h"
|
||||
#endif
|
||||
@@ -66,7 +73,9 @@ typedef void *pointer;
|
||||
typedef char *pointer;
|
||||
#endif
|
||||
|
||||
#ifndef NULL
|
||||
#define NULL 0
|
||||
#endif
|
||||
|
||||
/* Different portions of Emacs need to call different versions of
|
||||
malloc. The Emacs executable needs alloca to call xmalloc, because
|
||||
@@ -171,7 +180,7 @@ alloca (size)
|
||||
#endif
|
||||
|
||||
/* Reclaim garbage, defined as all alloca'd storage that
|
||||
was allocated from deeper in the stack than currently. */
|
||||
was allocated from deeper in the stack than currently. */
|
||||
|
||||
{
|
||||
register header *hp; /* Traverses linked list. */
|
||||
@@ -209,6 +218,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;
|
||||
|
||||
@@ -338,7 +350,7 @@ struct stk_trailer
|
||||
|
||||
#ifdef CRAY2
|
||||
/* Determine a "stack measure" for an arbitrary ADDRESS.
|
||||
I doubt that "lint" will like this much. */
|
||||
I doubt that "lint" will like this much. */
|
||||
|
||||
static long
|
||||
i00afunc (long *address)
|
||||
|
||||
122
amiga.c
Normal file
122
amiga.c
Normal file
@@ -0,0 +1,122 @@
|
||||
/* Running commands on Amiga
|
||||
Copyright (C) 1995, 1996 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)
|
||||
any later version.
|
||||
|
||||
GNU Make 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 GNU Make; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||
|
||||
#include "make.h"
|
||||
#include "variable.h"
|
||||
#include "amiga.h"
|
||||
#include <assert.h>
|
||||
#include <exec/memory.h>
|
||||
#include <dos/dostags.h>
|
||||
#include <proto/exec.h>
|
||||
#include <proto/dos.h>
|
||||
|
||||
static const char Amiga_version[] = "$VER: Make 3.74.3 (12.05.96) \n"
|
||||
"Amiga Port by A. Digulla (digulla@home.lake.de)";
|
||||
|
||||
int
|
||||
MyExecute (argv)
|
||||
char ** argv;
|
||||
{
|
||||
char * buffer, * ptr;
|
||||
char ** aptr;
|
||||
int len = 0;
|
||||
int status;
|
||||
|
||||
for (aptr=argv; *aptr; aptr++)
|
||||
{
|
||||
len += strlen (*aptr) + 4;
|
||||
}
|
||||
|
||||
buffer = AllocMem (len, MEMF_ANY);
|
||||
|
||||
if (!buffer)
|
||||
fatal ("MyExecute: Cannot allocate space for calling a command");
|
||||
|
||||
ptr = buffer;
|
||||
|
||||
for (aptr=argv; *aptr; aptr++)
|
||||
{
|
||||
if (((*aptr)[0] == ';' && !(*aptr)[1]))
|
||||
{
|
||||
*ptr ++ = '"';
|
||||
strcpy (ptr, *aptr);
|
||||
ptr += strlen (ptr);
|
||||
*ptr ++ = '"';
|
||||
}
|
||||
else if ((*aptr)[0] == '@' && (*aptr)[1] == '@' && !(*aptr)[2])
|
||||
{
|
||||
*ptr ++ = '\n';
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
strcpy (ptr, *aptr);
|
||||
ptr += strlen (ptr);
|
||||
}
|
||||
*ptr ++ = ' ';
|
||||
*ptr = 0;
|
||||
}
|
||||
|
||||
ptr[-1] = '\n';
|
||||
|
||||
status = SystemTags (buffer,
|
||||
SYS_UserShell, TRUE,
|
||||
TAG_END);
|
||||
|
||||
FreeMem (buffer, len);
|
||||
|
||||
if (SetSignal(0L,0L) & SIGBREAKF_CTRL_C)
|
||||
status = 20;
|
||||
|
||||
/* Warnings don't count */
|
||||
if (status == 5)
|
||||
status = 0;
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
char *
|
||||
wildcard_expansion (wc, o)
|
||||
char * wc, * o;
|
||||
{
|
||||
# define PATH_SIZE 1024
|
||||
struct AnchorPath * apath;
|
||||
|
||||
if ( (apath = AllocMem (sizeof (struct AnchorPath) + PATH_SIZE,
|
||||
MEMF_CLEAR))
|
||||
)
|
||||
{
|
||||
apath->ap_Strlen = PATH_SIZE;
|
||||
|
||||
if (MatchFirst (wc, apath) == 0)
|
||||
{
|
||||
do
|
||||
{
|
||||
o = variable_buffer_output (o, apath->ap_Buf,
|
||||
strlen (apath->ap_Buf));
|
||||
o = variable_buffer_output (o, " ",1);
|
||||
} while (MatchNext (apath) == 0);
|
||||
}
|
||||
|
||||
MatchEnd (apath);
|
||||
FreeMem (apath, sizeof (struct AnchorPath) + PATH_SIZE);
|
||||
}
|
||||
|
||||
return o;
|
||||
}
|
||||
|
||||
21
amiga.h
Normal file
21
amiga.h
Normal file
@@ -0,0 +1,21 @@
|
||||
/* Definitions for amiga specific things
|
||||
Copyright (C) 1995, 1996 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)
|
||||
any later version.
|
||||
|
||||
GNU Make 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 GNU Make; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||
|
||||
extern int MyExecute PARAMS ((char ** argv));
|
||||
extern char * wildcard_expansion PARAMS ((char * wc, char * o));
|
||||
|
||||
126
ar.c
126
ar.c
@@ -20,14 +20,14 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||
|
||||
#ifndef NO_ARCHIVES
|
||||
|
||||
#include "file.h"
|
||||
#include "filedef.h"
|
||||
#include "dep.h"
|
||||
#include <fnmatch.h>
|
||||
|
||||
/* Defined in arscan.c. */
|
||||
extern long int ar_scan ();
|
||||
extern int ar_member_touch ();
|
||||
extern int ar_name_equal ();
|
||||
extern long int ar_scan PARAMS ((char *archive, long int (*function) (), long int arg));
|
||||
extern int ar_member_touch PARAMS ((char *arname, char *memname));
|
||||
extern int ar_name_equal PARAMS ((char *name, char *mem, int truncated));
|
||||
|
||||
|
||||
/* Return nonzero if NAME is an archive-member reference, zero if not.
|
||||
@@ -67,8 +67,113 @@ ar_parse_name (name, arname_p, memname_p)
|
||||
if (memname_p != 0)
|
||||
*memname_p = savestring (p + 1, end - (p + 1));
|
||||
}
|
||||
|
||||
#ifdef VMS
|
||||
#include <lbrdef.h>
|
||||
#include <mhddef.h>
|
||||
#include <credef.h>
|
||||
#include <descrip.h>
|
||||
#include <ctype.h>
|
||||
#if __DECC
|
||||
#include <lbr$routines.h>
|
||||
#endif
|
||||
|
||||
#define uppercasify(str) {char *str1; for (str1 = str; *str1; str1++) *str1 = _toupper(*str1);}
|
||||
|
||||
#define LBR$_KEYNOTFND 2527330 /* This isn't in any .h file anywhere so I got it from a MACRO library */
|
||||
|
||||
time_t
|
||||
ar_member_date (name)
|
||||
char *name;
|
||||
{
|
||||
static char *arname;
|
||||
static char *memname;
|
||||
char *p,*q;
|
||||
long int val;
|
||||
static struct {
|
||||
struct mhddef mhd;
|
||||
struct credef cre;
|
||||
char garbage[256];
|
||||
} buf;
|
||||
int func=LBR$C_READ,
|
||||
type=LBR$C_TYP_OBJ,
|
||||
rfa[2],
|
||||
lidx,
|
||||
status;
|
||||
$DESCRIPTOR(bufdesc,(char *)&buf);
|
||||
$DESCRIPTOR(libdesc,arname);
|
||||
$DESCRIPTOR(moddesc,memname);
|
||||
|
||||
/* This "file" is an archive member. */
|
||||
p = index (name, '(');
|
||||
arname = savestring (name, p - name);
|
||||
val = strlen (p) - 2;
|
||||
/*
|
||||
if (val > 15)
|
||||
val = 15;
|
||||
*/
|
||||
memname = savestring (p + 1, val);
|
||||
#ifdef OLDWAY
|
||||
p = rindex (memname, ')');
|
||||
if (p != 0) {
|
||||
q = rindex(p,'.');
|
||||
if (q)
|
||||
*q = '\0'; /* to get rid of extension */
|
||||
}
|
||||
#endif
|
||||
|
||||
q = rindex(memname,'.');
|
||||
if (q)
|
||||
*q = '\0'; /* to get rid of extension */
|
||||
|
||||
uppercasify(memname);
|
||||
|
||||
/* Make sure we know the modtime of the archive itself because
|
||||
we are likely to be called just before commands to remake a
|
||||
member are run, and they will change the archive itself. */
|
||||
(void) f_mtime (enter_file (arname));
|
||||
|
||||
libdesc.dsc$a_pointer = arname;
|
||||
libdesc.dsc$w_length = strlen(arname);
|
||||
moddesc.dsc$a_pointer = memname;
|
||||
moddesc.dsc$w_length = strlen(memname);
|
||||
|
||||
if (!((status = lbr$ini_control(&lidx,&func,&type,0)) & 1)) {
|
||||
printf("Error in lbr$ini_control, %d\n",status);
|
||||
return(-1);
|
||||
}
|
||||
|
||||
if (!((status = lbr$open(&lidx,&libdesc,0,0,0,0,0)) & 1)) {
|
||||
printf("Error opening library %s to lookup member %s, %d\n",arname, memname ,status);
|
||||
return(-1);
|
||||
}
|
||||
|
||||
if (!((status = lbr$lookup_key(&lidx,&moddesc,rfa)) & 1)) {
|
||||
if (status != LBR$_KEYNOTFND)
|
||||
printf("Error looking up module %s in library %s, %d\n",memname, arname ,status);
|
||||
lbr$close(&lidx);
|
||||
return(-1);
|
||||
}
|
||||
|
||||
if (!((status = lbr$set_module(&lidx,rfa,&bufdesc,&bufdesc,0)) & 1)) {
|
||||
printf("Error getting module info, %d\n",status);
|
||||
lbr$close(&lidx);
|
||||
return(-1);
|
||||
}
|
||||
|
||||
lbr$close(&lidx);
|
||||
|
||||
val = SHELL$FIX_TIME(&buf.mhd.mhd$l_datim);
|
||||
|
||||
free (arname);
|
||||
free (memname);
|
||||
return (val <= 0 ? (time_t) -1 : (time_t) val);
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
static long int ar_member_date_1 ();
|
||||
static long int ar_member_date_1 PARAMS ((int desc, char *mem, int truncated, long int hdrpos,
|
||||
long int datapos, long int size, long int date, int uid, int gid, int mode, char *name));
|
||||
|
||||
/* Return the modtime of NAME. */
|
||||
|
||||
@@ -127,9 +232,19 @@ ar_member_date_1 (desc, mem, truncated,
|
||||
{
|
||||
return ar_name_equal (name, mem, truncated) ? date : 0;
|
||||
}
|
||||
#endif /* !VMS */
|
||||
|
||||
/* Set the archive-member NAME's modtime to now. */
|
||||
|
||||
#ifdef VMS
|
||||
int
|
||||
ar_touch (name)
|
||||
char *name;
|
||||
{
|
||||
error ("touch archive member is not available on VMS");
|
||||
return -1;
|
||||
}
|
||||
#else
|
||||
int
|
||||
ar_touch (name)
|
||||
char *name;
|
||||
@@ -182,6 +297,7 @@ ar_touch (name)
|
||||
|
||||
return val;
|
||||
}
|
||||
#endif /* !VMS */
|
||||
|
||||
/* State of an `ar_glob' run, passed to `ar_glob_match'. */
|
||||
|
||||
|
||||
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
|
||||
|
||||
136
build_w32.bat
Normal file
136
build_w32.bat
Normal file
@@ -0,0 +1,136 @@
|
||||
cd w32\subproc
|
||||
echo "Creating the subproc library"
|
||||
%ComSpec% /c build.bat
|
||||
cd ..\..
|
||||
del link.dbg link.rel
|
||||
del config.h
|
||||
copy config.h.WIN32 config.h
|
||||
echo off
|
||||
echo "Creating GNU make 3.74 for Windows NT"
|
||||
echo on
|
||||
if not exist .\WinDebug\nul mkdir .\WinDebug
|
||||
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D TIVOLI /D _DEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/make374.pch /Fo.\WinDebug/ /Fd.\WinDebug/make374.pdb /c variable.c
|
||||
echo WinDebug\variable.obj >>link.dbg
|
||||
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/make374.pch /Fo.\WinDebug/ /Fd.\WinDebug/make374.pdb /c rule.c
|
||||
echo WinDebug\rule.obj >>link.dbg
|
||||
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/make374.pch /Fo.\WinDebug/ /Fd.\WinDebug/make374.pdb /c remote-stub.c
|
||||
echo WinDebug\remote-stub.obj >>link.dbg
|
||||
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/make374.pch /Fo.\WinDebug/ /Fd.\WinDebug/make374.pdb /c commands.c
|
||||
echo WinDebug\commands.obj >>link.dbg
|
||||
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/make374.pch /Fo.\WinDebug/ /Fd.\WinDebug/make374.pdb /c file.c
|
||||
echo WinDebug\file.obj >>link.dbg
|
||||
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/make374.pch /Fo.\WinDebug/ /Fd.\WinDebug/make374.pdb /c getloadavg.c
|
||||
echo WinDebug\getloadavg.obj >>link.dbg
|
||||
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/make374.pch /Fo.\WinDebug/ /Fd.\WinDebug/make374.pdb /c default.c
|
||||
echo WinDebug\default.obj >>link.dbg
|
||||
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/make374.pch /Fo.\WinDebug/ /Fd.\WinDebug/make374.pdb /c signame.c
|
||||
echo WinDebug\signame.obj >>link.dbg
|
||||
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/make374.pch /Fo.\WinDebug/ /Fd.\WinDebug/make374.pdb /c expand.c
|
||||
echo WinDebug\expand.obj >>link.dbg
|
||||
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/make374.pch /Fo.\WinDebug/ /Fd.\WinDebug/make374.pdb /c dir.c
|
||||
echo WinDebug\dir.obj >>link.dbg
|
||||
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/make374.pch /Fo.\WinDebug/ /Fd.\WinDebug/make374.pdb /c main.c
|
||||
echo WinDebug\main.obj >>link.dbg
|
||||
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/make374.pch /Fo.\WinDebug/ /Fd.\WinDebug/make374.pdb /c getopt1.c
|
||||
echo WinDebug\getopt1.obj >>link.dbg
|
||||
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/make374.pch /Fo.\WinDebug/ /Fd.\WinDebug/make374.pdb /c job.c
|
||||
echo WinDebug\job.obj >>link.dbg
|
||||
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/make374.pch /Fo.\WinDebug/ /Fd.\WinDebug/make374.pdb /c read.c
|
||||
echo WinDebug\read.obj >>link.dbg
|
||||
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/make374.pch /Fo.\WinDebug/ /Fd.\WinDebug/make374.pdb /c version.c
|
||||
echo WinDebug\version.obj >>link.dbg
|
||||
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/make374.pch /Fo.\WinDebug/ /Fd.\WinDebug/make374.pdb /c getopt.c
|
||||
echo WinDebug\getopt.obj >>link.dbg
|
||||
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/make374.pch /Fo.\WinDebug/ /Fd.\WinDebug/make374.pdb /c arscan.c
|
||||
echo WinDebug\arscan.obj >>link.dbg
|
||||
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/make374.pch /Fo.\WinDebug/ /Fd.\WinDebug/make374.pdb /c remake.c
|
||||
echo WinDebug\remake.obj >>link.dbg
|
||||
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/make374.pch /Fo.\WinDebug/ /Fd.\WinDebug/make374.pdb /c misc.c
|
||||
echo WinDebug\misc.obj >>link.dbg
|
||||
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/make374.pch /Fo.\WinDebug/ /Fd.\WinDebug/make374.pdb /c ar.c
|
||||
echo WinDebug\ar.obj >>link.dbg
|
||||
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/make374.pch /Fo.\WinDebug/ /Fd.\WinDebug/make374.pdb /c function.c
|
||||
echo WinDebug\function.obj >>link.dbg
|
||||
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/make374.pch /Fo.\WinDebug/ /Fd.\WinDebug/make374.pdb /c vpath.c
|
||||
echo WinDebug\vpath.obj >>link.dbg
|
||||
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/make374.pch /Fo.\WinDebug/ /Fd.\WinDebug/make374.pdb /c implicit.c
|
||||
echo WinDebug\implicit.obj >>link.dbg
|
||||
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/make374.pch /Fo.\WinDebug/ /Fd.\WinDebug/make374.pdb /c .\w32\compat\dirent.c
|
||||
echo WinDebug\dirent.obj >>link.dbg
|
||||
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/make374.pch /Fo.\WinDebug/ /Fd.\WinDebug/make374.pdb /c .\glob\glob.c
|
||||
echo WinDebug\glob.obj >>link.dbg
|
||||
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/make374.pch /Fo.\WinDebug/ /Fd.\WinDebug/make374.pdb /c .\glob\fnmatch.c
|
||||
echo WinDebug\fnmatch.obj >>link.dbg
|
||||
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/make374.pch /Fo.\WinDebug/ /Fd.\WinDebug/make374.pdb /c .\w32\pathstuff.c
|
||||
echo WinDebug\pathstuff.obj >>link.dbg
|
||||
echo off
|
||||
echo "Linking WinDebug/make374.exe"
|
||||
rem link.exe kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib w32\subproc\windebug\subproc.lib /NOLOGO /SUBSYSTEM:console /INCREMENTAL:yes /PDB:.\WinDebug/make374.pdb /DEBUG /MACHINE:I386 /OUT:.\WinDebug/make374.exe .\WinDebug/variable.obj .\WinDebug/rule.obj .\WinDebug/remote-stub.obj .\WinDebug/commands.obj .\WinDebug/file.obj .\WinDebug/getloadavg.obj .\WinDebug/default.obj .\WinDebug/signame.obj .\WinDebug/expand.obj .\WinDebug/dir.obj .\WinDebug/main.obj .\WinDebug/getopt1.obj .\WinDebug/job.obj .\WinDebug/read.obj .\WinDebug/version.obj .\WinDebug/getopt.obj .\WinDebug/arscan.obj .\WinDebug/remake.obj .\WinDebug/misc.obj .\WinDebug/ar.obj .\WinDebug/function.obj .\WinDebug/vpath.obj .\WinDebug/implicit.obj .\WinDebug/dirent.obj .\WinDebug/glob.obj .\WinDebug/fnmatch.obj .\WinDebug/pathstuff.obj
|
||||
echo kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib w32\subproc\windebug\subproc.lib >>link.dbg
|
||||
link.exe /NOLOGO /SUBSYSTEM:console /INCREMENTAL:yes /PDB:.\WinDebug/make374.pdb /DEBUG /MACHINE:I386 /OUT:.\WinDebug/make374.exe @link.dbg
|
||||
if not exist .\WinDebug/make374.exe echo "WinDebug build failed"
|
||||
if exist .\WinDebug/make374.exe echo "WinDebug build succeeded!"
|
||||
if not exist .\WinRel\nul mkdir .\WinRel
|
||||
echo on
|
||||
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /D TIVOLI /FR.\WinRel/ /Fp.\WinRel/make374.pch /Fo.\WinRel/ /c variable.c
|
||||
echo WinRel\variable.obj >>link.rel
|
||||
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/make374.pch /Fo.\WinRel/ /c rule.c
|
||||
echo WinRel\rule.obj >>link.rel
|
||||
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/make374.pch /Fo.\WinRel/ /c remote-stub.c
|
||||
echo WinRel\remote-stub.obj >>link.rel
|
||||
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/make374.pch /Fo.\WinRel/ /c commands.c
|
||||
echo WinRel\commands.obj >>link.rel
|
||||
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/make374.pch /Fo.\WinRel/ /c file.c
|
||||
echo WinRel\file.obj >>link.rel
|
||||
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/make374.pch /Fo.\WinRel/ /c getloadavg.c
|
||||
echo WinRel\getloadavg.obj >>link.rel
|
||||
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/make374.pch /Fo.\WinRel/ /c default.c
|
||||
echo WinRel\default.obj >>link.rel
|
||||
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/make374.pch /Fo.\WinRel/ /c signame.c
|
||||
echo WinRel\signame.obj >>link.rel
|
||||
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/make374.pch /Fo.\WinRel/ /c expand.c
|
||||
echo WinRel\expand.obj >>link.rel
|
||||
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/make374.pch /Fo.\WinRel/ /c dir.c
|
||||
echo WinRel\dir.obj >>link.rel
|
||||
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/make374.pch /Fo.\WinRel/ /c main.c
|
||||
echo WinRel\main.obj >>link.rel
|
||||
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/make374.pch /Fo.\WinRel/ /c getopt1.c
|
||||
echo WinRel\getopt1.obj >>link.rel
|
||||
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/make374.pch /Fo.\WinRel/ /c job.c
|
||||
echo WinRel\job.obj >>link.rel
|
||||
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/make374.pch /Fo.\WinRel/ /c read.c
|
||||
echo WinRel\read.obj >>link.rel
|
||||
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/make374.pch /Fo.\WinRel/ /c version.c
|
||||
echo WinRel\version.obj >>link.rel
|
||||
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/make374.pch /Fo.\WinRel/ /c getopt.c
|
||||
echo WinRel\getopt.obj >>link.rel
|
||||
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/make374.pch /Fo.\WinRel/ /c arscan.c
|
||||
echo WinRel\arscan.obj >>link.rel
|
||||
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/make374.pch /Fo.\WinRel/ /c remake.c
|
||||
echo WinRel\remake.obj >>link.rel
|
||||
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/make374.pch /Fo.\WinRel/ /c misc.c
|
||||
echo WinRel\misc.obj >>link.rel
|
||||
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/make374.pch /Fo.\WinRel/ /c ar.c
|
||||
echo WinRel\ar.obj >>link.rel
|
||||
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/make374.pch /Fo.\WinRel/ /c function.c
|
||||
echo WinRel\function.obj >>link.rel
|
||||
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/make374.pch /Fo.\WinRel/ /c vpath.c
|
||||
echo WinRel\vpath.obj >>link.rel
|
||||
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/make374.pch /Fo.\WinRel/ /c implicit.c
|
||||
echo WinRel\implicit.obj >>link.rel
|
||||
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/make374.pch /Fo.\WinRel/ /c .\w32\compat\dirent.c
|
||||
echo WinRel\dirent.obj >>link.rel
|
||||
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/make374.pch /Fo.\WinRel/ /c .\glob\glob.c
|
||||
echo WinRel\glob.obj >>link.rel
|
||||
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/make374.pch /Fo.\WinRel/ /c .\glob\fnmatch.c
|
||||
echo WinRel\fnmatch.obj >>link.rel
|
||||
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/make374.pch /Fo.\WinRel/ /c .\w32\pathstuff.c
|
||||
echo WinRel\pathstuff.obj >>link.rel
|
||||
echo off
|
||||
echo "Linking WinRel/make374.exe"
|
||||
rem link.exe kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib w32\subproc\winrel\subproc.lib /NOLOGO /SUBSYSTEM:console /INCREMENTAL:no /PDB:.\WinRel/make374.pdb /MACHINE:I386 /OUT:.\WinRel/make374.exe .\WinRel/variable.obj .\WinRel/rule.obj .\WinRel/remote-stub.obj .\WinRel/commands.obj .\WinRel/file.obj .\WinRel/getloadavg.obj .\WinRel/default.obj .\WinRel/signame.obj .\WinRel/expand.obj .\WinRel/dir.obj .\WinRel/main.obj .\WinRel/getopt1.obj .\WinRel/job.obj .\WinRel/read.obj .\WinRel/version.obj .\WinRel/getopt.obj .\WinRel/arscan.obj .\WinRel/remake.obj .\WinRel/misc.obj .\WinRel/ar.obj .\WinRel/function.obj .\WinRel/vpath.obj .\WinRel/implicit.obj .\WinRel/dirent.obj .\WinRel/glob.obj .\WinRel/fnmatch.obj .\WinRel/pathstuff.obj
|
||||
echo kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib w32\subproc\winrel\subproc.lib >>link.rel
|
||||
link.exe /NOLOGO /SUBSYSTEM:console /INCREMENTAL:no /PDB:.\WinRel/make374.pdb /MACHINE:I386 /OUT:.\WinRel/make374.exe @link.rel
|
||||
if not exist .\WinRel/make374.exe echo "WinRel build failed"
|
||||
if exist .\WinRel/make374.exe echo "WinRel build succeeded!"
|
||||
echo on
|
||||
51
commands.c
51
commands.c
@@ -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, 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,12 +18,12 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||
|
||||
#include "make.h"
|
||||
#include "dep.h"
|
||||
#include "commands.h"
|
||||
#include "file.h"
|
||||
#include "filedef.h"
|
||||
#include "variable.h"
|
||||
#include "job.h"
|
||||
#include "commands.h"
|
||||
|
||||
extern int remote_kill ();
|
||||
extern int remote_kill PARAMS ((int id, int sig));
|
||||
|
||||
#ifndef HAVE_UNISTD_H
|
||||
extern int getpid ();
|
||||
@@ -154,8 +154,11 @@ set_file_variables (file)
|
||||
|
||||
bcopy (c, cp, len);
|
||||
cp += len;
|
||||
#if VMS
|
||||
*cp++ = ',';
|
||||
#else
|
||||
*cp++ = ' ';
|
||||
|
||||
#endif
|
||||
if (! d->changed)
|
||||
qmark_len -= len + 1; /* Don't space in $? for this one. */
|
||||
}
|
||||
@@ -193,13 +196,20 @@ set_file_variables (file)
|
||||
|
||||
bcopy (c, cp, len);
|
||||
cp += len;
|
||||
#if VMS
|
||||
*cp++ = ',';
|
||||
#else
|
||||
*cp++ = ' ';
|
||||
|
||||
#endif
|
||||
if (d->changed)
|
||||
{
|
||||
bcopy (c, qp, len);
|
||||
qp += len;
|
||||
#if VMS
|
||||
*qp++ = ',';
|
||||
#else
|
||||
*qp++ = ' ';
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -359,9 +369,16 @@ RETSIGTYPE
|
||||
fatal_error_signal (sig)
|
||||
int sig;
|
||||
{
|
||||
#ifdef __MSDOS__
|
||||
#if defined(__MSDOS__) || defined(_AMIGA)
|
||||
remove_intermediates (1);
|
||||
#ifdef _AMIGA
|
||||
if (sig == SIGINT)
|
||||
fputs ("*** Break.\n", stderr);
|
||||
|
||||
exit (10);
|
||||
#else
|
||||
exit (1);
|
||||
#endif
|
||||
#else /* Not MSDOS. */
|
||||
handling_fatal_signal = 1;
|
||||
|
||||
@@ -383,7 +400,14 @@ fatal_error_signal (sig)
|
||||
/* If we got a signal that means the user
|
||||
wanted to kill make, remove pending targets. */
|
||||
|
||||
if (sig == SIGTERM || sig == SIGINT || sig == SIGHUP || sig == SIGQUIT)
|
||||
if (sig == SIGTERM || sig == SIGINT
|
||||
#ifdef SIGHUP
|
||||
|| sig == SIGHUP
|
||||
#endif
|
||||
#ifdef SIGQUIT
|
||||
|| sig == SIGQUIT
|
||||
#endif
|
||||
)
|
||||
{
|
||||
register struct child *c;
|
||||
|
||||
@@ -410,10 +434,12 @@ fatal_error_signal (sig)
|
||||
|
||||
remove_intermediates (1);
|
||||
|
||||
#ifdef SIGQUIT
|
||||
if (sig == SIGQUIT)
|
||||
/* We don't want to send ourselves SIGQUIT, because it will
|
||||
cause a core dump. Just exit instead. */
|
||||
exit (1);
|
||||
exit (EXIT_FAILURE);
|
||||
#endif
|
||||
|
||||
/* Signal the same code; this time it will really be fatal. The signal
|
||||
will be unblocked when we return and arrive then to kill us. */
|
||||
@@ -451,7 +477,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 +485,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. */
|
||||
|
||||
@@ -36,7 +36,7 @@ struct commands
|
||||
#define COMMANDS_SILENT 2 /* Silent: @. */
|
||||
#define COMMANDS_NOERROR 4 /* No errors: -. */
|
||||
|
||||
extern void execute_file_commands ();
|
||||
extern void print_commands ();
|
||||
extern void delete_child_targets ();
|
||||
extern void chop_commands ();
|
||||
extern void execute_file_commands PARAMS ((struct file *file));
|
||||
extern void print_commands PARAMS ((struct commands *cmds));
|
||||
extern void delete_child_targets PARAMS ((struct child *child));
|
||||
extern void chop_commands PARAMS ((struct commands *cmds));
|
||||
|
||||
@@ -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,8 +120,9 @@ 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)/commands.h $(srcdir)/dep.h $(srcdir)/file.h \
|
||||
$(srcdir)/signame.c $(srcdir)/signame.h \
|
||||
$(srcdir)/getopt.c $(srcdir)/getopt1.c $(srcdir)/getopt.h \
|
||||
$(srcdir)/commands.h $(srcdir)/dep.h $(srcdir)/filedef.h \
|
||||
$(srcdir)/job.h $(srcdir)/make.h $(srcdir)/rule.h \
|
||||
$(srcdir)/variable.h $(ALLOCA_SRC) $(srcdir)/config.h.in
|
||||
|
||||
|
||||
271
config.ami.template
Normal file
271
config.ami.template
Normal file
@@ -0,0 +1,271 @@
|
||||
/* config.h.in. Generated automatically from configure.in by autoheader. */
|
||||
|
||||
/* Define if on AIX 3.
|
||||
System headers sometimes define this.
|
||||
We just want to avoid a redefinition error message. */
|
||||
#ifndef _ALL_SOURCE
|
||||
#undef _ALL_SOURCE
|
||||
#endif
|
||||
|
||||
/* Define if using alloca.c. */
|
||||
#define C_ALLOCA
|
||||
|
||||
/* Define to empty if the keyword does not work. */
|
||||
#undef const
|
||||
|
||||
/* Define to one of _getb67, GETB67, getb67 for Cray-2 and Cray-YMP systems.
|
||||
This function is required for alloca.c support on those systems. */
|
||||
#undef CRAY_STACKSEG_END
|
||||
|
||||
/* Define for DGUX with <sys/dg_sys_info.h>. */
|
||||
#undef DGUX
|
||||
|
||||
/* Define if the `getloadavg' function needs to be run setuid or setgid. */
|
||||
#undef GETLOADAVG_PRIVILEGED
|
||||
|
||||
/* Define to `int' if <sys/types.h> doesn't define. */
|
||||
#define gid_t int
|
||||
|
||||
/* Define if you have alloca, as a function or macro. */
|
||||
#undef HAVE_ALLOCA
|
||||
|
||||
/* Define if you have <alloca.h> and it should be used (not on Ultrix). */
|
||||
#undef HAVE_ALLOCA_H
|
||||
|
||||
/* Define if you don't have vprintf but do have _doprnt. */
|
||||
#undef HAVE_DOPRNT
|
||||
|
||||
/* Define if your system has its own `getloadavg' function. */
|
||||
#undef HAVE_GETLOADAVG
|
||||
|
||||
/* Define if you have the getmntent function. */
|
||||
#undef HAVE_GETMNTENT
|
||||
|
||||
/* Define if the `long double' type works. */
|
||||
#undef HAVE_LONG_DOUBLE
|
||||
|
||||
/* Define if you support file names longer than 14 characters. */
|
||||
#define HAVE_LONG_FILE_NAMES
|
||||
|
||||
/* Define if you have a working `mmap' system call. */
|
||||
#undef HAVE_MMAP
|
||||
|
||||
/* Define if system calls automatically restart after interruption
|
||||
by a signal. */
|
||||
#undef HAVE_RESTARTABLE_SYSCALLS
|
||||
|
||||
/* Define if your struct stat has st_blksize. */
|
||||
#undef HAVE_ST_BLKSIZE
|
||||
|
||||
/* Define if your struct stat has st_blocks. */
|
||||
#undef HAVE_ST_BLOCKS
|
||||
|
||||
/* Define if you have the strcoll function and it is properly defined. */
|
||||
#define HAVE_STRCOLL
|
||||
|
||||
/* Define if your struct stat has st_rdev. */
|
||||
#define HAVE_ST_RDEV
|
||||
|
||||
/* Define if you have the strftime function. */
|
||||
#define HAVE_STRFTIME
|
||||
|
||||
/* Define if you have <sys/wait.h> that is POSIX.1 compatible. */
|
||||
#undef HAVE_SYS_WAIT_H
|
||||
|
||||
/* Define if your struct tm has tm_zone. */
|
||||
#undef HAVE_TM_ZONE
|
||||
|
||||
/* Define if you don't have tm_zone but do have the external array
|
||||
tzname. */
|
||||
#define HAVE_TZNAME
|
||||
/* #define tzname __tzname */
|
||||
|
||||
/* Define if you have <unistd.h>. */
|
||||
#define HAVE_UNISTD_H
|
||||
|
||||
/* Define if utime(file, NULL) sets file's timestamp to the present. */
|
||||
#undef HAVE_UTIME_NULL
|
||||
|
||||
/* Define if you have <vfork.h>. */
|
||||
#undef HAVE_VFORK_H
|
||||
|
||||
/* Define if you have the vprintf function. */
|
||||
#define HAVE_VPRINTF
|
||||
|
||||
/* Define if you have the wait3 system call. */
|
||||
#undef HAVE_WAIT3
|
||||
|
||||
/* Define if on MINIX. */
|
||||
#undef _MINIX
|
||||
|
||||
/* Define if your struct nlist has an n_un member. */
|
||||
#undef NLIST_NAME_UNION
|
||||
|
||||
/* Define if you have <nlist.h>. */
|
||||
#undef NLIST_STRUCT
|
||||
|
||||
/* Define if your C compiler doesn't accept -c and -o together. */
|
||||
#undef NO_MINUS_C_MINUS_O
|
||||
|
||||
/* Define to `int' if <sys/types.h> doesn't define. */
|
||||
#define pid_t int
|
||||
|
||||
/* Define if the system does not provide POSIX.1 features except
|
||||
with this defined. */
|
||||
#undef _POSIX_1_SOURCE
|
||||
|
||||
/* Define if you need to in order for stat and other things to work. */
|
||||
#undef _POSIX_SOURCE
|
||||
|
||||
/* Define as the return type of signal handlers (int or void). */
|
||||
#define RETSIGTYPE void
|
||||
|
||||
/* Define if the setvbuf function takes the buffering type as its second
|
||||
argument and the buffer pointer as the third, as on System V
|
||||
before release 3. */
|
||||
#undef SETVBUF_REVERSED
|
||||
|
||||
/* If using the C implementation of alloca, define if you know the
|
||||
direction of stack growth for your system; otherwise it will be
|
||||
automatically deduced at run-time.
|
||||
STACK_DIRECTION > 0 => grows toward higher addresses
|
||||
STACK_DIRECTION < 0 => grows toward lower addresses
|
||||
STACK_DIRECTION = 0 => direction of growth unknown
|
||||
*/
|
||||
#define STACK_DIRECTION -1
|
||||
|
||||
/* Define if the `S_IS*' macros in <sys/stat.h> do not work properly. */
|
||||
#undef STAT_MACROS_BROKEN
|
||||
|
||||
/* Define if you have the ANSI C header files. */
|
||||
#define STDC_HEADERS
|
||||
|
||||
/* Define on System V Release 4. */
|
||||
#undef SVR4
|
||||
|
||||
/* Define if `sys_siglist' is declared by <signal.h>. */
|
||||
#undef SYS_SIGLIST_DECLARED
|
||||
|
||||
/* Define to `int' if <sys/types.h> doesn't define. */
|
||||
#define uid_t int
|
||||
|
||||
/* Define for Encore UMAX. */
|
||||
#undef UMAX
|
||||
|
||||
/* Define for Encore UMAX 4.3 that has <inq_status/cpustats.h>
|
||||
instead of <sys/cpustats.h>. */
|
||||
#undef UMAX4_3
|
||||
|
||||
/* Define vfork as fork if vfork does not work. */
|
||||
#undef vfork
|
||||
|
||||
/* Define to the name of the SCCS `get' command. */
|
||||
#define SCCS_GET "get"
|
||||
|
||||
/* Define this if the SCCS `get' command understands the `-G<file>' option. */
|
||||
#undef SCCS_GET_MINUS_G
|
||||
|
||||
/* Define this if the C library defines the variable `sys_siglist'. */
|
||||
#undef HAVE_SYS_SIGLIST
|
||||
|
||||
/* Define this if the C library defines the variable `_sys_siglist'. */
|
||||
#undef HAVE__SYS_SIGLIST
|
||||
|
||||
/* 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. */
|
||||
#define HAVE_GETCWD
|
||||
|
||||
/* Define if you have the getdtablesize function. */
|
||||
#undef HAVE_GETDTABLESIZE
|
||||
|
||||
/* Define if you have the getgroups function. */
|
||||
#undef HAVE_GETGROUPS
|
||||
|
||||
/* Define if you have the mktemp function. */
|
||||
#define HAVE_MKTEMP
|
||||
|
||||
/* Define if you have the psignal function. */
|
||||
#undef HAVE_PSIGNAL
|
||||
|
||||
/* Define if you have the setegid function. */
|
||||
#undef HAVE_SETEGID
|
||||
|
||||
/* Define if you have the seteuid function. */
|
||||
#undef HAVE_SETEUID
|
||||
|
||||
/* Define if you have the setlinebuf function. */
|
||||
#undef HAVE_SETLINEBUF
|
||||
|
||||
/* Define if you have the setregid function. */
|
||||
#undef HAVE_SETREGID
|
||||
|
||||
/* Define if you have the setreuid function. */
|
||||
#undef HAVE_SETREUID
|
||||
|
||||
/* Define if you have the sigsetmask function. */
|
||||
#undef HAVE_SIGSETMASK
|
||||
|
||||
/* Define if you have the strerror function. */
|
||||
#define HAVE_STRERROR
|
||||
|
||||
/* Define if you have the strsignal function. */
|
||||
#undef HAVE_STRSIGNAL
|
||||
|
||||
/* Define if you have the wait3 function. */
|
||||
#undef HAVE_WAIT3
|
||||
|
||||
/* Define if you have the waitpid function. */
|
||||
#undef HAVE_WAITPID
|
||||
|
||||
/* Define if you have the <dirent.h> header file. */
|
||||
#define HAVE_DIRENT_H
|
||||
|
||||
/* Define if you have the <fcntl.h> header file. */
|
||||
#define HAVE_FCNTL_H
|
||||
|
||||
/* Define if you have the <limits.h> header file. */
|
||||
#define HAVE_LIMITS_H
|
||||
|
||||
/* Define if you have the <mach/mach.h> header file. */
|
||||
#undef HAVE_MACH_MACH_H
|
||||
|
||||
/* Define if you have the <memory.h> header file. */
|
||||
#undef HAVE_MEMORY_H
|
||||
|
||||
/* Define if you have the <ndir.h> header file. */
|
||||
#undef HAVE_NDIR_H
|
||||
|
||||
/* Define if you have the <string.h> header file. */
|
||||
#define HAVE_STRING_H
|
||||
|
||||
/* Define if you have the <sys/dir.h> header file. */
|
||||
#define HAVE_SYS_DIR_H
|
||||
|
||||
/* Define if you have the <sys/ndir.h> header file. */
|
||||
#undef HAVE_SYS_NDIR_H
|
||||
|
||||
/* Define if you have the <sys/param.h> header file. */
|
||||
#undef HAVE_SYS_PARAM_H
|
||||
|
||||
/* Define if you have the <sys/timeb.h> header file. */
|
||||
#undef HAVE_SYS_TIMEB_H
|
||||
|
||||
/* Define if you have the <sys/wait.h> header file. */
|
||||
#undef HAVE_SYS_WAIT_H
|
||||
|
||||
/* Define if you have the <unistd.h> header file. */
|
||||
#define HAVE_UNISTD_H
|
||||
|
||||
/* Define if you have the dgc library (-ldgc). */
|
||||
#undef HAVE_LIBDGC
|
||||
|
||||
/* Define if you have the sun library (-lsun). */
|
||||
#undef HAVE_LIBSUN
|
||||
292
config.h-vms.template
Normal file
292
config.h-vms.template
Normal file
@@ -0,0 +1,292 @@
|
||||
/* config.h-vms. Generated by hand by Klaus Kämpf <kkaempf@didymus.rmi.de> */
|
||||
/* config.h. Generated automatically by configure. */
|
||||
/* config.h.in. Generated automatically from configure.in by autoheader. */
|
||||
|
||||
/* Define if on AIX 3.
|
||||
System headers sometimes define this.
|
||||
We just want to avoid a redefinition error message. */
|
||||
#ifndef _ALL_SOURCE
|
||||
/* #undef _ALL_SOURCE */
|
||||
#endif
|
||||
|
||||
/* Define if using alloca.c. */
|
||||
/* #undef C_ALLOCA */
|
||||
|
||||
/* Define to empty if the keyword does not work. */
|
||||
/* #undef const */
|
||||
|
||||
/* Define to one of _getb67, GETB67, getb67 for Cray-2 and Cray-YMP systems.
|
||||
This function is required for alloca.c support on those systems. */
|
||||
/* #undef CRAY_STACKSEG_END */
|
||||
|
||||
/* Define for DGUX with <sys/dg_sys_info.h>. */
|
||||
/* #undef DGUX */
|
||||
|
||||
/* Define if the `getloadavg' function needs to be run setuid or setgid. */
|
||||
/* #undef GETLOADAVG_PRIVILEGED 1 */
|
||||
|
||||
/* Define to `int' if <sys/types.h> doesn't define. */
|
||||
/* #undef gid_t */
|
||||
|
||||
/* Define if you have alloca, as a function or macro. */
|
||||
#define HAVE_ALLOCA 1
|
||||
|
||||
/* Define if you have <alloca.h> and it should be used (not on Ultrix). */
|
||||
/* #undef HAVE_ALLOCA_H 1 */
|
||||
|
||||
/* Define if you don't have vprintf but do have _doprnt. */
|
||||
/* #undef HAVE_DOPRNT */
|
||||
|
||||
/* Define if your system has its own `getloadavg' function. */
|
||||
/* #undef HAVE_GETLOADAVG */
|
||||
|
||||
/* Define if you have the getmntent function. */
|
||||
/* #undef HAVE_GETMNTENT */
|
||||
|
||||
/* Define if the `long double' type works. */
|
||||
/* #undef HAVE_LONG_DOUBLE */
|
||||
|
||||
/* Define if you support file names longer than 14 characters. */
|
||||
#define HAVE_LONG_FILE_NAMES 1
|
||||
|
||||
/* Define if you have a working `mmap' system call. */
|
||||
/* #undef HAVE_MMAP */
|
||||
|
||||
/* Define if system calls automatically restart after interruption
|
||||
by a signal. */
|
||||
/* #undef HAVE_RESTARTABLE_SYSCALLS */
|
||||
|
||||
/* Define if your struct stat has st_blksize. */
|
||||
/* #undef HAVE_ST_BLKSIZE */
|
||||
|
||||
/* Define if your struct stat has st_blocks. */
|
||||
/* #undef HAVE_ST_BLOCKS */
|
||||
|
||||
/* Define if you have the strcoll function and it is properly defined. */
|
||||
/* #undef HAVE_STRCOLL 1 */
|
||||
|
||||
/* Define if your struct stat has st_rdev. */
|
||||
/* #undef HAVE_ST_RDEV */
|
||||
|
||||
/* Define if you have the strftime function. */
|
||||
/* #undef HAVE_STRFTIME */
|
||||
|
||||
/* Define if you have <sys/wait.h> that is POSIX.1 compatible. */
|
||||
/* #undef HAVE_SYS_WAIT_H 1 */
|
||||
|
||||
/* Define if your struct tm has tm_zone. */
|
||||
/* #undef HAVE_TM_ZONE */
|
||||
|
||||
/* Define if you don't have tm_zone but do have the external array
|
||||
tzname. */
|
||||
/* #undef HAVE_TZNAME */
|
||||
|
||||
/* Define if you have <unistd.h>. */
|
||||
#ifdef __DECC
|
||||
#define HAVE_UNISTD_H 1
|
||||
#endif
|
||||
|
||||
/* Define if utime(file, NULL) sets file's timestamp to the present. */
|
||||
/* #undef HAVE_UTIME_NULL */
|
||||
|
||||
/* Define if you have <vfork.h>. */
|
||||
/* #undef HAVE_VFORK_H 1 */
|
||||
|
||||
/* Define if you have the vprintf function. */
|
||||
#define HAVE_VPRINTF 1
|
||||
|
||||
/* Define if you have the wait3 system call. */
|
||||
/* #undef HAVE_WAIT3 1 */
|
||||
|
||||
/* Define if on MINIX. */
|
||||
/* #undef _MINIX */
|
||||
|
||||
/* Define if your struct nlist has an n_un member. */
|
||||
/* #undef NLIST_NAME_UNION */
|
||||
|
||||
/* Define if you have <nlist.h>. */
|
||||
/* #undef NLIST_STRUCT 1 */
|
||||
|
||||
/* Define if your C compiler doesn't accept -c and -o together. */
|
||||
/* #undef NO_MINUS_C_MINUS_O */
|
||||
|
||||
/* Define to `int' if <sys/types.h> doesn't define. */
|
||||
#define pid_t int
|
||||
|
||||
/* Define if the system does not provide POSIX.1 features except
|
||||
with this defined. */
|
||||
/* #undef _POSIX_1_SOURCE */
|
||||
|
||||
/* Define if you need to in order for stat and other things to work. */
|
||||
/* #undef _POSIX_SOURCE */
|
||||
|
||||
/* Define as the return type of signal handlers (int or void). */
|
||||
#define RETSIGTYPE void
|
||||
|
||||
/* Define if the setvbuf function takes the buffering type as its second
|
||||
argument and the buffer pointer as the third, as on System V
|
||||
before release 3. */
|
||||
/* #undef SETVBUF_REVERSED 1 */
|
||||
|
||||
/* If using the C implementation of alloca, define if you know the
|
||||
direction of stack growth for your system; otherwise it will be
|
||||
automatically deduced at run-time.
|
||||
STACK_DIRECTION > 0 => grows toward higher addresses
|
||||
STACK_DIRECTION < 0 => grows toward lower addresses
|
||||
STACK_DIRECTION = 0 => direction of growth unknown
|
||||
*/
|
||||
/* #undef STACK_DIRECTION */
|
||||
|
||||
/* Define if the `S_IS*' macros in <sys/stat.h> do not work properly. */
|
||||
/* #undef STAT_MACROS_BROKEN */
|
||||
|
||||
/* Define if you have the ANSI C header files. */
|
||||
/* #undef STDC_HEADERS */
|
||||
|
||||
/* Define on System V Release 4. */
|
||||
/* #undef SVR4 */
|
||||
|
||||
/* Define if `sys_siglist' is declared by <signal.h>. */
|
||||
/* #undef SYS_SIGLIST_DECLARED */
|
||||
|
||||
/* Define to `int' if <sys/types.h> doesn't define. */
|
||||
#define uid_t int
|
||||
|
||||
/* Define for Encore UMAX. */
|
||||
/* #undef UMAX */
|
||||
|
||||
/* Define for Encore UMAX 4.3 that has <inq_status/cpustats.h>
|
||||
instead of <sys/cpustats.h>. */
|
||||
/* #undef UMAX4_3 */
|
||||
|
||||
/* Define vfork as fork if vfork does not work. */
|
||||
/* #undef vfork */
|
||||
|
||||
/* Define to the name of the SCCS `get' command. */
|
||||
/* #undef SCCS_GET "/usr/sccs/get" */
|
||||
|
||||
/* Define this if the SCCS `get' command understands the `-G<file>' option. */
|
||||
/* #undef SCCS_GET_MINUS_G 1 */
|
||||
|
||||
/* Define this if the C library defines the variable `sys_siglist'. */
|
||||
/* #undefine HAVE_SYS_SIGLIST 1 */
|
||||
|
||||
/* Define this if the C library defines the variable `_sys_siglist'. */
|
||||
/* #undef HAVE__SYS_SIGLIST */
|
||||
|
||||
/* 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. */
|
||||
#define HAVE_DUP2 1
|
||||
|
||||
/* Define if you have the getcwd function. */
|
||||
#define HAVE_GETCWD 1
|
||||
|
||||
/* Define if you have the getdtablesize function. */
|
||||
/* #undef HAVE_GETDTABLESIZE 1 */
|
||||
|
||||
/* Define if you have the getgroups function. */
|
||||
/* #undef HAVE_GETGROUPS 1 */
|
||||
|
||||
/* Define if you have the mktemp function. */
|
||||
#define HAVE_MKTEMP 1
|
||||
|
||||
/* Define if you have the psignal function. */
|
||||
/* #undef HAVE_PSIGNAL 1 */
|
||||
|
||||
/* Define if you have the setegid function. */
|
||||
/* #undef HAVE_SETEGID 1 */
|
||||
|
||||
/* Define if you have the seteuid function. */
|
||||
/* #undef HAVE_SETEUID 1 */
|
||||
|
||||
/* Define if you have the setlinebuf function. */
|
||||
/* #undef HAVE_SETLINEBUF 1 */
|
||||
|
||||
/* Define if you have the setregid function. */
|
||||
/* #undefine HAVE_SETREGID 1 */
|
||||
|
||||
/* Define if you have the setreuid function. */
|
||||
/* #define HAVE_SETREUID 1 */
|
||||
|
||||
/* Define if you have the sigsetmask function. */
|
||||
#define HAVE_SIGSETMASK 1
|
||||
|
||||
/* Define if you have the strerror function. */
|
||||
#define HAVE_STRERROR 1
|
||||
|
||||
/* Define if you have the strsignal function. */
|
||||
/* #undef HAVE_STRSIGNAL */
|
||||
|
||||
/* Define if you have the wait3 function. */
|
||||
/* #define HAVE_WAIT3 1 */
|
||||
|
||||
/* Define if you have the waitpid function. */
|
||||
/* #undef HAVE_WAITPID 1 */
|
||||
|
||||
/* Define if you have the <dirent.h> header file. */
|
||||
/* #unddef HAVE_DIRENT_H 1 */
|
||||
|
||||
/* Define if you have the <fcntl.h> header file. */
|
||||
#ifdef __DECC
|
||||
#define HAVE_FCNTL_H 1
|
||||
#endif
|
||||
|
||||
/* Define if you have the <limits.h> header file. */
|
||||
#define HAVE_LIMITS_H 1
|
||||
|
||||
/* Define if you have the <mach/mach.h> header file. */
|
||||
/* #undef HAVE_MACH_MACH_H */
|
||||
|
||||
/* Define if you have the <memory.h> header file. */
|
||||
/* #undef HAVE_MEMORY_H 1 */
|
||||
|
||||
/* Define if you have the <ndir.h> header file. */
|
||||
/* #undef HAVE_NDIR_H */
|
||||
|
||||
/* Define if you have the <string.h> header file. */
|
||||
#define HAVE_STRING_H 1
|
||||
|
||||
/* Define if you have the <pwd.h> header file. */
|
||||
/* #undef HAVE_PWD_H */
|
||||
|
||||
/* Define if you have the <sys/dir.h> header file. */
|
||||
/* #undef HAVE_SYS_DIR_H */
|
||||
|
||||
/* Define if you have the <sys/ndir.h> header file. */
|
||||
/* #undef HAVE_SYS_NDIR_H */
|
||||
|
||||
/* Define if you have the <sys/param.h> header file. */
|
||||
/* #undef HAVE_SYS_PARAM_H 1 */
|
||||
|
||||
/* Define if you have the <sys/timeb.h> header file. */
|
||||
#define HAVE_SYS_TIMEB_H 1
|
||||
|
||||
/* Define if you have the <sys/wait.h> header file. */
|
||||
/* #undef HAVE_SYS_WAIT_H 1 */
|
||||
|
||||
/* Define if you have the dgc library (-ldgc). */
|
||||
/* #undef HAVE_LIBDGC */
|
||||
|
||||
/* Define if you have the sun library (-lsun). */
|
||||
/* #undef HAVE_LIBSUN */
|
||||
|
||||
/* VMS specific */
|
||||
|
||||
#define HAVE_VMSDIR_H 1
|
||||
#define HAVE_STDLIB_H 1
|
||||
#define INCLUDEDIR "sys$sysroot:[syslib]"
|
||||
#define LIBDIR "sys$sysroot:[syslib]"
|
||||
|
||||
#if defined (__cplusplus) || (defined (__STDC__) && __STDC__)
|
||||
#undef PARAMS
|
||||
#define PARAMS(protos) protos
|
||||
#else /* Not C++ or ANSI C. */
|
||||
#undef PARAMS
|
||||
#define PARAMS(protos) ()
|
||||
#endif /* C++ or ANSI C. */
|
||||
|
||||
289
config.h.W32.template
Normal file
289
config.h.W32.template
Normal file
@@ -0,0 +1,289 @@
|
||||
/* config.h.in. Generated automatically from configure.in by autoheader. */
|
||||
|
||||
/* Define if on AIX 3.
|
||||
System headers sometimes define this.
|
||||
We just want to avoid a redefinition error message. */
|
||||
#ifndef _ALL_SOURCE
|
||||
#undef _ALL_SOURCE
|
||||
#endif
|
||||
|
||||
/* Define if using alloca.c. */
|
||||
#undef C_ALLOCA
|
||||
|
||||
/* Define to empty if the keyword does not work. */
|
||||
#undef const
|
||||
|
||||
/* Define to one of _getb67, GETB67, getb67 for Cray-2 and Cray-YMP systems.
|
||||
This function is required for alloca.c support on those systems. */
|
||||
#undef CRAY_STACKSEG_END
|
||||
|
||||
/* Define for DGUX with <sys/dg_sys_info.h>. */
|
||||
#undef DGUX
|
||||
|
||||
/* Define if the `getloadavg' function needs to be run setuid or setgid. */
|
||||
#undef GETLOADAVG_PRIVILEGED
|
||||
|
||||
/* Define to `int' if <sys/types.h> doesn't define. */
|
||||
#undef gid_t
|
||||
#define gid_t int
|
||||
|
||||
/* Define if you have alloca, as a function or macro. */
|
||||
#undef HAVE_ALLOCA
|
||||
#define HAVE_ALLOCA
|
||||
|
||||
/* Define if you have <alloca.h> and it should be used (not on Ultrix). */
|
||||
#undef HAVE_ALLOCA_H
|
||||
|
||||
/* Define if you don't have vprintf but do have _doprnt. */
|
||||
#undef HAVE_DOPRNT
|
||||
|
||||
/* Define if your system has its own `getloadavg' function. */
|
||||
#undef HAVE_GETLOADAVG
|
||||
|
||||
/* Define if you have the getmntent function. */
|
||||
#undef HAVE_GETMNTENT
|
||||
|
||||
/* Define if the `long double' type works. */
|
||||
#undef HAVE_LONG_DOUBLE
|
||||
|
||||
/* Define if you support file names longer than 14 characters. */
|
||||
#undef HAVE_LONG_FILE_NAMES
|
||||
#define HAVE_LONG_FILE_NAMES
|
||||
|
||||
/* Define if you have a working `mmap' system call. */
|
||||
#undef HAVE_MMAP
|
||||
|
||||
/* Define if system calls automatically restart after interruption
|
||||
by a signal. */
|
||||
#undef HAVE_RESTARTABLE_SYSCALLS
|
||||
|
||||
/* Define if your struct stat has st_blksize. */
|
||||
#undef HAVE_ST_BLKSIZE
|
||||
|
||||
/* Define if your struct stat has st_blocks. */
|
||||
#undef HAVE_ST_BLOCKS
|
||||
|
||||
/* Define if you have the strcoll function and it is properly defined. */
|
||||
#undef HAVE_STRCOLL
|
||||
#define HAVE_STRCOLL
|
||||
|
||||
/* Define if your struct stat has st_rdev. */
|
||||
#undef HAVE_ST_RDEV
|
||||
#define HAVE_ST_RDEV
|
||||
|
||||
/* Define if you have the strftime function. */
|
||||
#undef HAVE_STRFTIME
|
||||
#define HAVE_STRFTIME
|
||||
|
||||
/* Define if you have <sys/wait.h> that is POSIX.1 compatible. */
|
||||
#undef HAVE_SYS_WAIT_H
|
||||
|
||||
/* Define if your struct tm has tm_zone. */
|
||||
#undef HAVE_TM_ZONE
|
||||
|
||||
/* Define if you don't have tm_zone but do have the external array
|
||||
tzname. */
|
||||
#undef HAVE_TZNAME
|
||||
#define HAVE_TZNAME
|
||||
|
||||
/* Define if you have <unistd.h>. */
|
||||
#undef HAVE_UNISTD_H
|
||||
|
||||
/* Define if utime(file, NULL) sets file's timestamp to the present. */
|
||||
#undef HAVE_UTIME_NULL
|
||||
#define HAVE_UTIME_NULL
|
||||
|
||||
/* Define if you have <vfork.h>. */
|
||||
#undef HAVE_VFORK_H
|
||||
|
||||
/* Define if you have the vprintf function. */
|
||||
#undef HAVE_VPRINTF
|
||||
#define HAVE_VPRINTF
|
||||
|
||||
/* Define if you have the wait3 system call. */
|
||||
#undef HAVE_WAIT3
|
||||
|
||||
/* Define if on MINIX. */
|
||||
#undef _MINIX
|
||||
|
||||
/* Define if your struct nlist has an n_un member. */
|
||||
#undef NLIST_NAME_UNION
|
||||
|
||||
/* Define if you have <nlist.h>. */
|
||||
#undef NLIST_STRUCT
|
||||
|
||||
/* Define if your C compiler doesn't accept -c and -o together. */
|
||||
#undef NO_MINUS_C_MINUS_O
|
||||
|
||||
/* Define to `int' if <sys/types.h> doesn't define. */
|
||||
#undef pid_t
|
||||
#define pid_t int
|
||||
|
||||
/* Define if the system does not provide POSIX.1 features except
|
||||
with this defined. */
|
||||
#undef _POSIX_1_SOURCE
|
||||
|
||||
/* Define if you need to in order for stat and other things to work. */
|
||||
#undef _POSIX_SOURCE
|
||||
#define _POSIX_SOURCE
|
||||
|
||||
/* Define as the return type of signal handlers (int or void). */
|
||||
#undef RETSIGTYPE
|
||||
#define RETSIGTYPE void
|
||||
|
||||
/* Define if the setvbuf function takes the buffering type as its second
|
||||
argument and the buffer pointer as the third, as on System V
|
||||
before release 3. */
|
||||
#undef SETVBUF_REVERSED
|
||||
|
||||
/* If using the C implementation of alloca, define if you know the
|
||||
direction of stack growth for your system; otherwise it will be
|
||||
automatically deduced at run-time.
|
||||
STACK_DIRECTION > 0 => grows toward higher addresses
|
||||
STACK_DIRECTION < 0 => grows toward lower addresses
|
||||
STACK_DIRECTION = 0 => direction of growth unknown
|
||||
*/
|
||||
#undef STACK_DIRECTION
|
||||
|
||||
/* Define if the `S_IS*' macros in <sys/stat.h> do not work properly. */
|
||||
#undef STAT_MACROS_BROKEN
|
||||
|
||||
/* Define if you have the ANSI C header files. */
|
||||
#undef STDC_HEADERS
|
||||
#define STDC_HEADERS
|
||||
|
||||
/* Define on System V Release 4. */
|
||||
#undef SVR4
|
||||
|
||||
/* Define if `sys_siglist' is declared by <signal.h>. */
|
||||
#undef SYS_SIGLIST_DECLARED
|
||||
|
||||
/* Define to `int' if <sys/types.h> doesn't define. */
|
||||
#undef uid_t
|
||||
#define uid_t int
|
||||
|
||||
/* Define for Encore UMAX. */
|
||||
#undef UMAX
|
||||
|
||||
/* Define for Encore UMAX 4.3 that has <inq_status/cpustats.h>
|
||||
instead of <sys/cpustats.h>. */
|
||||
#undef UMAX4_3
|
||||
|
||||
/* Define vfork as fork if vfork does not work. */
|
||||
#undef vfork
|
||||
|
||||
/* Define to the name of the SCCS `get' command. */
|
||||
#undef SCCS_GET
|
||||
#define SCCS_GET "echo no sccs get"
|
||||
|
||||
/* Define this if the SCCS `get' command understands the `-G<file>' option. */
|
||||
#undef SCCS_GET_MINUS_G
|
||||
|
||||
/* Define this if the C library defines the variable `sys_siglist'. */
|
||||
#undef HAVE_SYS_SIGLIST
|
||||
|
||||
/* Define this if the C library defines the variable `_sys_siglist'. */
|
||||
#undef HAVE__SYS_SIGLIST
|
||||
|
||||
/* Define this if you have the `union wait' type in <sys/wait.h>. */
|
||||
#undef HAVE_UNION_WAIT
|
||||
|
||||
/* Define if you have the dup2 function. */
|
||||
#undef HAVE_DUP2
|
||||
#define HAVE_DUP2
|
||||
|
||||
/* Define if you have the getcwd function. */
|
||||
#undef HAVE_GETCWD
|
||||
#define HAVE_GETCWD
|
||||
|
||||
/* Define if you have the getgroups function. */
|
||||
#undef HAVE_GETGROUPS
|
||||
|
||||
/* Define if you have the mktemp function. */
|
||||
#undef HAVE_MKTEMP
|
||||
#define HAVE_MKTEMP
|
||||
|
||||
/* Define if you have the psignal function. */
|
||||
#undef HAVE_PSIGNAL
|
||||
|
||||
/* Define if you have the setegid function. */
|
||||
#undef HAVE_SETEGID
|
||||
|
||||
/* Define if you have the seteuid function. */
|
||||
#undef HAVE_SETEUID
|
||||
|
||||
/* Define if you have the setlinebuf function. */
|
||||
#undef HAVE_SETLINEBUF
|
||||
|
||||
/* Define if you have the setregid function. */
|
||||
#undef HAVE_SETREGID
|
||||
|
||||
/* Define if you have the setreuid function. */
|
||||
#undef HAVE_SETREUID
|
||||
|
||||
/* Define if you have the sigsetmask function. */
|
||||
#undef HAVE_SIGSETMASK
|
||||
|
||||
/* Define if you have the strerror function. */
|
||||
#undef HAVE_STRERROR
|
||||
#define HAVE_STRERROR
|
||||
|
||||
/* Define if you have the strsignal function. */
|
||||
#undef HAVE_STRSIGNAL
|
||||
|
||||
/* Define if you have the wait3 function. */
|
||||
#undef HAVE_WAIT3
|
||||
|
||||
/* Define if you have the waitpid function. */
|
||||
#undef HAVE_WAITPID
|
||||
|
||||
/* Define if you have the <dirent.h> header file. */
|
||||
#undef HAVE_DIRENT_H
|
||||
#define HAVE_DIRENT_H
|
||||
|
||||
/* Define if you have the <fcntl.h> header file. */
|
||||
#undef HAVE_FCNTL_H
|
||||
#define HAVE_FCNTL_H
|
||||
|
||||
/* Define if you have the <limits.h> header file. */
|
||||
#undef HAVE_LIMITS_H
|
||||
#define HAVE_LIMITS_H
|
||||
|
||||
/* Define if you have the <mach/mach.h> header file. */
|
||||
#undef HAVE_MACH_MACH_H
|
||||
|
||||
/* Define if you have the <memory.h> header file. */
|
||||
#undef HAVE_MEMORY_H
|
||||
#define HAVE_MEMORY_H
|
||||
|
||||
/* Define if you have the <ndir.h> header file. */
|
||||
#undef HAVE_NDIR_H
|
||||
|
||||
/* Define if you have the <string.h> header file. */
|
||||
#undef HAVE_STRING_H
|
||||
#define HAVE_STRING_H
|
||||
|
||||
/* Define if you have the <sys/dir.h> header file. */
|
||||
#undef HAVE_SYS_DIR_H
|
||||
|
||||
/* Define if you have the <sys/ndir.h> header file. */
|
||||
#undef HAVE_SYS_NDIR_H
|
||||
|
||||
/* Define if you have the <sys/param.h> header file. */
|
||||
#undef HAVE_SYS_PARAM_H
|
||||
|
||||
/* Define if you have the <sys/timeb.h> header file. */
|
||||
#undef HAVE_SYS_TIMEB_H
|
||||
#define HAVE_SYS_TIMEB_H
|
||||
|
||||
/* Define if you have the <sys/wait.h> header file. */
|
||||
#undef HAVE_SYS_WAIT_H
|
||||
|
||||
/* Define if you have the <unistd.h> header file. */
|
||||
#undef HAVE_UNISTD_H
|
||||
|
||||
/* Define if you have the dgc library (-ldgc). */
|
||||
#undef HAVE_LIBDGC
|
||||
|
||||
/* Define if you have the sun library (-lsun). */
|
||||
#undef HAVE_LIBSUN
|
||||
289
config.h.WIN32
Normal file
289
config.h.WIN32
Normal file
@@ -0,0 +1,289 @@
|
||||
/* config.h.in. Generated automatically from configure.in by autoheader. */
|
||||
|
||||
/* Define if on AIX 3.
|
||||
System headers sometimes define this.
|
||||
We just want to avoid a redefinition error message. */
|
||||
#ifndef _ALL_SOURCE
|
||||
#undef _ALL_SOURCE
|
||||
#endif
|
||||
|
||||
/* Define if using alloca.c. */
|
||||
#undef C_ALLOCA
|
||||
|
||||
/* Define to empty if the keyword does not work. */
|
||||
#undef const
|
||||
|
||||
/* Define to one of _getb67, GETB67, getb67 for Cray-2 and Cray-YMP systems.
|
||||
This function is required for alloca.c support on those systems. */
|
||||
#undef CRAY_STACKSEG_END
|
||||
|
||||
/* Define for DGUX with <sys/dg_sys_info.h>. */
|
||||
#undef DGUX
|
||||
|
||||
/* Define if the `getloadavg' function needs to be run setuid or setgid. */
|
||||
#undef GETLOADAVG_PRIVILEGED
|
||||
|
||||
/* Define to `int' if <sys/types.h> doesn't define. */
|
||||
#undef gid_t
|
||||
#define gid_t int
|
||||
|
||||
/* Define if you have alloca, as a function or macro. */
|
||||
#undef HAVE_ALLOCA
|
||||
#define HAVE_ALLOCA
|
||||
|
||||
/* Define if you have <alloca.h> and it should be used (not on Ultrix). */
|
||||
#undef HAVE_ALLOCA_H
|
||||
|
||||
/* Define if you don't have vprintf but do have _doprnt. */
|
||||
#undef HAVE_DOPRNT
|
||||
|
||||
/* Define if your system has its own `getloadavg' function. */
|
||||
#undef HAVE_GETLOADAVG
|
||||
|
||||
/* Define if you have the getmntent function. */
|
||||
#undef HAVE_GETMNTENT
|
||||
|
||||
/* Define if the `long double' type works. */
|
||||
#undef HAVE_LONG_DOUBLE
|
||||
|
||||
/* Define if you support file names longer than 14 characters. */
|
||||
#undef HAVE_LONG_FILE_NAMES
|
||||
#define HAVE_LONG_FILE_NAMES
|
||||
|
||||
/* Define if you have a working `mmap' system call. */
|
||||
#undef HAVE_MMAP
|
||||
|
||||
/* Define if system calls automatically restart after interruption
|
||||
by a signal. */
|
||||
#undef HAVE_RESTARTABLE_SYSCALLS
|
||||
|
||||
/* Define if your struct stat has st_blksize. */
|
||||
#undef HAVE_ST_BLKSIZE
|
||||
|
||||
/* Define if your struct stat has st_blocks. */
|
||||
#undef HAVE_ST_BLOCKS
|
||||
|
||||
/* Define if you have the strcoll function and it is properly defined. */
|
||||
#undef HAVE_STRCOLL
|
||||
#define HAVE_STRCOLL
|
||||
|
||||
/* Define if your struct stat has st_rdev. */
|
||||
#undef HAVE_ST_RDEV
|
||||
#define HAVE_ST_RDEV
|
||||
|
||||
/* Define if you have the strftime function. */
|
||||
#undef HAVE_STRFTIME
|
||||
#define HAVE_STRFTIME
|
||||
|
||||
/* Define if you have <sys/wait.h> that is POSIX.1 compatible. */
|
||||
#undef HAVE_SYS_WAIT_H
|
||||
|
||||
/* Define if your struct tm has tm_zone. */
|
||||
#undef HAVE_TM_ZONE
|
||||
|
||||
/* Define if you don't have tm_zone but do have the external array
|
||||
tzname. */
|
||||
#undef HAVE_TZNAME
|
||||
#define HAVE_TZNAME
|
||||
|
||||
/* Define if you have <unistd.h>. */
|
||||
#undef HAVE_UNISTD_H
|
||||
|
||||
/* Define if utime(file, NULL) sets file's timestamp to the present. */
|
||||
#undef HAVE_UTIME_NULL
|
||||
#define HAVE_UTIME_NULL
|
||||
|
||||
/* Define if you have <vfork.h>. */
|
||||
#undef HAVE_VFORK_H
|
||||
|
||||
/* Define if you have the vprintf function. */
|
||||
#undef HAVE_VPRINTF
|
||||
#define HAVE_VPRINTF
|
||||
|
||||
/* Define if you have the wait3 system call. */
|
||||
#undef HAVE_WAIT3
|
||||
|
||||
/* Define if on MINIX. */
|
||||
#undef _MINIX
|
||||
|
||||
/* Define if your struct nlist has an n_un member. */
|
||||
#undef NLIST_NAME_UNION
|
||||
|
||||
/* Define if you have <nlist.h>. */
|
||||
#undef NLIST_STRUCT
|
||||
|
||||
/* Define if your C compiler doesn't accept -c and -o together. */
|
||||
#undef NO_MINUS_C_MINUS_O
|
||||
|
||||
/* Define to `int' if <sys/types.h> doesn't define. */
|
||||
#undef pid_t
|
||||
#define pid_t int
|
||||
|
||||
/* Define if the system does not provide POSIX.1 features except
|
||||
with this defined. */
|
||||
#undef _POSIX_1_SOURCE
|
||||
|
||||
/* Define if you need to in order for stat and other things to work. */
|
||||
#undef _POSIX_SOURCE
|
||||
#define _POSIX_SOURCE
|
||||
|
||||
/* Define as the return type of signal handlers (int or void). */
|
||||
#undef RETSIGTYPE
|
||||
#define RETSIGTYPE void
|
||||
|
||||
/* Define if the setvbuf function takes the buffering type as its second
|
||||
argument and the buffer pointer as the third, as on System V
|
||||
before release 3. */
|
||||
#undef SETVBUF_REVERSED
|
||||
|
||||
/* If using the C implementation of alloca, define if you know the
|
||||
direction of stack growth for your system; otherwise it will be
|
||||
automatically deduced at run-time.
|
||||
STACK_DIRECTION > 0 => grows toward higher addresses
|
||||
STACK_DIRECTION < 0 => grows toward lower addresses
|
||||
STACK_DIRECTION = 0 => direction of growth unknown
|
||||
*/
|
||||
#undef STACK_DIRECTION
|
||||
|
||||
/* Define if the `S_IS*' macros in <sys/stat.h> do not work properly. */
|
||||
#undef STAT_MACROS_BROKEN
|
||||
|
||||
/* Define if you have the ANSI C header files. */
|
||||
#undef STDC_HEADERS
|
||||
#define STDC_HEADERS
|
||||
|
||||
/* Define on System V Release 4. */
|
||||
#undef SVR4
|
||||
|
||||
/* Define if `sys_siglist' is declared by <signal.h>. */
|
||||
#undef SYS_SIGLIST_DECLARED
|
||||
|
||||
/* Define to `int' if <sys/types.h> doesn't define. */
|
||||
#undef uid_t
|
||||
#define uid_t int
|
||||
|
||||
/* Define for Encore UMAX. */
|
||||
#undef UMAX
|
||||
|
||||
/* Define for Encore UMAX 4.3 that has <inq_status/cpustats.h>
|
||||
instead of <sys/cpustats.h>. */
|
||||
#undef UMAX4_3
|
||||
|
||||
/* Define vfork as fork if vfork does not work. */
|
||||
#undef vfork
|
||||
|
||||
/* Define to the name of the SCCS `get' command. */
|
||||
#undef SCCS_GET
|
||||
#define SCCS_GET "echo no sccs get"
|
||||
|
||||
/* Define this if the SCCS `get' command understands the `-G<file>' option. */
|
||||
#undef SCCS_GET_MINUS_G
|
||||
|
||||
/* Define this if the C library defines the variable `sys_siglist'. */
|
||||
#undef HAVE_SYS_SIGLIST
|
||||
|
||||
/* Define this if the C library defines the variable `_sys_siglist'. */
|
||||
#undef HAVE__SYS_SIGLIST
|
||||
|
||||
/* Define this if you have the `union wait' type in <sys/wait.h>. */
|
||||
#undef HAVE_UNION_WAIT
|
||||
|
||||
/* Define if you have the dup2 function. */
|
||||
#undef HAVE_DUP2
|
||||
#define HAVE_DUP2
|
||||
|
||||
/* Define if you have the getcwd function. */
|
||||
#undef HAVE_GETCWD
|
||||
#define HAVE_GETCWD
|
||||
|
||||
/* Define if you have the getgroups function. */
|
||||
#undef HAVE_GETGROUPS
|
||||
|
||||
/* Define if you have the mktemp function. */
|
||||
#undef HAVE_MKTEMP
|
||||
#define HAVE_MKTEMP
|
||||
|
||||
/* Define if you have the psignal function. */
|
||||
#undef HAVE_PSIGNAL
|
||||
|
||||
/* Define if you have the setegid function. */
|
||||
#undef HAVE_SETEGID
|
||||
|
||||
/* Define if you have the seteuid function. */
|
||||
#undef HAVE_SETEUID
|
||||
|
||||
/* Define if you have the setlinebuf function. */
|
||||
#undef HAVE_SETLINEBUF
|
||||
|
||||
/* Define if you have the setregid function. */
|
||||
#undef HAVE_SETREGID
|
||||
|
||||
/* Define if you have the setreuid function. */
|
||||
#undef HAVE_SETREUID
|
||||
|
||||
/* Define if you have the sigsetmask function. */
|
||||
#undef HAVE_SIGSETMASK
|
||||
|
||||
/* Define if you have the strerror function. */
|
||||
#undef HAVE_STRERROR
|
||||
#define HAVE_STRERROR
|
||||
|
||||
/* Define if you have the strsignal function. */
|
||||
#undef HAVE_STRSIGNAL
|
||||
|
||||
/* Define if you have the wait3 function. */
|
||||
#undef HAVE_WAIT3
|
||||
|
||||
/* Define if you have the waitpid function. */
|
||||
#undef HAVE_WAITPID
|
||||
|
||||
/* Define if you have the <dirent.h> header file. */
|
||||
#undef HAVE_DIRENT_H
|
||||
#define HAVE_DIRENT_H
|
||||
|
||||
/* Define if you have the <fcntl.h> header file. */
|
||||
#undef HAVE_FCNTL_H
|
||||
#define HAVE_FCNTL_H
|
||||
|
||||
/* Define if you have the <limits.h> header file. */
|
||||
#undef HAVE_LIMITS_H
|
||||
#define HAVE_LIMITS_H
|
||||
|
||||
/* Define if you have the <mach/mach.h> header file. */
|
||||
#undef HAVE_MACH_MACH_H
|
||||
|
||||
/* Define if you have the <memory.h> header file. */
|
||||
#undef HAVE_MEMORY_H
|
||||
#define HAVE_MEMORY_H
|
||||
|
||||
/* Define if you have the <ndir.h> header file. */
|
||||
#undef HAVE_NDIR_H
|
||||
|
||||
/* Define if you have the <string.h> header file. */
|
||||
#undef HAVE_STRING_H
|
||||
#define HAVE_STRING_H
|
||||
|
||||
/* Define if you have the <sys/dir.h> header file. */
|
||||
#undef HAVE_SYS_DIR_H
|
||||
|
||||
/* Define if you have the <sys/ndir.h> header file. */
|
||||
#undef HAVE_SYS_NDIR_H
|
||||
|
||||
/* Define if you have the <sys/param.h> header file. */
|
||||
#undef HAVE_SYS_PARAM_H
|
||||
|
||||
/* Define if you have the <sys/timeb.h> header file. */
|
||||
#undef HAVE_SYS_TIMEB_H
|
||||
#define HAVE_SYS_TIMEB_H
|
||||
|
||||
/* Define if you have the <sys/wait.h> header file. */
|
||||
#undef HAVE_SYS_WAIT_H
|
||||
|
||||
/* Define if you have the <unistd.h> header file. */
|
||||
#undef HAVE_UNISTD_H
|
||||
|
||||
/* Define if you have the dgc library (-ldgc). */
|
||||
#undef HAVE_LIBDGC
|
||||
|
||||
/* Define if you have the sun library (-lsun). */
|
||||
#undef HAVE_LIBSUN
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
#define LIBDIR "c:/djgpp/lib"
|
||||
|
||||
/* Define if you have dirent.h. */
|
||||
#define DIRENT
|
||||
#define HAVE_DIRENT_H
|
||||
|
||||
/* Define if you have the strcoll function and it is properly defined. */
|
||||
#define HAVE_STRCOLL
|
||||
|
||||
14
configure.in
14
configure.in
@@ -38,28 +38,16 @@ 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)
|
||||
AC_CHECK_SYMBOL(_sys_siglist)
|
||||
AC_FUNC_ALLOCA
|
||||
AC_FUNC_VFORK
|
||||
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)
|
||||
|
||||
146
default.c
146
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
|
||||
@@ -19,7 +19,8 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||
#include "make.h"
|
||||
#include "rule.h"
|
||||
#include "dep.h"
|
||||
#include "file.h"
|
||||
#include "filedef.h"
|
||||
#include "job.h"
|
||||
#include "commands.h"
|
||||
#include "variable.h"
|
||||
|
||||
@@ -35,9 +36,15 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||
a `.c' or `.p' or ... file rather than from a .s file. */
|
||||
|
||||
static char default_suffixes[]
|
||||
#ifdef VMS
|
||||
= ".exe .olb .ln .obj .c .cc .pas .p .for .f .r .y .l .mar \
|
||||
.mod .sym .def .h .info .dvi .tex .texinfo .texi .txinfo \
|
||||
.w .ch .cweb .web .com .sh .elc .el";
|
||||
#else
|
||||
= ".out .a .ln .o .c .cc .C .p .f .F .r .y .l .s .S \
|
||||
.mod .sym .def .h .info .dvi .tex .texinfo .texi .txinfo \
|
||||
.w .ch .web .sh .elc .el";
|
||||
#endif
|
||||
|
||||
static struct pspec default_pattern_rules[] =
|
||||
{
|
||||
@@ -47,9 +54,13 @@ static struct pspec default_pattern_rules[] =
|
||||
/* The X.out rules are only in BSD's default set because
|
||||
BSD Make has no null-suffix rules, so `foo.out' and
|
||||
`foo' are the same thing. */
|
||||
#ifdef VMS
|
||||
{ "%.exe", "%",
|
||||
"copy $< $@" },
|
||||
#else
|
||||
{ "%.out", "%",
|
||||
"@rm -f $@ \n cp $< $@" },
|
||||
|
||||
#endif
|
||||
/* Syntax is "ctangle foo.w foo.ch foo.c". */
|
||||
{ "%.c", "%.w %.ch",
|
||||
"$(CTANGLE) $^ $@" },
|
||||
@@ -61,23 +72,78 @@ static struct pspec default_pattern_rules[] =
|
||||
|
||||
static struct pspec default_terminal_rules[] =
|
||||
{
|
||||
#ifdef VMS
|
||||
/* RCS. */
|
||||
{ "%", "%$$5lv", /* Multinet style */
|
||||
"if f$$search($@) .nes. \"\" then +$(CHECKOUT,v)" },
|
||||
{ "%", "[.$$rcs]%$$5lv", /* Multinet style */
|
||||
"if f$$search($@) .nes. \"\" then +$(CHECKOUT,v)" },
|
||||
{ "%", "%_v", /* Normal style */
|
||||
"if f$$search($@) .nes. \"\" then +$(CHECKOUT,v)" },
|
||||
{ "%", "[.rcs]%_v", /* Normal style */
|
||||
"if f$$search($@) .nes. \"\" then +$(CHECKOUT,v)" },
|
||||
|
||||
/* SCCS. */
|
||||
/* ain't no SCCS on vms */
|
||||
#else
|
||||
/* RCS. */
|
||||
{ "%", "%,v",
|
||||
"+$(CHECKOUT,v)" },
|
||||
"$(CHECKOUT,v)" },
|
||||
{ "%", "RCS/%,v",
|
||||
"+$(CHECKOUT,v)" },
|
||||
"$(CHECKOUT,v)" },
|
||||
|
||||
/* SCCS. */
|
||||
{ "%", "s.%",
|
||||
"$(GET) $(GFLAGS) $(SCCS_OUTPUT_OPTION) $<" },
|
||||
{ "%", "SCCS/s.%",
|
||||
"$(GET) $(GFLAGS) $(SCCS_OUTPUT_OPTION) $<" },
|
||||
|
||||
#endif /* !VMS */
|
||||
{ 0, 0, 0 }
|
||||
};
|
||||
|
||||
static char *default_suffix_rules[] =
|
||||
{
|
||||
#ifdef VMS
|
||||
".obj.exe",
|
||||
"$(LINK.obj) $^ $(LOADLIBES) $(LDLIBS) /exe=$@",
|
||||
".mar.exe",
|
||||
"$(LINK.mar) $^ $(LOADLIBES) $(LDLIBS) /exe=$@",
|
||||
".c.exe",
|
||||
"$(COMPILE.c) $^ \n $(LINK.obj) $(subst .c,.obj,$^) $(LOADLIBES) $(LDLIBS) /exe=$@",
|
||||
".cc.exe",
|
||||
"$(COMPILE.cc) $^ \n $(LINK.obj) $(subst .cc,.obj,$^) $(LOADLIBES) $(LDLIBS) /exe=$@",
|
||||
".for.exe",
|
||||
"$(COMPILE.for) $^ \n $(LINK.obj) $(subst .for,.obj,$^) $(LOADLIBES) $(LDLIBS) /exe=$@",
|
||||
".pas.exe",
|
||||
"$(COMPILE.pas) $^ \n $(LINK.obj) $(subst .pas,.obj,$^) $(LOADLIBES) $(LDLIBS) /exe=$@",
|
||||
|
||||
".com",
|
||||
"copy $< >$@",
|
||||
|
||||
".mar.obj",
|
||||
"$(COMPILE.mar) /obj=$@ $<",
|
||||
".c.obj",
|
||||
"$(COMPILE.c) /obj=$@ $<",
|
||||
".cc.obj",
|
||||
"$(COMPILE.cc) /obj=$@ $<",
|
||||
".for.obj",
|
||||
"$(COMPILE.for) /obj=$@ $<",
|
||||
".pas.obj",
|
||||
"$(COMPILE.pas) /obj=$@ $<",
|
||||
|
||||
".y.c",
|
||||
"$(YACC.y) $< \n rename y_tab.c $@",
|
||||
".l.c",
|
||||
"$(LEX.l) $< \n rename lexyy.c $@",
|
||||
|
||||
".texinfo.info",
|
||||
"$(MAKEINFO) $<",
|
||||
|
||||
".tex.dvi",
|
||||
"$(TEX) $<",
|
||||
|
||||
#else /* ! VMS */
|
||||
|
||||
".o",
|
||||
"$(LINK.o) $^ $(LOADLIBES) $(LDLIBS) -o $@",
|
||||
".s",
|
||||
@@ -101,24 +167,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",
|
||||
@@ -203,11 +261,52 @@ static char *default_suffix_rules[] =
|
||||
".web.tex",
|
||||
"$(WEAVE) $<",
|
||||
|
||||
#endif /* !VMS */
|
||||
|
||||
0, 0,
|
||||
};
|
||||
|
||||
static char *default_variables[] =
|
||||
{
|
||||
#ifdef VMS
|
||||
"AR", "library/obj",
|
||||
"ARFLAGS", "/replace",
|
||||
"AS", "macro",
|
||||
"CC", "cc",
|
||||
"C++", "gcc/plus",
|
||||
"CXX", "gcc/plus",
|
||||
"CO", "co",
|
||||
"CPP", "$(CC) /preprocess_only",
|
||||
"FC", "fortran",
|
||||
/* System V uses these, so explicit rules using them should work.
|
||||
However, there is no way to make implicit rules use them and FC. */
|
||||
"F77", "$(FC)",
|
||||
"F77FLAGS", "$(FFLAGS)",
|
||||
"LD", "link",
|
||||
"LEX", "lex",
|
||||
"PC", "pascal",
|
||||
"YACC", "yacc", /* Or "bison -y" */
|
||||
"MAKEINFO", "makeinfo",
|
||||
"TEX", "tex",
|
||||
"TEXINDEX", "texindex",
|
||||
|
||||
"RM", "delete/nolog",
|
||||
|
||||
"LINK.obj", "$(LD) $(LDFLAGS)",
|
||||
"COMPILE.c", "$(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH)",
|
||||
"COMPILE.cc", "$(C++) $(C++FLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c",
|
||||
"YACC.y", "$(YACC) $(YFLAGS)",
|
||||
"LEX.l", "$(LEX) $(LFLAGS)",
|
||||
"COMPILE.for", "$(FC) $(FFLAGS) $(TARGET_ARCH)",
|
||||
"COMPILE.pas", "$(PC) $(PFLAGS) $(CPPFLAGS) $(TARGET_ARCH)",
|
||||
"COMPILE.mar", "$(AS) $(ASFLAGS) $(TARGET_MACH)",
|
||||
"LINT.c", "$(LINT) $(LINTFLAGS) $(CPPFLAGS) $(TARGET_ARCH)",
|
||||
|
||||
"MV", "rename/new_version",
|
||||
"CP", "copy",
|
||||
|
||||
#else /* !VMS */
|
||||
|
||||
"AR", "ar",
|
||||
"ARFLAGS", "rv",
|
||||
"AS", "as",
|
||||
@@ -222,8 +321,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,27 +404,20 @@ 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
|
||||
"SCCS_OUTPUT_OPTION", "-G$@",
|
||||
#endif
|
||||
|
||||
#endif /* !VMS */
|
||||
0, 0
|
||||
};
|
||||
|
||||
@@ -357,7 +449,7 @@ void
|
||||
install_default_suffix_rules ()
|
||||
{
|
||||
register char **s;
|
||||
|
||||
|
||||
if (no_builtin_rules_flag)
|
||||
return;
|
||||
|
||||
@@ -382,7 +474,7 @@ void
|
||||
install_default_implicit_rules ()
|
||||
{
|
||||
register struct pspec *p;
|
||||
|
||||
|
||||
if (no_builtin_rules_flag)
|
||||
return;
|
||||
|
||||
|
||||
15
dep.h
15
dep.h
@@ -1,5 +1,5 @@
|
||||
/* Definitions of dependency data structures for GNU Make.
|
||||
Copyright (C) 1988, 1989, 1991, 1992, 1993 Free Software Foundation, Inc.
|
||||
Copyright (C) 1988, 1989, 1991, 1992, 1993, 1996 Free Software Foundation, Inc.
|
||||
This file is part of GNU Make.
|
||||
|
||||
GNU Make is free software; you can redistribute it and/or modify
|
||||
@@ -40,11 +40,16 @@ struct nameseq
|
||||
};
|
||||
|
||||
|
||||
extern struct nameseq *multi_glob (), *parse_file_seq ();
|
||||
extern char *tilde_expand ();
|
||||
extern struct nameseq *multi_glob PARAMS ((struct nameseq *chain, unsigned int size));
|
||||
#ifdef VMS
|
||||
extern struct nameseq *parse_file_seq ();
|
||||
#else
|
||||
extern struct nameseq *parse_file_seq PARAMS ((char **stringp, int stopchar, unsigned int size, int strip));
|
||||
#endif
|
||||
extern char *tilde_expand PARAMS ((char *name));
|
||||
|
||||
#ifndef NO_ARCHIVES
|
||||
extern struct nameseq *ar_glob ();
|
||||
extern struct nameseq *ar_glob PARAMS ((char *arname, char *member_pattern, unsigned int size));
|
||||
#endif
|
||||
|
||||
#ifndef iAPX286
|
||||
@@ -54,7 +59,7 @@ extern struct nameseq *ar_glob ();
|
||||
extern char *dep_name ();
|
||||
#endif
|
||||
|
||||
extern struct dep *read_all_makefiles ();
|
||||
extern struct dep *read_all_makefiles PARAMS ((char **makefiles));
|
||||
|
||||
/* Flag bits for the second argument to `read_makefile'.
|
||||
These flags are saved in the `changed' field of each
|
||||
|
||||
458
dir.c
458
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,40 @@ 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
|
||||
# ifdef HAVE_VMSDIR_H
|
||||
# include "vmsdir.h"
|
||||
# endif /* HAVE_VMSDIR_H */
|
||||
#endif
|
||||
|
||||
#if defined (POSIX) && !defined (__GNU_LIBRARY__)
|
||||
/* 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 (WIN32)) && !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__
|
||||
@@ -88,7 +95,96 @@ dosify (filename)
|
||||
*df = 0;
|
||||
return dos_filename;
|
||||
}
|
||||
#endif /* __MSDOS__ */
|
||||
|
||||
#ifdef WIN32
|
||||
#include "pathstuff.h"
|
||||
#endif
|
||||
|
||||
#ifdef _AMIGA
|
||||
#include <ctype.h>
|
||||
|
||||
static char *
|
||||
amigafy (filename)
|
||||
char *filename;
|
||||
{
|
||||
static char amiga_filename[136];
|
||||
char *df;
|
||||
int i;
|
||||
|
||||
if (filename == 0)
|
||||
return 0;
|
||||
|
||||
df = amiga_filename;
|
||||
|
||||
/* First, transform the name part. */
|
||||
for (i = 0; *filename != '\0'; ++i)
|
||||
{
|
||||
*df++ = tolower (*filename);
|
||||
++filename;
|
||||
}
|
||||
|
||||
*df = 0;
|
||||
|
||||
return amiga_filename;
|
||||
}
|
||||
#endif /* _AMIGA */
|
||||
|
||||
#ifdef VMS
|
||||
|
||||
static int
|
||||
vms_hash (name)
|
||||
char *name;
|
||||
{
|
||||
int h = 0;
|
||||
int g;
|
||||
|
||||
while (*name)
|
||||
{
|
||||
h = (h << 4) + *name++;
|
||||
g = h & 0xf0000000;
|
||||
if (g)
|
||||
{
|
||||
h = h ^ (g >> 24);
|
||||
h = h ^ g;
|
||||
}
|
||||
}
|
||||
return h;
|
||||
}
|
||||
|
||||
/* fake stat entry for a directory */
|
||||
static int
|
||||
vmsstat_dir (name, st)
|
||||
char *name;
|
||||
struct stat *st;
|
||||
{
|
||||
char *s;
|
||||
int h;
|
||||
DIR *dir;
|
||||
|
||||
dir = opendir (name);
|
||||
if (dir == 0)
|
||||
return -1;
|
||||
closedir (dir);
|
||||
s = strchr (name, ':'); /* find device */
|
||||
if (s)
|
||||
{
|
||||
*s++ = 0;
|
||||
st->st_dev = (char *)vms_hash (name);
|
||||
}
|
||||
else
|
||||
{
|
||||
st->st_dev = 0;
|
||||
s = name;
|
||||
}
|
||||
h = vms_hash (s);
|
||||
st->st_ino[0] = h & 0xff;
|
||||
st->st_ino[1] = h & 0xff00;
|
||||
st->st_ino[2] = h >> 16;
|
||||
|
||||
return 0;
|
||||
}
|
||||
#endif /* VMS */
|
||||
|
||||
/* Hash table of directories. */
|
||||
|
||||
@@ -100,8 +196,25 @@ struct directory_contents
|
||||
{
|
||||
struct directory_contents *next;
|
||||
|
||||
int dev, ino; /* Device and inode numbers of this dir. */
|
||||
|
||||
dev_t dev; /* Device and inode numbers of this dir. */
|
||||
#ifdef WIN32
|
||||
/*
|
||||
* Inode means nothing on WIN32. Even file key information is
|
||||
* unreliable because it is random per file open and undefined
|
||||
* for remote filesystems. The most unique attribute I can
|
||||
* come up with is the fully qualified name of the directory. Beware
|
||||
* though, this is also unreliable. I'm open to suggestion on a better
|
||||
* way to emulate inode.
|
||||
*/
|
||||
char *path_key;
|
||||
int mtime; /* controls check for stale directory cache */
|
||||
#else
|
||||
#ifdef VMS
|
||||
ino_t ino[3];
|
||||
#else
|
||||
ino_t ino;
|
||||
#endif
|
||||
#endif /* WIN32 */
|
||||
struct dirfile **files; /* Files in this directory. */
|
||||
DIR *dirstream; /* Stream reading this directory. */
|
||||
};
|
||||
@@ -145,7 +258,8 @@ struct dirfile
|
||||
#define DIRFILE_BUCKETS 107
|
||||
#endif
|
||||
|
||||
static int dir_contents_file_exists_p ();
|
||||
static int dir_contents_file_exists_p PARAMS ((struct directory_contents *dir, char *filename));
|
||||
static struct directory *find_directory PARAMS ((char *name));
|
||||
|
||||
/* Find the directory named NAME and return its `struct directory'. */
|
||||
|
||||
@@ -156,13 +270,22 @@ find_directory (name)
|
||||
register unsigned int hash = 0;
|
||||
register char *p;
|
||||
register struct directory *dir;
|
||||
#ifdef WIN32
|
||||
char* w32_path;
|
||||
#endif
|
||||
#ifdef VMS
|
||||
if ((*name == '.') && (*(name+1) == 0))
|
||||
name = "[]";
|
||||
else
|
||||
name = vmsify (name,1);
|
||||
#endif
|
||||
|
||||
for (p = name; *p != '\0'; ++p)
|
||||
HASH (hash, *p);
|
||||
HASHI (hash, *p);
|
||||
hash %= DIRECTORY_BUCKETS;
|
||||
|
||||
for (dir = directories[hash]; dir != 0; dir = dir->next)
|
||||
if (streq (dir->name, name))
|
||||
if (strieq (dir->name, name))
|
||||
break;
|
||||
|
||||
if (dir == 0)
|
||||
@@ -179,21 +302,50 @@ 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)
|
||||
#ifdef VMS
|
||||
if (vmsstat_dir (name, &st) < 0)
|
||||
#else
|
||||
if (stat (name, &st) < 0)
|
||||
#endif
|
||||
{
|
||||
/* Couldn't stat the directory. Mark this by
|
||||
setting the `contents' member to a nil pointer. */
|
||||
dir->contents = 0;
|
||||
dir->contents = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Search the contents hash table; device and inode are the key. */
|
||||
|
||||
struct directory_contents *dc;
|
||||
|
||||
#ifdef WIN32
|
||||
w32_path = w32ify(name, 1);
|
||||
hash = ((unsigned int) st.st_dev << 16) | (unsigned int) st.st_ctime;
|
||||
#else
|
||||
#ifdef VMS
|
||||
hash = ((unsigned int) st.st_dev << 16)
|
||||
| ((unsigned int) st.st_ino[0]
|
||||
+ (unsigned int) st.st_ino[1]
|
||||
+ (unsigned int) st.st_ino[2]);
|
||||
#else
|
||||
hash = ((unsigned int) st.st_dev << 16) | (unsigned int) st.st_ino;
|
||||
#endif
|
||||
#endif
|
||||
hash %= DIRECTORY_BUCKETS;
|
||||
|
||||
for (dc = directories_contents[hash]; dc != 0; dc = dc->next)
|
||||
if (dc->dev == st.st_dev && dc->ino == st.st_ino)
|
||||
#ifdef WIN32
|
||||
if (!strcmp(dc->path_key, w32_path))
|
||||
#else
|
||||
if (dc->dev == st.st_dev
|
||||
#ifdef VMS
|
||||
&& dc->ino[0] == st.st_ino[0]
|
||||
&& dc->ino[1] == st.st_ino[1]
|
||||
&& dc->ino[2] == st.st_ino[2])
|
||||
#else
|
||||
&& dc->ino == st.st_ino)
|
||||
#endif
|
||||
#endif /* WIN32 */
|
||||
break;
|
||||
|
||||
if (dc == 0)
|
||||
@@ -205,15 +357,28 @@ find_directory (name)
|
||||
|
||||
/* Enter it in the contents hash table. */
|
||||
dc->dev = st.st_dev;
|
||||
#ifdef WIN32
|
||||
dc->path_key = strdup(w32_path);
|
||||
dc->mtime = st.st_mtime;
|
||||
#else
|
||||
#ifdef VMS
|
||||
dc->ino[0] = st.st_ino[0];
|
||||
dc->ino[1] = st.st_ino[1];
|
||||
dc->ino[2] = st.st_ino[2];
|
||||
#else
|
||||
dc->ino = st.st_ino;
|
||||
#endif
|
||||
#endif /* WIN32 */
|
||||
dc->next = directories_contents[hash];
|
||||
directories_contents[hash] = dc;
|
||||
|
||||
dc->dirstream = opendir (name);
|
||||
if (dc->dirstream == 0)
|
||||
{
|
||||
/* Couldn't open the directory. Mark this by
|
||||
setting the `files' member to a nil pointer. */
|
||||
dc->files = 0;
|
||||
dc->files = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Allocate an array of buckets for files and zero it. */
|
||||
@@ -251,21 +416,36 @@ dir_contents_file_exists_p (dir, filename)
|
||||
register char *p;
|
||||
register struct dirfile *df;
|
||||
register struct dirent *d;
|
||||
#ifdef WIN32
|
||||
struct stat st;
|
||||
int rehash = 0;
|
||||
#endif
|
||||
|
||||
if (dir == 0 || dir->files == 0)
|
||||
{
|
||||
/* The directory could not be stat'd or opened. */
|
||||
return 0;
|
||||
|
||||
return 0;
|
||||
}
|
||||
#ifdef __MSDOS__
|
||||
filename = dosify (filename);
|
||||
#endif
|
||||
|
||||
#ifdef _AMIGA
|
||||
filename = amigafy (filename);
|
||||
#endif
|
||||
|
||||
#ifdef VMS
|
||||
filename = vmsify (filename,0);
|
||||
#endif
|
||||
|
||||
hash = 0;
|
||||
if (filename != 0)
|
||||
{
|
||||
if (*filename == '\0')
|
||||
{
|
||||
/* Checking if the directory exists. */
|
||||
return 1;
|
||||
return 1;
|
||||
}
|
||||
|
||||
for (p = filename; *p != '\0'; ++p)
|
||||
HASH (hash, *p);
|
||||
@@ -274,16 +454,40 @@ dir_contents_file_exists_p (dir, filename)
|
||||
/* Search the list of hashed files. */
|
||||
|
||||
for (df = dir->files[hash]; df != 0; df = df->next)
|
||||
if (streq (df->name, filename))
|
||||
return !df->impossible;
|
||||
{
|
||||
if (strieq (df->name, filename))
|
||||
{
|
||||
return !df->impossible;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* The file was not found in the hashed list.
|
||||
Try to read the directory further. */
|
||||
|
||||
if (dir->dirstream == 0)
|
||||
{
|
||||
#ifdef WIN32
|
||||
/* Check to see if directory has changed since last read */
|
||||
if (dir->path_key &&
|
||||
stat(dir->path_key, &st) == 0 &&
|
||||
st.st_mtime > dir->mtime) {
|
||||
|
||||
/* reset date stamp to show most recent re-process */
|
||||
dir->mtime = st.st_mtime;
|
||||
|
||||
/* make sure directory can still be opened */
|
||||
dir->dirstream = opendir(dir->path_key);
|
||||
|
||||
if (dir->dirstream)
|
||||
rehash = 1;
|
||||
else
|
||||
return 0; /* couldn't re-read - fail */
|
||||
} else
|
||||
#endif
|
||||
/* The directory has been all read in. */
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
while ((d = readdir (dir->dirstream)) != 0)
|
||||
{
|
||||
@@ -295,24 +499,43 @@ 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]);
|
||||
HASHI (newhash, d->d_name[i]);
|
||||
newhash %= DIRFILE_BUCKETS;
|
||||
#ifdef WIN32
|
||||
/*
|
||||
* If re-reading a directory, check that this file isn't already
|
||||
* in the cache.
|
||||
*/
|
||||
if (rehash) {
|
||||
for (df = dir->files[newhash]; df != 0; df = df->next)
|
||||
if (streq(df->name, d->d_name))
|
||||
break;
|
||||
} else
|
||||
df = 0;
|
||||
|
||||
/*
|
||||
* If re-reading a directory, don't cache files that have
|
||||
* already been discovered.
|
||||
*/
|
||||
if (!df) {
|
||||
#endif
|
||||
|
||||
df = (struct dirfile *) xmalloc (sizeof (struct dirfile));
|
||||
df->next = dir->files[newhash];
|
||||
dir->files[newhash] = df;
|
||||
df->name = savestring (d->d_name, len);
|
||||
df->impossible = 0;
|
||||
|
||||
#ifdef WIN32
|
||||
}
|
||||
#endif
|
||||
/* Check if the name matches the one we're searching for. */
|
||||
if (filename != 0
|
||||
&& newhash == hash && streq (d->d_name, filename))
|
||||
return 1;
|
||||
&& newhash == hash && strieq (d->d_name, filename))
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
/* If the directory has been completely read in,
|
||||
@@ -323,7 +546,6 @@ dir_contents_file_exists_p (dir, filename)
|
||||
closedir (dir->dirstream);
|
||||
dir->dirstream = 0;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -354,9 +576,26 @@ file_exists_p (name)
|
||||
return ar_member_date (name) != (time_t) -1;
|
||||
#endif
|
||||
|
||||
#ifdef VMS
|
||||
dirend = rindex (name, ']');
|
||||
dirend++;
|
||||
if (dirend == (char *)1)
|
||||
return dir_file_exists_p ("[]", name);
|
||||
#else /* !VMS */
|
||||
dirend = rindex (name, '/');
|
||||
#ifdef WIN32
|
||||
if (!dirend)
|
||||
dirend = rindex(name, '\\');
|
||||
#endif /* WIN32 */
|
||||
if (dirend == 0)
|
||||
return dir_file_exists_p (".", name);
|
||||
if (dirend == 0)
|
||||
#ifndef _AMIGA
|
||||
return dir_file_exists_p (".", name);
|
||||
#else /* !VMS && !AMIGA */
|
||||
return dir_file_exists_p ("", name);
|
||||
#endif /* AMIGA */
|
||||
#endif /* VMS */
|
||||
|
||||
dirname = (char *) alloca (dirend - name + 1);
|
||||
bcopy (name, dirname, dirend - name);
|
||||
@@ -378,9 +617,20 @@ file_impossible (filename)
|
||||
register struct directory *dir;
|
||||
register struct dirfile *new;
|
||||
|
||||
#ifdef VMS
|
||||
dirend = rindex (p, ']');
|
||||
dirend++;
|
||||
if (dirend == (char *)1)
|
||||
dir = find_directory ("[]");
|
||||
#else
|
||||
dirend = rindex (p, '/');
|
||||
if (dirend == 0)
|
||||
#ifdef _AMIGA
|
||||
dir = find_directory ("");
|
||||
#else /* !VMS && !AMIGA */
|
||||
dir = find_directory (".");
|
||||
#endif /* AMIGA */
|
||||
#endif /* VMS */
|
||||
else
|
||||
{
|
||||
char *dirname = (char *) alloca (dirend - p + 1);
|
||||
@@ -391,7 +641,7 @@ file_impossible (filename)
|
||||
}
|
||||
|
||||
for (hash = 0; *p != '\0'; ++p)
|
||||
HASH (hash, *p);
|
||||
HASHI (hash, *p);
|
||||
hash %= DIRFILE_BUCKETS;
|
||||
|
||||
if (dir->contents == 0)
|
||||
@@ -400,7 +650,18 @@ file_impossible (filename)
|
||||
structure for it, but leave it out of the contents hash table. */
|
||||
dir->contents = (struct directory_contents *)
|
||||
xmalloc (sizeof (struct directory_contents));
|
||||
#ifdef WIN32
|
||||
dir->contents->path_key = NULL;
|
||||
dir->contents->mtime = 0;
|
||||
#else /* WIN32 */
|
||||
#ifdef VMS
|
||||
dir->contents->dev = 0;
|
||||
dir->contents->ino[0] = dir->contents->ino[1] =
|
||||
dir->contents->ino[2] = 0;
|
||||
#else
|
||||
dir->contents->dev = dir->contents->ino = 0;
|
||||
#endif
|
||||
#endif /* WIN32 */
|
||||
dir->contents->files = 0;
|
||||
dir->contents->dirstream = 0;
|
||||
}
|
||||
@@ -435,16 +696,30 @@ file_impossible_p (filename)
|
||||
register struct directory_contents *dir;
|
||||
register struct dirfile *next;
|
||||
|
||||
dirend = rindex (filename, '/');
|
||||
#ifdef VMS
|
||||
dirend = rindex (filename, ']');
|
||||
if (dirend == 0)
|
||||
dir = find_directory ("[]")->contents;
|
||||
#else
|
||||
dirend = rindex (filename, '/');
|
||||
#ifdef WIN32
|
||||
if (!dirend)
|
||||
dirend = rindex (filename, '\\');
|
||||
#endif /* WIN32 */
|
||||
if (dirend == 0)
|
||||
#ifdef _AMIGA
|
||||
dir = find_directory ("")->contents;
|
||||
#else /* !VMS && !AMIGA */
|
||||
dir = find_directory (".")->contents;
|
||||
#endif /* AMIGA */
|
||||
#endif /* VMS */
|
||||
else
|
||||
{
|
||||
char *dirname = (char *) alloca (dirend - filename + 1);
|
||||
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)
|
||||
@@ -454,13 +729,19 @@ file_impossible_p (filename)
|
||||
#ifdef __MSDOS__
|
||||
p = filename = dosify (p);
|
||||
#endif
|
||||
#ifdef _AMIGA
|
||||
p = filename = amigafy (p);
|
||||
#endif
|
||||
#ifdef VMS
|
||||
p = filename = vmsify (p, 1);
|
||||
#endif
|
||||
|
||||
for (hash = 0; *p != '\0'; ++p)
|
||||
HASH (hash, *p);
|
||||
hash %= DIRFILE_BUCKETS;
|
||||
|
||||
for (next = dir->files[hash]; next != 0; next = next->next)
|
||||
if (streq (filename, next->name))
|
||||
if (strieq (filename, next->name))
|
||||
return next->impossible;
|
||||
|
||||
return 0;
|
||||
@@ -494,8 +775,21 @@ print_dir_data_base ()
|
||||
if (dir->contents == 0)
|
||||
printf ("# %s: could not be stat'd.\n", dir->name);
|
||||
else if (dir->contents->files == 0)
|
||||
printf ("# %s (device %d, inode %d): could not be opened.\n",
|
||||
dir->name, dir->contents->dev, dir->contents->ino);
|
||||
#ifdef WIN32
|
||||
printf ("# %s (key %s, mtime %d): could not be opened.\n",
|
||||
dir->name, dir->contents->path_key,dir->contents->mtime);
|
||||
#else /* WIN32 */
|
||||
#ifdef VMS
|
||||
printf ("# %s (device %d, inode [%d,%d,%d]): could not be opened.\n",
|
||||
dir->name, dir->contents->dev,
|
||||
dir->contents->ino[0], dir->contents->ino[1],
|
||||
dir->contents->ino[2]);
|
||||
#else
|
||||
printf ("# %s (device %ld, inode %ld): could not be opened.\n",
|
||||
dir->name, (long int) dir->contents->dev,
|
||||
(long int) dir->contents->ino);
|
||||
#endif
|
||||
#endif /* WIN32 */
|
||||
else
|
||||
{
|
||||
register unsigned int f = 0, im = 0;
|
||||
@@ -507,8 +801,20 @@ print_dir_data_base ()
|
||||
++im;
|
||||
else
|
||||
++f;
|
||||
#ifdef WIN32
|
||||
printf ("# %s (key %s, mtime %d): ",
|
||||
dir->name, dir->contents->path_key, dir->contents->mtime);
|
||||
#else /* WIN32 */
|
||||
#ifdef VMS
|
||||
printf ("# %s (device %d, inode [%d,%d,%d]): ",
|
||||
dir->name, dir->contents->dev,
|
||||
dir->contents->ino[0], dir->contents->ino[1],
|
||||
dir->contents->ino[2]);
|
||||
#else
|
||||
printf ("# %s (device %d, inode %d): ",
|
||||
dir->name, dir->contents->dev, dir->contents->ino);
|
||||
#endif
|
||||
#endif /* WIN32 */
|
||||
if (f == 0)
|
||||
fputs ("No", stdout);
|
||||
else
|
||||
@@ -556,15 +862,15 @@ struct dirstream
|
||||
};
|
||||
|
||||
/* Forward declarations. */
|
||||
static __ptr_t open_dirstream __P ((const char *));
|
||||
static const char *read_dirstream __P ((__ptr_t));
|
||||
static __ptr_t open_dirstream PARAMS ((const char *));
|
||||
static struct dirent *read_dirstream PARAMS ((__ptr_t));
|
||||
|
||||
static __ptr_t
|
||||
open_dirstream (directory)
|
||||
const char *directory;
|
||||
{
|
||||
struct dirstream *new;
|
||||
struct directory *dir = find_directory (directory);
|
||||
struct directory *dir = find_directory ((char *)directory);
|
||||
|
||||
if (dir->contents == 0 || dir->contents->files == 0)
|
||||
/* DIR->contents is nil if the directory could not be stat'd.
|
||||
@@ -584,12 +890,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 +905,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 +937,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. */
|
||||
}
|
||||
|
||||
3
expand.c
3
expand.c
@@ -17,8 +17,9 @@ along with GNU Make; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||
|
||||
#include "make.h"
|
||||
#include "filedef.h"
|
||||
#include "job.h"
|
||||
#include "commands.h"
|
||||
#include "file.h"
|
||||
#include "variable.h"
|
||||
|
||||
/* The next two describe the variable output buffer.
|
||||
|
||||
135
file.c
135
file.c
@@ -1,5 +1,5 @@
|
||||
/* Target file hash table management 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
|
||||
@@ -17,9 +17,10 @@ along with GNU Make; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||
|
||||
#include "make.h"
|
||||
#include "commands.h"
|
||||
#include "dep.h"
|
||||
#include "file.h"
|
||||
#include "filedef.h"
|
||||
#include "job.h"
|
||||
#include "commands.h"
|
||||
#include "variable.h"
|
||||
#include <assert.h>
|
||||
|
||||
@@ -55,6 +56,10 @@ lookup_file (name)
|
||||
/* This is also done in parse_file_seq, so this is redundant
|
||||
for names read from makefiles. It is here for names passed
|
||||
on the command line. */
|
||||
#ifdef VMS
|
||||
while (name[0] == '[' && name[1] == ']' && name[2] != '\0')
|
||||
name += 2;
|
||||
#endif
|
||||
while (name[0] == '.' && name[1] == '/' && name[2] != '\0')
|
||||
{
|
||||
name += 2;
|
||||
@@ -65,16 +70,28 @@ lookup_file (name)
|
||||
|
||||
if (*name == '\0')
|
||||
/* It was all slashes after a dot. */
|
||||
#ifdef VMS
|
||||
name = "[]";
|
||||
#else
|
||||
#ifdef _AMIGA
|
||||
name = "";
|
||||
#else
|
||||
name = "./";
|
||||
#endif /* AMIGA */
|
||||
#endif /* VMS */
|
||||
|
||||
hashval = 0;
|
||||
for (n = name; *n != '\0'; ++n)
|
||||
HASH (hashval, *n);
|
||||
HASHI (hashval, *n);
|
||||
hashval %= FILE_BUCKETS;
|
||||
|
||||
for (f = files[hashval]; f != 0; f = f->next)
|
||||
if (streq (f->name, name))
|
||||
return f;
|
||||
{
|
||||
if (strieq (f->name, name))
|
||||
{
|
||||
return f;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -85,21 +102,42 @@ enter_file (name)
|
||||
register struct file *f, *new;
|
||||
register char *n;
|
||||
register unsigned int hashval;
|
||||
#ifdef VMS
|
||||
char *lname, *ln;
|
||||
#endif
|
||||
|
||||
if (*name == '\0')
|
||||
abort ();
|
||||
|
||||
#ifdef VMS
|
||||
lname = (char *)malloc (strlen (name) + 1);
|
||||
for (n = name, ln = lname; *n != '\0'; ++n, ++ln)
|
||||
{
|
||||
if (isupper(*n))
|
||||
*ln = tolower(*n);
|
||||
else
|
||||
*ln = *n;
|
||||
}
|
||||
*ln = 0;
|
||||
name = lname;
|
||||
#endif
|
||||
|
||||
hashval = 0;
|
||||
for (n = name; *n != '\0'; ++n)
|
||||
HASH (hashval, *n);
|
||||
HASHI (hashval, *n);
|
||||
hashval %= FILE_BUCKETS;
|
||||
|
||||
for (f = files[hashval]; f != 0; f = f->next)
|
||||
if (streq (f->name, name))
|
||||
if (strieq (f->name, name))
|
||||
break;
|
||||
|
||||
if (f != 0 && !f->double_colon)
|
||||
return f;
|
||||
{
|
||||
#ifdef VMS
|
||||
free(lname);
|
||||
#endif
|
||||
return f;
|
||||
}
|
||||
|
||||
new = (struct file *) xmalloc (sizeof (struct file));
|
||||
bzero ((char *) new, sizeof (struct file));
|
||||
@@ -144,7 +182,7 @@ rename_file (file, name)
|
||||
|
||||
oldhash = 0;
|
||||
for (n = oldname; *n != '\0'; ++n)
|
||||
HASH (oldhash, *n);
|
||||
HASHI (oldhash, *n);
|
||||
|
||||
file_hash_enter (file, name, oldhash, file->name);
|
||||
}
|
||||
@@ -164,13 +202,13 @@ file_hash_enter (file, name, oldhash, oldname)
|
||||
|
||||
newhash = 0;
|
||||
for (n = name; *n != '\0'; ++n)
|
||||
HASH (newhash, *n);
|
||||
HASHI (newhash, *n);
|
||||
newbucket = newhash % FILE_BUCKETS;
|
||||
|
||||
/* Look for an existing file under the new name. */
|
||||
|
||||
for (oldfile = files[newbucket]; oldfile != 0; oldfile = oldfile->next)
|
||||
if (streq (oldfile->name, name))
|
||||
if (strieq (oldfile->name, name))
|
||||
break;
|
||||
|
||||
if (oldhash != 0 && (newbucket != oldbucket || oldfile != 0))
|
||||
@@ -257,12 +295,17 @@ in favor of those for `%s'.",
|
||||
|
||||
merge_variable_set_lists (&oldfile->variables, file->variables);
|
||||
|
||||
if (oldfile->double_colon && !file->double_colon)
|
||||
if (oldfile->double_colon && file->is_target && !file->double_colon)
|
||||
fatal ("can't rename single-colon `%s' to double-colon `%s'",
|
||||
oldname, name);
|
||||
if (!oldfile->double_colon && file->double_colon)
|
||||
fatal ("can't rename double-colon `%s' to single-colon `%s'",
|
||||
oldname, name);
|
||||
if (!oldfile->double_colon && file->double_colon)
|
||||
{
|
||||
if (oldfile->is_target)
|
||||
fatal ("can't rename double-colon `%s' to single-colon `%s'",
|
||||
oldname, name);
|
||||
else
|
||||
oldfile->double_colon = file->double_colon;
|
||||
}
|
||||
|
||||
if (file->last_mtime > oldfile->last_mtime)
|
||||
/* %%% Kludge so -W wins on a file that gets vpathized. */
|
||||
@@ -294,7 +337,7 @@ remove_intermediates (sig)
|
||||
register int i;
|
||||
register struct file *f;
|
||||
char doneany;
|
||||
|
||||
|
||||
if (question_flag || touch_flag)
|
||||
return;
|
||||
if (sig && just_print_flag)
|
||||
@@ -303,7 +346,8 @@ remove_intermediates (sig)
|
||||
doneany = 0;
|
||||
for (i = 0; i < FILE_BUCKETS; ++i)
|
||||
for (f = files[i]; f != 0; f = f->next)
|
||||
if (f->intermediate && (f->dontcare || !f->precious))
|
||||
if (f->intermediate && (f->dontcare || !f->precious)
|
||||
&& !f->secondary)
|
||||
{
|
||||
int status;
|
||||
if (f->update_status == -1)
|
||||
@@ -349,7 +393,8 @@ remove_intermediates (sig)
|
||||
/* For each dependency of each file, make the `struct dep' point
|
||||
at the appropriate `struct file' (which may have to be created).
|
||||
|
||||
Also mark the files depended on by .PRECIOUS and .PHONY. */
|
||||
Also mark the files depended on by .PRECIOUS, .PHONY, .SILENT,
|
||||
and various other special targets. */
|
||||
|
||||
void
|
||||
snap_deps ()
|
||||
@@ -372,7 +417,7 @@ snap_deps ()
|
||||
free (d->name);
|
||||
d->name = 0;
|
||||
}
|
||||
|
||||
|
||||
for (f = lookup_file (".PRECIOUS"); f != 0; f = f->prev)
|
||||
for (d = f->deps; d != 0; d = d->next)
|
||||
for (f2 = d->file; f2 != 0; f2 = f2->prev)
|
||||
@@ -387,6 +432,41 @@ snap_deps ()
|
||||
f2->last_mtime = (time_t) -1;
|
||||
}
|
||||
|
||||
for (f = lookup_file (".INTERMEDIATE"); f != 0; f = f->prev)
|
||||
{
|
||||
/* .INTERMEDIATE with deps listed
|
||||
marks those deps as intermediate files. */
|
||||
for (d = f->deps; d != 0; d = d->next)
|
||||
for (f2 = d->file; f2 != 0; f2 = f2->prev)
|
||||
f2->intermediate = 1;
|
||||
/* .INTERMEDIATE with no deps does nothing.
|
||||
Marking all files as intermediates is useless
|
||||
since the goal targets would be deleted after they are built. */
|
||||
}
|
||||
|
||||
for (f = lookup_file (".SECONDARY"); f != 0; f = f->prev)
|
||||
{
|
||||
/* .SECONDARY with deps listed
|
||||
marks those deps as intermediate files
|
||||
in that they don't get rebuilt if not actually needed;
|
||||
but unlike real intermediate files,
|
||||
these are not deleted after make finishes. */
|
||||
if (f->deps)
|
||||
{
|
||||
for (d = f->deps; d != 0; d = d->next)
|
||||
for (f2 = d->file; f2 != 0; f2 = f2->prev)
|
||||
f2->intermediate = f2->secondary = 1;
|
||||
}
|
||||
/* .SECONDARY with no deps listed marks *all* files that way. */
|
||||
else
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < FILE_BUCKETS; i++)
|
||||
for (f2 = files[i]; f2; f2= f2->next)
|
||||
f2->intermediate = f2->secondary = 1;
|
||||
}
|
||||
}
|
||||
|
||||
f = lookup_file (".EXPORT_ALL_VARIABLES");
|
||||
if (f != 0 && f->is_target)
|
||||
export_all_variables = 1;
|
||||
@@ -440,16 +520,18 @@ print_file (f)
|
||||
struct file *f;
|
||||
{
|
||||
register struct dep *d;
|
||||
|
||||
#ifdef VMS
|
||||
extern char *cvt_time PARAMS ((unsigned long));
|
||||
#endif
|
||||
putchar ('\n');
|
||||
if (!f->is_target)
|
||||
puts ("# Not a target:");
|
||||
printf ("%s:%s", f->name, f->double_colon ? ":" : "");
|
||||
|
||||
|
||||
for (d = f->deps; d != 0; d = d->next)
|
||||
printf (" %s", dep_name (d));
|
||||
putchar ('\n');
|
||||
|
||||
|
||||
if (f->precious)
|
||||
puts ("# Precious file (dependency of .PRECIOUS).");
|
||||
if (f->phony)
|
||||
@@ -476,8 +558,13 @@ print_file (f)
|
||||
else if (f->last_mtime == (time_t) -1)
|
||||
puts ("# File does not exist.");
|
||||
else
|
||||
#ifdef VMS
|
||||
printf ("# Last modified %.24s (%0lx)\n",
|
||||
cvt_time(f->last_mtime), (unsigned long) f->last_mtime);
|
||||
#else
|
||||
printf ("# Last modified %.24s (%ld)\n",
|
||||
ctime (&f->last_mtime), (long int) f->last_mtime);
|
||||
#endif
|
||||
printf ("# File has%s been updated.\n",
|
||||
f->updated ? "" : " not");
|
||||
switch (f->command_state)
|
||||
@@ -564,3 +651,5 @@ print_file_data_base ()
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
/* EOF */
|
||||
|
||||
@@ -72,6 +72,9 @@ struct file
|
||||
unsigned int phony:1; /* Nonzero if this is a phony file
|
||||
i.e., a dependency of .PHONY. */
|
||||
unsigned int intermediate:1;/* Nonzero if this is an intermediate file. */
|
||||
/* Nonzero, for an intermediate file,
|
||||
means remove_intermediates should not delete it. */
|
||||
unsigned int secondary:1;
|
||||
unsigned int dontcare:1; /* Nonzero if no complaint is to be made if
|
||||
this target cannot be remade. */
|
||||
};
|
||||
@@ -89,11 +92,17 @@ extern void rename_file (), file_hash_enter ();
|
||||
extern void set_command_state ();
|
||||
|
||||
|
||||
/* Return the mtime of file F (a struct file *), caching it.
|
||||
The value is -1 if the file does not exist. */
|
||||
#define file_mtime(f) file_mtime_1 ((f), 1)
|
||||
/* Return the mtime of file F (a struct file *), caching it.
|
||||
Don't search using vpath for the file--if it doesn't actually exist,
|
||||
we don't find it.
|
||||
The value is -1 if the file does not exist. */
|
||||
#define file_mtime_no_search(f) file_mtime_1 ((f), 0)
|
||||
extern time_t f_mtime ();
|
||||
#define file_mtime_1(f, v) \
|
||||
((f)->last_mtime != (time_t) 0 ? (f)->last_mtime : f_mtime ((f), v))
|
||||
#define file_mtime(f) file_mtime_1 ((f), 1)
|
||||
#define file_mtime_no_search(f) file_mtime_1 ((f), 0)
|
||||
|
||||
/* Modtime value to use for `infinitely new'. We used to get the current time
|
||||
from the system and use that whenever we wanted `new'. But that causes
|
||||
272
function.c
272
function.c
@@ -1,5 +1,5 @@
|
||||
/* Variable function expansion for GNU Make.
|
||||
Copyright (C) 1988, 89, 91, 92, 93, 94, 95 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
|
||||
@@ -17,17 +17,26 @@ along with GNU Make; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||
|
||||
#include "make.h"
|
||||
#include "filedef.h"
|
||||
#include "variable.h"
|
||||
#include "dep.h"
|
||||
#include "commands.h"
|
||||
#include "job.h"
|
||||
#include "commands.h"
|
||||
|
||||
#ifdef __MSDOS__
|
||||
#include <process.h>
|
||||
#include <fcntl.h>
|
||||
#endif
|
||||
#ifdef _AMIGA
|
||||
#include "amiga.h"
|
||||
#endif
|
||||
#ifdef WIN32
|
||||
#include <windows.h>
|
||||
#include <io.h>
|
||||
#include "sub_proc.h"
|
||||
#endif
|
||||
|
||||
static char *string_glob ();
|
||||
static char *string_glob PARAMS ((char *line));
|
||||
|
||||
/* Store into VARIABLE_BUFFER at O the result of scanning TEXT and replacing
|
||||
each occurrence of SUBST with REPLACE. TEXT is null-terminated. SLEN is
|
||||
@@ -35,7 +44,7 @@ static char *string_glob ();
|
||||
nonzero, substitutions are done only on matches which are complete
|
||||
whitespace-delimited words. If SUFFIX_ONLY is nonzero, substitutions are
|
||||
done only at the ends of whitespace-delimited words. */
|
||||
|
||||
|
||||
char *
|
||||
subst_expand (o, text, subst, replace, slen, rlen, by_word, suffix_only)
|
||||
char *o;
|
||||
@@ -113,9 +122,9 @@ patsubst_expand (o, text, pattern, replace, pattern_percent, replace_percent)
|
||||
register char *pattern, *replace;
|
||||
register char *pattern_percent, *replace_percent;
|
||||
{
|
||||
register int pattern_prepercent_len, pattern_postpercent_len;
|
||||
register int replace_prepercent_len, replace_postpercent_len;
|
||||
register char *t;
|
||||
unsigned int pattern_prepercent_len, pattern_postpercent_len;
|
||||
unsigned int replace_prepercent_len, replace_postpercent_len;
|
||||
char *t;
|
||||
unsigned int len;
|
||||
int doneany = 0;
|
||||
|
||||
@@ -337,24 +346,38 @@ expand_function (o, function, text, end)
|
||||
default:
|
||||
abort ();
|
||||
break;
|
||||
|
||||
|
||||
#ifndef VMS /* not supported for vms yet */
|
||||
case function_shell:
|
||||
{
|
||||
char **argv, **envp;
|
||||
#ifdef WIN32
|
||||
SECURITY_ATTRIBUTES saAttr;
|
||||
HANDLE hIn;
|
||||
HANDLE hErr;
|
||||
HANDLE hChildOutRd;
|
||||
HANDLE hChildOutWr;
|
||||
HANDLE hProcess;
|
||||
#endif
|
||||
char **argv;
|
||||
char *error_prefix;
|
||||
#ifndef _AMIGA
|
||||
char **envp;
|
||||
int pipedes[2];
|
||||
int pid;
|
||||
#endif
|
||||
|
||||
/* Expand the command line. */
|
||||
text = expand_argument (text, end);
|
||||
|
||||
/* Construct the argument list. */
|
||||
argv = construct_command_argv (text, (char *) NULL, (struct file *) 0);
|
||||
argv = construct_command_argv (text,
|
||||
(char **) NULL, (struct file *) 0);
|
||||
if (argv == 0)
|
||||
break;
|
||||
|
||||
#ifndef _AMIGA
|
||||
/* Using a target environment for `shell' loses in cases like:
|
||||
export var = $(shell echo foobie)
|
||||
export var = $(shell echo foobie)
|
||||
because target_environment hits a loop trying to expand $(var)
|
||||
to put it in the environment. This is even more confusing when
|
||||
var was not explicitly exported, but just appeared in the
|
||||
@@ -365,6 +388,7 @@ expand_function (o, function, text, end)
|
||||
/* Construct the environment. */
|
||||
envp = target_environment ((struct file *) 0);
|
||||
#endif
|
||||
#endif /* Not Amiga. */
|
||||
|
||||
/* For error messages. */
|
||||
if (reading_filename != 0)
|
||||
@@ -376,7 +400,58 @@ expand_function (o, function, text, end)
|
||||
else
|
||||
error_prefix = "";
|
||||
|
||||
#ifndef __MSDOS__
|
||||
#if !defined(__MSDOS__) && !defined(_AMIGA)
|
||||
# ifdef WIN32
|
||||
saAttr.nLength = sizeof(SECURITY_ATTRIBUTES);
|
||||
saAttr.bInheritHandle = TRUE;
|
||||
saAttr.lpSecurityDescriptor = NULL;
|
||||
|
||||
if (DuplicateHandle(GetCurrentProcess(),
|
||||
GetStdHandle(STD_INPUT_HANDLE),
|
||||
GetCurrentProcess(),
|
||||
&hIn,
|
||||
0,
|
||||
TRUE,
|
||||
DUPLICATE_SAME_ACCESS) == FALSE) {
|
||||
fatal("create_child_process: DuplicateHandle(In) failed (e=%d)\n",
|
||||
GetLastError());
|
||||
}
|
||||
if (DuplicateHandle(GetCurrentProcess(),
|
||||
GetStdHandle(STD_ERROR_HANDLE),
|
||||
GetCurrentProcess(),
|
||||
&hErr,
|
||||
0,
|
||||
TRUE,
|
||||
DUPLICATE_SAME_ACCESS) == FALSE) {
|
||||
fatal("create_child_process: DuplicateHandle(Err) failed (e=%d)\n",
|
||||
GetLastError());
|
||||
}
|
||||
|
||||
if (!CreatePipe(&hChildOutRd, &hChildOutWr, &saAttr, 0))
|
||||
fatal("CreatePipe() failed (e=%d)\n", GetLastError());
|
||||
|
||||
hProcess = process_init_fd(hIn, hChildOutWr, hErr);
|
||||
|
||||
if (!hProcess)
|
||||
fatal("expand_function: process_init_fd() failed\n");
|
||||
else
|
||||
process_register(hProcess);
|
||||
|
||||
/* make sure that CreateProcess() has Path it needs */
|
||||
sync_Path_environment();
|
||||
|
||||
if (!process_begin(hProcess, argv, envp, argv[0], NULL))
|
||||
pid = (int) hProcess;
|
||||
else
|
||||
fatal("expand_function: unable to launch process (e=%d)\n",
|
||||
process_last_err(hProcess));
|
||||
|
||||
/* set up to read data from child */
|
||||
pipedes[0] = _open_osfhandle((long) hChildOutRd, O_RDONLY);
|
||||
|
||||
/* this will be closed almost right away */
|
||||
pipedes[1] = _open_osfhandle((long) hChildOutWr, O_APPEND);
|
||||
# else /* WIN32 */
|
||||
if (pipe (pipedes) < 0)
|
||||
{
|
||||
perror_with_name (error_prefix, "pipe");
|
||||
@@ -389,6 +464,7 @@ expand_function (o, function, text, end)
|
||||
else if (pid == 0)
|
||||
child_execute_job (0, pipedes[1], argv, envp);
|
||||
else
|
||||
# endif /* WIN32 */
|
||||
{
|
||||
/* We are the parent. */
|
||||
|
||||
@@ -481,7 +557,8 @@ expand_function (o, function, text, end)
|
||||
|
||||
free (buffer);
|
||||
}
|
||||
#else /* MSDOS. */
|
||||
#else /* MSDOS or Amiga */
|
||||
#ifndef _AMIGA
|
||||
{
|
||||
/* MS-DOS can't do fork, but it can do spawn. However, this
|
||||
means that we don't have an opportunity to reopen stdout to
|
||||
@@ -498,7 +575,7 @@ expand_function (o, function, text, end)
|
||||
unsigned int maxlen = 200;
|
||||
int cc;
|
||||
char *buffer;
|
||||
|
||||
|
||||
strcpy (tmp_output, "shXXXXXX");
|
||||
mktemp (tmp_output);
|
||||
child_stdout = open (tmp_output,
|
||||
@@ -509,9 +586,9 @@ expand_function (o, function, text, end)
|
||||
dup2 (save_stdout, 1);
|
||||
close (child_stdout);
|
||||
close (save_stdout);
|
||||
|
||||
|
||||
child_stdout = open (tmp_output, O_RDONLY|O_TEXT, 0644);
|
||||
|
||||
|
||||
buffer = xmalloc (maxlen);
|
||||
i = 0;
|
||||
do
|
||||
@@ -521,15 +598,15 @@ expand_function (o, function, text, end)
|
||||
maxlen += 512;
|
||||
buffer = (char *) xrealloc (buffer, maxlen + 1);
|
||||
}
|
||||
|
||||
|
||||
cc = read (child_stdout, &buffer[i], maxlen - i);
|
||||
if (cc > 0)
|
||||
i += cc;
|
||||
} while (cc > 0);
|
||||
|
||||
|
||||
close (child_stdout);
|
||||
unlink (tmp_output);
|
||||
|
||||
|
||||
if (i > 0)
|
||||
{
|
||||
if (buffer[i - 1] == '\n')
|
||||
@@ -543,11 +620,88 @@ expand_function (o, function, text, end)
|
||||
}
|
||||
free (buffer);
|
||||
}
|
||||
#endif /* Not MSDOS. */
|
||||
#else /* Amiga */
|
||||
{
|
||||
/* Amiga can't fork nor spawn, but I can start a program with
|
||||
redirection of my choice. The rest is the same as above. */
|
||||
#include <dos/dos.h>
|
||||
#include <proto/dos.h>
|
||||
|
||||
BPTR child_stdout;
|
||||
char tmp_output[FILENAME_MAX];
|
||||
unsigned int maxlen = 200;
|
||||
int cc;
|
||||
char * buffer, * ptr;
|
||||
char ** aptr;
|
||||
int len = 0;
|
||||
|
||||
strcpy (tmp_output, "t:MakeshXXXXXXXX");
|
||||
mktemp (tmp_output);
|
||||
child_stdout = Open (tmp_output, MODE_NEWFILE);
|
||||
|
||||
for (aptr=argv; *aptr; aptr++)
|
||||
{
|
||||
len += strlen (*aptr) + 1;
|
||||
}
|
||||
|
||||
buffer = xmalloc (len + 1);
|
||||
ptr = buffer;
|
||||
|
||||
for (aptr=argv; *aptr; aptr++)
|
||||
{
|
||||
strcpy (ptr, *aptr);
|
||||
ptr += strlen (ptr) + 1;
|
||||
*ptr ++ = ' ';
|
||||
*ptr = 0;
|
||||
}
|
||||
|
||||
ptr[-1] = '\n';
|
||||
|
||||
Execute (buffer, NULL, child_stdout);
|
||||
free (buffer);
|
||||
|
||||
Close (child_stdout);
|
||||
|
||||
child_stdout = Open (tmp_output, MODE_OLDFILE);
|
||||
|
||||
buffer = xmalloc (maxlen);
|
||||
i = 0;
|
||||
do
|
||||
{
|
||||
if (i == maxlen)
|
||||
{
|
||||
maxlen += 512;
|
||||
buffer = (char *) xrealloc (buffer, maxlen + 1);
|
||||
}
|
||||
|
||||
cc = Read (child_stdout, &buffer[i], maxlen - i);
|
||||
if (cc > 0)
|
||||
i += cc;
|
||||
} while (cc > 0);
|
||||
|
||||
Close (child_stdout);
|
||||
DeleteFile (tmp_output);
|
||||
|
||||
if (i > 0)
|
||||
{
|
||||
if (buffer[i - 1] == '\n')
|
||||
buffer[--i] = '\0';
|
||||
else
|
||||
buffer[i] = '\0';
|
||||
p = buffer;
|
||||
while ((p = index (p, '\n')) != 0)
|
||||
*p++ = ' ';
|
||||
o = variable_buffer_output (o, buffer, i);
|
||||
}
|
||||
free (buffer);
|
||||
}
|
||||
#endif /* Not Amiga. */
|
||||
#endif /* MSDOS or Amiga. */
|
||||
|
||||
free (text);
|
||||
break;
|
||||
}
|
||||
#endif /* !VMS */
|
||||
|
||||
case function_origin:
|
||||
/* Expand the argument. */
|
||||
@@ -590,7 +744,7 @@ expand_function (o, function, text, end)
|
||||
|
||||
free (text);
|
||||
break;
|
||||
|
||||
|
||||
case function_sort:
|
||||
/* Expand the argument. */
|
||||
text = expand_argument (text, end);
|
||||
@@ -610,7 +764,7 @@ expand_function (o, function, text, end)
|
||||
nwords *= 2;
|
||||
words = (char **) xrealloc ((char *) words,
|
||||
nwords * sizeof (char *));
|
||||
}
|
||||
}
|
||||
words[wordi++] = savestring (p, len);
|
||||
}
|
||||
|
||||
@@ -640,7 +794,7 @@ expand_function (o, function, text, end)
|
||||
|
||||
free (text);
|
||||
break;
|
||||
|
||||
|
||||
case function_foreach:
|
||||
{
|
||||
/* Get three comma-separated arguments but
|
||||
@@ -733,7 +887,7 @@ expand_function (o, function, text, end)
|
||||
if (p == end)
|
||||
BADARGS (function == function_filter ? "filter" : "filter-out");
|
||||
p2 = expand_argument (text, p);
|
||||
|
||||
|
||||
text = expand_argument (p + 1, end);
|
||||
|
||||
/* Chop TEXT up into words and then run each pattern through. */
|
||||
@@ -792,7 +946,7 @@ expand_function (o, function, text, end)
|
||||
free (text);
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case function_patsubst:
|
||||
/* Get three comma-separated arguments and expand each one. */
|
||||
count = 0;
|
||||
@@ -825,9 +979,9 @@ expand_function (o, function, text, end)
|
||||
text = expand_argument (text, p2);
|
||||
p3 = expand_argument (p2 + 1, p);
|
||||
p2 = expand_argument (p + 1, end);
|
||||
|
||||
|
||||
o = patsubst_expand (o, p2, text, p3, (char *) 0, (char *) 0);
|
||||
|
||||
|
||||
free (text);
|
||||
free (p3);
|
||||
free (p2);
|
||||
@@ -850,7 +1004,7 @@ expand_function (o, function, text, end)
|
||||
text = expand_argument (text, p);
|
||||
|
||||
p = expand_argument (p + 1, end);
|
||||
|
||||
|
||||
{
|
||||
/* Write each word of the first argument directly followed
|
||||
by the corresponding word of the second argument.
|
||||
@@ -866,11 +1020,11 @@ expand_function (o, function, text, end)
|
||||
tp = find_next_token (&p2, &tlen);
|
||||
if (tp != 0)
|
||||
o = variable_buffer_output (o, tp, tlen);
|
||||
|
||||
|
||||
pp = find_next_token (&p3, &plen);
|
||||
if (pp != 0)
|
||||
o = variable_buffer_output (o, pp, plen);
|
||||
|
||||
|
||||
if (tp != 0 || pp != 0)
|
||||
{
|
||||
o = variable_buffer_output (o, " ", 1);
|
||||
@@ -882,11 +1036,11 @@ expand_function (o, function, text, end)
|
||||
/* Kill the last blank. */
|
||||
--o;
|
||||
}
|
||||
|
||||
|
||||
free (text);
|
||||
free (p);
|
||||
break;
|
||||
|
||||
|
||||
case function_strip:
|
||||
/* Expand the argument. */
|
||||
text = expand_argument (text, end);
|
||||
@@ -901,19 +1055,23 @@ expand_function (o, function, text, end)
|
||||
if (doneany)
|
||||
/* Kill the last space. */
|
||||
--o;
|
||||
|
||||
|
||||
free (text);
|
||||
break;
|
||||
|
||||
|
||||
case function_wildcard:
|
||||
text = expand_argument (text, end);
|
||||
|
||||
|
||||
#ifdef _AMIGA
|
||||
o = wildcard_expansion (text, o);
|
||||
#else
|
||||
p = string_glob (text);
|
||||
o = variable_buffer_output (o, p, strlen (p));
|
||||
|
||||
#endif
|
||||
|
||||
free (text);
|
||||
break;
|
||||
|
||||
|
||||
case function_subst:
|
||||
/* Get three comma-separated arguments and expand each one. */
|
||||
count = 0;
|
||||
@@ -946,14 +1104,14 @@ expand_function (o, function, text, end)
|
||||
text = expand_argument (text, p2);
|
||||
p3 = expand_argument (p2 + 1, p);
|
||||
p2 = expand_argument (p + 1, end);
|
||||
|
||||
|
||||
o = subst_expand (o, p2, text, p3, strlen (text), strlen (p3), 0, 0);
|
||||
|
||||
|
||||
free (text);
|
||||
free (p3);
|
||||
free (p2);
|
||||
break;
|
||||
|
||||
|
||||
case function_firstword:
|
||||
/* Expand the argument. */
|
||||
text = expand_argument (text, end);
|
||||
@@ -963,10 +1121,10 @@ expand_function (o, function, text, end)
|
||||
p = find_next_token (&p2, &i);
|
||||
if (p != 0)
|
||||
o = variable_buffer_output (o, p, i);
|
||||
|
||||
|
||||
free (text);
|
||||
break;
|
||||
|
||||
|
||||
case function_word:
|
||||
/* Get two comma-separated arguments and expand each one. */
|
||||
count = 0;
|
||||
@@ -1058,11 +1216,11 @@ index argument");
|
||||
i = strlen (text);
|
||||
if (sindex (p, 0, text, i) != 0)
|
||||
o = variable_buffer_output (o, text, i);
|
||||
|
||||
|
||||
free (p);
|
||||
free (text);
|
||||
break;
|
||||
|
||||
|
||||
case function_addsuffix:
|
||||
case function_addprefix:
|
||||
/* Get two comma-separated arguments and expand each one. */
|
||||
@@ -1082,7 +1240,7 @@ index argument");
|
||||
i = strlen (text);
|
||||
|
||||
p2 = expand_argument (p + 1, end);
|
||||
|
||||
|
||||
p3 = p2;
|
||||
while ((p = find_next_token (&p3, &len)) != 0)
|
||||
{
|
||||
@@ -1097,11 +1255,11 @@ index argument");
|
||||
if (doneany)
|
||||
/* Kill last space. */
|
||||
--o;
|
||||
|
||||
|
||||
free (p2);
|
||||
free (text);
|
||||
break;
|
||||
|
||||
|
||||
case function_dir:
|
||||
case function_basename:
|
||||
/* Expand the argument. */
|
||||
@@ -1111,7 +1269,11 @@ index argument");
|
||||
while ((p2 = find_next_token (&p3, &len)) != 0)
|
||||
{
|
||||
p = p2 + len;
|
||||
#ifdef VMS
|
||||
while (p >= p2 && *p != (function == function_dir ? ']' : '.'))
|
||||
#else
|
||||
while (p >= p2 && *p != (function == function_dir ? '/' : '.'))
|
||||
#endif
|
||||
--p;
|
||||
if (p >= p2)
|
||||
{
|
||||
@@ -1120,7 +1282,15 @@ index argument");
|
||||
o = variable_buffer_output (o, p2, p - p2);
|
||||
}
|
||||
else if (function == function_dir)
|
||||
#ifdef VMS
|
||||
o = variable_buffer_output (o, "[]", 2);
|
||||
#else
|
||||
#ifndef _AMIGA
|
||||
o = variable_buffer_output (o, "./", 2);
|
||||
#else
|
||||
/* o = o */; /* Just a nop... */
|
||||
#endif /* AMIGA */
|
||||
#endif /* !VMS */
|
||||
else
|
||||
/* The entire name is the basename. */
|
||||
o = variable_buffer_output (o, p2, len);
|
||||
@@ -1131,10 +1301,10 @@ index argument");
|
||||
if (doneany)
|
||||
/* Kill last space. */
|
||||
--o;
|
||||
|
||||
|
||||
free (text);
|
||||
break;
|
||||
|
||||
|
||||
case function_notdir:
|
||||
case function_suffix:
|
||||
/* Expand the argument. */
|
||||
@@ -1144,7 +1314,11 @@ index argument");
|
||||
while ((p2 = find_next_token (&p3, &len)) != 0)
|
||||
{
|
||||
p = p2 + len;
|
||||
#ifdef VMS
|
||||
while (p >= p2 && *p != (function == function_notdir ? ']' : '.'))
|
||||
#else
|
||||
while (p >= p2 && *p != (function == function_notdir ? '/' : '.'))
|
||||
#endif
|
||||
--p;
|
||||
if (p >= p2)
|
||||
{
|
||||
|
||||
41
getloadavg.c
41
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,9 +39,11 @@
|
||||
|
||||
apollo
|
||||
BSD Real BSD, not just BSD-like.
|
||||
convex
|
||||
DGUX
|
||||
eunice UNIX emulator under VMS.
|
||||
hpux
|
||||
MSDOS No-op for MSDOS.
|
||||
NeXT
|
||||
sgi
|
||||
sequent Sequent Dynix 3.x.x (BSD)
|
||||
@@ -49,6 +52,7 @@
|
||||
UMAX
|
||||
UMAX4_3
|
||||
VMS
|
||||
WIN32 No-op for Windows95/NT.
|
||||
__linux__ Linux: assumes /proc filesystem mounted.
|
||||
Support from Michael K. Johnson.
|
||||
__NetBSD__ NetBSD: assumes /kern filesystem mounted.
|
||||
@@ -137,7 +141,7 @@ extern int errno;
|
||||
#define decstation
|
||||
#endif
|
||||
|
||||
#if defined(sun) && defined(SVR4)
|
||||
#if (defined(sun) && defined(SVR4)) || defined (SOLARIS2)
|
||||
#define SUNOS_5
|
||||
#endif
|
||||
|
||||
@@ -214,6 +218,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 +735,16 @@ getloadavg (loadavg, nelem)
|
||||
: (load_ave.tl_avenrun.l[0] / (double) load_ave.tl_lscale));
|
||||
#endif /* OSF_MIPS */
|
||||
|
||||
#if !defined (LDAV_DONE) && (defined (MSDOS) || defined (WIN32))
|
||||
#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 +824,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,12 +853,22 @@ 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. */
|
||||
kd = kvm_open (0, 0, 0, O_RDONLY, 0);
|
||||
if (kd != 0)
|
||||
if (kd != 0)
|
||||
{
|
||||
/* nlist the currently running kernel. */
|
||||
kvm_nlist (kd, nl);
|
||||
|
||||
101
glob/ChangeLog
101
glob/ChangeLog
@@ -1,3 +1,104 @@
|
||||
Sat Jun 22 10:44:09 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
|
||||
|
||||
* posix/glob.c: Include <alloca.h> only [HAVE_ALLOCA_H], not [sparc].
|
||||
|
||||
Fri Jun 21 00:27:51 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
|
||||
|
||||
* posix/fnmatch.c (fnmatch): Fix \*[*?]+ case to increment name ptr
|
||||
only for ?s, not for *s. Fix from Chet Ramey.
|
||||
|
||||
Wed May 22 17:22:14 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
|
||||
|
||||
* posix/glob.c [VMS]: Don't include <pwd.h>.
|
||||
[HAVE_VMSDIR_H]: Include "vmsdir.h".
|
||||
(glob) [VMS]: Don't grok ~.
|
||||
|
||||
Mon May 13 12:03:03 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
|
||||
|
||||
* posix/glob.h [_AMIGA]: Remove `struct stat;' forward decl.
|
||||
|
||||
* posix/glob.c [_AMIGA]: Don't include <pwd.h>.
|
||||
(glob): Remove bogus & in call to globfree.
|
||||
[_AMIGA]: Use AmigaDOS file name conventions.
|
||||
|
||||
Thu May 9 09:17:46 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
|
||||
|
||||
* posix/glob/SMakefile, posix/glob/SCOPTIONS, posix/glob/Makefile.ami:
|
||||
New files, AmigaDOS support from Aaron Digulla.
|
||||
* posix/Makefile (glob.tar): Add AmigaDOS support files.
|
||||
|
||||
Tue Apr 2 21:27:01 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
|
||||
|
||||
* posix/glob.c (glob_pattern_p): Avoid scanning past eos if
|
||||
the pattern ends with a backslash and quoting is enabled.
|
||||
* posix/fnmatch.c (fnmatch): Likewise; return FNM_NOMATCH for such
|
||||
patterns.
|
||||
|
||||
Thu Mar 14 06:01:07 1996 Roland McGrath <roland@charlie-brown.gnu.ai.mit.edu>
|
||||
|
||||
* posix/glob.c (glob): In GLOB_BRACE brace expansion, fix buffer size
|
||||
calculation to include trailing invariant portion. Don't use alloca;
|
||||
instead use a dynamic auto array for GCC, malloc for non-GCC.
|
||||
Handle nested braces properly.
|
||||
|
||||
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.
|
||||
|
||||
69
glob/Makefile.ami
Normal file
69
glob/Makefile.ami
Normal file
@@ -0,0 +1,69 @@
|
||||
# Makefile for standalone distribution of libglob.a (fnmatch, glob).
|
||||
|
||||
# Copyright (C) 1991, 92, 93, 94, 95 Free Software Foundation, Inc.
|
||||
# This file is part of the GNU C Library.
|
||||
|
||||
# This library is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU Library General Public License
|
||||
# as published by the Free Software Foundation; either version 2 of
|
||||
# the License, or (at your option) any later version.
|
||||
|
||||
# This library is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
# Library General Public License for more details.
|
||||
|
||||
# You should have received a copy of the GNU Library General Public
|
||||
# License along with this library; see the file COPYING.LIB. If
|
||||
# not, write to the Free Software Foundation, Inc., 675 Mass Ave,
|
||||
# Cambridge, MA 02139, USA.
|
||||
|
||||
# Ultrix 2.2 make doesn't expand the value of VPATH.
|
||||
VPATH = /glob/
|
||||
# This must repeat the value, because configure will remove `VPATH = .'.
|
||||
srcdir = /glob/
|
||||
|
||||
CC = sc
|
||||
RM = delete
|
||||
CPPFLAGS =
|
||||
CFLAGS =
|
||||
|
||||
# Information determined by configure.
|
||||
DEFS = Define HAVE_HEADER_STDC Define HAVE_UNISTD_H Define HAVE_STRING_H \
|
||||
Define HAVE_DIRENT_H
|
||||
|
||||
# How to invoke ar.
|
||||
AR = join
|
||||
ARFLAGS = as
|
||||
|
||||
# How to invoke ranlib.
|
||||
RANLIB = ;
|
||||
|
||||
.PHONY: all
|
||||
all: glob.lib
|
||||
|
||||
glob.lib : glob.o fnmatch.o
|
||||
$(AR) $(ARFLAGS) $@ glob.o fnmatch.o
|
||||
$(RANLIB) $@
|
||||
|
||||
# For some reason, Unix make wants the dependencies on the source files.
|
||||
# Otherwise it refuses to use an implicit rule!
|
||||
# And, get this: it doesn't work to use $(srcdir)foo.c!!
|
||||
glob.o: $(srcdir)glob.h $(srcdir)fnmatch.h glob.c
|
||||
fnmatch.o: $(srcdir)fnmatch.h fnmatch.c
|
||||
|
||||
OUTPUT_OPTION =
|
||||
.c.o:
|
||||
$(CC) IDir "" \
|
||||
$(DEFS) $(CPPFLAGS) $(CFLAGS) $< $(OUTPUT_OPTION)
|
||||
|
||||
.PHONY: clean realclean glob-clean glob-realclean distclean
|
||||
clean glob-clean:
|
||||
-$(RM) glob.lib "#?.o" core
|
||||
distclean glob-realclean: clean
|
||||
-$(RM) TAGS tags Makefile config.status config.h config.log
|
||||
realcean: distclean
|
||||
|
||||
# For inside the C library.
|
||||
glob.tar glob.tar.Z:
|
||||
$(MAKE) -C .. $@
|
||||
13
glob/SCOPTIONS
Normal file
13
glob/SCOPTIONS
Normal file
@@ -0,0 +1,13 @@
|
||||
ERRORREXX
|
||||
OPTIMIZE
|
||||
NOVERSION
|
||||
OPTIMIZERTIME
|
||||
OPTIMIZERALIAS
|
||||
DEFINE INCLUDEDIR="include:"
|
||||
DEFINE LIBDIR="lib:"
|
||||
DEFINE NO_ALLOCA
|
||||
DEFINE NO_FLOAT
|
||||
DEFINE NO_ARCHIVES
|
||||
IGNORE=161
|
||||
IGNORE=100
|
||||
STARTUP=cres
|
||||
69
glob/SMakefile
Normal file
69
glob/SMakefile
Normal file
@@ -0,0 +1,69 @@
|
||||
# Makefile for standalone distribution of libglob.a (fnmatch, glob).
|
||||
|
||||
# Copyright (C) 1991, 92, 93, 94, 95 Free Software Foundation, Inc.
|
||||
# This file is part of the GNU C Library.
|
||||
|
||||
# This library is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU Library General Public License
|
||||
# as published by the Free Software Foundation; either version 2 of
|
||||
# the License, or (at your option) any later version.
|
||||
|
||||
# This library is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
# Library General Public License for more details.
|
||||
|
||||
# You should have received a copy of the GNU Library General Public
|
||||
# License along with this library; see the file COPYING.LIB. If
|
||||
# not, write to the Free Software Foundation, Inc., 675 Mass Ave,
|
||||
# Cambridge, MA 02139, USA.
|
||||
|
||||
# Ultrix 2.2 make doesn't expand the value of VPATH.
|
||||
VPATH = /glob/
|
||||
# This must repeat the value, because configure will remove `VPATH = .'.
|
||||
srcdir = /glob/
|
||||
|
||||
CC = sc
|
||||
CPPFLAGS =
|
||||
CFLAGS =
|
||||
MAKE = smake
|
||||
RM = delete
|
||||
|
||||
# Information determined by configure.
|
||||
DEFS = Define HAVE_HEADER_STDC Define HAVE_UNISTD_H Define HAVE_STRING_H \
|
||||
Define HAVE_DIRENT_H
|
||||
|
||||
# How to invoke ar.
|
||||
AR = join
|
||||
ARFLAGS = as
|
||||
|
||||
# How to invoke ranlib.
|
||||
RANLIB = ;
|
||||
|
||||
.PHONY: all
|
||||
all: glob.lib
|
||||
|
||||
glob.lib : glob.o fnmatch.o
|
||||
$(AR) $(ARFLAGS) $@ glob.o fnmatch.o
|
||||
$(RANLIB) $@
|
||||
|
||||
# For some reason, Unix make wants the dependencies on the source files.
|
||||
# Otherwise it refuses to use an implicit rule!
|
||||
# And, get this: it doesn't work to use $(srcdir)foo.c!!
|
||||
glob.o: $(srcdir)glob.h $(srcdir)fnmatch.h glob.c
|
||||
fnmatch.o: $(srcdir)fnmatch.h fnmatch.c
|
||||
|
||||
.c.o:
|
||||
$(CC) IDir "" \
|
||||
$(DEFS) $(CPPFLAGS) $(CFLAGS) $< $(OUTPUT_OPTION)
|
||||
|
||||
.PHONY: clean realclean glob-clean glob-realclean distclean
|
||||
clean glob-clean:
|
||||
-$(RM) -f glob.lib *.o core
|
||||
distclean glob-realclean: clean
|
||||
-$(RM) -f TAGS tags Makefile config.status config.h config.log
|
||||
realcean: distclean
|
||||
|
||||
# For inside the C library.
|
||||
glob.tar glob.tar.Z:
|
||||
$(MAKE) -C .. $@
|
||||
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>
|
||||
@@ -73,6 +78,9 @@ fnmatch (pattern, string, flags)
|
||||
if (!(flags & FNM_NOESCAPE))
|
||||
{
|
||||
c = *p++;
|
||||
if (c == '\0')
|
||||
/* Trailing \ loses. */
|
||||
return FNM_NOMATCH;
|
||||
c = FOLD (c);
|
||||
}
|
||||
if (FOLD (*n) != c)
|
||||
@@ -84,10 +92,24 @@ fnmatch (pattern, string, flags)
|
||||
(n == string || ((flags & FNM_FILE_NAME) && n[-1] == '/')))
|
||||
return FNM_NOMATCH;
|
||||
|
||||
for (c = *p++; c == '?' || c == '*'; c = *p++, ++n)
|
||||
if (((flags & FNM_FILE_NAME) && *n == '/') ||
|
||||
(c == '?' && *n == '\0'))
|
||||
return FNM_NOMATCH;
|
||||
for (c = *p++; c == '?' || c == '*'; c = *p++)
|
||||
{
|
||||
if ((flags & FNM_FILE_NAME) && *n == '/')
|
||||
/* A slash does not match a wildcard under FNM_FILE_NAME. */
|
||||
return FNM_NOMATCH;
|
||||
else if (c == '?')
|
||||
{
|
||||
/* A ? needs to match one character. */
|
||||
if (*n == '\0')
|
||||
/* There isn't another character; no match. */
|
||||
return FNM_NOMATCH;
|
||||
else
|
||||
/* One character of the string is consumed in matching
|
||||
this ? wildcard, so *??? won't match if there are
|
||||
less than three characters. */
|
||||
++n;
|
||||
}
|
||||
}
|
||||
|
||||
if (c == '\0')
|
||||
return 0;
|
||||
@@ -124,7 +146,11 @@ fnmatch (pattern, string, flags)
|
||||
register char cstart = c, cend = c;
|
||||
|
||||
if (!(flags & FNM_NOESCAPE) && c == '\\')
|
||||
cstart = cend = *p++;
|
||||
{
|
||||
if (*p == '\0')
|
||||
return FNM_NOMATCH;
|
||||
cstart = cend = *p++;
|
||||
}
|
||||
|
||||
cstart = cend = FOLD (cstart);
|
||||
|
||||
@@ -171,8 +197,12 @@ fnmatch (pattern, string, flags)
|
||||
|
||||
c = *p++;
|
||||
if (!(flags & FNM_NOESCAPE) && c == '\\')
|
||||
/* XXX 1003.2d11 is unclear if this is right. */
|
||||
++p;
|
||||
{
|
||||
if (*p == '\0')
|
||||
return FNM_NOMATCH;
|
||||
/* XXX 1003.2d11 is unclear if this is right. */
|
||||
++p;
|
||||
}
|
||||
}
|
||||
if (not)
|
||||
return FNM_NOMATCH;
|
||||
|
||||
341
glob/glob.c
341
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,10 @@ Cambridge, MA 02139, USA. */
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if !defined (_AMIGA) && !defined (VMS)
|
||||
#include <pwd.h>
|
||||
#endif
|
||||
|
||||
#if !defined(__GNU_LIBRARY__) && !defined(STDC_HEADERS)
|
||||
extern int errno;
|
||||
#endif
|
||||
@@ -62,26 +78,33 @@ 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
|
||||
# ifdef HAVE_VMSDIR_H
|
||||
# include "vmsdir.h"
|
||||
# endif /* HAVE_VMSDIR_H */
|
||||
#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 +120,8 @@ extern int errno;
|
||||
#define ANSI_STRING
|
||||
#else /* No standard headers. */
|
||||
|
||||
extern char *getenv ();
|
||||
|
||||
#ifdef HAVE_STRING_H
|
||||
#include <string.h>
|
||||
#define ANSI_STRING
|
||||
@@ -140,6 +165,7 @@ extern void bcopy ();
|
||||
#ifdef __GNUC__
|
||||
__inline
|
||||
#endif
|
||||
#ifndef __SASC
|
||||
static char *
|
||||
my_realloc (p, n)
|
||||
char *p;
|
||||
@@ -152,7 +178,8 @@ my_realloc (p, n)
|
||||
return (char *) realloc (p, n);
|
||||
}
|
||||
#define realloc my_realloc
|
||||
#endif
|
||||
#endif /* __SASC */
|
||||
#endif /* __GNU_LIBRARY__ */
|
||||
|
||||
|
||||
#if !defined(__alloca) && !defined(__GNU_LIBRARY__)
|
||||
@@ -161,9 +188,9 @@ my_realloc (p, n)
|
||||
#undef alloca
|
||||
#define alloca(n) __builtin_alloca (n)
|
||||
#else /* Not GCC. */
|
||||
#if defined (sparc) || defined (HAVE_ALLOCA_H)
|
||||
#ifdef HAVE_ALLOCA_H
|
||||
#include <alloca.h>
|
||||
#else /* Not sparc or HAVE_ALLOCA_H. */
|
||||
#else /* Not HAVE_ALLOCA_H. */
|
||||
#ifndef _AIX
|
||||
extern char *alloca ();
|
||||
#endif /* Not _AIX. */
|
||||
@@ -175,10 +202,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 +235,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,12 +270,139 @@ glob (pattern, flags, errfunc, pglob)
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (flags & GLOB_BRACE)
|
||||
{
|
||||
const char *begin = strchr (pattern, '{');
|
||||
if (begin != NULL)
|
||||
{
|
||||
int firstc;
|
||||
size_t restlen;
|
||||
const char *p, *end, *next;
|
||||
unsigned int depth = 0;
|
||||
|
||||
/* Find the end of the brace expression, by counting braces.
|
||||
While we're at it, notice the first comma at top brace level. */
|
||||
end = begin + 1;
|
||||
next = NULL;
|
||||
while (1)
|
||||
{
|
||||
switch (*end++)
|
||||
{
|
||||
case ',':
|
||||
if (depth == 0 && next == NULL)
|
||||
next = end;
|
||||
continue;
|
||||
case '{':
|
||||
++depth;
|
||||
continue;
|
||||
case '}':
|
||||
if (depth-- == 0)
|
||||
break;
|
||||
continue;
|
||||
case '\0':
|
||||
return glob (pattern, flags &~ GLOB_BRACE, errfunc, pglob);
|
||||
}
|
||||
break;
|
||||
}
|
||||
restlen = strlen (end) + 1;
|
||||
if (next == NULL)
|
||||
next = end;
|
||||
|
||||
/* We have a brace expression. BEGIN points to the opening {,
|
||||
NEXT points past the terminator of the first element, and END
|
||||
points past the final }. We will accumulate result names from
|
||||
recursive runs for each brace alternative in the buffer using
|
||||
GLOB_APPEND. */
|
||||
|
||||
if (!(flags & GLOB_APPEND))
|
||||
{
|
||||
/* This call is to set a new vector, so clear out the
|
||||
vector so we can append to it. */
|
||||
pglob->gl_pathc = 0;
|
||||
pglob->gl_pathv = NULL;
|
||||
}
|
||||
firstc = pglob->gl_pathc;
|
||||
|
||||
/* In this loop P points to the beginning of the current element
|
||||
and NEXT points past its terminator. */
|
||||
p = begin + 1;
|
||||
while (1)
|
||||
{
|
||||
/* Construct a whole name that is one of the brace
|
||||
alternatives in a temporary buffer. */
|
||||
int result;
|
||||
size_t bufsz = (begin - pattern) + (next - 1 - p) + restlen;
|
||||
#ifdef __GNUC__
|
||||
char onealt[bufsz];
|
||||
#else
|
||||
char *onealt = malloc (bufsz);
|
||||
if (onealt == NULL)
|
||||
{
|
||||
if (!(flags & GLOB_APPEND))
|
||||
globfree (pglob);
|
||||
return GLOB_NOSPACE;
|
||||
}
|
||||
#endif
|
||||
memcpy (onealt, pattern, begin - pattern);
|
||||
memcpy (&onealt[begin - pattern], p, next - 1 - p);
|
||||
memcpy (&onealt[(begin - pattern) + (next - 1 - p)],
|
||||
end, restlen);
|
||||
result = glob (onealt,
|
||||
((flags & ~(GLOB_NOCHECK|GLOB_NOMAGIC)) |
|
||||
GLOB_APPEND), errfunc, pglob);
|
||||
#ifndef __GNUC__
|
||||
free (onealt);
|
||||
#endif
|
||||
|
||||
/* If we got an error, return it. */
|
||||
if (result && result != GLOB_NOMATCH)
|
||||
{
|
||||
if (!(flags & GLOB_APPEND))
|
||||
globfree (pglob);
|
||||
return result;
|
||||
}
|
||||
|
||||
/* Advance past this alternative and process the next. */
|
||||
p = next;
|
||||
depth = 0;
|
||||
scan:
|
||||
switch (*p++)
|
||||
{
|
||||
case ',':
|
||||
if (depth == 0)
|
||||
{
|
||||
/* Found the next alternative. Loop to glob it. */
|
||||
next = p;
|
||||
continue;
|
||||
}
|
||||
goto scan;
|
||||
case '{':
|
||||
++depth;
|
||||
goto scan;
|
||||
case '}':
|
||||
if (depth-- == 0)
|
||||
/* End of the brace expression. Break out of the loop. */
|
||||
break;
|
||||
goto scan;
|
||||
}
|
||||
}
|
||||
|
||||
if (pglob->gl_pathc == firstc &&
|
||||
!(flags & (GLOB_NOCHECK|GLOB_NOMAGIC)))
|
||||
return GLOB_NOMATCH;
|
||||
}
|
||||
}
|
||||
|
||||
/* Find the filename. */
|
||||
filename = strrchr (pattern, '/');
|
||||
if (filename == NULL)
|
||||
{
|
||||
filename = pattern;
|
||||
#ifdef _AMIGA
|
||||
dirname = (char *) "";
|
||||
#else
|
||||
dirname = (char *) ".";
|
||||
#endif
|
||||
dirlen = 0;
|
||||
}
|
||||
else if (filename == pattern)
|
||||
@@ -291,6 +438,47 @@ glob (pattern, flags, errfunc, pglob)
|
||||
|
||||
oldcount = pglob->gl_pathc;
|
||||
|
||||
#ifndef VMS
|
||||
if ((flags & GLOB_TILDE) && dirname[0] == '~')
|
||||
{
|
||||
if (dirname[1] == '\0')
|
||||
{
|
||||
/* Look up home directory. */
|
||||
dirname = getenv ("HOME");
|
||||
#ifdef _AMIGA
|
||||
if (dirname == NULL || dirname[0] == '\0')
|
||||
dirname = "SYS:";
|
||||
#else
|
||||
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. */
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
#ifdef _AMIGA
|
||||
if (dirname == NULL || dirname[0] == '\0')
|
||||
dirname = "SYS:";
|
||||
#else
|
||||
/* Look up specific user's home directory. */
|
||||
struct passwd *p = getpwnam (dirname + 1);
|
||||
if (p != NULL)
|
||||
dirname = p->pw_dir;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
#endif /* Not VMS. */
|
||||
|
||||
if (glob_pattern_p (dirname, !(flags & GLOB_NOESCAPE)))
|
||||
{
|
||||
/* The directory name contains metacharacters, so we
|
||||
@@ -410,14 +598,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))
|
||||
@@ -523,7 +722,7 @@ glob_pattern_p (pattern, quote)
|
||||
return 1;
|
||||
|
||||
case '\\':
|
||||
if (quote)
|
||||
if (quote && p[1] != '\0')
|
||||
++p;
|
||||
break;
|
||||
|
||||
@@ -572,8 +771,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 +785,29 @@ 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)
|
||||
((flags & GLOB_NOESCAPE) ? FNM_NOESCAPE : 0)
|
||||
#ifdef _AMIGA
|
||||
| FNM_CASEFOLD
|
||||
#endif
|
||||
) == 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 +819,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 +858,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 +869,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 +884,5 @@ glob_in_dir (pattern, directory, flags, errfunc, pglob)
|
||||
return GLOB_NOSPACE;
|
||||
}
|
||||
|
||||
#endif /* _LIBC or not __GNU_LIBRARY__. */
|
||||
#endif /* Not ELIDE_CODE. */
|
||||
|
||||
|
||||
28
glob/glob.h
28
glob/glob.h
@@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 1991, 1992 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1991, 1992, 1995, 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
|
||||
@@ -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,23 @@ extern "C"
|
||||
#define GLOB_NOMATCH 3 /* No matches found. */
|
||||
|
||||
/* Structure describing a globbing run. */
|
||||
#if !defined (_AMIGA) && !defined (VMS) /* Buggy compiler. */
|
||||
struct stat;
|
||||
#endif
|
||||
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.
|
||||
@@ -83,13 +100,6 @@ extern int glob __P ((const char *__pattern, int __flags,
|
||||
extern void globfree __P ((glob_t *__pglob));
|
||||
|
||||
|
||||
#if !defined (_POSIX_C_SOURCE) || _POSIX_C_SOURCE < 2 || defined (_GNU_SOURCE)
|
||||
/* If they are not NULL, `glob' uses these functions to read directories. */
|
||||
extern __ptr_t (*__glob_opendir_hook) __P ((const char *__directory));
|
||||
extern const char *(*__glob_readdir_hook) __P ((__ptr_t __stream));
|
||||
extern void (*__glob_closedir_hook) __P ((__ptr_t __stream));
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -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.
|
||||
|
||||
13
implicit.c
13
implicit.c
@@ -19,9 +19,10 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||
#include "make.h"
|
||||
#include "rule.h"
|
||||
#include "dep.h"
|
||||
#include "file.h"
|
||||
#include "filedef.h"
|
||||
|
||||
static int pattern_search ();
|
||||
static int pattern_search PARAMS ((struct file *file, int archive, unsigned int depth,
|
||||
unsigned int recursions));
|
||||
|
||||
/* For a FILE which has no commands specified, try to figure out some
|
||||
from the implicit pattern rules.
|
||||
@@ -162,7 +163,11 @@ pattern_search (file, archive, depth, recursions)
|
||||
/* Set LASTSLASH to point at the last slash in FILENAME
|
||||
but not counting any slash at the end. (foo/bar/ counts as
|
||||
bar/ in directory foo/, not empty in directory foo/bar/.) */
|
||||
#ifdef VMS
|
||||
lastslash = rindex (filename, ']');
|
||||
#else
|
||||
lastslash = rindex (filename, '/');
|
||||
#endif
|
||||
if (lastslash != 0 && lastslash[1] == '\0')
|
||||
lastslash = 0;
|
||||
}
|
||||
@@ -210,7 +215,11 @@ pattern_search (file, archive, depth, recursions)
|
||||
/* Set CHECK_LASTSLASH if FILENAME contains a directory
|
||||
prefix and the target pattern does not contain a slash. */
|
||||
|
||||
#ifdef VMS
|
||||
check_lastslash = lastslash != 0 && index (target, ']') == 0;
|
||||
#else
|
||||
check_lastslash = lastslash != 0 && index (target, '/') == 0;
|
||||
#endif
|
||||
if (check_lastslash)
|
||||
{
|
||||
/* In that case, don't include the
|
||||
|
||||
34
job.h
34
job.h
@@ -1,5 +1,5 @@
|
||||
/* Definitions for managing subprocesses in GNU Make.
|
||||
Copyright (C) 1992, 1993 Free Software Foundation, Inc.
|
||||
Copyright (C) 1992, 1993, 1996 Free Software Foundation, Inc.
|
||||
This file is part of GNU Make.
|
||||
|
||||
GNU Make is free software; you can redistribute it and/or modify
|
||||
@@ -16,6 +16,9 @@ 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. */
|
||||
|
||||
#ifndef SEEN_JOB_H
|
||||
#define SEEN_JOB_H
|
||||
|
||||
/* Structure describing a running or dead child process. */
|
||||
|
||||
struct child
|
||||
@@ -31,6 +34,10 @@ struct child
|
||||
char *command_ptr; /* Ptr into command_lines[command_line]. */
|
||||
|
||||
pid_t pid; /* Child process's ID number. */
|
||||
#ifdef VMS
|
||||
int efn; /* Completion event flag number */
|
||||
int cstatus; /* Completion status */
|
||||
#endif
|
||||
unsigned int remote:1; /* Nonzero if executing remotely. */
|
||||
|
||||
unsigned int noerror:1; /* Nonzero if commands contained a `-'. */
|
||||
@@ -41,18 +48,27 @@ struct child
|
||||
|
||||
extern struct child *children;
|
||||
|
||||
extern void new_job ();
|
||||
extern void reap_children ();
|
||||
extern void start_waiting_jobs ();
|
||||
extern void new_job PARAMS ((struct file *file));
|
||||
extern void reap_children PARAMS ((int block, int err));
|
||||
extern void start_waiting_jobs PARAMS ((void));
|
||||
|
||||
extern char **construct_command_argv ();
|
||||
extern void child_execute_job ();
|
||||
extern void exec_command ();
|
||||
extern char **construct_command_argv PARAMS ((char *line, char **restp, struct file *file));
|
||||
#ifdef VMS
|
||||
extern int child_execute_job PARAMS ((char *argv, struct child *child));
|
||||
#else
|
||||
extern void child_execute_job PARAMS ((int stdin_fd, int stdout_fd, char **argv, char **envp));
|
||||
#endif
|
||||
#ifdef _AMIGA
|
||||
extern void exec_command PARAMS ((char **argv));
|
||||
#else
|
||||
extern void exec_command PARAMS ((char **argv, char **envp));
|
||||
#endif
|
||||
|
||||
extern unsigned int job_slots_used;
|
||||
|
||||
extern void block_sigs PARAMS ((void));
|
||||
#ifdef POSIX
|
||||
extern void unblock_sigs ();
|
||||
extern void unblock_sigs PARAMS ((void));
|
||||
#else
|
||||
#ifdef HAVE_SIGSETMASK
|
||||
extern int fatal_signal_mask;
|
||||
@@ -61,3 +77,5 @@ extern int fatal_signal_mask;
|
||||
#define unblock_sigs()
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif /* SEEN_JOB_H */
|
||||
|
||||
447
main.c
447
main.c
@@ -1,5 +1,5 @@
|
||||
/* Argument parsing and main program of GNU Make.
|
||||
Copyright (C) 1988, 89, 90, 91, 94, 1995 Free Software Foundation, Inc.
|
||||
Copyright (C) 1988, 89, 90, 91, 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
|
||||
@@ -17,20 +17,37 @@ along with GNU Make; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||
|
||||
#include "make.h"
|
||||
#include "commands.h"
|
||||
#include "dep.h"
|
||||
#include "file.h"
|
||||
#include "filedef.h"
|
||||
#include "variable.h"
|
||||
#include "job.h"
|
||||
#include "commands.h"
|
||||
#include "getopt.h"
|
||||
#include <assert.h>
|
||||
#ifdef _AMIGA
|
||||
# include <dos/dos.h>
|
||||
# include <proto/dos.h>
|
||||
#endif
|
||||
#ifdef WIN32
|
||||
#include <windows.h>
|
||||
#include "pathstuff.h"
|
||||
#endif
|
||||
|
||||
#ifdef _AMIGA
|
||||
int __stack = 20000; /* Make sure we have 20K of stack space */
|
||||
#endif
|
||||
|
||||
extern void print_variable_data_base ();
|
||||
extern void print_dir_data_base ();
|
||||
extern void print_rule_data_base ();
|
||||
extern void print_file_data_base ();
|
||||
extern void print_vpath_data_base ();
|
||||
extern void init_dir PARAMS ((void));
|
||||
extern void remote_setup PARAMS ((void));
|
||||
extern void remote_cleanup PARAMS ((void));
|
||||
extern RETSIGTYPE fatal_error_signal PARAMS ((int sig));
|
||||
extern RETSIGTYPE child_handler PARAMS ((int sig));
|
||||
|
||||
extern void print_variable_data_base PARAMS ((void));
|
||||
extern void print_dir_data_base PARAMS ((void));
|
||||
extern void print_rule_data_base PARAMS ((void));
|
||||
extern void print_file_data_base PARAMS ((void));
|
||||
extern void print_vpath_data_base PARAMS ((void));
|
||||
|
||||
#ifndef HAVE_UNISTD_H
|
||||
extern int chdir ();
|
||||
@@ -43,11 +60,12 @@ 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 ();
|
||||
static char *quote_as_word ();
|
||||
static void print_data_base PARAMS((void));
|
||||
static void print_version PARAMS ((void));
|
||||
static void decode_switches PARAMS ((int argc, char **argv, int env));
|
||||
static void decode_env_switches PARAMS ((char *envar, unsigned int len));
|
||||
static void define_makeflags PARAMS ((int all, int makefile));
|
||||
static char *quote_as_word PARAMS ((char *out, char *in, int double_dollars));
|
||||
|
||||
/* The structure that describes an accepted command switch. */
|
||||
|
||||
@@ -111,6 +129,12 @@ int just_print_flag;
|
||||
|
||||
int debug_flag = 0;
|
||||
|
||||
#ifdef WIN32
|
||||
/* Suspend make in main for a short time to allow debugger to attach */
|
||||
|
||||
int suspend_flag = 0;
|
||||
#endif
|
||||
|
||||
/* Environment variables override makefile definitions. */
|
||||
|
||||
int env_overrides = 0;
|
||||
@@ -170,9 +194,13 @@ static unsigned int inf_jobs = 0;
|
||||
Negative values mean unlimited, while zero means limit to
|
||||
zero load (which could be useful to start infinite jobs remotely
|
||||
but one at a time locally). */
|
||||
|
||||
#ifndef NO_FLOAT
|
||||
double max_load_average = -1.0;
|
||||
double default_load_average = -1.0;
|
||||
#else
|
||||
int max_load_average = -1;
|
||||
int default_load_average = -1;
|
||||
#endif
|
||||
|
||||
/* List of directories given with -C switches. */
|
||||
|
||||
@@ -212,6 +240,11 @@ static const struct command_switch switches[] =
|
||||
{ 'd', flag, (char *) &debug_flag, 1, 1, 0, 0, 0,
|
||||
"debug", 0,
|
||||
"Print lots of debugging information" },
|
||||
#ifdef WIN32
|
||||
{ 'D', flag, (char *) &suspend_flag, 1, 1, 0, 0, 0,
|
||||
"suspend-for-debug", 0,
|
||||
"Suspend process to allow a debugger to attach" },
|
||||
#endif
|
||||
{ 'e', flag, (char *) &env_overrides, 1, 1, 0, 0, 0,
|
||||
"environment-overrides", 0,
|
||||
"Environment variables override makefiles" },
|
||||
@@ -235,10 +268,17 @@ static const struct command_switch switches[] =
|
||||
0, (char *) &default_keep_going_flag,
|
||||
"keep-going", 0,
|
||||
"Keep going when some targets can't be made" },
|
||||
#ifndef NO_FLOAT
|
||||
{ 'l', floating, (char *) &max_load_average, 1, 1, 0,
|
||||
(char *) &default_load_average, (char *) &default_load_average,
|
||||
"load-average", "N",
|
||||
"Don't start multiple jobs unless load is below N" },
|
||||
#else
|
||||
{ 'l', positive_int, (char *) &max_load_average, 1, 1, 0,
|
||||
(char *) &default_load_average, (char *) &default_load_average,
|
||||
"load-average", "N",
|
||||
"Don't start multiple jobs unless load is below N" },
|
||||
#endif
|
||||
{ 'm', ignore, 0, 0, 0, 0, 0, 0,
|
||||
0, 0,
|
||||
"-b" },
|
||||
@@ -367,6 +407,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 +427,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
|
||||
@@ -407,24 +450,31 @@ debug_signal_handler (sig)
|
||||
debug_flag = ! debug_flag;
|
||||
}
|
||||
|
||||
#ifndef _AMIGA
|
||||
int
|
||||
main (argc, argv, envp)
|
||||
int argc;
|
||||
char **argv;
|
||||
char **envp;
|
||||
#else
|
||||
int main (int argc, char ** argv)
|
||||
#endif
|
||||
{
|
||||
extern void init_dir ();
|
||||
extern RETSIGTYPE fatal_error_signal (), child_handler ();
|
||||
register struct file *f;
|
||||
register unsigned int i;
|
||||
char **p;
|
||||
struct dep *read_makefiles;
|
||||
PATH_VAR (current_directory);
|
||||
#ifdef WIN32
|
||||
extern int no_default_sh_exe;
|
||||
char *unix_path = NULL;
|
||||
char *win32_path = NULL;
|
||||
#endif
|
||||
|
||||
default_goal_file = 0;
|
||||
reading_filename = 0;
|
||||
reading_lineno_ptr = 0;
|
||||
|
||||
|
||||
#if !defined (HAVE_STRSIGNAL) && !defined (HAVE_SYS_SIGLIST)
|
||||
signame_init ();
|
||||
#endif
|
||||
@@ -447,8 +497,12 @@ main (argc, argv, envp)
|
||||
else \
|
||||
ADD_SIG (sig);
|
||||
|
||||
#ifdef SIGHUP
|
||||
FATAL_SIG (SIGHUP);
|
||||
#endif
|
||||
#ifdef SIGQUIT
|
||||
FATAL_SIG (SIGQUIT);
|
||||
#endif
|
||||
FATAL_SIG (SIGINT);
|
||||
FATAL_SIG (SIGTERM);
|
||||
|
||||
@@ -477,18 +531,19 @@ 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
|
||||
{
|
||||
#ifdef VMS
|
||||
program = rindex (argv[0], ']');
|
||||
#else
|
||||
program = rindex (argv[0], '/');
|
||||
#endif
|
||||
#ifdef __MSDOS__
|
||||
if (program == 0)
|
||||
program = rindex (argv[0], '\\');
|
||||
@@ -506,7 +561,11 @@ main (argc, argv, envp)
|
||||
|
||||
/* Figure out where we are. */
|
||||
|
||||
#ifdef WIN32
|
||||
if (getcwd_fs (current_directory, GET_PATH_MAX) == 0)
|
||||
#else
|
||||
if (getcwd (current_directory, GET_PATH_MAX) == 0)
|
||||
#endif
|
||||
{
|
||||
#ifdef HAVE_GETCWD
|
||||
perror_with_name ("getcwd: ", "");
|
||||
@@ -524,11 +583,18 @@ main (argc, argv, envp)
|
||||
done before $(MAKE) is are figured out so its definitions will not be
|
||||
one from the environment. */
|
||||
|
||||
#ifndef _AMIGA
|
||||
for (i = 0; envp[i] != 0; ++i)
|
||||
{
|
||||
register char *ep = envp[i];
|
||||
while (*ep != '=')
|
||||
++ep;
|
||||
#ifdef WIN32
|
||||
if (!strncmp(ep, "PATH", 4))
|
||||
unix_path = &ep[5];
|
||||
if (!strncmp(ep, "Path", 4))
|
||||
win32_path = &ep[5];
|
||||
#endif
|
||||
/* The result of pointer arithmetic is cast to unsigned int for
|
||||
machines where ptrdiff_t is a different size that doesn't widen
|
||||
the same. */
|
||||
@@ -541,6 +607,43 @@ main (argc, argv, envp)
|
||||
be exported, because it was originally in the environment. */
|
||||
->export = v_export;
|
||||
}
|
||||
#ifdef WIN32
|
||||
/*
|
||||
* PATH defaults to Path iff PATH not found and Path is found.
|
||||
*/
|
||||
if (!unix_path && win32_path)
|
||||
define_variable("PATH", 4, win32_path, o_env, 1)->export = v_export;
|
||||
#endif
|
||||
#else /* For Amiga, read the ENV: device, ignoring all dirs */
|
||||
{
|
||||
BPTR env, file, old;
|
||||
char buffer[1024];
|
||||
int len;
|
||||
__aligned struct FileInfoBlock fib;
|
||||
|
||||
env = Lock ("ENV:", ACCESS_READ);
|
||||
if (env)
|
||||
{
|
||||
old = CurrentDir (DupLock(env));
|
||||
Examine (env, &fib);
|
||||
|
||||
while (ExNext (env, &fib))
|
||||
{
|
||||
if (fib.fib_DirEntryType < 0) /* File */
|
||||
{
|
||||
/* Define an empty variable. It will be filled in
|
||||
variable_lookup(). Makes startup quite a bit
|
||||
faster. */
|
||||
define_variable (fib.fib_FileName,
|
||||
strlen (fib.fib_FileName),
|
||||
"", o_env, 1)->export = v_export;
|
||||
}
|
||||
}
|
||||
UnLock (env);
|
||||
UnLock(CurrentDir(old));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Decode the switches. */
|
||||
|
||||
@@ -552,6 +655,14 @@ main (argc, argv, envp)
|
||||
decode_env_switches ("MFLAGS", 6);
|
||||
#endif
|
||||
decode_switches (argc, argv, 0);
|
||||
#ifdef WIN32
|
||||
if (suspend_flag) {
|
||||
fprintf(stderr, "%s (pid = %d)\n", argv[0], GetCurrentProcessId());
|
||||
fprintf(stderr, "%s is suspending for 30 seconds...", argv[0]);
|
||||
Sleep(30 * 1000);
|
||||
fprintf(stderr, "done sleep(30). Continuing.\n");
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Print version information. */
|
||||
|
||||
@@ -562,16 +673,28 @@ main (argc, argv, envp)
|
||||
if (print_version_flag)
|
||||
die (0);
|
||||
|
||||
#ifndef __MSDOS__
|
||||
#if !defined(__MSDOS__) && !defined(VMS)
|
||||
/* Set the "MAKE_COMMAND" variable to the name we were invoked with.
|
||||
(If it is a relative pathname with a slash, prepend our directory name
|
||||
so the result will run the same program regardless of the current dir.
|
||||
If it is a name with no slash, we can only hope that PATH did not
|
||||
find it in the current directory.) */
|
||||
|
||||
#ifdef WIN32
|
||||
/*
|
||||
* Convert from backslashes to forward slashes for
|
||||
* programs like sh which don't like them. Shouldn't
|
||||
* matter if the path is one way or the other for
|
||||
* CreateProcess().
|
||||
*/
|
||||
if (strpbrk(argv[0], "/:\\") ||
|
||||
strstr(argv[0], "..") ||
|
||||
!strncmp(argv[0], "//", 2))
|
||||
argv[0] = strdup(w32ify(argv[0],1));
|
||||
#else /* WIN32 */
|
||||
if (current_directory[0] != '\0'
|
||||
&& argv[0] != 0 && argv[0][0] != '/' && index (argv[0], '/') != 0)
|
||||
argv[0] = concat (current_directory, "/", argv[0]);
|
||||
#endif /* WIN32 */
|
||||
#endif
|
||||
|
||||
/* The extra indirection through $(MAKE_COMMAND) is done
|
||||
@@ -644,6 +767,79 @@ main (argc, argv, envp)
|
||||
free (dir);
|
||||
}
|
||||
|
||||
#ifdef WIN32
|
||||
/*
|
||||
* THIS BLOCK OF CODE MUST COME AFTER chdir() CALL ABOVE IN ORDER
|
||||
* TO NOT CONFUSE THE DEPENDENCY CHECKING CODE IN implicit.c.
|
||||
*
|
||||
* The functions in dir.c can incorrectly cache information for "."
|
||||
* before we have changed directory and this can cause file
|
||||
* lookups to fail because the current directory (.) was pointing
|
||||
* at the wrong place when it was first evaluated.
|
||||
*/
|
||||
|
||||
/*
|
||||
* On Windows/NT, we don't have the luxury of a /bin directory that
|
||||
* is mapped globally to every drive mounted to the system. Since make could
|
||||
* be invoked from any drive, and we don't want to propogate /bin/sh
|
||||
* to every single drive. Allow ourselves a chance to search for
|
||||
* a value for default shell here (if the default path does not exist).
|
||||
*
|
||||
* The value of default_shell is set here, but it could get reset after
|
||||
* the Makefiles are read in. See logic below where SHELL is checked
|
||||
* after the call to read_all_makefiles() completes.
|
||||
*
|
||||
* The reason SHELL is set here is so that macros can be safely evaluated
|
||||
* as makefiles are read in (some macros require $SHELL).
|
||||
*/
|
||||
|
||||
{
|
||||
extern char *default_shell;
|
||||
|
||||
if (!file_exists_p(default_shell)) {
|
||||
char *p;
|
||||
struct variable *v = lookup_variable ("Path", 4);
|
||||
|
||||
/*
|
||||
* Try and make sure we have a full path to default_shell before
|
||||
* we parse makefiles.
|
||||
*/
|
||||
if (v && v->value) {
|
||||
PATH_VAR(sh_path);
|
||||
char *ep;
|
||||
|
||||
p = v->value;
|
||||
ep = strchr(p, PATH_SEPARATOR_CHAR);
|
||||
|
||||
while (ep && *ep) {
|
||||
*ep = '\0';
|
||||
|
||||
if (dir_file_exists_p(p, default_shell)) {
|
||||
sprintf(sh_path, "%s/%s", p, default_shell);
|
||||
default_shell = strdup(w32ify(sh_path,0));
|
||||
no_default_sh_exe = 0;
|
||||
*ep = PATH_SEPARATOR_CHAR;
|
||||
|
||||
/* terminate loop */
|
||||
p += strlen(p);
|
||||
} else {
|
||||
*ep = PATH_SEPARATOR_CHAR;
|
||||
p = ++ep;
|
||||
}
|
||||
|
||||
ep = strchr(p, PATH_SEPARATOR_CHAR);
|
||||
}
|
||||
|
||||
/* be sure to check last element of Path */
|
||||
if (p && *p && dir_file_exists_p(p, default_shell)) {
|
||||
sprintf(sh_path, "%s/%s", p, default_shell);
|
||||
default_shell = strdup(w32ify(sh_path,0));
|
||||
no_default_sh_exe = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif /* WIN32 */
|
||||
/* Figure out the level of recursion. */
|
||||
{
|
||||
struct variable *v = lookup_variable ("MAKELEVEL", 9);
|
||||
@@ -672,7 +868,11 @@ main (argc, argv, envp)
|
||||
starting_directory = current_directory;
|
||||
else
|
||||
{
|
||||
#ifdef WIN32
|
||||
if (getcwd_fs (current_directory, GET_PATH_MAX) == 0)
|
||||
#else
|
||||
if (getcwd (current_directory, GET_PATH_MAX) == 0)
|
||||
#endif
|
||||
{
|
||||
#ifdef HAVE_GETCWD
|
||||
perror_with_name ("getcwd: ", "");
|
||||
@@ -685,11 +885,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. */
|
||||
|
||||
if (makefiles != 0)
|
||||
@@ -705,7 +900,12 @@ main (argc, argv, envp)
|
||||
|
||||
/* Make a unique filename. */
|
||||
#ifdef HAVE_MKTEMP
|
||||
|
||||
#ifdef VMS
|
||||
static char name[] = "sys$scratch:GmXXXXXX";
|
||||
#else
|
||||
static char name[] = "/tmp/GmXXXXXX";
|
||||
#endif
|
||||
(void) mktemp (name);
|
||||
#else
|
||||
static char name[L_tmpnam];
|
||||
@@ -718,7 +918,7 @@ main (argc, argv, envp)
|
||||
while (!feof (stdin))
|
||||
{
|
||||
char buf[2048];
|
||||
int n = fread (buf, 1, sizeof(buf), stdin);
|
||||
unsigned int n = fread (buf, 1, sizeof(buf), stdin);
|
||||
if (n > 0 && fwrite (buf, 1, n, outfile) != n)
|
||||
pfatal_with_name ("fwrite (temporary file)");
|
||||
}
|
||||
@@ -785,6 +985,53 @@ main (argc, argv, envp)
|
||||
|
||||
define_makeflags (0, 0);
|
||||
|
||||
#ifdef WIN32
|
||||
/*
|
||||
* Now that makefiles are parsed, see if a Makefile gave a
|
||||
* value for SHELL and use that for default_shell instead if
|
||||
* that filename exists. This should speed up the
|
||||
* construct_argv_internal() function by avoiding unnecessary
|
||||
* recursion.
|
||||
*/
|
||||
{
|
||||
struct variable *v = lookup_variable("SHELL", 5);
|
||||
extern char* default_shell;
|
||||
|
||||
/*
|
||||
* to change value:
|
||||
*
|
||||
* SHELL must be found, SHELL must be set, value of SHELL
|
||||
* must be different from current value, and the
|
||||
* specified file must exist. Whew!
|
||||
*/
|
||||
if (v != 0 && *v->value != '\0') {
|
||||
char *fn = recursively_expand(v);
|
||||
|
||||
if (fn && strcmp(fn, default_shell) && file_exists_p(fn)) {
|
||||
char *p;
|
||||
|
||||
default_shell = fn;
|
||||
|
||||
/* if Makefile says SHELL is sh.exe, believe it */
|
||||
if (strstr(default_shell, "sh.exe"))
|
||||
no_default_sh_exe = 0;
|
||||
|
||||
/*
|
||||
* Convert from backslashes to forward slashes so
|
||||
* create_command_line_argv_internal() is not confused.
|
||||
*/
|
||||
for (p = strchr(default_shell, '\\'); p; p = strchr(default_shell, '\\'))
|
||||
*p = '/';
|
||||
}
|
||||
}
|
||||
}
|
||||
if (no_default_sh_exe && job_slots != 1) {
|
||||
error("Do not specify -j or --jobs if sh.exe is not available.");
|
||||
error("Resetting make for single job mode.");
|
||||
job_slots = 1;
|
||||
}
|
||||
#endif /* WIN32 */
|
||||
|
||||
/* Define the default variables. */
|
||||
define_default_variables ();
|
||||
|
||||
@@ -855,6 +1102,9 @@ main (argc, argv, envp)
|
||||
}
|
||||
}
|
||||
|
||||
/* Initialize the remote job module. */
|
||||
remote_setup ();
|
||||
|
||||
if (read_makefiles != 0)
|
||||
{
|
||||
/* Update any makefiles if necessary. */
|
||||
@@ -917,7 +1167,7 @@ main (argc, argv, envp)
|
||||
d = d->next;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Set up `MAKEFLAGS' specially while remaking makefiles. */
|
||||
define_makeflags (1, 1);
|
||||
@@ -929,11 +1179,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 +1257,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)
|
||||
{
|
||||
@@ -1045,6 +1294,7 @@ main (argc, argv, envp)
|
||||
fatal ("Couldn't change back to original directory.");
|
||||
}
|
||||
|
||||
#ifndef _AMIGA
|
||||
for (p = environ; *p != 0; ++p)
|
||||
if (!strncmp (*p, "MAKELEVEL=", 10))
|
||||
{
|
||||
@@ -1057,6 +1307,20 @@ main (argc, argv, envp)
|
||||
sprintf (*p, "MAKELEVEL=%u", makelevel);
|
||||
break;
|
||||
}
|
||||
#else /* AMIGA */
|
||||
{
|
||||
char buffer[256];
|
||||
int len;
|
||||
|
||||
len = GetVar ("MAKELEVEL", buffer, sizeof (buffer), GVF_GLOBAL_ONLY);
|
||||
|
||||
if (len != -1)
|
||||
{
|
||||
sprintf (buffer, "%u", makelevel);
|
||||
SetVar ("MAKELEVEL", buffer, -1, GVF_GLOBAL_ONLY);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
if (debug_flag)
|
||||
{
|
||||
@@ -1070,7 +1334,12 @@ main (argc, argv, envp)
|
||||
fflush (stdout);
|
||||
fflush (stderr);
|
||||
|
||||
#ifndef _AMIGA
|
||||
exec_command (argv, environ);
|
||||
#else
|
||||
exec_command (argv);
|
||||
exit (0);
|
||||
#endif
|
||||
/* NOTREACHED */
|
||||
}
|
||||
}
|
||||
@@ -1108,15 +1377,16 @@ main (argc, argv, envp)
|
||||
/* Nothing happened. */
|
||||
case 0:
|
||||
/* Updated successfully. */
|
||||
status = 0;
|
||||
status = EXIT_SUCCESS;
|
||||
break;
|
||||
case 2:
|
||||
/* Updating failed. */
|
||||
status = 2;
|
||||
/* Updating failed. POSIX.2 specifies exit status >1 for this;
|
||||
but in VMS, there is only success and failure. */
|
||||
status = EXIT_FAILURE ? 2 : EXIT_FAILURE;
|
||||
break;
|
||||
case 1:
|
||||
/* We are under -q and would run some commands. */
|
||||
status = 1;
|
||||
status = EXIT_FAILURE;
|
||||
break;
|
||||
default:
|
||||
abort ();
|
||||
@@ -1230,7 +1500,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));
|
||||
@@ -1366,19 +1636,21 @@ positive integral argument",
|
||||
= *(unsigned int *) cs->noarg_value;
|
||||
break;
|
||||
|
||||
#ifndef NO_FLOAT
|
||||
case floating:
|
||||
if (optarg == 0 && optind < argc
|
||||
&& (isdigit (argv[optind][0]) || argv[optind][0] == '.'))
|
||||
optarg = argv[optind++];
|
||||
|
||||
if (doit)
|
||||
*(double *) cs->value_ptr
|
||||
*(double *) cs->value_ptr
|
||||
= (optarg != 0 ? atof (optarg)
|
||||
: *(double *) cs->noarg_value);
|
||||
|
||||
break;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
/* We've found the switch. Stop looking. */
|
||||
break;
|
||||
}
|
||||
@@ -1549,34 +1821,12 @@ decode_env_switches (envar, len)
|
||||
*p = '\0';
|
||||
argv[++argc] = 0;
|
||||
|
||||
if (argc == 2 && argv[1][0] != '-')
|
||||
{
|
||||
/* There is just one word in the value, and it is not a switch.
|
||||
Either this is the single-word form and we should prepend a dash
|
||||
before calling decode_switches, or this is the multi-word form and
|
||||
there is no dash because it is a variable definition. */
|
||||
struct variable *v;
|
||||
v = try_variable_definition ((char *) 0, 0, argv[1], o_command);
|
||||
if (v != 0)
|
||||
{
|
||||
/* It was indeed a variable definition, and now it has been
|
||||
processed. There is nothing for decode_switches to do.
|
||||
Record a pointer to the variable for later use in
|
||||
define_makeflags. */
|
||||
struct command_variable *cv
|
||||
= (struct command_variable *) xmalloc (sizeof (*cv));
|
||||
cv->variable = v;
|
||||
cv->next = command_variables;
|
||||
command_variables = cv;
|
||||
return;
|
||||
}
|
||||
|
||||
/* It wasn't a variable definition, so it's some switches without a
|
||||
leading dash. Add one and pass it along to decode_switches. We
|
||||
need permanent storage for this in case decode_switches saves
|
||||
pointers into the value. */
|
||||
argv[1] = concat ("-", argv[1], "");
|
||||
}
|
||||
if (argv[1][0] != '-' && index (argv[1], '=') == 0)
|
||||
/* The first word doesn't start with a dash and isn't a variable
|
||||
definition. Add a dash and pass it along to decode_switches. We
|
||||
need permanent storage for this in case decode_switches saves
|
||||
pointers into the value. */
|
||||
argv[1] = concat ("-", argv[1], "");
|
||||
|
||||
/* Parse those words. */
|
||||
decode_switches (argc, argv, 1);
|
||||
@@ -1596,7 +1846,11 @@ quote_as_word (out, in, double_dollars)
|
||||
{
|
||||
while (*in != '\0')
|
||||
{
|
||||
#ifdef VMS
|
||||
if (index ("^;'\"*?$<>(){}|&~`\\ \t\r\n\f\v", *in) != 0)
|
||||
#else
|
||||
if (index ("^;'\"*?[]$<>(){}|&~`\\ \t\r\n\f\v", *in) != 0)
|
||||
#endif
|
||||
*out++ = '\\';
|
||||
if (double_dollars && *in == '$')
|
||||
*out++ = '$';
|
||||
@@ -1692,6 +1946,7 @@ define_makeflags (all, makefile)
|
||||
}
|
||||
break;
|
||||
|
||||
#ifndef NO_FLOAT
|
||||
case floating:
|
||||
if (all)
|
||||
{
|
||||
@@ -1711,6 +1966,7 @@ define_makeflags (all, makefile)
|
||||
}
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
|
||||
case string:
|
||||
if (all)
|
||||
@@ -1778,6 +2034,22 @@ 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
|
||||
@@ -1824,10 +2096,10 @@ define_makeflags (all, makefile)
|
||||
*p = '\0';
|
||||
|
||||
v = define_variable ("MAKEFLAGS", 9,
|
||||
/* If there is just a single word of switches,
|
||||
omit the leading dash unless it is a single
|
||||
long option with two leading dashes. */
|
||||
&flagstring[(words == 1 && command_variables == 0
|
||||
/* If there are switches, omit the leading dash
|
||||
unless it is a single long option with two
|
||||
leading dashes. */
|
||||
&flagstring[(flagstring[0] == '-'
|
||||
&& flagstring[1] != '-')
|
||||
? 1 : 0],
|
||||
/* This used to use o_env, but that lost when a
|
||||
@@ -1842,9 +2114,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. */
|
||||
@@ -1865,10 +2134,11 @@ print_version ()
|
||||
printf ("-%s", remote_description);
|
||||
|
||||
printf (", by Richard Stallman and Roland McGrath.\n\
|
||||
%sCopyright (C) 1988, 89, 90, 91, 92, 93, 94, 95 Free Software Foundation, Inc.\n\
|
||||
%sCopyright (C) 1988, 89, 90, 91, 92, 93, 94, 95, 96\n\
|
||||
%s\tFree Software Foundation, Inc.\n\
|
||||
%sThis is free software; see the source for copying conditions.\n\
|
||||
%sThere is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A\n\
|
||||
%sPARTICULAR PURPOSE.\n\n", precede, precede, precede, precede);
|
||||
%sPARTICULAR PURPOSE.\n\n", precede, precede, precede, precede, precede);
|
||||
|
||||
printed_version = 1;
|
||||
|
||||
@@ -1926,14 +2196,16 @@ die (status)
|
||||
for (err = status != 0; job_slots_used > 0; err = 0)
|
||||
reap_children (1, err);
|
||||
|
||||
/* Let the remote job module clean up its state. */
|
||||
remote_cleanup ();
|
||||
|
||||
/* Remove the intermediate files. */
|
||||
remove_intermediates (0);
|
||||
|
||||
if (print_data_base_flag)
|
||||
print_data_base ();
|
||||
|
||||
if (print_directory_flag)
|
||||
log_working_directory (0);
|
||||
log_working_directory (0);
|
||||
}
|
||||
|
||||
exit (status);
|
||||
@@ -1942,20 +2214,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);
|
||||
|
||||
|
||||
562
make-stds.texi
562
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
|
||||
@@ -51,7 +63,7 @@ you need to run programs that are a part of your package during the
|
||||
make, please make sure that it uses @file{./} if the program is built as
|
||||
part of the make or @file{$(srcdir)/} if the file is an unchanging part
|
||||
of the source code. Without one of these prefixes, the current search
|
||||
path is used.
|
||||
path is used.
|
||||
|
||||
The distinction between @file{./} and @file{$(srcdir)/} is important
|
||||
when using the @samp{--srcdir} option to @file{configure}. A rule of
|
||||
@@ -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,14 +123,17 @@ 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
|
||||
example, don't use @samp{mkdir -p}, convenient as it may be, because
|
||||
most systems don't support it.
|
||||
|
||||
It is a good idea to avoid creating symbolic links in makefiles, since a
|
||||
few systems don't support them.
|
||||
|
||||
The Makefile rules for building and installation can also use compilers
|
||||
and related programs, but should do so via @code{make} variables so that the
|
||||
user can substitute alternatives. Here are some of the programs we
|
||||
@@ -137,226 +155,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 +247,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 +270,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 +303,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 +326,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 +341,44 @@ 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)}
|
||||
install executables here, they probably ought to go 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 lispdir
|
||||
The directory for installing any Emacs Lisp files in this package. By
|
||||
default, it should be @file{/usr/local/share/emacs/site-lisp}, but it
|
||||
should be written as @file{$(prefix)/share/emacs/site-lisp}.
|
||||
|
||||
If you are using Autoconf, write the default as @samp{@@lispdir@@}.
|
||||
In order to make @samp{@@lispdir@@} work, you need the following lines
|
||||
in your @file{configure.in} file:
|
||||
|
||||
@example
|
||||
lispdir='$@{datadir@}/emacs/site-lisp'
|
||||
AC_SUBST(lispdir)
|
||||
@end example
|
||||
|
||||
@item includedir
|
||||
@c rewritten to avoid overfull hbox --roland
|
||||
@@ -553,6 +386,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 +399,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 +413,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 +457,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 +489,248 @@ 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:
|
||||
|
||||
@smallexample
|
||||
install-strip:
|
||||
$(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' \
|
||||
install
|
||||
@end smallexample
|
||||
|
||||
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 need 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 @code{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
|
||||
|
||||
165
make.h
165
make.h
@@ -1,5 +1,5 @@
|
||||
/* Miscellaneous global declarations and portability cruft for GNU Make.
|
||||
Copyright (C) 1988, 89, 90, 91, 92, 93, 94, 95 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
|
||||
@@ -28,6 +28,17 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||
#undef HAVE_CONFIG_H
|
||||
#define HAVE_CONFIG_H
|
||||
|
||||
|
||||
/* Use prototypes if available. */
|
||||
#if defined (__cplusplus) || (defined (__STDC__) && __STDC__)
|
||||
#undef PARAMS
|
||||
#define PARAMS(protos) protos
|
||||
#else /* Not C++ or ANSI C. */
|
||||
#undef PARAMS
|
||||
#define PARAMS(protos) ()
|
||||
#endif /* C++ or ANSI C. */
|
||||
|
||||
|
||||
#ifdef CRAY
|
||||
/* This must happen before #include <signal.h> so
|
||||
that the declaration therein is changed. */
|
||||
@@ -67,9 +78,7 @@ extern int errno;
|
||||
#endif
|
||||
|
||||
/* Some systems define _POSIX_VERSION but are not really POSIX.1. */
|
||||
#if (defined (butterfly) || defined (__arm) || \
|
||||
(defined (__mips) && defined (_SYSTYPE_SVR3)) || \
|
||||
(defined (sequent) && defined (i386)))
|
||||
#if (defined (butterfly) || defined (__arm) || (defined (__mips) && defined (_SYSTYPE_SVR3)) || (defined (sequent) && defined (i386)))
|
||||
#undef POSIX
|
||||
#endif
|
||||
|
||||
@@ -77,15 +86,6 @@ extern int errno;
|
||||
#define POSIX
|
||||
#endif
|
||||
|
||||
#if !defined (HAVE_SYS_SIGLIST) && defined (HAVE__SYS_SIGLIST)
|
||||
#define sys_siglist _sys_siglist
|
||||
#define HAVE_SYS_SIGLIST /* Now we have it. */
|
||||
|
||||
/* It was declared in <signal.h>, with who knows what type.
|
||||
Don't declare it again and risk conflicting. */
|
||||
#define SYS_SIGLIST_DECLARED
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_SYS_SIGLIST
|
||||
#ifndef SYS_SIGLIST_DECLARED
|
||||
extern char *sys_siglist[];
|
||||
@@ -132,7 +132,7 @@ extern char *sys_siglist[];
|
||||
#define PATH_VAR(var) char var[PATH_MAX]
|
||||
#else
|
||||
#define NEED_GET_PATH_MAX
|
||||
extern unsigned int get_path_max ();
|
||||
extern unsigned int get_path_max PARAMS ((void));
|
||||
#define GET_PATH_MAX (get_path_max ())
|
||||
#define PATH_VAR(var) char *var = (char *) alloca (GET_PATH_MAX)
|
||||
#endif
|
||||
@@ -153,8 +153,16 @@ extern unsigned int get_path_max ();
|
||||
#define S_ISDIR(mode) (((mode) & S_IFMT) == S_IFDIR)
|
||||
#endif
|
||||
|
||||
#ifdef VMS
|
||||
#include <stdio.h>
|
||||
#include <types.h>
|
||||
#include <unixlib.h>
|
||||
#include <unixio.h>
|
||||
#include <errno.h>
|
||||
#include <perror.h>
|
||||
#endif
|
||||
|
||||
#if (defined (STDC_HEADERS) || defined (__GNU_LIBRARY__))
|
||||
#if (defined (STDC_HEADERS) || defined (__GNU_LIBRARY__) || defined(VMS))
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#define ANSI_STRING
|
||||
@@ -170,10 +178,12 @@ extern unsigned int get_path_max ();
|
||||
#include <memory.h>
|
||||
#endif
|
||||
|
||||
extern char *malloc (), *realloc ();
|
||||
extern void free ();
|
||||
extern char *malloc PARAMS ((int));
|
||||
extern char *realloc PARAMS ((char *, int));
|
||||
extern void free PARAMS ((char *));
|
||||
|
||||
extern void abort (), exit ();
|
||||
extern void abort PARAMS ((void));
|
||||
extern void exit PARAMS ((int));
|
||||
|
||||
#endif /* Standard headers. */
|
||||
|
||||
@@ -214,8 +224,8 @@ extern void bcopy ();
|
||||
/* SCO Xenix has a buggy macro definition in <string.h>. */
|
||||
#undef strerror
|
||||
|
||||
#ifndef ANSI_STRING
|
||||
extern char *strerror ();
|
||||
#if !defined(ANSI_STRING) && !defined(__DECC)
|
||||
extern char *strerror PARAMS ((int errnum));
|
||||
#endif
|
||||
|
||||
|
||||
@@ -236,14 +246,30 @@ extern char *alloca ();
|
||||
#define streq(a, b) \
|
||||
((a) == (b) || \
|
||||
(*(a) == *(b) && (*(a) == '\0' || !strcmp ((a) + 1, (b) + 1))))
|
||||
#ifdef _AMIGA
|
||||
#define strieq(a, b) \
|
||||
((a) == (b) || \
|
||||
(tolower(*(a)) == tolower(*(b)) && (*(a) == '\0' || !strcmpi ((a) + 1, (b) + 1))))
|
||||
#else
|
||||
#define strieq(a, b) \
|
||||
((a) == (b) || \
|
||||
(*(a) == *(b) && (*(a) == '\0' || !strcmp ((a) + 1, (b) + 1))))
|
||||
#endif
|
||||
#else
|
||||
/* Buggy compiler can't handle this. */
|
||||
#define streq(a, b) (strcmp ((a), (b)) == 0)
|
||||
#define strieq(a, b) (strcmp ((a), (b)) == 0)
|
||||
#endif
|
||||
|
||||
/* Add to VAR the hashing value of C, one character in a name. */
|
||||
#define HASH(var, c) \
|
||||
((var += (c)), (var = ((var) << 7) + ((var) >> 20)))
|
||||
#ifdef _AMIGA /* Fold filenames on #amiga */
|
||||
#define HASHI(var, c) \
|
||||
((var += tolower((c))), (var = ((var) << 7) + ((var) >> 20)))
|
||||
#else
|
||||
#define HASHI(var, c) HASH(var,c)
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__) || defined(ENUM_BITFIELDS)
|
||||
#define ENUM_BITFIELD(bits) :bits
|
||||
@@ -251,25 +277,49 @@ extern char *alloca ();
|
||||
#define ENUM_BITFIELD(bits)
|
||||
#endif
|
||||
|
||||
#ifdef __MSDOS__
|
||||
#if defined(__MSDOS__) || defined(WIN32)
|
||||
#define PATH_SEPARATOR_CHAR ';'
|
||||
#else
|
||||
#define PATH_SEPARATOR_CHAR ':'
|
||||
#endif
|
||||
|
||||
#ifdef WIN32
|
||||
#include <fcntl.h>
|
||||
#include <malloc.h>
|
||||
#define pipe(p) _pipe(p, 512, O_BINARY)
|
||||
#define kill(pid,sig) w32_kill(pid,sig)
|
||||
|
||||
extern void sync_Path_environment(void);
|
||||
extern int kill(int pid, int sig);
|
||||
extern int safe_stat(char *file, struct stat *sb);
|
||||
extern char *end_of_token_w32();
|
||||
#endif
|
||||
|
||||
extern void die ();
|
||||
extern void message (), fatal (), error ();
|
||||
extern void makefile_error (), makefile_fatal ();
|
||||
extern void pfatal_with_name (), perror_with_name ();
|
||||
extern char *savestring (), *concat ();
|
||||
extern char *xmalloc (), *xrealloc ();
|
||||
extern char *find_next_token (), *next_token (), *end_of_token ();
|
||||
extern void collapse_continuations (), remove_comments ();
|
||||
extern char *sindex (), *lindex ();
|
||||
extern void message ();
|
||||
extern void fatal ();
|
||||
extern void error ();
|
||||
extern void log_working_directory ();
|
||||
extern void makefile_error ();
|
||||
extern void makefile_fatal ();
|
||||
extern void pfatal_with_name ();
|
||||
extern void perror_with_name ();
|
||||
extern char *savestring ();
|
||||
extern char *concat ();
|
||||
extern char *xmalloc ();
|
||||
extern char *xrealloc ();
|
||||
extern char *find_next_token ();
|
||||
extern char *next_token ();
|
||||
extern char *end_of_token ();
|
||||
extern void collapse_continuations ();
|
||||
extern void remove_comments ();
|
||||
extern char *sindex ();
|
||||
extern char *lindex ();
|
||||
extern int alpha_compare ();
|
||||
extern void print_spaces ();
|
||||
extern struct dep *copy_dep_chain ();
|
||||
extern char *find_char_unquote (), *find_percent ();
|
||||
extern char *find_char_unquote ();
|
||||
extern char *find_percent ();
|
||||
|
||||
#ifndef NO_ARCHIVES
|
||||
extern int ar_name ();
|
||||
@@ -279,16 +329,22 @@ extern time_t ar_member_date ();
|
||||
#endif
|
||||
|
||||
extern void dir_load ();
|
||||
extern int dir_file_exists_p (), file_exists_p (), file_impossible_p ();
|
||||
extern int dir_file_exists_p ();
|
||||
extern int file_exists_p ();
|
||||
extern int file_impossible_p ();
|
||||
extern void file_impossible ();
|
||||
extern char *dir_name ();
|
||||
|
||||
extern void define_default_variables ();
|
||||
extern void set_default_suffixes (), install_default_suffix_rules ();
|
||||
extern void install_default_implicit_rules (), count_implicit_rule_limits ();
|
||||
extern void convert_to_pattern (), create_pattern_rule ();
|
||||
extern void set_default_suffixes ();
|
||||
extern void install_default_suffix_rules ();
|
||||
extern void install_default_implicit_rules ();
|
||||
extern void count_implicit_rule_limits ();
|
||||
extern void convert_to_pattern ();
|
||||
extern void create_pattern_rule ();
|
||||
|
||||
extern void build_vpath_lists (), construct_vpath_list ();
|
||||
extern void build_vpath_lists ();
|
||||
extern void construct_vpath_list ();
|
||||
extern int vpath_search ();
|
||||
|
||||
extern void construct_include_path ();
|
||||
@@ -297,8 +353,9 @@ extern void uniquize_deps ();
|
||||
extern int update_goal_chain ();
|
||||
extern void notice_finished_file ();
|
||||
|
||||
extern void user_access (), make_access (), child_access ();
|
||||
|
||||
extern void user_access ();
|
||||
extern void make_access ();
|
||||
extern void child_access ();
|
||||
|
||||
#ifdef HAVE_VFORK_H
|
||||
#include <vfork.h>
|
||||
@@ -307,15 +364,20 @@ extern void user_access (), make_access (), child_access ();
|
||||
/* We omit these declarations on non-POSIX systems which define _POSIX_VERSION,
|
||||
because such systems often declare the in header files anyway. */
|
||||
|
||||
#if !defined (__GNU_LIBRARY__) && !defined (POSIX) && !defined (_POSIX_VERSION)
|
||||
#if !defined (__GNU_LIBRARY__) && !defined (POSIX) && !defined (_POSIX_VERSION) && !defined(WIN32)
|
||||
|
||||
extern long int atol ();
|
||||
#ifndef VMS
|
||||
extern long int lseek ();
|
||||
#endif
|
||||
|
||||
#endif /* Not GNU C library or POSIX. */
|
||||
|
||||
#ifdef HAVE_GETCWD
|
||||
extern char *getcwd ();
|
||||
#ifdef VMS
|
||||
extern char *getwd PARAMS ((char *));
|
||||
#endif
|
||||
#else
|
||||
extern char *getwd ();
|
||||
#define getcwd(buf, len) getwd (buf)
|
||||
@@ -333,7 +395,11 @@ extern int print_directory_flag, warn_undefined_variables_flag;
|
||||
extern int posix_pedantic;
|
||||
|
||||
extern unsigned int job_slots;
|
||||
#ifndef NO_FLOAT
|
||||
extern double max_load_average;
|
||||
#else
|
||||
extern int max_load_average;
|
||||
#endif
|
||||
|
||||
extern char *program;
|
||||
extern char *starting_directory;
|
||||
@@ -348,3 +414,26 @@ extern int handling_fatal_signal;
|
||||
#define DEBUGPR(msg) \
|
||||
do if (debug_flag) { print_spaces (depth); printf (msg, file->name); \
|
||||
fflush (stdout); } while (0)
|
||||
|
||||
#ifdef VMS
|
||||
# ifndef EXIT_FAILURE
|
||||
# define EXIT_FAILURE 3
|
||||
# endif
|
||||
# ifndef EXIT_SUCCESS
|
||||
# define EXIT_SUCCESS 1
|
||||
# endif
|
||||
# ifndef EXIT_TROUBLE
|
||||
# define EXIT_TROUBLE 2
|
||||
# endif
|
||||
#else
|
||||
# ifndef EXIT_FAILURE
|
||||
# define EXIT_FAILURE 2
|
||||
# endif
|
||||
# ifndef EXIT_SUCCESS
|
||||
# define EXIT_SUCCESS 0
|
||||
# endif
|
||||
# ifndef EXIT_TROUBLE
|
||||
# define EXIT_TROUBLE 1
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
||||
5
make.lnk
Normal file
5
make.lnk
Normal file
@@ -0,0 +1,5 @@
|
||||
FROM LIB:cres.o "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-stub.o"+"getopt.o"+"getopt1.o"+"alloca.o"+"amiga.o"
|
||||
TO "make.new"
|
||||
LIB glob/glob.lib LIB:sc.lib LIB:amiga.lib
|
||||
QUIET
|
||||
|
||||
402
make.texinfo
402
make.texinfo
File diff suppressed because it is too large
Load Diff
34
makefile.com
Normal file
34
makefile.com
Normal file
@@ -0,0 +1,34 @@
|
||||
$!
|
||||
$! Makefile.com - builds GNU Make for VMS
|
||||
$!
|
||||
$! P1 is non-empty if you want to link with the VAXCRTL library instead
|
||||
$! of the shareable executable
|
||||
$!
|
||||
$ def/nolog sys sys$library:
|
||||
$ filelist = "alloca commands default dir expand file function implicit job main misc read remake remote-stub rule signame variable version vmsfunctions vmsify vpath [.glob]glob [.glob]fnmatch getopt getopt1"
|
||||
$ copy config.h-vms config.h
|
||||
$ n=0
|
||||
$ loop:
|
||||
$ cfile = f$elem(n," ",filelist)
|
||||
$ if cfile .eqs. " " then goto linkit
|
||||
$ write sys$output "Compiling ''cfile'..."
|
||||
$ call compileit 'cfile' 'p1'
|
||||
$ n = n + 1
|
||||
$ goto loop
|
||||
$ linkit:
|
||||
$ if p1 .nes. "" then goto link_using_library
|
||||
$ link/exe=make alloca,commands,default,dir,expand,file,function,-
|
||||
implicit,job,main,misc,read,remake,remote-stub,rule,-
|
||||
signame,variable,version,vmsfunctions,vmsify,vpath,-
|
||||
glob,fnmatch,getopt,getopt1
|
||||
$ exit
|
||||
$ link_using_library:
|
||||
$ link/exe=make alloca,commands,default,dir,expand,file,function,-
|
||||
implicit,job,main,misc,read,remake,remote-stub,rule,-
|
||||
signame,variable,version,vmsfunctions,vmsify,vpath,-
|
||||
glob,fnmatch,getopt,getopt1,sys$library:vaxcrtl/lib
|
||||
$!
|
||||
$ compileit : subroutine
|
||||
$ cc/include=([],[.glob])/define=("allocated_variable_expand_for_file=alloc_var_expand_for_file","unlink=remove","HAVE_CONFIG_H","VMS","NO_ARCHIVES") 'p1'
|
||||
$ exit
|
||||
$ endsubroutine : compileit
|
||||
121
makefile.vms
Normal file
121
makefile.vms
Normal file
@@ -0,0 +1,121 @@
|
||||
# Copyright (C) 1988, 1989, 1996 Free Software Foundation, Inc.
|
||||
# This file is part of GNU Make.
|
||||
#
|
||||
# VMS extensions from GNU Make 3.60 imported by
|
||||
# Klaus Kämpf (kkaempf@didymus.rmi.de)
|
||||
#
|
||||
# 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)
|
||||
# any later version.
|
||||
#
|
||||
# GNU Make 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 GNU Make; see the file COPYING. If not, write to
|
||||
# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
CC = cc/warn
|
||||
CP = copy
|
||||
|
||||
%.obj: %.c
|
||||
$(CC) $(CFLAGS)/obj=$@ $<
|
||||
#
|
||||
# Makefile for GNU Make
|
||||
#
|
||||
|
||||
CFLAGS = $(defines) /debug/noopt/include=([],[.glob])
|
||||
#LDFLAGS = /deb
|
||||
LDFLAGS =
|
||||
|
||||
defines = /define=("unlink=remove","HAVE_CONFIG_H","VMS","NO_ARCHIVES","allocated_variable_expand_for_file=alloc_var_expand_for_file")
|
||||
|
||||
LOAD_AVG = /define="NO_LDAV"
|
||||
|
||||
# If you don't want archive support, comment these out.
|
||||
#ARCHIVES = ,ar.obj,arscan.obj
|
||||
#ARCHIVES_SRC = ar.c arscan.c
|
||||
|
||||
# If your system needs extra libraries loaded in, define them here.
|
||||
# System V probably need -lPW for alloca.
|
||||
# if on vax, uncomment the following line
|
||||
#LOADLIBES = ,c.opt/opt
|
||||
LOADLIBES =,sys$$library:vaxcrtl.olb/lib
|
||||
|
||||
# If your system doesn't have alloca, or the one provided is bad,
|
||||
# get it from the Emacs distribution and define these.
|
||||
ALLOCA = ,alloca.obj
|
||||
ALLOCASRC = alloca.c
|
||||
|
||||
# If there are remote execution facilities defined,
|
||||
# enable them with switches here (see remote-*.c).
|
||||
REMOTE =
|
||||
|
||||
# Any extra object files your system needs.
|
||||
extras = ,signame.obj,remote-stub.obj,vmsfunctions.obj,vmsify.obj
|
||||
#,directory.obj
|
||||
# as an alternative:
|
||||
glob = ,[.glob]glob.obj,[.glob]fnmatch.obj
|
||||
getopt = ,getopt.obj,getopt1.obj
|
||||
# Directory to install `make' in.
|
||||
bindir = []
|
||||
# Directory to install the man page in.
|
||||
mandir = []
|
||||
# Number to put on the man page filename.
|
||||
manext = 1
|
||||
|
||||
objs = commands.obj,job.obj,dir.obj,file.obj,misc.obj,\
|
||||
main.obj,read.obj,remake.obj,rule.obj,implicit.obj,\
|
||||
default.obj,variable.obj,expand.obj,function.obj,\
|
||||
vpath.obj,version.obj$(ARCHIVES)$(ALLOCA)$(extras)$(getopt)$(glob)
|
||||
srcs = commands.c job.c dir.c file.c misc.c \
|
||||
main.c read.c remake.c rule.c implicit.c \
|
||||
default.c variable.c expand.c function.c \
|
||||
vpath.c version.c vmsfunctions.c vmsify.c $(ARCHIVES_SRC) $(ALLOCASRC) \
|
||||
commands.h dep.h filedef.h job.h make.h rule.h variable.h
|
||||
|
||||
|
||||
.PHONY: all doc
|
||||
all: config.h make.exe
|
||||
|
||||
doc: make.info make.dvi
|
||||
|
||||
|
||||
make.exe: $(objs)
|
||||
$(LD)$(LDFLAGS)/exe=$@ $^$(LOADLIBES)
|
||||
|
||||
.PHONY: clean realclean
|
||||
clean:
|
||||
-$(RM) make.exe;,*.obj;*
|
||||
|
||||
# Automatically generated dependencies.
|
||||
commands.obj: commands.c make.h dep.h commands.h filedef.h variable.h job.h
|
||||
job.obj: job.c make.h commands.h job.h filedef.h variable.h
|
||||
dir.obj: dir.c make.h
|
||||
file.obj: file.c make.h commands.h dep.h filedef.h variable.h
|
||||
misc.obj: misc.c make.h dep.h
|
||||
main.obj: main.c make.h commands.h dep.h filedef.h variable.h job.h
|
||||
read.obj: read.c make.h commands.h dep.h filedef.h variable.h
|
||||
remake.obj: remake.c make.h commands.h job.h dep.h filedef.h
|
||||
rule.obj: rule.c make.h commands.h dep.h filedef.h variable.h rule.h
|
||||
implicit.obj: implicit.c make.h rule.h dep.h filedef.h
|
||||
default.obj: default.c make.h rule.h dep.h filedef.h commands.h variable.h
|
||||
variable.obj: variable.c make.h commands.h variable.h dep.h filedef.h
|
||||
expand.obj: expand.c make.h commands.h filedef.h variable.h
|
||||
function.obj: function.c make.h variable.h dep.h commands.h job.h
|
||||
vpath.obj: vpath.c make.h filedef.h variable.h
|
||||
version.obj: version.c
|
||||
arscan.obj: arscan.c
|
||||
ar.obj: ar.c make.h filedef.h
|
||||
signame.obj: signame.c
|
||||
remote-stub.obj: remote-stub.c
|
||||
[.glob]glob.obj: [.glob]glob.c
|
||||
[.glob]fnmatch.obj: [.glob]fnmatch.c
|
||||
getopt.obj: getopt.c
|
||||
getopt1.obj: getopt1.c
|
||||
|
||||
config.h: config.h-vms
|
||||
$(CP) $< $@
|
||||
92
misc.c
92
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);
|
||||
@@ -254,7 +271,9 @@ strerror (errnum)
|
||||
int errnum;
|
||||
{
|
||||
extern int errno, sys_nerr;
|
||||
#ifndef __DECC
|
||||
extern char *sys_errlist[];
|
||||
#endif
|
||||
static char buf[] = "Unknown error 12345678901234567890";
|
||||
|
||||
if (errno < sys_nerr)
|
||||
@@ -378,6 +397,37 @@ end_of_token (s)
|
||||
return s;
|
||||
}
|
||||
|
||||
#ifdef WIN32
|
||||
/*
|
||||
* Same as end_of_token, but take into account a stop character
|
||||
*/
|
||||
char *
|
||||
end_of_token_w32 (s, stopchar)
|
||||
char *s;
|
||||
char stopchar;
|
||||
{
|
||||
register char *p = s;
|
||||
register int backslash = 0;
|
||||
|
||||
while (*p != '\0' && *p != stopchar && (backslash || !isblank (*p)))
|
||||
{
|
||||
if (*p++ == '\\')
|
||||
{
|
||||
backslash = !backslash;
|
||||
while (*p == '\\')
|
||||
{
|
||||
backslash = !backslash;
|
||||
++p;
|
||||
}
|
||||
}
|
||||
else
|
||||
backslash = 0;
|
||||
}
|
||||
|
||||
return p;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Return the address of the first nonwhitespace or null in the string S. */
|
||||
|
||||
char *
|
||||
@@ -523,6 +573,7 @@ log_access (flavor)
|
||||
static void
|
||||
init_access ()
|
||||
{
|
||||
#ifndef VMS
|
||||
user_uid = getuid ();
|
||||
user_gid = getgid ();
|
||||
|
||||
@@ -536,6 +587,7 @@ init_access ()
|
||||
log_access ("Initialized");
|
||||
|
||||
current_access = make;
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif /* GETLOADAVG_PRIVILEGED */
|
||||
@@ -716,23 +768,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;
|
||||
}
|
||||
|
||||
263
read.c
263
read.c
@@ -1,5 +1,5 @@
|
||||
/* Reading and parsing of makefiles 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
|
||||
@@ -17,9 +17,10 @@ along with GNU Make; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||
|
||||
#include "make.h"
|
||||
#include "commands.h"
|
||||
#include "dep.h"
|
||||
#include "file.h"
|
||||
#include "filedef.h"
|
||||
#include "job.h"
|
||||
#include "commands.h"
|
||||
#include "variable.h"
|
||||
|
||||
/* This is POSIX.2, but most systems using -DPOSIX probably don't have it. */
|
||||
@@ -29,16 +30,15 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||
#include "glob/glob.h"
|
||||
#endif
|
||||
|
||||
#ifndef WIN32
|
||||
#ifndef _AMIGA
|
||||
#ifndef VMS
|
||||
#include <pwd.h>
|
||||
struct passwd *getpwnam ();
|
||||
|
||||
|
||||
static int read_makefile ();
|
||||
static unsigned int readline (), do_define ();
|
||||
static int conditional_line ();
|
||||
static void record_files ();
|
||||
static char *find_semicolon ();
|
||||
|
||||
#else
|
||||
struct passwd *getpwnam PARAMS ((char *name));
|
||||
#endif
|
||||
#endif
|
||||
#endif /* !WIN32 */
|
||||
|
||||
/* A `struct linebuffer' is a structure which holds a line of text.
|
||||
`readline' reads a line from a stream into a linebuffer
|
||||
@@ -75,16 +75,25 @@ struct conditionals
|
||||
|
||||
static struct conditionals toplevel_conditionals;
|
||||
static struct conditionals *conditionals = &toplevel_conditionals;
|
||||
|
||||
|
||||
|
||||
/* Default directories to search for include files in */
|
||||
|
||||
static char *default_include_directories[] =
|
||||
{
|
||||
#if defined(WIN32) && !defined(INCLUDEDIR)
|
||||
/*
|
||||
* This completly up to the user when they install MSVC or other packages.
|
||||
* This is defined as a placeholder.
|
||||
*/
|
||||
#define INCLUDEDIR "."
|
||||
#endif
|
||||
INCLUDEDIR,
|
||||
#ifndef _AMIGA
|
||||
"/usr/gnu/include",
|
||||
"/usr/local/include",
|
||||
"/usr/include",
|
||||
#endif
|
||||
0
|
||||
};
|
||||
|
||||
@@ -105,6 +114,17 @@ unsigned int *reading_lineno_ptr;
|
||||
/* The chain of makefiles read by read_makefile. */
|
||||
|
||||
static struct dep *read_makefiles = 0;
|
||||
|
||||
static int read_makefile PARAMS ((char *filename, int flags));
|
||||
static unsigned int readline PARAMS ((struct linebuffer *linebuffer, FILE *stream,
|
||||
char *filename, unsigned int lineno));
|
||||
static unsigned int do_define PARAMS ((char *name, unsigned int namelen, enum variable_origin origin,
|
||||
unsigned int lineno, FILE *infile, char *filename));
|
||||
static int conditional_line PARAMS ((char *line, char *filename, unsigned int lineno));
|
||||
static void record_files PARAMS ((struct nameseq *filenames, char *pattern, char *pattern_percent,
|
||||
struct dep *deps, unsigned int commands_started, char *commands,
|
||||
unsigned int commands_idx, int two_colon, char *filename,
|
||||
unsigned int lineno, int set_default));
|
||||
|
||||
/* Read in all the makefiles and return the chain of their names. */
|
||||
|
||||
@@ -139,6 +159,7 @@ read_all_makefiles (makefiles)
|
||||
/* Set NAME to the start of next token and LENGTH to its length.
|
||||
MAKEFILES is updated for finding remaining tokens. */
|
||||
p = value;
|
||||
|
||||
while ((name = find_next_token (&p, &length)) != 0)
|
||||
{
|
||||
if (*p != '\0')
|
||||
@@ -177,7 +198,16 @@ read_all_makefiles (makefiles)
|
||||
if (num_makefiles == 0)
|
||||
{
|
||||
static char *default_makefiles[] =
|
||||
#ifdef VMS
|
||||
/* all lower case since readdir() (the vms version) 'lowercasifies' */
|
||||
{ "makefile.vms", "gnumakefile", "makefile", 0 };
|
||||
#else
|
||||
#ifdef _AMIGA
|
||||
{ "GNUmakefile", "Makefile", "SMakefile", 0 };
|
||||
#else /* !Amiga && !VMS */
|
||||
{ "GNUmakefile", "makefile", "Makefile", 0 };
|
||||
#endif /* AMIGA */
|
||||
#endif /* VMS */
|
||||
register char **p = default_makefiles;
|
||||
while (*p != 0 && !file_exists_p (*p))
|
||||
++p;
|
||||
@@ -192,6 +222,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));
|
||||
@@ -250,6 +283,9 @@ read_makefile (filename, flags)
|
||||
char *pattern = 0, *pattern_percent;
|
||||
|
||||
int makefile_errno;
|
||||
#ifdef WIN32
|
||||
int check_again;
|
||||
#endif
|
||||
|
||||
#define record_waiting_files() \
|
||||
do \
|
||||
@@ -266,6 +302,7 @@ read_makefile (filename, flags)
|
||||
|
||||
#ifdef lint /* Suppress `used before set' messages. */
|
||||
two_colon = 0;
|
||||
pattern_percent = 0;
|
||||
#endif
|
||||
|
||||
if (debug_flag)
|
||||
@@ -300,7 +337,6 @@ read_makefile (filename, flags)
|
||||
/* If the makefile wasn't found and it's either a makefile from
|
||||
the `MAKEFILES' variable or an included makefile,
|
||||
search the included makefile search path for this makefile. */
|
||||
|
||||
if (infile == 0 && (flags & RM_INCLUDED) && *filename != '/')
|
||||
{
|
||||
register unsigned int i;
|
||||
@@ -542,15 +578,16 @@ read_makefile (filename, flags)
|
||||
v->export = v_noexport;
|
||||
}
|
||||
}
|
||||
else if (word1eq ("include", 7) || word1eq ("-include", 8))
|
||||
else if (word1eq ("include", 7) || word1eq ("-include", 8)
|
||||
|| word1eq ("sinclude", 8))
|
||||
{
|
||||
/* We have found an `include' line specifying a nested
|
||||
makefile to be read at this point. */
|
||||
struct conditionals *save, new_conditionals;
|
||||
struct nameseq *files;
|
||||
/* "-include" (vs "include") says no
|
||||
error if the file does not exist. */
|
||||
int noerror = p[0] == '-';
|
||||
/* "-include" (vs "include") says no error if the file does not
|
||||
exist. "sinclude" is an alias for this from SGI. */
|
||||
int noerror = p[0] != 'i';
|
||||
|
||||
p = allocated_variable_expand (next_token (p + (noerror ? 9 : 8)));
|
||||
if (*p == '\0')
|
||||
@@ -584,7 +621,7 @@ read_makefile (filename, flags)
|
||||
{
|
||||
struct nameseq *next = files->next;
|
||||
char *name = files->name;
|
||||
free (files);
|
||||
free ((char *)files);
|
||||
files = next;
|
||||
|
||||
if (! read_makefile (name, (RM_INCLUDED | RM_NO_TILDE
|
||||
@@ -654,9 +691,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 +712,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')
|
||||
{
|
||||
@@ -727,6 +768,32 @@ read_makefile (filename, flags)
|
||||
/* For MS-DOS, skip a "C:\...". */
|
||||
if (p != 0 && p[1] == '\\' && isalpha (p[-1]))
|
||||
p = 0;
|
||||
#endif
|
||||
#ifdef _AMIGA
|
||||
/* Here, the situation is quite complicated. Let's have a look
|
||||
at a couple of targets:
|
||||
|
||||
install: dev:make
|
||||
|
||||
dev:make: make
|
||||
|
||||
dev:make:: xyz
|
||||
|
||||
The rule is that it's only a target, if there are TWO :'s
|
||||
OR a space around the :.
|
||||
*/
|
||||
if (p && !(isspace(p[1]) || !p[1] || isspace(p[-1])))
|
||||
p = 0;
|
||||
#endif
|
||||
#ifdef WIN32
|
||||
do {
|
||||
check_again = 0;
|
||||
/* For WIN32, skip a "C:\..." or a "C:/..." */
|
||||
if (p != 0 && (p[1] == '\\' || p[1] == '/') && isalpha (p[-1])) {
|
||||
p = index(p + 1, ':');
|
||||
check_again = 1;
|
||||
}
|
||||
} while (check_again);
|
||||
#endif
|
||||
if (p != 0)
|
||||
{
|
||||
@@ -1024,7 +1091,16 @@ conditional_line (line, filename, lineno)
|
||||
if (*line == '\0')
|
||||
return -1;
|
||||
|
||||
*line++ = '\0';
|
||||
if (termin == ',')
|
||||
{
|
||||
/* Strip blanks after the first string. */
|
||||
char *p = line++;
|
||||
while (isblank (p[-1]))
|
||||
--p;
|
||||
*p = '\0';
|
||||
}
|
||||
else
|
||||
*line++ = '\0';
|
||||
|
||||
s2 = variable_expand (s1);
|
||||
/* We must allocate a new copy of the expanded string because
|
||||
@@ -1248,7 +1324,7 @@ record_files (filenames, pattern, pattern_percent, deps, commands_started,
|
||||
d->name = savestring (buffer, o - buffer);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (!two_colon)
|
||||
{
|
||||
/* Single-colon. Combine these dependencies
|
||||
@@ -1297,7 +1373,7 @@ record_files (filenames, pattern, pattern_percent, deps, commands_started,
|
||||
{
|
||||
struct dep *nextd = d->next;
|
||||
free (d->name);
|
||||
free (d);
|
||||
free ((char *)d);
|
||||
d = nextd;
|
||||
}
|
||||
f->deps = 0;
|
||||
@@ -1442,7 +1518,7 @@ find_char_unquote (string, stopchars, blank)
|
||||
char *stopchars;
|
||||
int blank;
|
||||
{
|
||||
unsigned int string_len = strlen (string);
|
||||
unsigned int string_len = 0;
|
||||
register char *p = string;
|
||||
|
||||
while (1)
|
||||
@@ -1460,6 +1536,9 @@ find_char_unquote (string, stopchars, blank)
|
||||
while (&p[i] >= string && p[i] == '\\')
|
||||
--i;
|
||||
++i;
|
||||
/* Only compute the length if really needed. */
|
||||
if (string_len == 0)
|
||||
string_len = strlen (string);
|
||||
/* The number of backslashes is now -I.
|
||||
Copy P over itself to swallow half of them. */
|
||||
bcopy (&p[i / 2], &p[i], (string_len - (p - string)) - (i / 2) + 1);
|
||||
@@ -1488,19 +1567,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.
|
||||
@@ -1518,7 +1584,7 @@ find_semicolon (string)
|
||||
struct nameseq *
|
||||
parse_file_seq (stringp, stopchar, size, strip)
|
||||
char **stringp;
|
||||
char stopchar;
|
||||
int stopchar;
|
||||
unsigned int size;
|
||||
int strip;
|
||||
{
|
||||
@@ -1527,9 +1593,16 @@ parse_file_seq (stringp, stopchar, size, strip)
|
||||
register char *p = *stringp;
|
||||
char *q;
|
||||
char *name;
|
||||
char stopchars[2];
|
||||
char stopchars[3];
|
||||
|
||||
#ifdef VMS
|
||||
stopchars[0] = ',';
|
||||
stopchars[1] = stopchar;
|
||||
stopchars[2] = '\0';
|
||||
#else
|
||||
stopchars[0] = stopchar;
|
||||
stopchars[1] = '\0';
|
||||
#endif
|
||||
|
||||
while (1)
|
||||
{
|
||||
@@ -1539,20 +1612,49 @@ parse_file_seq (stringp, stopchar, size, strip)
|
||||
break;
|
||||
if (*p == stopchar)
|
||||
break;
|
||||
|
||||
/* Yes, find end of next name. */
|
||||
q = p;
|
||||
p = find_char_unquote (q, stopchars, 1);
|
||||
#ifdef VMS
|
||||
/* convert comma separated list to space separated */
|
||||
if (p && *p == ',')
|
||||
*p =' ';
|
||||
#endif
|
||||
#ifdef __MSDOS__
|
||||
/* For MS-DOS, skip a "C:\...". */
|
||||
if (stopchar == ':' && p != 0 && p[1] == '\\' && isalpha (p[-1]))
|
||||
p = 0;
|
||||
#endif
|
||||
#ifdef _AMIGA
|
||||
if (stopchar == ':' && p && *p == ':' &&
|
||||
!(isspace(p[1]) || !p[1] || isspace(p[-1])))
|
||||
{
|
||||
p = find_char_unquote (p+1, stopchars, 1);
|
||||
}
|
||||
#endif
|
||||
#ifdef WIN32
|
||||
/* For WIN32, skip a "C:\..." or "C:/...". */
|
||||
if (stopchar == ':' &&
|
||||
p != 0 &&
|
||||
(p[1] == '\\' || p[1] == '/') &&
|
||||
isalpha (p[-1])) {
|
||||
p = end_of_token_w32(++p, ':');
|
||||
if (*p == '\0' && p[-1] == ':')
|
||||
p--;
|
||||
}
|
||||
#endif
|
||||
if (p == 0)
|
||||
p = q + strlen (q);
|
||||
|
||||
if (strip)
|
||||
#ifdef VMS
|
||||
/* Skip leading `[]'s. */
|
||||
while (p - q > 2 && q[0] == '[' && q[1] == ']')
|
||||
#else
|
||||
/* Skip leading `./'s. */
|
||||
while (p - q > 2 && q[0] == '.' && q[1] == '/')
|
||||
#endif
|
||||
{
|
||||
q += 2; /* Skip "./". */
|
||||
while (q < p && *q == '/')
|
||||
@@ -1563,10 +1665,44 @@ parse_file_seq (stringp, stopchar, size, strip)
|
||||
/* Extract the filename just found, and skip it. */
|
||||
|
||||
if (q == p)
|
||||
/* ".///" was stripped to "". */
|
||||
/* ".///" was stripped to "". */
|
||||
#ifdef VMS
|
||||
continue;
|
||||
#else
|
||||
#ifdef _AMIGA
|
||||
name = savestring ("", 0);
|
||||
#else
|
||||
name = savestring ("./", 2);
|
||||
#endif
|
||||
#endif
|
||||
else
|
||||
#ifdef VMS
|
||||
/* VMS filenames can have a ':' in them but they have to be '\'ed but we need
|
||||
* to remove this '\' before we can use the filename.
|
||||
* Savestring called because q may be read-only string constant.
|
||||
*/
|
||||
{
|
||||
char *qbase = savestring(q, strlen(q));
|
||||
char *pbase = qbase + (p-q);
|
||||
char *q1 = qbase;
|
||||
char *q2 = q1;
|
||||
char *p1 = pbase;
|
||||
|
||||
while (q1 != pbase)
|
||||
{
|
||||
if (*q1 == '\\' && *(q1+1) == ':')
|
||||
{
|
||||
q1++;
|
||||
p1--;
|
||||
}
|
||||
*q2++ = *q1++;
|
||||
}
|
||||
name = savestring (qbase, p1 - qbase);
|
||||
free (qbase);
|
||||
}
|
||||
#else
|
||||
name = savestring (q, p - q);
|
||||
#endif
|
||||
|
||||
/* Add it to the front of the chain. */
|
||||
new1 = (struct nameseq *) xmalloc (size);
|
||||
@@ -1659,7 +1795,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 +1897,7 @@ readline (linebuffer, stream, filename, lineno)
|
||||
else
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
if (!backslash)
|
||||
{
|
||||
p[-1] = '\0';
|
||||
@@ -1794,8 +1930,11 @@ construct_include_path (arg_dirs)
|
||||
char **arg_dirs;
|
||||
{
|
||||
register unsigned int i;
|
||||
#ifdef VAXC /* just don't ask ... */
|
||||
stat_t stbuf;
|
||||
#else
|
||||
struct stat stbuf;
|
||||
|
||||
#endif
|
||||
/* Table to hold the dirs. */
|
||||
|
||||
register unsigned int defsize = (sizeof (default_include_directories)
|
||||
@@ -1819,7 +1958,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 +1975,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];
|
||||
|
||||
@@ -1867,6 +2006,7 @@ char *
|
||||
tilde_expand (name)
|
||||
char *name;
|
||||
{
|
||||
#ifndef VMS
|
||||
if (name[1] == '/' || name[1] == '\0')
|
||||
{
|
||||
extern char *getenv ();
|
||||
@@ -1882,13 +2022,14 @@ tilde_expand (name)
|
||||
|
||||
warn_undefined_variables_flag = save;
|
||||
}
|
||||
|
||||
|
||||
is_variable = home_dir[0] != '\0';
|
||||
if (!is_variable)
|
||||
{
|
||||
free (home_dir);
|
||||
home_dir = getenv ("HOME");
|
||||
}
|
||||
#if !defined(_AMIGA) && !defined(WIN32)
|
||||
if (home_dir == 0 || home_dir[0] == '\0')
|
||||
{
|
||||
extern char *getlogin ();
|
||||
@@ -1901,6 +2042,7 @@ tilde_expand (name)
|
||||
home_dir = p->pw_dir;
|
||||
}
|
||||
}
|
||||
#endif /* !AMIGA && !WIN32 */
|
||||
if (home_dir != 0)
|
||||
{
|
||||
char *new = concat (home_dir, "", name + 1);
|
||||
@@ -1909,6 +2051,7 @@ tilde_expand (name)
|
||||
return new;
|
||||
}
|
||||
}
|
||||
#if !defined(_AMIGA) && !defined(WIN32)
|
||||
else
|
||||
{
|
||||
struct passwd *pwent;
|
||||
@@ -1926,7 +2069,8 @@ tilde_expand (name)
|
||||
else if (userend != 0)
|
||||
*userend = '/';
|
||||
}
|
||||
|
||||
#endif /* !AMIGA && !WIN32 */
|
||||
#endif /* !VMS */
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1945,13 +2089,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
|
||||
@@ -1983,9 +2130,9 @@ multi_glob (chain, size)
|
||||
}
|
||||
else
|
||||
memname = 0;
|
||||
#endif
|
||||
#endif /* !NO_ARCHIVES */
|
||||
|
||||
switch (glob (old->name, GLOB_NOCHECK, NULL, &gl))
|
||||
switch (glob (old->name, GLOB_NOCHECK|GLOB_ALTDIRFUNC, NULL, &gl))
|
||||
{
|
||||
case 0: /* Success. */
|
||||
{
|
||||
@@ -2030,7 +2177,7 @@ multi_glob (chain, size)
|
||||
free (memname);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
#endif /* !NO_ARCHIVES */
|
||||
{
|
||||
struct nameseq *elt = (struct nameseq *) xmalloc (size);
|
||||
elt->name = savestring (gl.gl_pathv[i],
|
||||
@@ -2041,7 +2188,7 @@ multi_glob (chain, size)
|
||||
}
|
||||
globfree (&gl);
|
||||
free (old->name);
|
||||
free (old);
|
||||
free ((char *)old);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
62
readme.vms
Normal file
62
readme.vms
Normal file
@@ -0,0 +1,62 @@
|
||||
This is the VMS port of GNU Make version 3.74.
|
||||
|
||||
It is based on the VMS port of GNU Make 3.60 by Mike Moretti.
|
||||
|
||||
This port was done by Klaus Kämpf (kkaempf@didymus.rmi.de)
|
||||
|
||||
To build Make, simply type @makefile. This should compile all the
|
||||
necessary files and link Make.
|
||||
There is also a file called makefile.vms. If you already have GNU
|
||||
Make 3.74 built you can just use Make with this makefile to rebuild.
|
||||
|
||||
Here are some notes about GNU Make for VMS:
|
||||
|
||||
Libraries are not supported. They were in GNU Make 3.60 but somehow I didn't
|
||||
care porting the code. If there is enough interest, I'll do it at some
|
||||
later time.
|
||||
|
||||
The variable $^ separates files with commas instead of spaces (It's the
|
||||
natural thing to do for VMS).
|
||||
|
||||
See defaults.c for VMS default suffixes and my definitions for default
|
||||
rules and variables.
|
||||
|
||||
The shell function is not implemented yet.
|
||||
|
||||
Load average routines haven't been implemented for VMS yet.
|
||||
|
||||
The default include directory for including other makefiles is
|
||||
SYS$SYSROOT:[SYSLIB] (I don't remember why I didn't just use
|
||||
SYS$LIBRARY: instead; maybe it wouldn't work that way).
|
||||
|
||||
The default makefiles make looks for are: makefile.vms, gnumakefile, makefile.,
|
||||
and gnumakefile. .
|
||||
|
||||
The stat() function and handling of time stamps in VMS is broken, so I
|
||||
replaced it with a hack in vmsfunctions.c. I will provide a full rewrite
|
||||
somewhere in the future. Be warned, the time resolution inside make is
|
||||
less than what vms provides. This might be a problem on the faster Alphas.
|
||||
|
||||
You can use a : in a filename only if you preceed it with a backslash ('\').
|
||||
E.g.- hobbes\:[bogas.files]
|
||||
|
||||
None of the stuff in vpath.c has been implemented yet.
|
||||
|
||||
Make ignores success, informational, or warning errors (-S-, -I-, or -W-).
|
||||
But it will stop on -E- and -F- errors. (unless you do something to override
|
||||
this in your makefile, or whatever).
|
||||
|
||||
Remote stuff isn't implemented yet.
|
||||
|
||||
Multiple line DCL commands, such as "if" statements, must be put inside
|
||||
command files. You can run a command file by using \@.
|
||||
|
||||
|
||||
VMS changes made for 3.74.3
|
||||
|
||||
Lots of default settings are adapted for VMS. See default.c.
|
||||
|
||||
Long command lines are now converted to command files.
|
||||
|
||||
Comma (',') as a separator is now allowed. See makefile.vms for an example.
|
||||
|
||||
212
remake.c
212
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
|
||||
@@ -17,10 +17,10 @@ along with GNU Make; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||
|
||||
#include "make.h"
|
||||
#include "commands.h"
|
||||
#include "filedef.h"
|
||||
#include "job.h"
|
||||
#include "commands.h"
|
||||
#include "dep.h"
|
||||
#include "file.h"
|
||||
#include <assert.h>
|
||||
|
||||
#ifdef HAVE_FCNTL_H
|
||||
@@ -29,17 +29,33 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||
#include <sys/file.h>
|
||||
#endif
|
||||
|
||||
extern int try_implicit_rule ();
|
||||
#ifdef VMS
|
||||
#include <starlet.h>
|
||||
#endif
|
||||
#ifdef WIN32
|
||||
#include <io.h>
|
||||
#endif
|
||||
|
||||
extern int try_implicit_rule PARAMS ((struct file *file, unsigned int depth));
|
||||
|
||||
|
||||
/* Incremented when a command is started (under -n, when one would be). */
|
||||
unsigned int commands_started = 0;
|
||||
|
||||
static int update_file (), update_file_1 (), check_dep (), touch_file ();
|
||||
static void remake_file ();
|
||||
static time_t name_mtime ();
|
||||
static int library_search ();
|
||||
extern time_t f_mtime ();
|
||||
static int update_file PARAMS ((struct file *file, unsigned int depth));
|
||||
static int update_file_1 PARAMS ((struct file *file, unsigned int depth));
|
||||
static int check_dep PARAMS ((struct file *file, unsigned int depth, time_t this_mtime, int *must_make_ptr));
|
||||
static int touch_file PARAMS ((struct file *file));
|
||||
static void remake_file PARAMS ((struct file *file));
|
||||
static time_t name_mtime PARAMS ((char *name));
|
||||
static int library_search PARAMS ((char **lib, time_t *mtime_ptr));
|
||||
|
||||
extern time_t f_mtime PARAMS ((struct file *file, int search));
|
||||
|
||||
#ifdef VMS
|
||||
extern int vms_stat PARAMS ((char *name, struct stat *buf));
|
||||
#endif
|
||||
|
||||
|
||||
/* Remake all the goals in the `struct dep' chain GOALS. Return -1 if nothing
|
||||
was done, 0 if all goals were updated successfully, or 1 if a goal failed.
|
||||
@@ -100,6 +116,7 @@ update_goal_chain (goals, makefiles)
|
||||
/* Iterate over all double-colon entries for this file. */
|
||||
struct file *file = g->file;
|
||||
int stop, any_not_updated = 0;
|
||||
|
||||
for (file = g->file->double_colon ? g->file->double_colon : g->file;
|
||||
file != NULL;
|
||||
file = file->prev)
|
||||
@@ -108,7 +125,6 @@ update_goal_chain (goals, makefiles)
|
||||
int x;
|
||||
time_t mtime = MTIME (file);
|
||||
check_renamed (file);
|
||||
|
||||
if (makefiles)
|
||||
{
|
||||
if (file->cmd_target)
|
||||
@@ -133,7 +149,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 +211,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)
|
||||
@@ -233,7 +245,6 @@ update_goal_chain (goals, makefiles)
|
||||
just_print_flag = n;
|
||||
job_slots = j;
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
@@ -710,49 +721,78 @@ check_dep (file, depth, this_mtime, must_make_ptr)
|
||||
}
|
||||
else
|
||||
{
|
||||
/* FILE is an intermediate file.
|
||||
Update all non-intermediate files we depend on, if necessary,
|
||||
and see whether any of them is more recent than the file
|
||||
on whose behalf we are checking. */
|
||||
register struct dep *lastd;
|
||||
lastd = 0;
|
||||
d = file->deps;
|
||||
while (d != 0)
|
||||
/* FILE is an intermediate file. */
|
||||
time_t mtime;
|
||||
|
||||
if (!file->phony && file->cmds == 0 && !file->tried_implicit
|
||||
&& file->secondary)
|
||||
{
|
||||
if (d->file->updating)
|
||||
if (try_implicit_rule (file, depth))
|
||||
DEBUGPR ("Found an implicit rule for `%s'.\n");
|
||||
else
|
||||
DEBUGPR ("No implicit rule found for `%s'.\n");
|
||||
file->tried_implicit = 1;
|
||||
}
|
||||
if (file->cmds == 0 && !file->is_target && file->secondary
|
||||
&& default_file != 0 && default_file->cmds != 0)
|
||||
{
|
||||
DEBUGPR ("Using default commands for `%s'.\n");
|
||||
file->cmds = default_file->cmds;
|
||||
}
|
||||
|
||||
/* If the intermediate file actually exists
|
||||
and is newer, then we should remake from it. */
|
||||
check_renamed (file);
|
||||
mtime = file_mtime (file);
|
||||
check_renamed (file);
|
||||
if (mtime > this_mtime)
|
||||
*must_make_ptr = 1;
|
||||
/* Otherwise, update all non-intermediate files we depend on,
|
||||
if necessary, and see whether any of them is more
|
||||
recent than the file on whose behalf we are checking. */
|
||||
else
|
||||
{
|
||||
register struct dep *lastd;
|
||||
|
||||
lastd = 0;
|
||||
d = file->deps;
|
||||
while (d != 0)
|
||||
{
|
||||
error ("Circular %s <- %s dependency dropped.",
|
||||
file->name, d->file->name);
|
||||
if (lastd == 0)
|
||||
if (d->file->updating)
|
||||
{
|
||||
file->deps = d->next;
|
||||
free ((char *) d);
|
||||
d = file->deps;
|
||||
error ("Circular %s <- %s dependency dropped.",
|
||||
file->name, d->file->name);
|
||||
if (lastd == 0)
|
||||
{
|
||||
file->deps = d->next;
|
||||
free ((char *) d);
|
||||
d = file->deps;
|
||||
}
|
||||
else
|
||||
{
|
||||
lastd->next = d->next;
|
||||
free ((char *) d);
|
||||
d = lastd->next;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
lastd->next = d->next;
|
||||
free ((char *) d);
|
||||
d = lastd->next;
|
||||
}
|
||||
continue;
|
||||
|
||||
d->file->parent = file;
|
||||
dep_status |= check_dep (d->file, depth, this_mtime, must_make_ptr);
|
||||
check_renamed (d->file);
|
||||
if (dep_status != 0 && !keep_going_flag)
|
||||
break;
|
||||
|
||||
if (d->file->command_state == cs_running
|
||||
|| d->file->command_state == cs_deps_running)
|
||||
/* Record that some of FILE's dependencies are still being made.
|
||||
This tells the upper levels to wait on processing it until
|
||||
the commands are finished. */
|
||||
set_command_state (file, cs_deps_running);
|
||||
|
||||
lastd = d;
|
||||
d = d->next;
|
||||
}
|
||||
|
||||
d->file->parent = file;
|
||||
dep_status |= check_dep (d->file, depth, this_mtime, must_make_ptr);
|
||||
check_renamed (d->file);
|
||||
if (dep_status != 0 && !keep_going_flag)
|
||||
break;
|
||||
|
||||
if (d->file->command_state == cs_running
|
||||
|| d->file->command_state == cs_deps_running)
|
||||
/* Record that some of FILE's dependencies are still being made.
|
||||
This tells the upper levels to wait on processing it until
|
||||
the commands are finished. */
|
||||
set_command_state (file, cs_deps_running);
|
||||
|
||||
lastd = d;
|
||||
d = d->next;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -769,10 +809,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 +1023,34 @@ 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 != -1 && mtime > now && ! file->updated)
|
||||
{
|
||||
/* This file's time appears to be in the future.
|
||||
Update our concept of the present, and compare again. */
|
||||
#ifdef VMS
|
||||
/* Handle vms 64bit to 32bit time hack introduced in vms_stat ... */
|
||||
static unsigned long vms_now[2]; /* assumes 32 bit long ! */
|
||||
sys$gettim (vms_now);
|
||||
now = ((vms_now[0]>>24) & 0xff) + ((vms_now[1]<<8) & 0xffffff00);
|
||||
#else
|
||||
extern time_t time ();
|
||||
if (mtime > time (&now))
|
||||
#endif
|
||||
{
|
||||
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 +1072,11 @@ name_mtime (name)
|
||||
{
|
||||
struct stat st;
|
||||
|
||||
if (safe_stat (name, &st) < 0)
|
||||
#ifdef VMS
|
||||
if (vms_stat (name, &st) < 0)
|
||||
#else
|
||||
if (stat (name, &st) < 0)
|
||||
#endif
|
||||
return (time_t) -1;
|
||||
|
||||
return (time_t) st.st_mtime;
|
||||
@@ -1025,8 +1094,17 @@ library_search (lib, mtime_ptr)
|
||||
{
|
||||
static char *dirs[] =
|
||||
{
|
||||
#ifndef _AMIGA
|
||||
"/lib",
|
||||
"/usr/lib",
|
||||
#endif
|
||||
#if defined(WIN32) && !defined(LIBDIR)
|
||||
/*
|
||||
* This is completely up to the user at product install time. Just define
|
||||
* a placeholder.
|
||||
*/
|
||||
#define LIBDIR "."
|
||||
#endif
|
||||
LIBDIR, /* Defined by configuration. */
|
||||
0
|
||||
};
|
||||
@@ -1040,7 +1118,11 @@ library_search (lib, mtime_ptr)
|
||||
|
||||
/* Look first for `libNAME.a' in the current directory. */
|
||||
|
||||
#ifndef _AMIGA
|
||||
sprintf (buf, "lib%s.a", libname);
|
||||
#else
|
||||
sprintf (buf, "%s.lib", libname);
|
||||
#endif
|
||||
mtime = name_mtime (buf);
|
||||
if (mtime != (time_t) -1)
|
||||
{
|
||||
@@ -1064,7 +1146,11 @@ library_search (lib, mtime_ptr)
|
||||
|
||||
for (dp = dirs; *dp != 0; ++dp)
|
||||
{
|
||||
#ifndef _AMIGA
|
||||
sprintf (buf, "%s/lib%s.a", *dp, libname);
|
||||
#else
|
||||
sprintf (buf, "%s/%s.lib", *dp, libname);
|
||||
#endif
|
||||
mtime = name_mtime (buf);
|
||||
if (mtime != (time_t) -1)
|
||||
{
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Template for the remote job exportation interface to GNU Make.
|
||||
Copyright (C) 1988, 1989, 1992, 1993 Free Software Foundation, Inc.
|
||||
Copyright (C) 1988, 1989, 1992, 1993, 1996 Free Software Foundation, Inc.
|
||||
This file is part of GNU Make.
|
||||
|
||||
GNU Make is free software; you can redistribute it and/or modify
|
||||
@@ -17,12 +17,27 @@ along with GNU Make; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||
|
||||
#include "make.h"
|
||||
#include "filedef.h"
|
||||
#include "job.h"
|
||||
#include "commands.h"
|
||||
|
||||
|
||||
char *remote_description = 0;
|
||||
|
||||
/* Call once at startup even if no commands are run. */
|
||||
|
||||
void
|
||||
remote_setup ()
|
||||
{
|
||||
}
|
||||
|
||||
/* Called before exit. */
|
||||
|
||||
void
|
||||
remote_cleanup ()
|
||||
{
|
||||
}
|
||||
|
||||
/* Return nonzero if the next job should be done remotely. */
|
||||
|
||||
int
|
||||
|
||||
28
rule.c
28
rule.c
@@ -17,13 +17,14 @@ along with GNU Make; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||
|
||||
#include "make.h"
|
||||
#include "commands.h"
|
||||
#include "dep.h"
|
||||
#include "file.h"
|
||||
#include "filedef.h"
|
||||
#include "job.h"
|
||||
#include "commands.h"
|
||||
#include "variable.h"
|
||||
#include "rule.h"
|
||||
|
||||
static void freerule ();
|
||||
static void freerule PARAMS ((struct rule *rule, struct rule *lastrule));
|
||||
|
||||
/* Chain of all pattern rules. */
|
||||
|
||||
@@ -96,9 +97,13 @@ count_implicit_rule_limits ()
|
||||
for (dep = rule->deps; dep != 0; dep = dep->next)
|
||||
{
|
||||
unsigned int len = strlen (dep->name);
|
||||
char *p = rindex (dep->name, '/');
|
||||
char *p2 = p != 0 ? index (dep->name, '%') : 0;
|
||||
|
||||
#ifdef VMS
|
||||
char *p = rindex (dep->name, ']');
|
||||
#else
|
||||
char *p = rindex (dep->name, '/');
|
||||
#endif
|
||||
char *p2 = p != 0 ? index (dep->name, '%') : 0;
|
||||
ndeps++;
|
||||
|
||||
if (len > max_pattern_dep_length)
|
||||
@@ -125,7 +130,11 @@ count_implicit_rule_limits ()
|
||||
nonexistent subdirectory. */
|
||||
|
||||
dep->changed = !dir_file_exists_p (name, "");
|
||||
#ifdef VMS
|
||||
if (dep->changed && *name == ']')
|
||||
#else
|
||||
if (dep->changed && *name == '/')
|
||||
#endif
|
||||
{
|
||||
/* The name is absolute and the directory does not exist.
|
||||
This rule can never possibly match, since this dependency
|
||||
@@ -173,7 +182,11 @@ convert_suffix_rule (target, source, cmds)
|
||||
/* Special case: TARGET being nil means we are defining a
|
||||
`.X.a' suffix rule; the target pattern is always `(%.o)'. */
|
||||
{
|
||||
#ifdef VMS
|
||||
targname = savestring ("(%.obj)", 7);
|
||||
#else
|
||||
targname = savestring ("(%.o)", 5);
|
||||
#endif
|
||||
targpercent = targname + 1;
|
||||
}
|
||||
else
|
||||
@@ -561,6 +574,11 @@ print_rule_data_base ()
|
||||
printf ("\n# %u implicit rules, %u", rules, terminal);
|
||||
#ifndef NO_FLOAT
|
||||
printf (" (%.1f%%)", (double) terminal / (double) rules * 100.0);
|
||||
#else
|
||||
{
|
||||
int f = (terminal * 1000 + 5) / rules;
|
||||
printf (" (%d.%d%%)", f/10, f%10);
|
||||
}
|
||||
#endif
|
||||
puts (" terminal.");
|
||||
}
|
||||
|
||||
4
rule.h
4
rule.h
@@ -49,5 +49,5 @@ extern struct file *suffix_file;
|
||||
extern unsigned int maxsuffix;
|
||||
|
||||
|
||||
extern void install_pattern_rule ();
|
||||
int new_pattern_rule ();
|
||||
extern void install_pattern_rule PARAMS ((struct pspec *p, int terminal));
|
||||
extern int new_pattern_rule PARAMS ((struct rule *rule, int override));
|
||||
|
||||
12
signame.c
12
signame.c
@@ -1,5 +1,5 @@
|
||||
/* Convert between signal names and numbers.
|
||||
Copyright (C) 1990, 1992, 1993, 1995 Free Software Foundation, Inc.
|
||||
Copyright (C) 1990, 1992, 1993, 1995, 1996 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
|
||||
@@ -23,6 +23,10 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||
#include <sys/types.h> /* Some systems need this for <signal.h>. */
|
||||
#include <signal.h>
|
||||
|
||||
#ifdef HAVE_STRING_H
|
||||
#include <string.h>
|
||||
#endif
|
||||
|
||||
/* Some systems declare `sys_siglist in <unistd.h>; if
|
||||
configure defined SYS_SIGLIST_DECLARED, it may expect
|
||||
to find the declaration there. */
|
||||
@@ -239,7 +243,7 @@ sig_abbrev (number)
|
||||
|
||||
if (sig_table_nelts == 0)
|
||||
signame_init ();
|
||||
|
||||
|
||||
for (i = 0; i < sig_table_nelts; i++)
|
||||
if (sig_table[i].number == number)
|
||||
return (char *)sig_table[i].abbrev;
|
||||
@@ -293,10 +297,10 @@ strsignal (signal)
|
||||
int signal;
|
||||
{
|
||||
static char buf[] = "Signal 12345678901234567890";
|
||||
|
||||
|
||||
if (signal > 0 || signal < NSIG)
|
||||
return (char *) sys_siglist[signal];
|
||||
|
||||
|
||||
sprintf (buf, "Signal %d", signal);
|
||||
return buf;
|
||||
}
|
||||
|
||||
3
subproc.bat
Normal file
3
subproc.bat
Normal file
@@ -0,0 +1,3 @@
|
||||
cd w32\subproc
|
||||
nmake /f %1
|
||||
cd ..\..
|
||||
98
variable.c
98
variable.c
@@ -1,5 +1,5 @@
|
||||
/* Internals of variables for GNU Make.
|
||||
Copyright (C) 1988, 89, 90, 91, 92, 93, 94 Free Software Foundation, Inc.
|
||||
Copyright (C) 1988, 89, 90, 91, 92, 93, 94, 96 Free Software Foundation, Inc.
|
||||
This file is part of GNU Make.
|
||||
|
||||
GNU Make is free software; you can redistribute it and/or modify
|
||||
@@ -17,10 +17,14 @@ along with GNU Make; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||
|
||||
#include "make.h"
|
||||
#include "dep.h"
|
||||
#include "filedef.h"
|
||||
#include "job.h"
|
||||
#include "commands.h"
|
||||
#include "variable.h"
|
||||
#include "dep.h"
|
||||
#include "file.h"
|
||||
#ifdef WIN32
|
||||
#include "pathstuff.h"
|
||||
#endif
|
||||
|
||||
/* Hash table of all global variable definitions. */
|
||||
|
||||
@@ -39,6 +43,11 @@ static struct variable_set global_variable_set
|
||||
static struct variable_set_list global_setlist
|
||||
= { 0, &global_variable_set };
|
||||
struct variable_set_list *current_variable_set_list = &global_setlist;
|
||||
|
||||
static struct variable *define_variable_in_set PARAMS ((char *name, unsigned int length,
|
||||
char *value, enum variable_origin origin,
|
||||
int recursive, struct variable_set *set));
|
||||
|
||||
|
||||
/* Implement variables. */
|
||||
|
||||
@@ -345,7 +354,11 @@ merge_variable_set_lists (setlist0, setlist1)
|
||||
void
|
||||
define_automatic_variables ()
|
||||
{
|
||||
#ifdef WIN32
|
||||
extern char* default_shell;
|
||||
#else
|
||||
extern char default_shell[];
|
||||
#endif
|
||||
register struct variable *v;
|
||||
char buf[200];
|
||||
|
||||
@@ -360,7 +373,7 @@ define_automatic_variables ()
|
||||
? "" : remote_description);
|
||||
(void) define_variable ("MAKE_VERSION", 12, buf, o_default, 0);
|
||||
|
||||
|
||||
|
||||
/* This won't override any definition, but it
|
||||
will provide one if there isn't one there. */
|
||||
v = define_variable ("SHELL", 5, default_shell, o_default, 0);
|
||||
@@ -533,11 +546,25 @@ target_environment (file)
|
||||
&& v->origin != o_env && v->origin != o_env_override)
|
||||
{
|
||||
char *value = recursively_expand (v);
|
||||
#ifdef WIN32
|
||||
if (strcmp(v->name, "Path") == 0 ||
|
||||
strcmp(v->name, "PATH") == 0)
|
||||
convert_Path_to_win32(value, ';');
|
||||
#endif
|
||||
result[nvariables++] = concat (v->name, "=", value);
|
||||
free (value);
|
||||
}
|
||||
else
|
||||
#ifdef WIN32
|
||||
{
|
||||
if (strcmp(v->name, "Path") == 0 ||
|
||||
strcmp(v->name, "PATH") == 0)
|
||||
convert_Path_to_win32(v->value, ';');
|
||||
result[nvariables++] = concat (v->name, "=", v->value);
|
||||
}
|
||||
#else
|
||||
result[nvariables++] = concat (v->name, "=", v->value);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
result[nvariables] = (char *) xmalloc (100);
|
||||
@@ -605,6 +632,34 @@ try_variable_definition (filename, lineno, line, origin)
|
||||
flavor = append;
|
||||
break;
|
||||
}
|
||||
else if (c == '$')
|
||||
{
|
||||
/* This might begin a variable expansion reference. Make sure we
|
||||
don't misrecognize chars inside the reference as =, := or +=. */
|
||||
char closeparen;
|
||||
int count;
|
||||
c = *p++;
|
||||
if (c == '(')
|
||||
closeparen = ')';
|
||||
else if (c == '{')
|
||||
closeparen = '}';
|
||||
else
|
||||
continue; /* Nope. */
|
||||
|
||||
/* P now points past the opening paren or brace.
|
||||
Count parens or braces until it is matched. */
|
||||
count = 0;
|
||||
for (; *p != '\0'; ++p)
|
||||
{
|
||||
if (*p == c)
|
||||
++count;
|
||||
else if (*p == closeparen && --count < 0)
|
||||
{
|
||||
++p;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
beg = next_token (line);
|
||||
@@ -795,6 +850,14 @@ print_variable_set (set, prefix)
|
||||
max %u in one bucket.\n",
|
||||
(double) nvariables / (double) set->buckets,
|
||||
per_bucket);
|
||||
#else
|
||||
{
|
||||
int f = (nvariables * 1000 + 5) / set->buckets;
|
||||
printf ("# average of %d.%d variables per bucket, \
|
||||
max %u in one bucket.\n",
|
||||
f/10, f%10,
|
||||
per_bucket);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@@ -820,3 +883,30 @@ print_file_variables (file)
|
||||
if (file->variables != 0)
|
||||
print_variable_set (file->variables->set, "# ");
|
||||
}
|
||||
|
||||
#ifdef WIN32
|
||||
void
|
||||
sync_Path_environment(void)
|
||||
{
|
||||
char* path = allocated_variable_expand("$(Path)");
|
||||
static char* environ_path = NULL;
|
||||
|
||||
if (!path)
|
||||
return;
|
||||
|
||||
/*
|
||||
* If done this before, don't leak memory unnecessarily.
|
||||
* Free the previous entry before allocating new one.
|
||||
*/
|
||||
if (environ_path)
|
||||
free(environ_path);
|
||||
|
||||
/*
|
||||
* Create something WIN32 world can grok
|
||||
*/
|
||||
convert_Path_to_win32(path, ';');
|
||||
environ_path = concat("Path", "=", path);
|
||||
putenv(environ_path);
|
||||
free(path);
|
||||
}
|
||||
#endif
|
||||
|
||||
49
variable.h
49
variable.h
@@ -70,31 +70,40 @@ struct variable_set_list
|
||||
|
||||
extern struct variable_set_list *current_variable_set_list;
|
||||
|
||||
|
||||
extern void push_new_variable_scope (), pop_variable_scope ();
|
||||
|
||||
extern int handle_function ();
|
||||
|
||||
extern char *variable_buffer_output ();
|
||||
extern char *variable_expand (), *variable_expand_for_file ();
|
||||
extern char *allocated_variable_expand_for_file ();
|
||||
/* expand.c */
|
||||
extern char *variable_buffer_output PARAMS ((char *ptr, char *string, unsigned int length));
|
||||
extern char *variable_expand PARAMS ((char *line));
|
||||
extern char *variable_expand_for_file PARAMS ((char *line, struct file *file));
|
||||
extern char *allocated_variable_expand_for_file PARAMS ((char *line, struct file *file));
|
||||
#define allocated_variable_expand(line) \
|
||||
allocated_variable_expand_for_file (line, (struct file *) 0)
|
||||
extern char *expand_argument ();
|
||||
extern char *expand_argument PARAMS ((char *str, char *end));
|
||||
|
||||
extern void define_automatic_variables ();
|
||||
extern void initialize_file_variables ();
|
||||
extern void print_file_variables ();
|
||||
/* function.c */
|
||||
extern int handle_function PARAMS ((char **op, char **stringp));
|
||||
extern int pattern_matches PARAMS ((char *pattern, char *percent, char *word));
|
||||
extern char *subst_expand PARAMS ((char *o, char *text, char *subst, char *replace,
|
||||
unsigned int slen, unsigned int rlen, int by_word, int suffix_only));
|
||||
extern char *patsubst_expand PARAMS ((char *o, char *text, char *pattern, char *replace,
|
||||
char *pattern_percent, char *replace_percent));
|
||||
|
||||
extern void merge_variable_set_lists ();
|
||||
/* expand.c */
|
||||
extern char *recursively_expand PARAMS ((struct variable *v));
|
||||
|
||||
extern struct variable *try_variable_definition ();
|
||||
/* variable.c */
|
||||
extern void push_new_variable_scope PARAMS ((void));
|
||||
extern void pop_variable_scope PARAMS ((void));
|
||||
extern void define_automatic_variables PARAMS ((void));
|
||||
extern void initialize_file_variables PARAMS ((struct file *file));
|
||||
extern void print_file_variables PARAMS ((struct file *file));
|
||||
extern void merge_variable_set_lists PARAMS ((struct variable_set_list **setlist0, struct variable_set_list *setlist1));
|
||||
extern struct variable *try_variable_definition PARAMS ((char *filename, unsigned int lineno, char *line, enum variable_origin origin));
|
||||
|
||||
extern struct variable *lookup_variable (), *define_variable ();
|
||||
extern struct variable *define_variable_for_file ();
|
||||
extern struct variable *lookup_variable PARAMS ((char *name, unsigned int length));
|
||||
extern struct variable *define_variable PARAMS ((char *name, unsigned int length, char *value,
|
||||
enum variable_origin origin, int recursive));
|
||||
extern struct variable *define_variable_for_file PARAMS ((char *name, unsigned int length,
|
||||
char *value, enum variable_origin origin, int recursive, struct file *file));
|
||||
extern char **target_environment PARAMS ((struct file *file));
|
||||
|
||||
extern int pattern_matches ();
|
||||
extern char *subst_expand (), *patsubst_expand (), *recursively_expand ();
|
||||
|
||||
extern char **target_environment ();
|
||||
extern int export_all_variables;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
char *version_string = "3.74";
|
||||
char *version_string = "3.74.6";
|
||||
|
||||
/*
|
||||
Local variables:
|
||||
|
||||
40
vmsdir.h
Normal file
40
vmsdir.h
Normal file
@@ -0,0 +1,40 @@
|
||||
/* dirent.h for vms */
|
||||
|
||||
#include <rms.h>
|
||||
|
||||
#define MAXNAMLEN 255
|
||||
|
||||
typedef unsigned long u_long;
|
||||
typedef unsigned short u_short;
|
||||
|
||||
struct direct {
|
||||
off_t d_off;
|
||||
u_long d_fileno;
|
||||
u_short d_reclen;
|
||||
u_short d_namlen;
|
||||
char d_name[MAXNAMLEN + 1];
|
||||
};
|
||||
|
||||
#undef DIRSIZ
|
||||
#define DIRSIZ(dp) \
|
||||
(((sizeof (struct direct) - (MAXNAMLEN+1) + ((dp)->d_namlen+1)) + 3) & ~3)
|
||||
|
||||
#define d_ino d_fileno /* compatability */
|
||||
|
||||
|
||||
/*
|
||||
* Definitions for library routines operating on directories.
|
||||
*/
|
||||
|
||||
typedef struct FAB DIR;
|
||||
|
||||
#ifndef NULL
|
||||
#define NULL 0
|
||||
#endif
|
||||
extern DIR *opendir PARAMS (());
|
||||
extern struct direct *readdir PARAMS ((DIR *dfd));
|
||||
#define rewinddir(dirp) seekdir((dirp), (long)0)
|
||||
extern int closedir PARAMS ((DIR *dfd));
|
||||
extern char *vmsify PARAMS ((char *name, int type));
|
||||
|
||||
/* EOF */
|
||||
234
vmsfunctions.c
Normal file
234
vmsfunctions.c
Normal file
@@ -0,0 +1,234 @@
|
||||
#define KDEBUG 0
|
||||
/* vmsfunctions.c */
|
||||
|
||||
#include <stdio.h>
|
||||
#include "make.h"
|
||||
#ifdef __DECC
|
||||
#include <starlet.h>
|
||||
#endif
|
||||
#include <descrip.h>
|
||||
#include <rms.h>
|
||||
#include <iodef.h>
|
||||
#include <atrdef.h>
|
||||
#include <fibdef.h>
|
||||
#include "vmsdir.h"
|
||||
|
||||
DIR *opendir(char *dspec)
|
||||
{
|
||||
static struct FAB *dfab;
|
||||
struct NAM *dnam;
|
||||
char *searchspec;
|
||||
|
||||
if ((dfab = (struct FAB *)xmalloc(sizeof (struct FAB))) == NULL) {
|
||||
printf("Error mallocing for FAB\n");
|
||||
return(NULL);
|
||||
}
|
||||
if ((dnam = (struct NAM *)xmalloc(sizeof (struct NAM))) == NULL) {
|
||||
printf("Error mallocing for NAM\n");
|
||||
free(dfab);
|
||||
return(NULL);
|
||||
}
|
||||
if ((searchspec = (char *)xmalloc(MAXNAMLEN+1)) == NULL) {
|
||||
printf("Error mallocing for searchspec\n");
|
||||
free(dfab);
|
||||
free(dnam);
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
sprintf(searchspec,"%s*.*;",dspec);
|
||||
|
||||
*dfab = cc$rms_fab;
|
||||
dfab->fab$l_fna = searchspec;
|
||||
dfab->fab$b_fns = strlen(searchspec);
|
||||
dfab->fab$l_nam = dnam;
|
||||
|
||||
*dnam = cc$rms_nam;
|
||||
dnam->nam$l_esa = searchspec;
|
||||
dnam->nam$b_ess = MAXNAMLEN;
|
||||
|
||||
if (!(sys$parse(dfab) & 1)) {
|
||||
free(dfab);
|
||||
free(dnam);
|
||||
free(searchspec);
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
return(dfab);
|
||||
}
|
||||
|
||||
#include <ctype.h>
|
||||
#define uppercasify(str) { char *tmp; for(tmp = (str); *tmp != '\0'; tmp++) if(islower(*tmp)) *tmp = toupper(*tmp); }
|
||||
|
||||
struct direct *readdir(DIR *dfd)
|
||||
{
|
||||
static struct direct *dentry;
|
||||
static char resultspec[MAXNAMLEN+1];
|
||||
int i;
|
||||
|
||||
if ((dentry = (struct direct *)xmalloc(sizeof (struct direct))) == NULL) {
|
||||
printf("Error mallocing for direct\n");
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
dfd->fab$l_nam->nam$l_rsa = resultspec;
|
||||
dfd->fab$l_nam->nam$b_rss = MAXNAMLEN;
|
||||
|
||||
if (debug_flag)
|
||||
printf(".");
|
||||
|
||||
if (!((i = sys$search(dfd)) & 1)) {
|
||||
if (debug_flag)
|
||||
printf("sys$search failed with %d\n", i);
|
||||
free(dentry);
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
dentry->d_off = 0;
|
||||
if (dfd->fab$l_nam->nam$w_fid == 0)
|
||||
dentry->d_fileno = 1;
|
||||
else dentry->d_fileno = dfd->fab$l_nam->nam$w_fid[0]
|
||||
+dfd->fab$l_nam->nam$w_fid[1]<<16;
|
||||
dentry->d_reclen = sizeof (struct direct);
|
||||
/*
|
||||
if (!strcmp(dfd->fab$l_nam->nam$l_type,".DIR"))
|
||||
dentry->d_namlen = dfd->fab$l_nam->nam$b_name;
|
||||
else
|
||||
*/
|
||||
dentry->d_namlen = dfd->fab$l_nam->nam$b_name+dfd->fab$l_nam->nam$b_type;
|
||||
strncpy(dentry->d_name,dfd->fab$l_nam->nam$l_name,dentry->d_namlen);
|
||||
dentry->d_name[dentry->d_namlen] = '\0';
|
||||
uppercasify(dentry->d_name);
|
||||
/* uvUnFixRCSSeparator(dentry->d_name);*/
|
||||
|
||||
return(dentry);
|
||||
}
|
||||
|
||||
closedir(DIR *dfd)
|
||||
{
|
||||
if (dfd != NULL) {
|
||||
if (dfd->fab$l_nam != NULL)
|
||||
free(dfd->fab$l_nam->nam$l_esa);
|
||||
free(dfd->fab$l_nam);
|
||||
free(dfd);
|
||||
}
|
||||
}
|
||||
|
||||
char *getwd(char *cwd)
|
||||
{
|
||||
static char buf[512];
|
||||
|
||||
if (cwd)
|
||||
return(getcwd(cwd,512));
|
||||
else
|
||||
return(getcwd(buf,512));
|
||||
}
|
||||
|
||||
int
|
||||
vms_stat (name, buf)
|
||||
char *name;
|
||||
struct stat *buf;
|
||||
{
|
||||
int status;
|
||||
int i;
|
||||
|
||||
static struct FAB Fab;
|
||||
static struct NAM Nam;
|
||||
static struct fibdef Fib; /* short fib */
|
||||
static struct dsc$descriptor FibDesc =
|
||||
{sizeof(Fib), DSC$K_DTYPE_Z, DSC$K_CLASS_S, (char *)&Fib};
|
||||
static struct dsc$descriptor_s DevDesc =
|
||||
{0, DSC$K_DTYPE_T, DSC$K_CLASS_S, &Nam.nam$t_dvi[1]};
|
||||
static char EName[NAM$C_MAXRSS];
|
||||
static char RName[NAM$C_MAXRSS];
|
||||
static struct dsc$descriptor_s FileName =
|
||||
{0, DSC$K_DTYPE_T, DSC$K_CLASS_S, 0};
|
||||
static struct dsc$descriptor_s string =
|
||||
{0, DSC$K_DTYPE_T, DSC$K_CLASS_S, 0};
|
||||
static unsigned long Rdate[2];
|
||||
static unsigned long Cdate[2];
|
||||
static struct atrdef Atr[] = {
|
||||
{sizeof(Rdate),ATR$C_REVDATE,&Rdate[0]}, /* Revision date */
|
||||
{sizeof(Cdate),ATR$C_CREDATE,&Cdate[0]}, /* Creation date */
|
||||
{0,0,0}
|
||||
};
|
||||
static short int DevChan;
|
||||
static short int iosb[4];
|
||||
|
||||
name = vmsify (name, 0);
|
||||
|
||||
/* initialize RMS structures, we need a NAM to retrieve the FID */
|
||||
Fab = cc$rms_fab;
|
||||
Fab.fab$l_fna = name ; /* name of file */
|
||||
Fab.fab$b_fns = strlen(name);
|
||||
Fab.fab$l_nam = &Nam; /* FAB has an associated NAM */
|
||||
|
||||
Nam = cc$rms_nam;
|
||||
Nam.nam$l_esa = EName; /* expanded filename */
|
||||
Nam.nam$b_ess = sizeof(EName);
|
||||
Nam.nam$l_rsa = RName; /* resultant filename */
|
||||
Nam.nam$b_rss = sizeof(RName);
|
||||
|
||||
/* do $PARSE and $SEARCH here */
|
||||
status = sys$parse(&Fab);
|
||||
if (!(status & 1))
|
||||
return -1;
|
||||
|
||||
DevDesc.dsc$w_length = Nam.nam$t_dvi[0];
|
||||
status = sys$assign(&DevDesc,&DevChan,0,0);
|
||||
if (!(status & 1))
|
||||
return -1;
|
||||
|
||||
FileName.dsc$a_pointer = Nam.nam$l_name;
|
||||
FileName.dsc$w_length = Nam.nam$b_name+Nam.nam$b_type+Nam.nam$b_ver;
|
||||
|
||||
/* Initialize the FIB */
|
||||
for (i=0;i<3;i++)
|
||||
{
|
||||
#if __DECC
|
||||
Fib.fib$w_fid[i]=Nam.nam$w_fid[i];
|
||||
Fib.fib$w_did[i]=Nam.nam$w_did[i];
|
||||
#else
|
||||
Fib.fib$r_fid_overlay.fib$w_fid[i]=Nam.nam$w_fid[i];
|
||||
Fib.fib$r_did_overlay.fib$w_did[i]=Nam.nam$w_did[i];
|
||||
#endif
|
||||
}
|
||||
|
||||
status = sys$qiow(0,DevChan,IO$_ACCESS,&iosb,0,0,
|
||||
&FibDesc,&FileName,0,0,&Atr,0);
|
||||
if (!(status & 1))
|
||||
return -1;
|
||||
status = iosb[0];
|
||||
if (!(status & 1))
|
||||
return -1;
|
||||
|
||||
status = stat (name, buf);
|
||||
if (status)
|
||||
return -1;
|
||||
|
||||
buf->st_mtime = ((Rdate[0]>>24) & 0xff) + ((Rdate[1]<<8) & 0xffffff00);
|
||||
buf->st_ctime = ((Cdate[0]>>24) & 0xff) + ((Cdate[1]<<8) & 0xffffff00);
|
||||
return 0;
|
||||
}
|
||||
|
||||
char *
|
||||
cvt_time(tval)
|
||||
unsigned long tval;
|
||||
{
|
||||
static long int date[2];
|
||||
static char str[27];
|
||||
static struct dsc$descriptor date_str =
|
||||
{26, DSC$K_DTYPE_T, DSC$K_CLASS_S, str};
|
||||
|
||||
date[0] = (tval & 0xff) << 24;
|
||||
date[1] = ((tval>>8) & 0xffffff);
|
||||
|
||||
if ((date[0]==0) && (date[1]==0))
|
||||
return("never");
|
||||
|
||||
sys$asctim(0,&date_str,date,0);
|
||||
str[26]='\0';
|
||||
|
||||
return(str);
|
||||
}
|
||||
|
||||
/* EOF */
|
||||
925
vmsify.c
Normal file
925
vmsify.c
Normal file
@@ -0,0 +1,925 @@
|
||||
/*
|
||||
vmsify.c
|
||||
|
||||
Module for vms <-> unix file name conversion
|
||||
|
||||
Written by Klaus Kämpf (kkaempf@didymus.rmi.de)
|
||||
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#if VMS
|
||||
#include <unixlib.h>
|
||||
#include <stdlib.h>
|
||||
#include <jpidef.h>
|
||||
#include <descrip.h>
|
||||
#include <uaidef.h>
|
||||
#include <ssdef.h>
|
||||
#include <starlet.h>
|
||||
#include <lib$routines.h>
|
||||
/* Initialize a string descriptor (struct dsc$descriptor_s) for an
|
||||
arbitrary string. ADDR is a pointer to the first character
|
||||
of the string, and LEN is the length of the string. */
|
||||
|
||||
#define INIT_DSC_S(dsc, addr, len) do { \
|
||||
(dsc).dsc$b_dtype = DSC$K_DTYPE_T; \
|
||||
(dsc).dsc$b_class = DSC$K_CLASS_S; \
|
||||
(dsc).dsc$w_length = (len); \
|
||||
(dsc).dsc$a_pointer = (addr); \
|
||||
} while (0)
|
||||
|
||||
/* Initialize a string descriptor (struct dsc$descriptor_s) for a
|
||||
NUL-terminated string. S is a pointer to the string; the length
|
||||
is determined by calling strlen(). */
|
||||
|
||||
#define INIT_DSC_CSTRING(dsc, s) INIT_DSC_S(dsc, s, strlen(s))
|
||||
#endif
|
||||
|
||||
/*
|
||||
copy 'from' to 'to' up to but not including 'upto'
|
||||
return 0 if eos on from
|
||||
return 1 if upto found
|
||||
|
||||
return 'to' at last char + 1
|
||||
return 'from' at match + 1 or eos if no match
|
||||
|
||||
if as_dir == 1, change all '.' to '_'
|
||||
else change all '.' but the last to '_'
|
||||
*/
|
||||
|
||||
static int
|
||||
copyto (char **to, char **from, char upto, int as_dir)
|
||||
{
|
||||
char *s;
|
||||
|
||||
s = strrchr (*from, '.');
|
||||
|
||||
while (**from)
|
||||
{
|
||||
if (**from == upto)
|
||||
{
|
||||
do
|
||||
{
|
||||
(*from)++;
|
||||
}
|
||||
while (**from == upto);
|
||||
return 1;
|
||||
}
|
||||
if (**from == '.')
|
||||
{
|
||||
if ((as_dir == 1)
|
||||
|| (*from != s))
|
||||
**to = '_';
|
||||
else
|
||||
**to = '.';
|
||||
}
|
||||
else
|
||||
{
|
||||
if (islower (**from))
|
||||
**to = toupper (**from);
|
||||
else
|
||||
**to = **from;
|
||||
}
|
||||
(*to)++;
|
||||
(*from)++;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
get translation of logical name
|
||||
|
||||
*/
|
||||
|
||||
static char *
|
||||
trnlog (char *name)
|
||||
{
|
||||
int stat;
|
||||
static char reslt[1024];
|
||||
$DESCRIPTOR (reslt_dsc, reslt);
|
||||
short resltlen;
|
||||
struct dsc$descriptor_s name_dsc;
|
||||
char *s;
|
||||
|
||||
INIT_DSC_CSTRING (name_dsc, name);
|
||||
|
||||
stat = lib$sys_trnlog (&name_dsc, &resltlen, &reslt_dsc);
|
||||
|
||||
if ((stat&1) == 0)
|
||||
{
|
||||
return "";
|
||||
}
|
||||
if (stat == SS$_NOTRAN)
|
||||
{
|
||||
return "";
|
||||
}
|
||||
reslt[resltlen] = '\0';
|
||||
|
||||
s = (char *)malloc (resltlen+1);
|
||||
if (s == 0)
|
||||
return "";
|
||||
strcpy (s, reslt);
|
||||
return s;
|
||||
}
|
||||
|
||||
enum namestate { N_START, N_DEVICE, N_OPEN, N_DOT, N_CLOSED, N_DONE };
|
||||
|
||||
/*
|
||||
convert unix style name to vms style
|
||||
type = 0 -> name is a full name (directory and filename part)
|
||||
type = 1 -> name is a directory
|
||||
type = 2 -> name is a filename without directory
|
||||
|
||||
The following conversions are applied
|
||||
(0) (1) (2)
|
||||
input full name dir name file name
|
||||
|
||||
1 ./ <cwd> [] <current directory>.dir
|
||||
2 ../ <home of cwd> <home of cwd> <home of cwd>.dir
|
||||
|
||||
3 // <dev of cwd>: <dev of cwd>:[000000] <dev of cwd>:000000.dir
|
||||
4 //a a: a: a:
|
||||
5 //a/ a: a: a:000000.dir
|
||||
|
||||
9 / [000000] [000000] 000000.dir
|
||||
10 /a [000000]a [a] [000000]a
|
||||
11 /a/ [a] [a] [000000]a.dir
|
||||
12 /a/b [a]b [a.b] [a]b
|
||||
13 /a/b/ [a.b] [a.b] [a]b.dir
|
||||
14 /a/b/c [a.b]c [a.b.c] [a.b]c
|
||||
15 /a/b/c/ [a.b.c] [a.b.c] [a.b]c.dir
|
||||
|
||||
16 a a [.a] a
|
||||
17 a/ [.a] [.a] a.dir
|
||||
18 a/b [.a]b [.a.b] [.a]b
|
||||
19 a/b/ [.a.b] [.a.b] [.a]b.dir
|
||||
20 a/b/c [.a.b]c [.a.b.c] [.a.b]c
|
||||
21 a/b/c/ [.a.b.c] [.a.b.c] [.a.b]c.dir
|
||||
|
||||
22 a.b.c a_b.c [.a_b_c] a_b_c.dir
|
||||
|
||||
23 [x][y]z [x.y]z [x.y]z [x.y]z
|
||||
24 [x][.y]z [x.y]z [x.y]z [x.y]z
|
||||
|
||||
25 filenames with '$' are left unchanged if they contain no '/'
|
||||
25 filenames with ':' are left unchanged
|
||||
26 filenames with a single pair of '[' ']' are left unchanged
|
||||
|
||||
the input string is not written to
|
||||
*/
|
||||
|
||||
char *
|
||||
vmsify (name, type)
|
||||
char *name;
|
||||
int type;
|
||||
{
|
||||
/* max 255 device
|
||||
max 39 directory
|
||||
max 39 filename
|
||||
max 39 filetype
|
||||
max 5 version
|
||||
*/
|
||||
#define MAXPATHLEN 512
|
||||
|
||||
enum namestate nstate;
|
||||
static char vmsname[MAXPATHLEN+1];
|
||||
char *fptr;
|
||||
char *vptr;
|
||||
char *s,*s1;
|
||||
int as_dir;
|
||||
int count;
|
||||
|
||||
if (name == 0)
|
||||
return 0;
|
||||
fptr = name;
|
||||
vptr = vmsname;
|
||||
nstate = N_START;
|
||||
|
||||
/* case 25a */
|
||||
|
||||
s = strpbrk (name, "$:");
|
||||
if (s != 0)
|
||||
{
|
||||
if (*s == '$')
|
||||
{
|
||||
if (strchr (name, '/') == 0)
|
||||
{
|
||||
return name;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return name;
|
||||
}
|
||||
}
|
||||
|
||||
/* case 26 */
|
||||
|
||||
s = strchr (name, '[');
|
||||
|
||||
if (s != 0)
|
||||
{
|
||||
s1 = strchr (s+1, '[');
|
||||
if (s1 == 0)
|
||||
{
|
||||
return name; /* single [, keep unchanged */
|
||||
}
|
||||
s1--;
|
||||
if (*s1 != ']')
|
||||
{
|
||||
return name; /* not ][, keep unchanged */
|
||||
}
|
||||
|
||||
/* we have ][ */
|
||||
|
||||
s = name;
|
||||
|
||||
/* s -> starting char
|
||||
s1 -> ending ']' */
|
||||
|
||||
do
|
||||
{
|
||||
strncpy (vptr, s, s1-s); /* copy up to but not including ']' */
|
||||
vptr += s1-s;
|
||||
if (*s1 == 0)
|
||||
break;
|
||||
s = s1 + 1; /* s -> char behind ']' */
|
||||
if (*s != '[') /* was '][' ? */
|
||||
break; /* no, last ] found, exit */
|
||||
s++;
|
||||
if (*s != '.')
|
||||
*vptr++ = '.';
|
||||
s1 = strchr (s, ']');
|
||||
if (s1 == 0) /* no closing ] */
|
||||
s1 = s + strlen (s);
|
||||
}
|
||||
while (1);
|
||||
|
||||
*vptr++ = ']';
|
||||
|
||||
fptr = s;
|
||||
|
||||
}
|
||||
|
||||
else /* no [ in name */
|
||||
|
||||
{
|
||||
|
||||
int state;
|
||||
int rooted = 1; /* flag if logical is rooted, else insert [000000] */
|
||||
|
||||
state = 0;
|
||||
|
||||
do
|
||||
{
|
||||
|
||||
switch (state)
|
||||
{
|
||||
case 0: /* start of loop */
|
||||
if (*fptr == '/')
|
||||
{
|
||||
fptr++;
|
||||
state = 1;
|
||||
}
|
||||
else if (*fptr == '.')
|
||||
{
|
||||
fptr++;
|
||||
state = 10;
|
||||
}
|
||||
else
|
||||
state = 2;
|
||||
break;
|
||||
|
||||
case 1: /* '/' at start */
|
||||
if (*fptr == '/')
|
||||
{
|
||||
fptr++;
|
||||
state = 3;
|
||||
}
|
||||
else
|
||||
state = 4;
|
||||
break;
|
||||
|
||||
case 2: /* no '/' at start */
|
||||
s = strchr (fptr, '/');
|
||||
if (s == 0) /* no '/' (16) */
|
||||
{
|
||||
if (type == 1)
|
||||
{
|
||||
strcpy (vptr, "[.");
|
||||
vptr += 2;
|
||||
}
|
||||
copyto (&vptr, &fptr, 0, (type==1));
|
||||
if (type == 1)
|
||||
*vptr++ = ']';
|
||||
state = -1;
|
||||
}
|
||||
else /* found '/' (17..21) */
|
||||
{
|
||||
if ((type == 2)
|
||||
&& (*(s+1) == 0)) /* 17(2) */
|
||||
{
|
||||
copyto (&vptr, &fptr, '/', 1);
|
||||
state = 7;
|
||||
}
|
||||
else
|
||||
{
|
||||
strcpy (vptr, "[.");
|
||||
nstate = N_DOT;
|
||||
vptr += 2;
|
||||
copyto (&vptr, &fptr, '/', 1);
|
||||
state = 9;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case 3: /* '//' at start */
|
||||
while (*fptr == '/') /* collapse all '/' */
|
||||
fptr++;
|
||||
if (*fptr == 0) /* just // */
|
||||
{
|
||||
char cwdbuf[MAXPATHLEN+1];
|
||||
|
||||
s1 = getcwd(cwdbuf, MAXPATHLEN);
|
||||
if (s1 == 0)
|
||||
{
|
||||
return ""; /* FIXME, err getcwd */
|
||||
}
|
||||
s = strchr (s1, ':');
|
||||
if (s == 0)
|
||||
{
|
||||
return ""; /* FIXME, err no device */
|
||||
}
|
||||
strncpy (vptr, s1, s-s1+1);
|
||||
vptr += s-s1+1;
|
||||
state = -1;
|
||||
break;
|
||||
}
|
||||
|
||||
s = vptr;
|
||||
|
||||
if (copyto (&vptr, &fptr, '/', 1) == 0) /* copy device part */
|
||||
{
|
||||
*vptr++ = ':';
|
||||
state = -1;
|
||||
break;
|
||||
}
|
||||
*vptr = ':';
|
||||
nstate = N_DEVICE;
|
||||
if (*fptr == 0) /* just '//a/' */
|
||||
{
|
||||
strcpy (vptr+1, "[000000]");
|
||||
vptr += 9;
|
||||
state = -1;
|
||||
break;
|
||||
}
|
||||
*vptr = 0;
|
||||
/* check logical for [000000] insertion */
|
||||
s1 = trnlog (s);
|
||||
if (*s1 != 0)
|
||||
{ /* found translation */
|
||||
char *s2;
|
||||
for (;;) /* loop over all nested logicals */
|
||||
{
|
||||
s2 = s1 + strlen (s1) - 1;
|
||||
if (*s2 == ':') /* translation ends in ':' */
|
||||
{
|
||||
s2 = trnlog (s1);
|
||||
free (s1);
|
||||
if (*s2 == 0)
|
||||
{
|
||||
rooted = 0;
|
||||
break;
|
||||
}
|
||||
s1 = s2;
|
||||
continue; /* next iteration */
|
||||
}
|
||||
if (*s2 == ']') /* translation ends in ']' */
|
||||
{
|
||||
if (*(s2-1) == '.') /* ends in '.]' */
|
||||
{
|
||||
if (strncmp (fptr, "000000", 6) != 0)
|
||||
rooted = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
strcpy (vmsname, s1);
|
||||
s = strchr (vmsname, ']');
|
||||
*s = '.';
|
||||
nstate = N_DOT;
|
||||
vptr = s;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
free (s1);
|
||||
}
|
||||
else
|
||||
rooted = 0;
|
||||
|
||||
if (*vptr == 0)
|
||||
{
|
||||
nstate = N_DEVICE;
|
||||
*vptr++ = ':';
|
||||
}
|
||||
else
|
||||
vptr++;
|
||||
|
||||
if (rooted == 0)
|
||||
{
|
||||
strcpy (vptr, "[000000.");
|
||||
vptr += 8;
|
||||
s1 = vptr-1;
|
||||
nstate = N_DOT;
|
||||
}
|
||||
else
|
||||
s1 = 0;
|
||||
|
||||
/* s1-> '.' after 000000 or NULL */
|
||||
|
||||
s = strchr (fptr, '/');
|
||||
if (s == 0)
|
||||
{ /* no next '/' */
|
||||
if (*(vptr-1) == '.')
|
||||
*(vptr-1) = ']';
|
||||
else if (rooted == 0)
|
||||
*vptr++ = ']';
|
||||
copyto (&vptr, &fptr, 0, (type == 1));
|
||||
state = -1;
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
while (*(s+1) == '/') /* skip multiple '/' */
|
||||
s++;
|
||||
}
|
||||
|
||||
if ((rooted != 0)
|
||||
&& (*(vptr-1) != '.'))
|
||||
{
|
||||
*vptr++ = '[';
|
||||
nstate = N_DOT;
|
||||
}
|
||||
else
|
||||
if ((nstate == N_DOT)
|
||||
&& (s1 != 0)
|
||||
&& (*(s+1) == 0))
|
||||
{
|
||||
if (type == 2)
|
||||
{
|
||||
*s1 = ']';
|
||||
nstate = N_CLOSED;
|
||||
}
|
||||
}
|
||||
state = 9;
|
||||
break;
|
||||
|
||||
case 4: /* single '/' at start (9..15) */
|
||||
if (*fptr == 0)
|
||||
state = 5;
|
||||
else
|
||||
state = 6;
|
||||
break;
|
||||
|
||||
case 5: /* just '/' at start (9) */
|
||||
if (type != 2)
|
||||
{
|
||||
*vptr++ = '[';
|
||||
nstate = N_OPEN;
|
||||
}
|
||||
strcpy (vptr, "000000");
|
||||
vptr += 6;
|
||||
if (type == 2)
|
||||
state = 7;
|
||||
else
|
||||
state = 8;
|
||||
break;
|
||||
|
||||
case 6: /* chars following '/' at start 10..15 */
|
||||
*vptr++ = '[';
|
||||
nstate = N_OPEN;
|
||||
s = strchr (fptr, '/');
|
||||
if (s == 0) /* 10 */
|
||||
{
|
||||
if (type != 1)
|
||||
{
|
||||
strcpy (vptr, "000000]");
|
||||
vptr += 7;
|
||||
}
|
||||
copyto (&vptr, &fptr, 0, (type == 1));
|
||||
if (type == 1)
|
||||
{
|
||||
*vptr++ = ']';
|
||||
}
|
||||
state = -1;
|
||||
}
|
||||
else /* 11..15 */
|
||||
{
|
||||
if ( (type == 2)
|
||||
&& (*(s+1) == 0)) /* 11(2) */
|
||||
{
|
||||
strcpy (vptr, "000000]");
|
||||
nstate = N_CLOSED;
|
||||
vptr += 7;
|
||||
}
|
||||
copyto (&vptr, &fptr, '/', (*(vptr-1) != ']'));
|
||||
state = 9;
|
||||
}
|
||||
break;
|
||||
|
||||
case 7: /* add '.dir' and exit */
|
||||
if ((nstate == N_OPEN)
|
||||
|| (nstate == N_DOT))
|
||||
{
|
||||
s = vptr-1;
|
||||
while (s > vmsname)
|
||||
{
|
||||
if (*s == ']')
|
||||
{
|
||||
break;
|
||||
}
|
||||
if (*s == '.')
|
||||
{
|
||||
*s = ']';
|
||||
break;
|
||||
}
|
||||
s--;
|
||||
}
|
||||
}
|
||||
strcpy (vptr, ".dir");
|
||||
vptr += 4;
|
||||
state = -1;
|
||||
break;
|
||||
|
||||
case 8: /* add ']' and exit */
|
||||
*vptr++ = ']';
|
||||
state = -1;
|
||||
break;
|
||||
|
||||
case 9: /* 17..21, fptr -> 1st '/' + 1 */
|
||||
if (*fptr == 0)
|
||||
{
|
||||
if (type == 2)
|
||||
{
|
||||
state = 7;
|
||||
}
|
||||
else
|
||||
state = 8;
|
||||
break;
|
||||
}
|
||||
s = strchr (fptr, '/');
|
||||
if (s == 0)
|
||||
{
|
||||
if (type != 1)
|
||||
{
|
||||
if (nstate == N_OPEN)
|
||||
{
|
||||
*vptr++ = ']';
|
||||
nstate = N_CLOSED;
|
||||
}
|
||||
as_dir = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (nstate == N_OPEN)
|
||||
{
|
||||
*vptr++ = '.';
|
||||
nstate = N_DOT;
|
||||
}
|
||||
as_dir = 1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
while (*(s+1) == '/')
|
||||
s++;
|
||||
if ( (type == 2)
|
||||
&& (*(s+1) == 0)) /* 19(2), 21(2)*/
|
||||
{
|
||||
if (nstate != N_CLOSED)
|
||||
{
|
||||
*vptr++ = ']';
|
||||
nstate = N_CLOSED;
|
||||
}
|
||||
as_dir = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (nstate == N_OPEN)
|
||||
{
|
||||
*vptr++ = '.';
|
||||
nstate = N_DOT;
|
||||
}
|
||||
as_dir = 1;
|
||||
}
|
||||
}
|
||||
if ( (*fptr == '.') /* check for '..' or '../' */
|
||||
&& (*(fptr+1) == '.')
|
||||
&& ((*(fptr+2) == '/')
|
||||
|| (*(fptr+2) == 0)) )
|
||||
{
|
||||
fptr += 2;
|
||||
if (*fptr == '/')
|
||||
{
|
||||
do
|
||||
{
|
||||
fptr++;
|
||||
}
|
||||
while (*fptr == '/');
|
||||
}
|
||||
else if (*fptr == 0)
|
||||
type = 1;
|
||||
vptr--; /* vptr -> '.' or ']' */
|
||||
s1 = vptr;
|
||||
for (;;)
|
||||
{
|
||||
s1--;
|
||||
if (*s1 == '.') /* one back */
|
||||
{
|
||||
vptr = s1;
|
||||
nstate = N_OPEN;
|
||||
break;
|
||||
}
|
||||
if (*s1 == '[') /* top level reached */
|
||||
{
|
||||
if (*fptr == 0)
|
||||
{
|
||||
strcpy (s1, "[000000]");
|
||||
vptr = s1 + 8;
|
||||
nstate = N_CLOSED;
|
||||
s = 0;
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
vptr = s1+1;
|
||||
nstate = N_OPEN;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
copyto (&vptr, &fptr, '/', as_dir);
|
||||
if (nstate == N_DOT)
|
||||
nstate = N_OPEN;
|
||||
}
|
||||
if (s == 0)
|
||||
{ /* 18,20 */
|
||||
if (type == 1)
|
||||
*vptr++ = ']';
|
||||
state = -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (*(s+1) == 0)
|
||||
{
|
||||
if (type == 2) /* 19,21 */
|
||||
{
|
||||
state = 7;
|
||||
}
|
||||
else
|
||||
{
|
||||
*vptr++ = ']';
|
||||
state = -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case 10: /* 1,2 first is '.' */
|
||||
if (*fptr == '.')
|
||||
{
|
||||
fptr++;
|
||||
state = 11;
|
||||
}
|
||||
else
|
||||
state = 12;
|
||||
break;
|
||||
|
||||
case 11: /* 2, '..' at start */
|
||||
count = 1;
|
||||
if (*fptr != 0)
|
||||
{
|
||||
if (*fptr != '/') /* got ..xxx */
|
||||
{
|
||||
return name;
|
||||
}
|
||||
do /* got ../ */
|
||||
{
|
||||
fptr++;
|
||||
while (*fptr == '/') fptr++;
|
||||
if (*fptr != '.')
|
||||
break;
|
||||
if (*(fptr+1) != '.')
|
||||
break;
|
||||
fptr += 2;
|
||||
if ((*fptr == 0)
|
||||
|| (*fptr == '/'))
|
||||
count++;
|
||||
}
|
||||
while (*fptr == '/');
|
||||
}
|
||||
{ /* got '..' or '../' */
|
||||
char cwdbuf[MAXPATHLEN+1];
|
||||
|
||||
s1 = getcwd(cwdbuf, MAXPATHLEN);
|
||||
if (s1 == 0)
|
||||
{
|
||||
return ""; /* FIXME, err getcwd */
|
||||
}
|
||||
strcpy (vptr, s1);
|
||||
s = strchr (vptr, ']');
|
||||
if (s != 0)
|
||||
{
|
||||
while (s > vptr)
|
||||
{
|
||||
s--;
|
||||
if (*s == '[')
|
||||
{
|
||||
s++;
|
||||
strcpy (s, "000000]");
|
||||
state = -1;
|
||||
break;
|
||||
}
|
||||
else if (*s == '.')
|
||||
{
|
||||
if (--count == 0)
|
||||
{
|
||||
if (*fptr == 0) /* had '..' or '../' */
|
||||
{
|
||||
*s++ = ']';
|
||||
state = -1;
|
||||
}
|
||||
else /* had '../xxx' */
|
||||
{
|
||||
state = 9;
|
||||
}
|
||||
*s = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
vptr += strlen (vptr);
|
||||
}
|
||||
break;
|
||||
|
||||
case 12: /* 1, '.' at start */
|
||||
if (*fptr != 0)
|
||||
{
|
||||
if (*fptr != '/')
|
||||
{
|
||||
return name;
|
||||
}
|
||||
fptr++;
|
||||
}
|
||||
|
||||
{
|
||||
char cwdbuf[MAXPATHLEN+1];
|
||||
|
||||
s1 = getcwd(cwdbuf, MAXPATHLEN);
|
||||
if (s1 == 0)
|
||||
{
|
||||
return ""; /*FIXME, err getcwd */
|
||||
}
|
||||
strcpy (vptr, s1);
|
||||
if (*fptr == 0)
|
||||
{
|
||||
state = -1;
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
s = strchr (vptr, ']');
|
||||
if (s == 0)
|
||||
{
|
||||
state = -1;
|
||||
break;
|
||||
}
|
||||
*s = 0;
|
||||
nstate = N_OPEN;
|
||||
vptr += strlen (vptr);
|
||||
state = 9;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
while (state > 0);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
/* directory conversion done
|
||||
fptr -> filename part of input string
|
||||
vptr -> free space in vmsname
|
||||
*/
|
||||
|
||||
*vptr++ = 0;
|
||||
|
||||
return vmsname;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
convert from vms-style to unix-style
|
||||
|
||||
dev:[dir1.dir2] //dev/dir1/dir2/
|
||||
*/
|
||||
|
||||
char *
|
||||
unixify (char *name)
|
||||
{
|
||||
static char piece[512];
|
||||
char *s, *p;
|
||||
|
||||
if (strchr (name, '/') != 0) /* already in unix style */
|
||||
return name;
|
||||
|
||||
p = piece;
|
||||
*p = 0;
|
||||
|
||||
/* device part */
|
||||
|
||||
s = strchr (name, ':');
|
||||
|
||||
if (s != 0)
|
||||
{
|
||||
*s = 0;
|
||||
*p++ = '/';
|
||||
*p++ = '/';
|
||||
strcpy (p, name);
|
||||
p += strlen (p);
|
||||
*s = ':';
|
||||
}
|
||||
|
||||
/* directory part */
|
||||
|
||||
*p++ = '/';
|
||||
s = strchr (name, '[');
|
||||
|
||||
if (s != 0)
|
||||
{
|
||||
s++;
|
||||
switch (*s)
|
||||
{
|
||||
case ']': /* [] */
|
||||
strcat (p, "./");
|
||||
break;
|
||||
case '-': /* [- */
|
||||
strcat (p, "../");
|
||||
break;
|
||||
case '.':
|
||||
strcat (p, "./"); /* [. */
|
||||
break;
|
||||
default:
|
||||
s--;
|
||||
break;
|
||||
}
|
||||
s++;
|
||||
while (*s)
|
||||
{
|
||||
if (*s == '.')
|
||||
*p++ = '/';
|
||||
else
|
||||
*p++ = *s;
|
||||
s++;
|
||||
if (*s == ']')
|
||||
{
|
||||
s++;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (*s != 0) /* more after ']' ?? */
|
||||
{
|
||||
if (*(p-1) != '/')
|
||||
*p++ = '/';
|
||||
strcpy (p, s); /* copy it anyway */
|
||||
}
|
||||
}
|
||||
|
||||
else /* no '[' anywhere */
|
||||
|
||||
{
|
||||
*p++ = 0;
|
||||
}
|
||||
|
||||
/* force end with '/' */
|
||||
|
||||
if (*(p-1) != '/')
|
||||
*p++ = '/';
|
||||
*p = 0;
|
||||
|
||||
return piece;
|
||||
}
|
||||
|
||||
/* EOF */
|
||||
30
vpath.c
30
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, 96 Free Software Foundation, Inc.
|
||||
This file is part of GNU Make.
|
||||
|
||||
GNU Make is free software; you can redistribute it and/or modify
|
||||
@@ -17,8 +17,11 @@ along with GNU Make; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||
|
||||
#include "make.h"
|
||||
#include "file.h"
|
||||
#include "filedef.h"
|
||||
#include "variable.h"
|
||||
#ifdef WIN32
|
||||
#include "pathstuff.h"
|
||||
#endif
|
||||
|
||||
|
||||
/* Structure used to represent a selective VPATH searchpath. */
|
||||
@@ -41,7 +44,7 @@ static struct vpath *vpaths;
|
||||
|
||||
static struct vpath *general_vpath;
|
||||
|
||||
static int selective_vpath_search ();
|
||||
static int selective_vpath_search PARAMS ((struct vpath *path, char **file, time_t *mtime_ptr));
|
||||
|
||||
/* Reverse the chain of selective VPATH lists so they
|
||||
will be searched in the order given in the makefiles
|
||||
@@ -170,6 +173,10 @@ construct_vpath_list (pattern, dirpath)
|
||||
return;
|
||||
}
|
||||
|
||||
#ifdef WIN32
|
||||
convert_vpath_to_win32(dirpath, ';');
|
||||
#endif
|
||||
|
||||
/* Figure out the maximum number of VPATH entries and
|
||||
put it in MAXELEM. We start with 2, one before the
|
||||
first colon and one nil, the list terminator and
|
||||
@@ -279,7 +286,12 @@ vpath_search (file, mtime_ptr)
|
||||
/* If there are no VPATH entries or FILENAME starts at the root,
|
||||
there is nothing we can do. */
|
||||
|
||||
if (**file == '/' || (vpaths == 0 && general_vpath == 0))
|
||||
if (**file == '/'
|
||||
#ifdef WIN32
|
||||
|| **file == '\\'
|
||||
|| (*file)[1] == ':'
|
||||
#endif
|
||||
|| (vpaths == 0 && general_vpath == 0))
|
||||
return 0;
|
||||
|
||||
for (v = vpaths; v != 0; v = v->next)
|
||||
@@ -331,6 +343,10 @@ selective_vpath_search (path, file, mtime_ptr)
|
||||
pointer to the name-within-directory and FLEN is its length. */
|
||||
|
||||
n = rindex (*file, '/');
|
||||
#ifdef WIN32
|
||||
if (!n)
|
||||
n = rindex(*file,, '\\');
|
||||
#endif
|
||||
name_dplen = n != 0 ? n - *file : 0;
|
||||
filename = name_dplen > 0 ? n + 1 : *file;
|
||||
if (name_dplen > 0)
|
||||
@@ -340,7 +356,7 @@ selective_vpath_search (path, file, mtime_ptr)
|
||||
a slash, the directory prefix that came with *FILE,
|
||||
another slash (although this one may not always be
|
||||
necessary), the filename, and a null terminator. */
|
||||
name = (char *) alloca (maxvpath + 1 + name_dplen + 1 + flen + 1);
|
||||
name = (char *) xmalloc (maxvpath + 1 + name_dplen + 1 + flen + 1);
|
||||
|
||||
/* Try each VPATH entry. */
|
||||
for (i = 0; vpath[i] != 0; ++i)
|
||||
@@ -419,7 +435,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. */
|
||||
@@ -432,6 +448,7 @@ selective_vpath_search (path, file, mtime_ptr)
|
||||
we record a zero modtime to indicate this. */
|
||||
*mtime_ptr = exists_in_cache ? st.st_mtime : (time_t) 0;
|
||||
|
||||
free (name);
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
@@ -439,6 +456,7 @@ selective_vpath_search (path, file, mtime_ptr)
|
||||
}
|
||||
}
|
||||
|
||||
free (name);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
188
w32/compat/dirent.c
Normal file
188
w32/compat/dirent.c
Normal file
@@ -0,0 +1,188 @@
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <errno.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include "dirent.h"
|
||||
|
||||
|
||||
DIR*
|
||||
opendir(const char* pDirName)
|
||||
{
|
||||
struct stat sb;
|
||||
DIR* pDir;
|
||||
char* pEndDirName;
|
||||
int nBufferLen;
|
||||
|
||||
/* sanity checks */
|
||||
if (!pDirName) {
|
||||
errno = EINVAL;
|
||||
return NULL;
|
||||
}
|
||||
if (stat(pDirName, &sb) != 0) {
|
||||
errno = ENOENT;
|
||||
return NULL;
|
||||
}
|
||||
if ((sb.st_mode & S_IFMT) != S_IFDIR) {
|
||||
errno = ENOTDIR;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* allocate a DIR structure to return */
|
||||
pDir = (DIR *) malloc(sizeof (DIR));
|
||||
|
||||
if (!pDir)
|
||||
return NULL;
|
||||
|
||||
/* input directory name length */
|
||||
nBufferLen = strlen(pDirName);
|
||||
|
||||
/* copy input directory name to DIR buffer */
|
||||
strcpy(pDir->dir_pDirectoryName, pDirName);
|
||||
|
||||
/* point to end of the copied directory name */
|
||||
pEndDirName = &pDir->dir_pDirectoryName[nBufferLen - 1];
|
||||
|
||||
/* if directory name did not end in '/' or '\', add '/' */
|
||||
if ((*pEndDirName != '/') && (*pEndDirName != '\\')) {
|
||||
pEndDirName++;
|
||||
*pEndDirName = '/';
|
||||
}
|
||||
|
||||
/* now append the wildcard character to the buffer */
|
||||
pEndDirName++;
|
||||
*pEndDirName = '*';
|
||||
pEndDirName++;
|
||||
*pEndDirName = '\0';
|
||||
|
||||
/* other values defaulted */
|
||||
pDir->dir_nNumFiles = 0;
|
||||
pDir->dir_hDirHandle = INVALID_HANDLE_VALUE;
|
||||
pDir->dir_ulCookie = __DIRENT_COOKIE;
|
||||
|
||||
return pDir;
|
||||
}
|
||||
|
||||
void
|
||||
closedir(DIR *pDir)
|
||||
{
|
||||
/* got a valid pointer? */
|
||||
if (!pDir) {
|
||||
errno = EINVAL;
|
||||
return;
|
||||
}
|
||||
|
||||
/* sanity check that this is a DIR pointer */
|
||||
if (pDir->dir_ulCookie != __DIRENT_COOKIE) {
|
||||
errno = EINVAL;
|
||||
return;
|
||||
}
|
||||
|
||||
/* close the WIN32 directory handle */
|
||||
if (pDir->dir_hDirHandle != INVALID_HANDLE_VALUE)
|
||||
FindClose(pDir->dir_hDirHandle);
|
||||
|
||||
free(pDir);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
struct dirent *
|
||||
readdir(DIR* pDir)
|
||||
{
|
||||
WIN32_FIND_DATA wfdFindData;
|
||||
|
||||
if (!pDir) {
|
||||
errno = EINVAL;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* sanity check that this is a DIR pointer */
|
||||
if (pDir->dir_ulCookie != __DIRENT_COOKIE) {
|
||||
errno = EINVAL;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (pDir->dir_nNumFiles == 0) {
|
||||
pDir->dir_hDirHandle = FindFirstFile(pDir->dir_pDirectoryName, &wfdFindData);
|
||||
if (pDir->dir_hDirHandle == INVALID_HANDLE_VALUE)
|
||||
return NULL;
|
||||
} else if (!FindNextFile(pDir->dir_hDirHandle, &wfdFindData))
|
||||
return NULL;
|
||||
|
||||
/* bump count for next call to readdir() or telldir() */
|
||||
pDir->dir_nNumFiles++;
|
||||
|
||||
/* fill in struct dirent values */
|
||||
pDir->dir_sdReturn.d_ino = -1;
|
||||
strcpy(pDir->dir_sdReturn.d_name, wfdFindData.cFileName);
|
||||
|
||||
return &pDir->dir_sdReturn;
|
||||
}
|
||||
|
||||
void
|
||||
rewinddir(DIR* pDir)
|
||||
{
|
||||
if (!pDir) {
|
||||
errno = EINVAL;
|
||||
return;
|
||||
}
|
||||
|
||||
/* sanity check that this is a DIR pointer */
|
||||
if (pDir->dir_ulCookie != __DIRENT_COOKIE) {
|
||||
errno = EINVAL;
|
||||
return;
|
||||
}
|
||||
|
||||
/* close the WIN32 directory handle */
|
||||
if (pDir->dir_hDirHandle != INVALID_HANDLE_VALUE)
|
||||
if (!FindClose(pDir->dir_hDirHandle))
|
||||
errno = EBADF;
|
||||
|
||||
/* reset members which control readdir() */
|
||||
pDir->dir_hDirHandle = INVALID_HANDLE_VALUE;
|
||||
pDir->dir_nNumFiles = 0;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
int
|
||||
telldir(DIR* pDir)
|
||||
{
|
||||
if (!pDir) {
|
||||
errno = EINVAL;
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* sanity check that this is a DIR pointer */
|
||||
if (pDir->dir_ulCookie != __DIRENT_COOKIE) {
|
||||
errno = EINVAL;
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* return number of times readdir() called */
|
||||
return pDir->dir_nNumFiles;
|
||||
}
|
||||
|
||||
void
|
||||
seekdir(DIR* pDir, long nPosition)
|
||||
{
|
||||
if (!pDir)
|
||||
return;
|
||||
|
||||
/* sanity check that this is a DIR pointer */
|
||||
if (pDir->dir_ulCookie != __DIRENT_COOKIE)
|
||||
return;
|
||||
|
||||
/* go back to beginning of directory */
|
||||
rewinddir(pDir);
|
||||
|
||||
/* loop until we have found position we care about */
|
||||
for (--nPosition; nPosition && readdir(pDir); nPosition--);
|
||||
|
||||
/* flag invalid nPosition value */
|
||||
if (nPosition)
|
||||
errno = EINVAL;
|
||||
|
||||
return;
|
||||
}
|
||||
37
w32/include/dirent.h
Normal file
37
w32/include/dirent.h
Normal file
@@ -0,0 +1,37 @@
|
||||
#ifndef _DIRENT_H
|
||||
#define _DIRENT_H
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <windows.h>
|
||||
#include <limits.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#ifndef NAME_MAX
|
||||
#define NAME_MAX 255
|
||||
#endif
|
||||
|
||||
#define __DIRENT_COOKIE 0xfefeabab
|
||||
|
||||
|
||||
struct dirent
|
||||
{
|
||||
ino_t d_ino; /* unused - no equivalent on WIN32 */
|
||||
char d_name[NAME_MAX+1];
|
||||
};
|
||||
|
||||
typedef struct dir_struct {
|
||||
ULONG dir_ulCookie;
|
||||
HANDLE dir_hDirHandle;
|
||||
DWORD dir_nNumFiles;
|
||||
char dir_pDirectoryName[NAME_MAX+1];
|
||||
struct dirent dir_sdReturn;
|
||||
} DIR;
|
||||
|
||||
DIR *opendir(const char *);
|
||||
struct dirent *readdir(DIR *);
|
||||
void rewinddir(DIR *);
|
||||
void closedir(DIR *);
|
||||
int telldir(DIR *);
|
||||
void seekdir(DIR *, long);
|
||||
|
||||
#endif
|
||||
10
w32/include/pathstuff.h
Normal file
10
w32/include/pathstuff.h
Normal file
@@ -0,0 +1,10 @@
|
||||
#ifndef _PATHSTUFF_H
|
||||
#define _PATHSTUFF_H
|
||||
|
||||
extern char * convert_Path_to_win32(char *Path, char to_delim);
|
||||
extern char * w32ify(char *file, int resolve);
|
||||
extern char * getcwd_fs(char *buf, int len);
|
||||
|
||||
#define convert_vpath_to_win32(vpath, delim) convert_Path_to_win32(vpath, delim)
|
||||
|
||||
#endif
|
||||
54
w32/include/sub_proc.h
Normal file
54
w32/include/sub_proc.h
Normal file
@@ -0,0 +1,54 @@
|
||||
#ifndef SUB_PROC_H
|
||||
#define SUB_PROC_H
|
||||
|
||||
/*
|
||||
* Component Name:
|
||||
*
|
||||
* $Date$
|
||||
*
|
||||
* $Source$
|
||||
*
|
||||
* $Revision$
|
||||
*
|
||||
* Description:
|
||||
*
|
||||
* (C) COPYRIGHT TIVOLI Systems, Inc. 1991-1994
|
||||
* Unpublished Work
|
||||
* All Rights Reserved
|
||||
* Licensed Material - Property of TIVOLI Systems, Inc.
|
||||
*/
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
#ifdef WIN32
|
||||
|
||||
#define EXTERN_DECL(entry, args) extern entry args
|
||||
#define VOID_DECL void
|
||||
|
||||
EXTERN_DECL(HANDLE process_init, (VOID_DECL));
|
||||
EXTERN_DECL(HANDLE process_init_fd, (HANDLE stdinh, HANDLE stdouth,
|
||||
HANDLE stderrh));
|
||||
EXTERN_DECL(long process_begin, (HANDLE proc, char **argv, char **envp,
|
||||
char *exec_path, char *as_user));
|
||||
EXTERN_DECL(long process_pipe_io, (HANDLE proc, char *stdin_data,
|
||||
int stdin_data_len));
|
||||
EXTERN_DECL(long process_file_io, (HANDLE proc));
|
||||
EXTERN_DECL(void process_cleanup, (HANDLE proc));
|
||||
EXTERN_DECL(HANDLE process_wait_for_any, (VOID_DECL));
|
||||
EXTERN_DECL(void process_register, (HANDLE proc));
|
||||
EXTERN_DECL(HANDLE process_easy, (char** argv, char** env));
|
||||
EXTERN_DECL(BOOL process_kill, (HANDLE proc, int signal));
|
||||
|
||||
/* support routines */
|
||||
EXTERN_DECL(long process_errno, (HANDLE proc));
|
||||
EXTERN_DECL(long process_last_err, (HANDLE proc));
|
||||
EXTERN_DECL(long process_exit_code, (HANDLE proc));
|
||||
EXTERN_DECL(long process_signal, (HANDLE proc));
|
||||
EXTERN_DECL(char * process_outbuf, (HANDLE proc));
|
||||
EXTERN_DECL(char * process_errbuf, (HANDLE proc));
|
||||
EXTERN_DECL(int process_outcnt, (HANDLE proc));
|
||||
EXTERN_DECL(int process_errcnt, (HANDLE proc));
|
||||
EXTERN_DECL(void process_pipes, (HANDLE proc, int pipes[3]));
|
||||
|
||||
#endif
|
||||
#endif
|
||||
10
w32/include/w32err.h
Normal file
10
w32/include/w32err.h
Normal file
@@ -0,0 +1,10 @@
|
||||
#ifndef _W32ERR_H_
|
||||
#define _W32ERR_H_
|
||||
|
||||
#ifndef EXTERN_DECL
|
||||
#define EXTERN_DECL(entry, args) entry args
|
||||
#endif
|
||||
|
||||
EXTERN_DECL(char * map_win32_error_to_string, (DWORD error));
|
||||
|
||||
#endif /* !_W32ERR_H */
|
||||
219
w32/pathstuff.c
Normal file
219
w32/pathstuff.c
Normal file
@@ -0,0 +1,219 @@
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include "make.h"
|
||||
|
||||
/*
|
||||
* Convert delimiter separated path to Canonical format.
|
||||
*/
|
||||
char *
|
||||
convert_Path_to_win32(char *Path, char to_delim)
|
||||
{
|
||||
char *etok; /* token separator for old Path */
|
||||
char *p; /* points to element of old Path */
|
||||
|
||||
/* is this a multi-element Path ? */
|
||||
for (p = Path, etok = strpbrk(p, ":;");
|
||||
etok;
|
||||
etok = strpbrk(p, ":;"))
|
||||
if ((etok - p) == 1) {
|
||||
if (*(etok - 1) == ';' ||
|
||||
*(etok - 1) == ':') {
|
||||
etok[-1] = to_delim;
|
||||
etok[0] = to_delim;
|
||||
p = ++etok;
|
||||
continue; /* ignore empty bucket */
|
||||
} else if (etok = strpbrk(etok+1, ":;")) {
|
||||
/* found one to count, handle drive letter */
|
||||
*etok = to_delim;
|
||||
p = ++etok;
|
||||
} else
|
||||
/* all finished, force abort */
|
||||
p += strlen(p);
|
||||
} else {
|
||||
/* found another one, no drive letter */
|
||||
*etok = to_delim;
|
||||
p = ++etok;
|
||||
}
|
||||
|
||||
#if 0
|
||||
/* convert to backward slashes */
|
||||
for (p = Path, p = strchr(p, '/'); p; p = strchr(p, '/'))
|
||||
*p = '\\';
|
||||
#endif
|
||||
return Path;
|
||||
}
|
||||
|
||||
/*
|
||||
* Convert to forward slashes. Resolve to full pathname optionally
|
||||
*/
|
||||
char *
|
||||
w32ify(char *filename, int resolve)
|
||||
{
|
||||
static char w32_path[FILENAME_MAX];
|
||||
char *p;
|
||||
|
||||
if (resolve)
|
||||
_fullpath(w32_path, filename, sizeof (w32_path));
|
||||
else
|
||||
strncpy(w32_path, filename, sizeof (w32_path));
|
||||
|
||||
for (p = w32_path; p && *p; p++)
|
||||
if (*p == '\\')
|
||||
*p = '/';
|
||||
|
||||
return w32_path;
|
||||
}
|
||||
|
||||
char *
|
||||
getcwd_fs(char* buf, int len)
|
||||
{
|
||||
char *p;
|
||||
|
||||
if (p = getcwd(buf, len)) {
|
||||
char *q = w32ify(buf, 0);
|
||||
strncpy(buf, q, len);
|
||||
}
|
||||
|
||||
return p;
|
||||
}
|
||||
|
||||
#ifdef unused
|
||||
/*
|
||||
* Convert delimiter separated pathnames (e.g. PATH) or single file pathname
|
||||
* (e.g. c:/foo, c:\bar) to NutC format. If we are handed a string that
|
||||
* _NutPathToNutc() fails to convert, just return the path we were handed
|
||||
* and assume the caller will know what to do with it (It was probably
|
||||
* a mistake to try and convert it anyway due to some of the bizarre things
|
||||
* that might look like pathnames in makefiles).
|
||||
*/
|
||||
char *
|
||||
convert_path_to_nutc(char *path)
|
||||
{
|
||||
int count; /* count of path elements */
|
||||
char *nutc_path; /* new NutC path */
|
||||
int nutc_path_len; /* length of buffer to allocate for new path */
|
||||
char *pathp; /* pointer to nutc_path used to build it */
|
||||
char *etok; /* token separator for old path */
|
||||
char *p; /* points to element of old path */
|
||||
char sep; /* what flavor of separator used in old path */
|
||||
char *rval;
|
||||
|
||||
/* is this a multi-element path ? */
|
||||
for (p = path, etok = strpbrk(p, ":;"), count = 0;
|
||||
etok;
|
||||
etok = strpbrk(p, ":;"))
|
||||
if ((etok - p) == 1) {
|
||||
if (*(etok - 1) == ';' ||
|
||||
*(etok - 1) == ':') {
|
||||
p = ++etok;
|
||||
continue; /* ignore empty bucket */
|
||||
} else if (etok = strpbrk(etok+1, ":;"))
|
||||
/* found one to count, handle drive letter */
|
||||
p = ++etok, count++;
|
||||
else
|
||||
/* all finished, force abort */
|
||||
p += strlen(p);
|
||||
} else
|
||||
/* found another one, no drive letter */
|
||||
p = ++etok, count++;
|
||||
|
||||
if (count) {
|
||||
count++; /* x1;x2;x3 <- need to count x3 */
|
||||
|
||||
/*
|
||||
* Hazard a guess on how big the buffer needs to be.
|
||||
* We have to convert things like c:/foo to /c=/foo.
|
||||
*/
|
||||
nutc_path_len = strlen(path) + (count*2) + 1;
|
||||
nutc_path = xmalloc(nutc_path_len);
|
||||
pathp = nutc_path;
|
||||
*pathp = '\0';
|
||||
|
||||
/*
|
||||
* Loop through PATH and convert one elemnt of the path at at
|
||||
* a time. Single file pathnames will fail this and fall
|
||||
* to the logic below loop.
|
||||
*/
|
||||
for (p = path, etok = strpbrk(p, ":;");
|
||||
etok;
|
||||
etok = strpbrk(p, ":;")) {
|
||||
|
||||
/* don't trip up on device specifiers or empty path slots */
|
||||
if ((etok - p) == 1)
|
||||
if (*(etok - 1) == ';' ||
|
||||
*(etok - 1) == ':') {
|
||||
p = ++etok;
|
||||
continue;
|
||||
} else if ((etok = strpbrk(etok+1, ":;")) == NULL)
|
||||
break; /* thing found was a WIN32 pathname */
|
||||
|
||||
/* save separator */
|
||||
sep = *etok;
|
||||
|
||||
/* terminate the current path element -- temporarily */
|
||||
*etok = '\0';
|
||||
|
||||
#ifdef __NUTC__
|
||||
/* convert to NutC format */
|
||||
if (_NutPathToNutc(p, pathp, 0) == FALSE) {
|
||||
free(nutc_path);
|
||||
rval = savestring(path, strlen(path));
|
||||
return rval;
|
||||
}
|
||||
#else
|
||||
*pathp++ = '/';
|
||||
*pathp++ = p[0];
|
||||
*pathp++ = '=';
|
||||
*pathp++ = '/';
|
||||
strcpy(pathp, &p[2]);
|
||||
#endif
|
||||
|
||||
pathp += strlen(pathp);
|
||||
*pathp++ = ':'; /* use Unix style path separtor for new path */
|
||||
*pathp = '\0'; /* make sure we are null terminaed */
|
||||
|
||||
/* restore path separator */
|
||||
*etok = sep;
|
||||
|
||||
/* point p to first char of next path element */
|
||||
p = ++etok;
|
||||
|
||||
}
|
||||
} else {
|
||||
nutc_path_len = strlen(path) + 3;
|
||||
nutc_path = xmalloc(nutc_path_len);
|
||||
pathp = nutc_path;
|
||||
*pathp = '\0';
|
||||
p = path;
|
||||
}
|
||||
|
||||
/*
|
||||
* OK, here we handle the last element in PATH (e.g. c of a;b;c)
|
||||
* or the path was a single filename and will be converted
|
||||
* here. Note, testing p here assures that we don't trip up
|
||||
* on paths like a;b; which have trailing delimiter followed by
|
||||
* nothing.
|
||||
*/
|
||||
if (*p != '\0') {
|
||||
#ifdef __NUTC__
|
||||
if (_NutPathToNutc(p, pathp, 0) == FALSE) {
|
||||
free(nutc_path);
|
||||
rval = savestring(path, strlen(path));
|
||||
return rval;
|
||||
}
|
||||
#else
|
||||
*pathp++ = '/';
|
||||
*pathp++ = p[0];
|
||||
*pathp++ = '=';
|
||||
*pathp++ = '/';
|
||||
strcpy(pathp, &p[2]);
|
||||
#endif
|
||||
} else
|
||||
*(pathp-1) = '\0'; /* we're already done, don't leave trailing : */
|
||||
|
||||
rval = savestring(nutc_path, strlen(nutc_path));
|
||||
free(nutc_path);
|
||||
return rval;
|
||||
}
|
||||
|
||||
#endif
|
||||
59
w32/subproc/NMakefile
Normal file
59
w32/subproc/NMakefile
Normal file
@@ -0,0 +1,59 @@
|
||||
# NOTE: If you have no `make' program at all to process this makefile, run
|
||||
# `build.bat' instead.
|
||||
#
|
||||
# Copyright (C) 1988, 89, 91, 92, 93, 94, 95, 1996 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)
|
||||
# any later version.
|
||||
#
|
||||
# GNU Make 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 GNU Make; see the file COPYING. If not, write to
|
||||
# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
#
|
||||
# NMakefile for GNU Make (subproc library)
|
||||
#
|
||||
LIB = lib
|
||||
CC = cl
|
||||
|
||||
OUTDIR=.
|
||||
MAKEFILE=NMakefile
|
||||
|
||||
CFLAGS_any = /nologo /MT /W3 /GX /Z7 /YX /D WIN32 /D _WINDOWS -I. -I../include
|
||||
CFLAGS_debug = $(CFLAGS_any) /Od /D _DEBUG /FR.\WinDebug\ /Fp.\WinDebug\subproc.pch /Fo.\WinDebug/
|
||||
CFLAGS_release = $(CFLAGS_any) /O2 /FR.\WinRel\ /Fp.\WinRel\subproc.pch /Fo.\WinRel/
|
||||
|
||||
all: Release Debug
|
||||
|
||||
Release:
|
||||
$(MAKE) /f $(MAKEFILE) OUTDIR=WinRel CFLAGS="$(CFLAGS_release)" WinRel/subproc.lib
|
||||
Debug:
|
||||
$(MAKE) /f $(MAKEFILE) OUTDIR=WinDebug CFLAGS="$(CFLAGS_debug)" WinDebug/subproc.lib
|
||||
|
||||
clean:
|
||||
rmdir /s /q WinRel WinDebug
|
||||
|
||||
$(OUTDIR):
|
||||
if not exist .\$@\nul mkdir .\$@
|
||||
|
||||
OBJS = $(OUTDIR)/misc.obj $(OUTDIR)/w32err.obj $(OUTDIR)/sub_proc.obj
|
||||
|
||||
$(OUTDIR)/subproc.lib: $(OUTDIR) $(OBJS)
|
||||
$(LIB) -out:$@ @<<
|
||||
$(OBJS)
|
||||
<<
|
||||
|
||||
.c{$(OUTDIR)}.obj:
|
||||
$(CC) $(CFLAGS) /c $<
|
||||
|
||||
$(OUTDIR)/misc.obj: misc.c proc.h
|
||||
$(OUTDIR)/sub_proc.obj: sub_proc.c ../include/sub_proc.h ../include/w32err.h proc.h
|
||||
$(OUTDIR)/w32err.obj: w32err.c ../include/w32err.h
|
||||
10
w32/subproc/build.bat
Normal file
10
w32/subproc/build.bat
Normal file
@@ -0,0 +1,10 @@
|
||||
if not exist .\WinDebug\nul mkdir .\WinDebug
|
||||
cl.exe /nologo /MT /W3 /GX /Z7 /YX /Od /I .. /I . /I ../include /D WIN32 /D _DEBUG /D _WINDOWS /FR.\WinDebug/ /Fp.\WinDebug/subproc.pch /Fo.\WinDebug/ /c misc.c
|
||||
cl.exe /nologo /MT /W3 /GX /Z7 /YX /Od /I .. /I . /I ../include /D WIN32 /D _DEBUG /D _WINDOWS /FR.\WinDebug/ /Fp.\WinDebug/subproc.pch /Fo.\WinDebug/ /c sub_proc.c
|
||||
cl.exe /nologo /MT /W3 /GX /Z7 /YX /Od /I .. /I . /I ../include /D WIN32 /D _DEBUG /D _WINDOWS /FR.\WinDebug/ /Fp.\WinDebug/subproc.pch /Fo.\WinDebug/ /c w32err.c
|
||||
lib.exe /NOLOGO /OUT:.\WinDebug\subproc.lib .\WinDebug/misc.obj .\WinDebug/sub_proc.obj .\WinDebug/w32err.obj
|
||||
if not exist .\WinRel\nul mkdir .\WinRel
|
||||
cl.exe /nologo /MT /W3 /GX /YX /O2 /I ../include /D WIN32 /D NDEBUG /D _WINDOWS /FR.\WinRel/ /Fp.\WinRel/subproc.pch /Fo.\WinRel/ /c misc.c
|
||||
cl.exe /nologo /MT /W3 /GX /YX /O2 /I ../include /D WIN32 /D NDEBUG /D _WINDOWS /FR.\WinRel/ /Fp.\WinRel/subproc.pch /Fo.\WinRel/ /c sub_proc.c
|
||||
cl.exe /nologo /MT /W3 /GX /YX /O2 /I ../include /D WIN32 /D NDEBUG /D _WINDOWS /FR.\WinRel/ /Fp.\WinRel/subproc.pch /Fo.\WinRel/ /c w32err.c
|
||||
lib.exe /NOLOGO /OUT:.\WinRel\subproc.lib .\WinRel/misc.obj .\WinRel/sub_proc.obj .\WinRel/w32err.obj
|
||||
63
w32/subproc/misc.c
Normal file
63
w32/subproc/misc.c
Normal file
@@ -0,0 +1,63 @@
|
||||
#include <stddef.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <windows.h>
|
||||
#include "proc.h"
|
||||
|
||||
|
||||
/*
|
||||
* Description: Convert a NULL string terminated UNIX environment block to
|
||||
* an environment block suitable for a win32 system call
|
||||
*
|
||||
* Returns: TRUE= success, FALSE=fail
|
||||
*
|
||||
* Notes/Dependencies: the environment block is sorted in case-insensitive
|
||||
* order, is double-null terminated, and is a char *, not a char **
|
||||
*/
|
||||
int _cdecl compare(const void *a1, const void *a2)
|
||||
{
|
||||
return _stricoll(*((char**)a1),*((char**)a2));
|
||||
}
|
||||
bool_t
|
||||
arr2envblk(char **arr, char **envblk_out)
|
||||
{
|
||||
char **tmp;
|
||||
int size_needed;
|
||||
int arrcnt;
|
||||
char *ptr;
|
||||
|
||||
arrcnt = 0;
|
||||
while (arr[arrcnt]) {
|
||||
arrcnt++;
|
||||
}
|
||||
|
||||
tmp = (char**) calloc(arrcnt + 1, sizeof(char *));
|
||||
if (!tmp) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
arrcnt = 0;
|
||||
size_needed = 0;
|
||||
while (arr[arrcnt]) {
|
||||
tmp[arrcnt] = arr[arrcnt];
|
||||
size_needed += strlen(arr[arrcnt]) + 1;
|
||||
arrcnt++;
|
||||
}
|
||||
size_needed++;
|
||||
|
||||
qsort((void *) tmp, (size_t) arrcnt, sizeof (char*), compare);
|
||||
|
||||
ptr = *envblk_out = calloc(size_needed, 1);
|
||||
if (!ptr) {
|
||||
free(tmp);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
arrcnt = 0;
|
||||
while (tmp[arrcnt]) {
|
||||
strcpy(ptr, tmp[arrcnt]);
|
||||
ptr += strlen(tmp[arrcnt]) + 1;
|
||||
arrcnt++;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
13
w32/subproc/proc.h
Normal file
13
w32/subproc/proc.h
Normal file
@@ -0,0 +1,13 @@
|
||||
#ifndef _PROC_H
|
||||
#define _PROC_H
|
||||
|
||||
typedef int bool_t;
|
||||
|
||||
#define E_SCALL 101
|
||||
#define E_IO 102
|
||||
#define E_NO_MEM 103
|
||||
#define E_FORK 104
|
||||
|
||||
extern bool_t arr2envblk(char **arr, char **envblk_out);
|
||||
|
||||
#endif
|
||||
1100
w32/subproc/sub_proc.c
Normal file
1100
w32/subproc/sub_proc.c
Normal file
File diff suppressed because it is too large
Load Diff
51
w32/subproc/w32err.c
Normal file
51
w32/subproc/w32err.c
Normal file
@@ -0,0 +1,51 @@
|
||||
#include <windows.h>
|
||||
#include "w32err.h"
|
||||
|
||||
/*
|
||||
* Description: the win32 version of perror()
|
||||
*
|
||||
* Returns: a pointer to a static error
|
||||
*
|
||||
* Notes/Dependencies: I got this from
|
||||
* comp.os.ms-windows.programmer.win32
|
||||
*/
|
||||
char *
|
||||
map_win32_error_to_string (DWORD ercode) {
|
||||
/* __declspec (thread) necessary if you will use multiple threads */
|
||||
__declspec (thread) static char szMessageBuffer[128];
|
||||
|
||||
/* Fill message buffer with a default message in
|
||||
* case FormatMessage fails
|
||||
*/
|
||||
wsprintf (szMessageBuffer, "Error %ld", ercode);
|
||||
|
||||
/*
|
||||
* Special code for winsock error handling.
|
||||
*/
|
||||
if (ercode > WSABASEERR) {
|
||||
HMODULE hModule = GetModuleHandle("wsock32");
|
||||
if (hModule != NULL) {
|
||||
FormatMessage(FORMAT_MESSAGE_FROM_HMODULE,
|
||||
hModule,
|
||||
ercode,
|
||||
LANG_NEUTRAL,
|
||||
szMessageBuffer,
|
||||
sizeof(szMessageBuffer),
|
||||
NULL);
|
||||
FreeLibrary(hModule);
|
||||
}
|
||||
} else {
|
||||
/*
|
||||
* Default system message handling
|
||||
*/
|
||||
FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM,
|
||||
NULL,
|
||||
ercode,
|
||||
LANG_NEUTRAL,
|
||||
szMessageBuffer,
|
||||
sizeof(szMessageBuffer),
|
||||
NULL);
|
||||
}
|
||||
return szMessageBuffer;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user