mirror of
https://github.com/mirror/make.git
synced 2026-08-20 00:43:29 +08:00
Compare commits
103 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
625b9f6ba2 | ||
|
|
8756e81616 | ||
|
|
3e141c8277 | ||
|
|
aaed50ac3f | ||
|
|
a89eb21084 | ||
|
|
4356ddddbc | ||
|
|
b8db661c24 | ||
|
|
a54c552d39 | ||
|
|
25d48503eb | ||
|
|
5df0d41985 | ||
|
|
737e056a89 | ||
|
|
8c13a20895 | ||
|
|
2a0707e1b8 | ||
|
|
d116acac75 | ||
|
|
6ab25d18b2 | ||
|
|
4061695ef6 | ||
|
|
e3200b9303 | ||
|
|
18a7013e55 | ||
|
|
624552badd | ||
|
|
76d037cb95 | ||
|
|
dfdf1bec21 | ||
|
|
caa2fe5d39 | ||
|
|
2f506a6d52 | ||
|
|
856d83462f | ||
|
|
e9fcf7ea88 | ||
|
|
bfa6ab6a0c | ||
|
|
4e6de57b8f | ||
|
|
41e6704efd | ||
|
|
ffea662953 | ||
|
|
db5cc03f75 | ||
|
|
cd851988e7 | ||
|
|
fb39f49937 | ||
|
|
dccc12dbee | ||
|
|
1305447ace | ||
|
|
5ed1a6399a | ||
|
|
3f614c58ed | ||
|
|
37cf6fdc18 | ||
|
|
808f1c1cd2 | ||
|
|
06021f945f | ||
|
|
ad61285598 | ||
|
|
10d6808977 | ||
|
|
21fbad8602 | ||
|
|
fa6d6f9150 | ||
|
|
ed02723506 | ||
|
|
692858922f | ||
|
|
9da3bccd89 | ||
|
|
16a5d4cf48 | ||
|
|
b1e6353edd | ||
|
|
e1c593016b | ||
|
|
10124ce95b | ||
|
|
6e19c6febb | ||
|
|
4314e2f987 | ||
|
|
0eab889a28 | ||
|
|
c51dd24814 | ||
|
|
41ea0f1556 | ||
|
|
ee6b27b728 | ||
|
|
af72fc38fe | ||
|
|
294c429f93 | ||
|
|
9409f5c54a | ||
|
|
78ac5bd9c7 | ||
|
|
030d31ba93 | ||
|
|
70465ffcfb | ||
|
|
ee2b67af6d | ||
|
|
0afe62e255 | ||
|
|
ee14af651f | ||
|
|
9fd3c2453b | ||
|
|
a4e66c61c0 | ||
|
|
8cfdca3e72 | ||
|
|
2c27d8dbdc | ||
|
|
d02b26a4b8 | ||
|
|
8b3f13f6ec | ||
|
|
e74b6ae5c2 | ||
|
|
f21ec15ffa | ||
|
|
3f49392b9c | ||
|
|
f9a914c035 | ||
|
|
b2fc502c55 | ||
|
|
d091a08961 | ||
|
|
eb3b7904f0 | ||
|
|
bbfb270092 | ||
|
|
c18253b59b | ||
|
|
41177916df | ||
|
|
7acd99c5e6 | ||
|
|
d6c62b351f | ||
|
|
c9c43b0871 | ||
|
|
13e8568f03 | ||
|
|
cebdba9dfa | ||
|
|
4ea152e71b | ||
|
|
443f39f4f7 | ||
|
|
675981bc4f | ||
|
|
11af972f87 | ||
|
|
d9c126da40 | ||
|
|
7170467928 | ||
|
|
81699266d3 | ||
|
|
cbdb3653da | ||
|
|
5d82479d89 | ||
|
|
ed0d607279 | ||
|
|
855bd6896d | ||
|
|
179ef370e8 | ||
|
|
01dc9a22f9 | ||
|
|
bc15ada5ed | ||
|
|
fce5e4a9b9 | ||
|
|
07a45cd0af | ||
|
|
226a132e31 |
@@ -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.
|
||||
4980
ChangeLog.1
Normal file
4980
ChangeLog.1
Normal file
File diff suppressed because it is too large
Load Diff
17
GNUmakefile
17
GNUmakefile
@@ -2,7 +2,7 @@
|
||||
|
||||
# Copyright (C) 1990, 91, 92, 93, 94, 95 Free Software Foundation, Inc.
|
||||
# This file is part of GNU Make.
|
||||
#
|
||||
#
|
||||
# GNU Make is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2, or (at your option)
|
||||
@@ -12,7 +12,7 @@
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with GNU Make; see the file COPYING. If not, write to
|
||||
# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
@@ -50,7 +50,7 @@ exec_prefix = $(prefix)
|
||||
extras := $(filter-out getloadavg.o @%@,$(extras)) getloadavg.o
|
||||
LOADLIBES := $(filter-out @%@,$(LOADLIBES))
|
||||
ALLOCA := $(filter-out @%@,$(ALLOCA))
|
||||
CPPFLAGS := $(filter-out @%@,$(CPPFLAGS)) -DHAVE_CONFIG_H
|
||||
CPPFLAGS := $(filter-out @%@,$(defines) $(CPPFLAGS)) -DHAVE_CONFIG_H
|
||||
|
||||
ifdef AC_MACRODIR
|
||||
configure config.h.in: $(patsubst %,$(AC_MACRODIR)/%.m4,acspecific acgeneral)
|
||||
@@ -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
|
||||
@@ -154,7 +155,7 @@ globfiles = $(addprefix glob/,COPYING.LIB configure.in configure Makefile.in \
|
||||
configure.bat glob.c fnmatch.c glob.h fnmatch.h)
|
||||
$(globfiles): stamp-glob ;
|
||||
stamp-glob: /home/gd/gnu/libc/posix/glob.tar
|
||||
-rm -f $(globfiles)
|
||||
-rm -f stamp-glob glob/*
|
||||
tar xvf $< glob
|
||||
cvs commit -m'Updated from libc' glob
|
||||
touch $@
|
||||
@@ -223,7 +224,7 @@ tarfiles: $(tarfiles)
|
||||
distfiles=README INSTALL COPYING ChangeLog NEWS \
|
||||
configure Makefile.in configure.in build.sh.in mkinstalldirs \
|
||||
configh.dos configure.bat \
|
||||
acconfig.h $(srcs) remote-*.c $(globfiles) \
|
||||
aclocal.m4 acconfig.h $(srcs) remote-*.c $(globfiles) \
|
||||
make.texinfo make-stds.texi \
|
||||
make.?? make.??s make.toc make.aux make.man texinfo.tex TAGS tags \
|
||||
install-sh \
|
||||
|
||||
181
INSTALL
Normal file
181
INSTALL
Normal file
@@ -0,0 +1,181 @@
|
||||
Basic Installation
|
||||
==================
|
||||
|
||||
These are generic installation instructions.
|
||||
|
||||
The `configure' shell script attempts to guess correct values for
|
||||
various system-dependent variables used during compilation. It uses
|
||||
those values to create a `Makefile' in each directory of the package.
|
||||
It may also create one or more `.h' files containing system-dependent
|
||||
definitions. Finally, it creates a shell script `config.status' that
|
||||
you can run in the future to recreate the current configuration, a file
|
||||
`config.cache' that saves the results of its tests to speed up
|
||||
reconfiguring, and a file `config.log' containing compiler output
|
||||
(useful mainly for debugging `configure').
|
||||
|
||||
If you need to do unusual things to compile the package, please try
|
||||
to figure out how `configure' could check whether to do them, and mail
|
||||
diffs or instructions to the address given in the `README' so they can
|
||||
be considered for the next release. If at some point `config.cache'
|
||||
contains results you don't want to keep, you may remove or edit it.
|
||||
|
||||
The file `configure.in' is used to create `configure' by a program
|
||||
called `autoconf'. You only need `configure.in' if you want to change
|
||||
it or regenerate `configure' using a newer version of `autoconf'.
|
||||
|
||||
The simplest way to compile this package is:
|
||||
|
||||
1. `cd' to the directory containing the package's source code and type
|
||||
`./configure' to configure the package for your system. If you're
|
||||
using `csh' on an old version of System V, you might need to type
|
||||
`sh ./configure' instead to prevent `csh' from trying to execute
|
||||
`configure' itself.
|
||||
|
||||
Running `configure' takes awhile. While running, it prints some
|
||||
messages telling which features it is checking for.
|
||||
|
||||
2. Type `make' to compile the package.
|
||||
|
||||
3. Optionally, type `make check' to run any self-tests that come with
|
||||
the package.
|
||||
|
||||
4. Type `make install' to install the programs and any data files and
|
||||
documentation.
|
||||
|
||||
5. You can remove the program binaries and object files from the
|
||||
source code directory by typing `make clean'. To also remove the
|
||||
files that `configure' created (so you can compile the package for
|
||||
a different kind of computer), type `make distclean'. There is
|
||||
also a `make maintainer-clean' target, but that is intended mainly
|
||||
for the package's developers. If you use it, you may have to get
|
||||
all sorts of other programs in order to regenerate files that came
|
||||
with the distribution.
|
||||
|
||||
Compilers and Options
|
||||
=====================
|
||||
|
||||
Some systems require unusual options for compilation or linking that
|
||||
the `configure' script does not know about. You can give `configure'
|
||||
initial values for variables by setting them in the environment. Using
|
||||
a Bourne-compatible shell, you can do that on the command line like
|
||||
this:
|
||||
CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure
|
||||
|
||||
Or on systems that have the `env' program, you can do it like this:
|
||||
env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure
|
||||
|
||||
Compiling For Multiple Architectures
|
||||
====================================
|
||||
|
||||
You can compile the package for more than one kind of computer at the
|
||||
same time, by placing the object files for each architecture in their
|
||||
own directory. To do this, you must use a version of `make' that
|
||||
supports the `VPATH' variable, such as GNU `make'. `cd' to the
|
||||
directory where you want the object files and executables to go and run
|
||||
the `configure' script. `configure' automatically checks for the
|
||||
source code in the directory that `configure' is in and in `..'.
|
||||
|
||||
If you have to use a `make' that does not supports the `VPATH'
|
||||
variable, you have to compile the package for one architecture at a time
|
||||
in the source code directory. After you have installed the package for
|
||||
one architecture, use `make distclean' before reconfiguring for another
|
||||
architecture.
|
||||
|
||||
Installation Names
|
||||
==================
|
||||
|
||||
By default, `make install' will install the package's files in
|
||||
`/usr/local/bin', `/usr/local/man', etc. You can specify an
|
||||
installation prefix other than `/usr/local' by giving `configure' the
|
||||
option `--prefix=PATH'.
|
||||
|
||||
You can specify separate installation prefixes for
|
||||
architecture-specific files and architecture-independent files. If you
|
||||
give `configure' the option `--exec-prefix=PATH', the package will use
|
||||
PATH as the prefix for installing programs and libraries.
|
||||
Documentation and other data files will still use the regular prefix.
|
||||
|
||||
In addition, if you use an unusual directory layout you can give
|
||||
options like `--bindir=PATH' to specify different values for particular
|
||||
kinds of files. Run `configure --help' for a list of the directories
|
||||
you can set and what kinds of files go in them.
|
||||
|
||||
If the package supports it, you can cause programs to be installed
|
||||
with an extra prefix or suffix on their names by giving `configure' the
|
||||
option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
|
||||
|
||||
Optional Features
|
||||
=================
|
||||
|
||||
Some packages pay attention to `--enable-FEATURE' options to
|
||||
`configure', where FEATURE indicates an optional part of the package.
|
||||
They may also pay attention to `--with-PACKAGE' options, where PACKAGE
|
||||
is something like `gnu-as' or `x' (for the X Window System). The
|
||||
`README' should mention any `--enable-' and `--with-' options that the
|
||||
package recognizes.
|
||||
|
||||
For packages that use the X Window System, `configure' can usually
|
||||
find the X include and library files automatically, but if it doesn't,
|
||||
you can use the `configure' options `--x-includes=DIR' and
|
||||
`--x-libraries=DIR' to specify their locations.
|
||||
|
||||
Specifying the System Type
|
||||
==========================
|
||||
|
||||
There may be some features `configure' can not figure out
|
||||
automatically, but needs to determine by the type of host the package
|
||||
will run on. Usually `configure' can figure that out, but if it prints
|
||||
a message saying it can not guess the host type, give it the
|
||||
`--host=TYPE' option. TYPE can either be a short name for the system
|
||||
type, such as `sun4', or a canonical name with three fields:
|
||||
CPU-COMPANY-SYSTEM
|
||||
|
||||
See the file `config.sub' for the possible values of each field. If
|
||||
`config.sub' isn't included in this package, then this package doesn't
|
||||
need to know the host type.
|
||||
|
||||
If you are building compiler tools for cross-compiling, you can also
|
||||
use the `--target=TYPE' option to select the type of system they will
|
||||
produce code for and the `--build=TYPE' option to select the type of
|
||||
system on which you are compiling the package.
|
||||
|
||||
Sharing Defaults
|
||||
================
|
||||
|
||||
If you want to set default values for `configure' scripts to share,
|
||||
you can create a site shell script called `config.site' that gives
|
||||
default values for variables like `CC', `cache_file', and `prefix'.
|
||||
`configure' looks for `PREFIX/share/config.site' if it exists, then
|
||||
`PREFIX/etc/config.site' if it exists. Or, you can set the
|
||||
`CONFIG_SITE' environment variable to the location of the site script.
|
||||
A warning: not all `configure' scripts look for a site script.
|
||||
|
||||
Operation Controls
|
||||
==================
|
||||
|
||||
`configure' recognizes the following options to control how it
|
||||
operates.
|
||||
|
||||
`--cache-file=FILE'
|
||||
Use and save the results of the tests in FILE instead of
|
||||
`./config.cache'. Set FILE to `/dev/null' to disable caching, for
|
||||
debugging `configure'.
|
||||
|
||||
`--help'
|
||||
Print a summary of the options to `configure', and exit.
|
||||
|
||||
`--quiet'
|
||||
`--silent'
|
||||
`-q'
|
||||
Do not print messages saying which checks are being made.
|
||||
|
||||
`--srcdir=DIR'
|
||||
Look for the package's source code in directory DIR. Usually
|
||||
`configure' can determine that directory automatically.
|
||||
|
||||
`--version'
|
||||
Print the version of Autoconf used to generate the `configure'
|
||||
script, and exit.
|
||||
|
||||
`configure' also accepts some other, not widely useful, options.
|
||||
|
||||
@@ -216,6 +216,7 @@ $(infodir)/make.info: make.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
|
||||
|
||||
@@ -281,10 +282,10 @@ $(objs): config.h
|
||||
# Automatically generated dependencies will be put at the end of the file.
|
||||
|
||||
# Automatically generated dependencies.
|
||||
commands.o : commands.c make.h dep.h commands.h file.h variable.h job.h
|
||||
commands.o: commands.c make.h dep.h commands.h file.h variable.h job.h
|
||||
job.o: job.c make.h commands.h job.h file.h variable.h
|
||||
dir.o: dir.c make.h
|
||||
file.o : file.c make.h commands.h dep.h file.h variable.h
|
||||
file.o: file.c make.h commands.h dep.h file.h variable.h
|
||||
misc.o: misc.c make.h dep.h
|
||||
main.o: main.c make.h commands.h dep.h file.h variable.h job.h getopt.h
|
||||
read.o: read.c make.h commands.h dep.h file.h variable.h glob/glob.h
|
||||
@@ -294,8 +295,8 @@ 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
|
||||
function.o: function.c make.h variable.h dep.h commands.h job.h
|
||||
vpath.o: vpath.c make.h file.h variable.h
|
||||
version.o: version.c
|
||||
ar.o : ar.c make.h file.h dep.h
|
||||
arscan.o: arscan.c make.h
|
||||
|
||||
11
NEWS
11
NEWS
@@ -1,17 +1,22 @@
|
||||
GNU make NEWS -- history of user-visible changes. 26 January 1995
|
||||
GNU make NEWS -- history of user-visible changes. 11 December 1995
|
||||
|
||||
Copyright (C) 1992, 1993, 1994, 1995 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.
|
||||
|
||||
Version 3.73
|
||||
|
||||
* Converted to use Autoconf version 2, so `configure' has some new options.
|
||||
See INSTALL for details.
|
||||
|
||||
* You can now send a SIGUSR1 signal to Make to toggle printing of debugging
|
||||
output enable by -d, at any time during the run.
|
||||
output enabled by -d, at any time during the run.
|
||||
|
||||
Version 3.72
|
||||
|
||||
@@ -222,7 +227,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.
|
||||
|
||||
6
README
6
README
@@ -1,4 +1,4 @@
|
||||
This directory contains the 3.73 test release of GNU Make.
|
||||
This directory contains the 3.74.2 test release of GNU Make.
|
||||
All bugs reported for previous test releases have been fixed.
|
||||
Some bugs surely remain.
|
||||
|
||||
@@ -10,6 +10,10 @@ build the program, type `sh build.sh'. This should compile the program
|
||||
in the current directory. Then you will have a Make program that you can
|
||||
use for `make install', or whatever else.
|
||||
|
||||
Some systems' Make programs are broken and cannot process the Makefile for
|
||||
GNU Make. If you get errors from your system's Make when building GNU
|
||||
Make, try using `build.sh' instead.
|
||||
|
||||
It has been reported that the XLC 1.2 compiler on AIX 3.2 is buggy such
|
||||
that if you compile make with `cc -O' on AIX 3.2, it will not work correctly.
|
||||
It is said that using `cc' without `-O' does work.
|
||||
|
||||
@@ -10,6 +10,10 @@ build the program, type `sh build.sh'. This should compile the program
|
||||
in the current directory. Then you will have a Make program that you can
|
||||
use for `make install', or whatever else.
|
||||
|
||||
Some systems' Make programs are broken and cannot process the Makefile for
|
||||
GNU Make. If you get errors from your system's Make when building GNU
|
||||
Make, try using `build.sh' instead.
|
||||
|
||||
It has been reported that the XLC 1.2 compiler on AIX 3.2 is buggy such
|
||||
that if you compile make with `cc -O' on AIX 3.2, it will not work correctly.
|
||||
It is said that using `cc' without `-O' does work.
|
||||
|
||||
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);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Command processing for GNU Make.
|
||||
Copyright (C) 1988, 1989, 1991, 1992, 1993, 1994 Free Software Foundation, Inc.
|
||||
Copyright (C) 1988, 89, 91, 92, 93, 94, 95 Free Software Foundation, Inc.
|
||||
This file is part of GNU Make.
|
||||
|
||||
GNU Make is free software; you can redistribute it and/or modify
|
||||
@@ -451,7 +451,7 @@ delete_target (file, on_behalf_of)
|
||||
}
|
||||
#endif
|
||||
|
||||
if (safe_stat (file->name, &st) == 0
|
||||
if (stat (file->name, &st) == 0
|
||||
&& S_ISREG (st.st_mode)
|
||||
&& (time_t) st.st_mtime != file->last_mtime)
|
||||
{
|
||||
@@ -459,11 +459,12 @@ delete_target (file, on_behalf_of)
|
||||
error ("*** [%s] Deleting file `%s'", on_behalf_of, file->name);
|
||||
else
|
||||
error ("*** Deleting file `%s'", file->name);
|
||||
if (unlink (file->name) < 0)
|
||||
if (unlink (file->name) < 0
|
||||
&& errno != ENOENT) /* It disappeared; so what. */
|
||||
perror_with_name ("unlink: ", file->name);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* Delete all non-precious targets of CHILD unless they were already deleted.
|
||||
Set the flag in CHILD to say they've been deleted. */
|
||||
|
||||
@@ -216,6 +216,7 @@ $(infodir)/make.info: make.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
|
||||
|
||||
|
||||
@@ -182,9 +182,6 @@
|
||||
/* Define if you have the getcwd function. */
|
||||
#undef HAVE_GETCWD
|
||||
|
||||
/* Define if you have the getdtablesize function. */
|
||||
#undef HAVE_GETDTABLESIZE
|
||||
|
||||
/* Define if you have the getgroups function. */
|
||||
#undef HAVE_GETGROUPS
|
||||
|
||||
|
||||
13
configure.in
13
configure.in
@@ -38,7 +38,7 @@ changequote([,])dnl
|
||||
fi
|
||||
AC_MSG_RESULT($ac_cv_check_symbol_$1)])dnl
|
||||
|
||||
AC_CHECK_FUNCS(getdtablesize psignal mktemp \
|
||||
AC_CHECK_FUNCS(psignal mktemp \
|
||||
dup2 getcwd sigsetmask getgroups setlinebuf \
|
||||
seteuid setegid setreuid setregid strerror strsignal)
|
||||
AC_CHECK_SYMBOL(sys_siglist)
|
||||
@@ -49,17 +49,6 @@ AC_FUNC_SETVBUF_REVERSED
|
||||
AC_FUNC_GETLOADAVG
|
||||
AC_FUNC_STRCOLL
|
||||
|
||||
if test $ac_cv_func_getdtablesize = no; then
|
||||
AC_MSG_CHECKING(for sysconf (_SC_OPEN_MAX))
|
||||
AC_CACHE_VAL(make_cv_sysconf_open_max, [dnl
|
||||
AC_TRY_LINK([#include <unistd.h>], [int max = sysconf (_SC_OPEN_MAX);],
|
||||
[make_cv_sysconf_open_max=yes], [make_cv_sysconf_open_max=no])])
|
||||
if test $make_cv_sysconf_open_max = yes; then
|
||||
AC_DEFINE(HAVE_SYSCONF_OPEN_MAX)
|
||||
fi
|
||||
AC_MSG_RESULT($make_cv_sysconf_open_max)
|
||||
fi
|
||||
|
||||
# Check out the wait reality.
|
||||
AC_CHECK_HEADERS(sys/wait.h) AC_CHECK_FUNCS(waitpid wait3)
|
||||
AC_MSG_CHECKING(for union wait)
|
||||
|
||||
22
default.c
22
default.c
@@ -101,24 +101,16 @@ static char *default_suffix_rules[] =
|
||||
".mod",
|
||||
"$(COMPILE.mod) -o $@ -e $@ $^",
|
||||
|
||||
".def.sym",
|
||||
".def.sym",
|
||||
"$(COMPILE.def) -o $@ $<",
|
||||
|
||||
".sh",
|
||||
"cat $< >$@ \n chmod a+x $@",
|
||||
|
||||
".s.o",
|
||||
#if !defined(M_XENIX) || defined(__GNUC__)
|
||||
"$(COMPILE.s) -o $@ $<",
|
||||
#else /* Xenix. */
|
||||
"$(COMPILE.s) -o$@ $<",
|
||||
#endif /* Not Xenix. */
|
||||
".S.o",
|
||||
#if !defined(M_XENIX) || defined(__GNUC__)
|
||||
"$(COMPILE.S) -o $@ $<",
|
||||
#else /* Xenix. */
|
||||
"$(COMPILE.S) -o$@ $<",
|
||||
#endif /* Not Xenix. */
|
||||
".c.o",
|
||||
"$(COMPILE.c) $< $(OUTPUT_OPTION)",
|
||||
".cc.o",
|
||||
@@ -305,21 +297,13 @@ static char *default_variables[] =
|
||||
"COMPILE.s", "$(AS) $(ASFLAGS) $(TARGET_MACH)",
|
||||
"LINK.S", "$(CC) $(ASFLAGS) $(CPPFLAGS) $(LDFLAGS) $(TARGET_MACH)",
|
||||
"COMPILE.S", "$(CC) $(ASFLAGS) $(CPPFLAGS) $(TARGET_MACH) -c",
|
||||
#if !defined(M_XENIX) || defined(__GNUC__)
|
||||
"PREPROCESS.S", "$(CC) -E $(CPPFLAGS)",
|
||||
#else /* Xenix. */
|
||||
"PREPROCESS.S", "$(CC) -EP $(CPPFLAGS)",
|
||||
#endif /* Not Xenix. */
|
||||
"PREPROCESS.F", "$(FC) $(FFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -F",
|
||||
"PREPROCESS.r", "$(FC) $(FFLAGS) $(RFLAGS) $(TARGET_ARCH) -F",
|
||||
"LINT.c", "$(LINT) $(LINTFLAGS) $(CPPFLAGS) $(TARGET_ARCH)",
|
||||
|
||||
#ifndef NO_MINUS_C_MINUS_O
|
||||
#if !defined(M_XENIX) || defined(__GNUC__)
|
||||
"OUTPUT_OPTION", "-o $@",
|
||||
#else /* Xenix. */
|
||||
"OUTPUT_OPTION", "-Fo$@",
|
||||
#endif /* Not Xenix. */
|
||||
#endif
|
||||
|
||||
#ifdef SCCS_GET_MINUS_G
|
||||
@@ -357,7 +341,7 @@ void
|
||||
install_default_suffix_rules ()
|
||||
{
|
||||
register char **s;
|
||||
|
||||
|
||||
if (no_builtin_rules_flag)
|
||||
return;
|
||||
|
||||
@@ -382,7 +366,7 @@ void
|
||||
install_default_implicit_rules ()
|
||||
{
|
||||
register struct pspec *p;
|
||||
|
||||
|
||||
if (no_builtin_rules_flag)
|
||||
return;
|
||||
|
||||
|
||||
68
dir.c
68
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 Free Software Foundation, Inc.
|
||||
This file is part of GNU Make.
|
||||
|
||||
GNU Make is free software; you can redistribute it and/or modify
|
||||
@@ -20,14 +20,12 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||
|
||||
#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. */
|
||||
#if defined (__GNU_LIBRARY__) && __GNU_LIBRARY__ > 1
|
||||
#define HAVE_D_NAMLEN
|
||||
#endif /* GNU C library. */
|
||||
#else /* Not POSIX or HAVE_DIRENT_H. */
|
||||
#define direct dirent
|
||||
#define D_NAMLEN(d) ((d)->d_namlen)
|
||||
#define HAVE_D_NAMLEN
|
||||
#ifdef HAVE_SYS_NDIR_H
|
||||
#include <sys/ndir.h>
|
||||
#endif /* HAVE_SYS_NDIR_H */
|
||||
@@ -43,8 +41,10 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||
/* Posix does not require that the d_ino field be present, and some
|
||||
systems do not provide it. */
|
||||
#define REAL_DIR_ENTRY(dp) 1
|
||||
#define FAKE_DIR_ENTRY(dp)
|
||||
#else
|
||||
#define REAL_DIR_ENTRY(dp) (dp->d_ino != 0)
|
||||
#define FAKE_DIR_ENTRY(dp) (dp->d_ino = 1)
|
||||
#endif /* POSIX */
|
||||
|
||||
#ifdef __MSDOS__
|
||||
@@ -179,7 +179,7 @@ find_directory (name)
|
||||
/* The directory is not in the name hash table.
|
||||
Find its device and inode numbers, and look it up by them. */
|
||||
|
||||
if (safe_stat (name, &st) < 0)
|
||||
if (stat (name, &st) < 0)
|
||||
/* Couldn't stat the directory. Mark this by
|
||||
setting the `contents' member to a nil pointer. */
|
||||
dir->contents = 0;
|
||||
@@ -295,9 +295,13 @@ dir_contents_file_exists_p (dir, filename)
|
||||
if (!REAL_DIR_ENTRY (d))
|
||||
continue;
|
||||
|
||||
len = D_NAMLEN (d);
|
||||
#ifdef HAVE_D_NAMLEN
|
||||
len = d->d_namlen;
|
||||
while (d->d_name[len - 1] == '\0')
|
||||
--len;
|
||||
#else
|
||||
len = strlen (d->d_name);
|
||||
#endif
|
||||
|
||||
for (i = 0; i < len; ++i)
|
||||
HASH (newhash, d->d_name[i]);
|
||||
@@ -444,7 +448,7 @@ file_impossible_p (filename)
|
||||
bcopy (p, dirname, dirend - p);
|
||||
dirname[dirend - p] = '\0';
|
||||
dir = find_directory (dirname)->contents;
|
||||
p = dirend + 1;
|
||||
p = filename = dirend + 1;
|
||||
}
|
||||
|
||||
if (dir == 0 || dir->files == 0)
|
||||
@@ -557,7 +561,7 @@ struct dirstream
|
||||
|
||||
/* Forward declarations. */
|
||||
static __ptr_t open_dirstream __P ((const char *));
|
||||
static const char *read_dirstream __P ((__ptr_t));
|
||||
static struct dirent *read_dirstream __P ((__ptr_t));
|
||||
|
||||
static __ptr_t
|
||||
open_dirstream (directory)
|
||||
@@ -584,12 +588,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 +603,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 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 +635,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. */
|
||||
}
|
||||
|
||||
17
file.c
17
file.c
@@ -1,5 +1,5 @@
|
||||
/* Target file hash table management 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, 1995 Free Software Foundation, Inc.
|
||||
This file is part of GNU Make.
|
||||
|
||||
GNU Make is free software; you can redistribute it and/or modify
|
||||
@@ -21,6 +21,7 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||
#include "dep.h"
|
||||
#include "file.h"
|
||||
#include "variable.h"
|
||||
#include <assert.h>
|
||||
|
||||
|
||||
/* Hash table of files the makefile knows how to make. */
|
||||
@@ -294,7 +295,9 @@ remove_intermediates (sig)
|
||||
register struct file *f;
|
||||
char doneany;
|
||||
|
||||
if (!sig && just_print_flag)
|
||||
if (question_flag || touch_flag)
|
||||
return;
|
||||
if (sig && just_print_flag)
|
||||
return;
|
||||
|
||||
doneany = 0;
|
||||
@@ -303,7 +306,11 @@ remove_intermediates (sig)
|
||||
if (f->intermediate && (f->dontcare || !f->precious))
|
||||
{
|
||||
int status;
|
||||
if (just_print_flag)
|
||||
if (f->update_status == -1)
|
||||
/* If nothing would have created this file yet,
|
||||
don't print an "rm" command for it. */
|
||||
continue;
|
||||
else if (just_print_flag)
|
||||
status = 0;
|
||||
else
|
||||
{
|
||||
@@ -491,6 +498,10 @@ print_file (f)
|
||||
puts ("# Successfully updated.");
|
||||
break;
|
||||
case 1:
|
||||
assert (question_flag);
|
||||
puts ("# Needs to be updated (-q is set).");
|
||||
break;
|
||||
case 2:
|
||||
puts ("# Failed to be updated.");
|
||||
break;
|
||||
default:
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Variable function expansion for GNU Make.
|
||||
Copyright (C) 1988, 1989, 1991, 1992, 1993, 1994 Free Software Foundation, Inc.
|
||||
Copyright (C) 1988, 89, 91, 92, 93, 94, 95 Free Software Foundation, Inc.
|
||||
This file is part of GNU Make.
|
||||
|
||||
GNU Make is free software; you can redistribute it and/or modify
|
||||
@@ -24,6 +24,7 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||
|
||||
#ifdef __MSDOS__
|
||||
#include <process.h>
|
||||
#include <fcntl.h>
|
||||
#endif
|
||||
|
||||
static char *string_glob ();
|
||||
|
||||
68
getloadavg.c
68
getloadavg.c
@@ -38,6 +38,7 @@
|
||||
|
||||
apollo
|
||||
BSD Real BSD, not just BSD-like.
|
||||
convex
|
||||
DGUX
|
||||
eunice UNIX emulator under VMS.
|
||||
hpux
|
||||
@@ -210,6 +211,17 @@ extern int errno;
|
||||
#define LOAD_AVE_TYPE long
|
||||
#endif
|
||||
|
||||
#ifdef _AIX
|
||||
#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
|
||||
@@ -254,6 +266,10 @@ extern int errno;
|
||||
#define FSCALE 100.0
|
||||
#endif
|
||||
|
||||
#ifdef _AIX
|
||||
#define FSCALE 65536.0
|
||||
#endif
|
||||
|
||||
#endif /* Not FSCALE. */
|
||||
|
||||
#if !defined (LDAV_CVT) && defined (FSCALE)
|
||||
@@ -315,6 +331,10 @@ extern int errno;
|
||||
#define NLIST_STRUCT
|
||||
#endif
|
||||
|
||||
#ifdef _AIX
|
||||
#define NLIST_STRUCT
|
||||
#endif
|
||||
|
||||
#endif /* defined (NLIST_STRUCT) */
|
||||
|
||||
|
||||
@@ -340,7 +360,7 @@ extern int errno;
|
||||
#define LDAV_SYMBOL "_Loadavg"
|
||||
#endif
|
||||
|
||||
#if !defined(LDAV_SYMBOL) && ((defined(hpux) && !defined(hp9000s300)) || defined(_SEQUENT_) || defined(SVR4) || defined(ISC) || defined(sgi) || (defined (ardent) && defined (titan)))
|
||||
#if !defined(LDAV_SYMBOL) && ((defined(hpux) && !defined(hp9000s300)) || defined(_SEQUENT_) || defined(SVR4) || defined(ISC) || defined(sgi) || (defined (ardent) && defined (titan)) || defined (_AIX))
|
||||
#define LDAV_SYMBOL "avenrun"
|
||||
#endif
|
||||
|
||||
@@ -790,23 +810,29 @@ getloadavg (loadavg, nelem)
|
||||
#endif /* NLIST_STRUCT */
|
||||
|
||||
#ifndef SUNOS_5
|
||||
if (nlist (KERNEL_FILE, nl) >= 0)
|
||||
/* Omit "&& nl[0].n_type != 0 " -- it breaks on Sun386i. */
|
||||
{
|
||||
#ifdef FIXUP_KERNEL_SYMBOL_ADDR
|
||||
FIXUP_KERNEL_SYMBOL_ADDR (nl);
|
||||
if (
|
||||
#if !(defined (_AIX) && !defined (ps2))
|
||||
nlist (KERNEL_FILE, nl)
|
||||
#else /* _AIX */
|
||||
knlist (nl, 1, sizeof (nl[0]))
|
||||
#endif
|
||||
offset = nl[0].n_value;
|
||||
}
|
||||
#endif /* !SUNOS_5 */
|
||||
#else /* sgi */
|
||||
int ldav_off;
|
||||
>= 0)
|
||||
/* Omit "&& nl[0].n_type != 0 " -- it breaks on Sun386i. */
|
||||
{
|
||||
#ifdef FIXUP_KERNEL_SYMBOL_ADDR
|
||||
FIXUP_KERNEL_SYMBOL_ADDR (nl);
|
||||
#endif
|
||||
offset = nl[0].n_value;
|
||||
}
|
||||
#endif /* !SUNOS_5 */
|
||||
#else /* sgi */
|
||||
int ldav_off;
|
||||
|
||||
ldav_off = sysmp (MP_KERNADDR, MPKA_AVENRUN);
|
||||
if (ldav_off != -1)
|
||||
offset = (long) ldav_off & 0x7fffffff;
|
||||
ldav_off = sysmp (MP_KERNADDR, MPKA_AVENRUN);
|
||||
if (ldav_off != -1)
|
||||
offset = (long) ldav_off & 0x7fffffff;
|
||||
#endif /* sgi */
|
||||
}
|
||||
}
|
||||
|
||||
/* Make sure we have /dev/kmem open. */
|
||||
if (!getloadavg_initialized)
|
||||
@@ -814,7 +840,17 @@ getloadavg (loadavg, nelem)
|
||||
#ifndef SUNOS_5
|
||||
channel = open ("/dev/kmem", 0);
|
||||
if (channel >= 0)
|
||||
getloadavg_initialized = 1;
|
||||
{
|
||||
/* Set the channel to close on exec, so it does not
|
||||
litter any child's descriptor table. */
|
||||
#ifdef FD_SETFD
|
||||
#ifndef FD_CLOEXEC
|
||||
#define FD_CLOEXEC 1
|
||||
#endif
|
||||
(void) fcntl (channel, F_SETFD, FD_CLOEXEC);
|
||||
#endif
|
||||
getloadavg_initialized = 1;
|
||||
}
|
||||
#else /* SUNOS_5 */
|
||||
/* We pass 0 for the kernel, corefile, and swapfile names
|
||||
to use the currently running kernel. */
|
||||
|
||||
318
glob/ChangeLog
318
glob/ChangeLog
@@ -1,3 +1,51 @@
|
||||
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.
|
||||
|
||||
Tue Apr 25 17:17:19 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
|
||||
|
||||
* posix/glob.c (glob): If GLOB_MARK set, stat names to find
|
||||
directories and append slashes to them in final pass before
|
||||
sorting.
|
||||
(glob_in_dir): If GLOB_MARK set, just allocate the extra char for the
|
||||
slash; never append it here.
|
||||
|
||||
Wed Mar 8 13:38:13 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
|
||||
|
||||
* posix/glob/configure.bat: Fixes from DJ.
|
||||
@@ -43,273 +91,3 @@ Sun Jan 15 06:56:47 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
|
||||
|
||||
* posix/glob/configure.in: Add AC_CONST check.
|
||||
|
||||
Wed Dec 7 14:05:12 1994 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
|
||||
|
||||
* posix/glob/Makefile.in (realclean): Remove config.status.
|
||||
|
||||
* posix/glob/Makefile.in (DEFS): New variable, set from @DEFS@.
|
||||
(CPPFLAGS): Remove @DEFS@ from here.
|
||||
(.c.o): Use $(DEFS).
|
||||
|
||||
Tue Dec 6 19:04:50 1994 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
|
||||
|
||||
* posix/glob/Makefile.in (CPPFLAGS): Include @DEFS@.
|
||||
|
||||
Mon Dec 5 12:05:10 1994 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
|
||||
|
||||
* posix/glob/configure.in: Add AC_PROG_CC.
|
||||
|
||||
Mon Nov 7 00:38:45 1994 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
|
||||
|
||||
* posix/glob/configure.in: Converted to Autoconf v2.
|
||||
* posix/glob.c: Test HAVE_DIRENT_H, HAVE_SYS_DIR_H, HAVE_NDIR_H
|
||||
instead of DIRENT, SYSDIR, NDIR.
|
||||
* posix/glob/Makefile.in (CC): New variable, set from @CC@.
|
||||
(CPPFLAGS): Set from @CPPFLAGS@, not @DEFS@.
|
||||
|
||||
Sun Oct 09 01:19:38 1994 Jim Meyering (meyering@comco.com)
|
||||
|
||||
* posix/fnmatch.c: Remove CONFIG_BROKETS conditional.
|
||||
|
||||
Sun Oct 2 18:35:16 1994 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
|
||||
|
||||
* posix/glob.h (__P): Change arg name to `protos', for congruence
|
||||
with 4.4 BSD.
|
||||
* posix/fnmatch.h (__P): Likewise.
|
||||
|
||||
Tue Sep 6 19:06:00 1994 Roland McGrath <roland@geech.gnu.ai.mit.edu>
|
||||
|
||||
* posix/glob.c (prefix_array, glob): Avoid const on initialized
|
||||
variables. Some compiler generates bad code.
|
||||
|
||||
Mon Jul 25 17:17:28 1994 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
|
||||
|
||||
* posix/glob/configure.bat: New file.
|
||||
* posix/Makefile (glob.tar): Add glob/configure.bat.
|
||||
|
||||
Tue Dec 14 13:08:35 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
|
||||
|
||||
* posix/fnmatch.h: #undef FNM_PATHNAME, FNM_NOESCAPE, and
|
||||
FNM_PERIOD before defining them.
|
||||
|
||||
Mon Oct 18 04:22:42 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
|
||||
|
||||
* posix/glob/configure.in: Use AC_HAVE_HEADERS instead of
|
||||
AC_MEMORY_H and AC_UNISTD_H; omit AC_USG (not needed).
|
||||
|
||||
Sun Oct 10 14:31:35 1993 Jim Meyering (meyering@comco.com)
|
||||
|
||||
* posix/fnmatch.c [CONFIG_BROKETS]: Include <config.h> only under
|
||||
this condition, else "config.h".
|
||||
|
||||
Wed May 12 16:24:23 1993 Roland McGrath (roland@geech.gnu.ai.mit.edu)
|
||||
|
||||
* posix/glob.c: Move include <unistd.h> before dir includes.
|
||||
[HAVE_UNISTD_H] [! POSIX] [_POSIX_SOURCE]: Define POSIX.
|
||||
|
||||
Thu Apr 22 17:40:28 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
|
||||
|
||||
* posix/glob/Makefile.in (.c.o): Put $(CFLAGS) last.
|
||||
(glob.o): Depend on glob.c.
|
||||
(fnmatch.o): Depend on fnmatch.c.
|
||||
|
||||
Fri Apr 16 12:24:21 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
|
||||
|
||||
* posix/glob.c, posix/fnmatch.c: Surround code with
|
||||
#if defined (_LIBC) || !defined (__GNU_LIBRARY__)
|
||||
|
||||
Wed Apr 14 12:49:10 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
|
||||
|
||||
* posix/glob.c [USG, NeXT]: Don't test these.
|
||||
[HAVE_STRING_H]: Test this to include string.h and define ANSI_STRING.
|
||||
[HAVE_MEMORY_H]: Test this instead of NEED_MEMORY_H.
|
||||
[! ANSI_STRING]: Put decls of bcopy and #define of memcpy et al here.
|
||||
|
||||
* posix/fnmatch.c [HAVE_CONFIG_H]: #include "config.h".
|
||||
|
||||
Mon Apr 12 16:34:53 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
|
||||
|
||||
* posix/glob.c: Rationalize directory header conditionals.
|
||||
|
||||
Sun Apr 11 18:53:50 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
|
||||
|
||||
* posix/fnmatch.h [__cplusplus || __STDC__]: Don't #define const.
|
||||
|
||||
Sun Mar 28 16:12:33 1993 Roland McGrath (roland@geech.gnu.ai.mit.edu)
|
||||
|
||||
* posix/fnmatch.c (case '*'): Before final loop, fold C1, rather
|
||||
than foling *P before it goes into C1. C might need folding instead.
|
||||
|
||||
Thu Mar 25 13:40:17 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
|
||||
|
||||
* posix/fnmatch.h [!_POSIX_C_SOURCE || ...]: Make this test
|
||||
_GNU_SOURCE, not _BSD_SOURCE; these are our extensions, not theirs.
|
||||
(FNM_CASEFOLD): New bit.
|
||||
(__FNM_FLAGS): Removed macro.
|
||||
* posix/fnmatch.c (fnmatch): Don't test for bogus flag bits; who cares?
|
||||
(FOLD): New macro to casefold a char if FNM_CASEFOLD.
|
||||
Use it to fold all chars before comparison.
|
||||
|
||||
Mon Mar 8 13:20:02 1993 Roland McGrath (roland@geech.gnu.ai.mit.edu)
|
||||
|
||||
* posix/glob/Makefile.in (VPATH): Set this to @srcdir@.
|
||||
(srcdir): Set this to $(VPATH).
|
||||
|
||||
* posix/glob.c (glob): In no matches with GLOB_NOCHECK set case,
|
||||
add NULL terminator to PGLOB->gl_pathv.
|
||||
(prefix_array): Renamed arg PREFIX to DIRNAME, local var PRELEN to
|
||||
DIRLEN. If DIRNAME is just "/", don't prepend it, so we get
|
||||
"/foo" instead of "//foo".
|
||||
(glob): Move qsort call outside of the else clause of the
|
||||
glob_pattern_p test; it should always be done.
|
||||
|
||||
Thu Jan 21 20:12:25 1993 Roland McGrath (roland@geech.gnu.ai.mit.edu)
|
||||
|
||||
* posix/glob.c: Put #includes of <glob.h> and <fnmatch.h> after
|
||||
all system includes, in case one of them has conflicting defns of
|
||||
FNM_* or GLOB_*, so we will redefine. #undef FNM_* and GLOB_*
|
||||
before including our headers.
|
||||
|
||||
Tue Jan 19 16:16:05 1993 Roland McGrath (roland@geech.gnu.ai.mit.edu)
|
||||
|
||||
* posix/glob.c (my_realloc): Cast result of malloc/realloc to (char *).
|
||||
|
||||
Thu Jan 14 13:52:43 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
|
||||
|
||||
* posix/glob/Makefile.in (realclean): Remove Makefile.
|
||||
|
||||
Mon Jan 4 17:05:44 1993 Roland McGrath (roland@geech.gnu.ai.mit.edu)
|
||||
|
||||
* posix/glob/Makefile.in (RANLIB): Define to @RANLIB@.
|
||||
(RANLIB_TEST): Removed.
|
||||
(libglob.a): Don't use it.
|
||||
|
||||
Mon Dec 28 15:50:31 1992 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
|
||||
|
||||
* posix/glob.c [HAVE_CONFIG_H]: Test this, not SHELL, to decide
|
||||
whether or not we want to #include "config.h".
|
||||
|
||||
Wed Nov 18 13:42:09 1992 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
|
||||
|
||||
* posix/fnmatch.h (FNM_LEADING_DIR): New flag.
|
||||
* posix/fnmatch.c (fnmatch): Support it.
|
||||
|
||||
Sun Oct 11 16:58:36 1992 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
|
||||
|
||||
* posix/glob.c (__glob_{open,read,close}dir_hook): New vars.
|
||||
(glob_in_dir): Use them.
|
||||
* posix/glob.h: Declare them.
|
||||
|
||||
Fri Sep 18 16:32:16 1992 Roland McGrath (roland@geech.gnu.ai.mit.edu)
|
||||
|
||||
* posix/glob/Makefile.in (AR, ARFLAGS): Define.
|
||||
(libglob.a): Use those vars instead of hardcoding.
|
||||
|
||||
Thu Aug 13 18:30:58 1992 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
|
||||
|
||||
* posix/glob.c: Always #include <sys/types.h>.
|
||||
[! USG]: Don't do it here.
|
||||
[STDC_HEADERS]: Test this instead of __STDC__ for size_t.
|
||||
[HAVE_STRCOLL]: Test this instead of ANSI_STRING for strcoll.
|
||||
|
||||
* posix/glob/Makefile.in (Makefile): Remove rule.
|
||||
|
||||
Tue Aug 11 15:01:50 1992 Roland McGrath (roland@geech.gnu.ai.mit.edu)
|
||||
|
||||
* posix/glob.c [_AIX]: Don't declare alloca.
|
||||
|
||||
Thu Jul 30 15:42:01 1992 Roland McGrath (roland@geech.gnu.ai.mit.edu)
|
||||
|
||||
* posix/glob/Makefile.in (Makefile): Depend on config.status; invoke
|
||||
it directly instead of using $(SHELL).
|
||||
|
||||
* posix/glob.c [! USG]: #include <sys/types.h> before <sys/dir.h>.
|
||||
|
||||
Sun Jul 26 17:03:31 1992 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
|
||||
|
||||
* posix/glob.c [_AIX]: #pragma alloca first thing.
|
||||
[ANSI_STRING]: Remove #define's for index et al.
|
||||
|
||||
Thu Jul 9 21:27:39 1992 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
|
||||
|
||||
* posix/glob.c [STDC_STRINGS]: Don't test this.
|
||||
[! ANSI_STRING]: Put memcpy, strrchr, memset defns here instead.
|
||||
|
||||
* posix/glob/Makefile.in (glob.o, fnmatch.o): / after $(srcdir).
|
||||
|
||||
Sat Jul 4 20:44:42 1992 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
|
||||
|
||||
* posix/glob/Makefile.in (glob.o, fnmatch.o): Put $(srcdir) on deps.
|
||||
|
||||
Wed Jul 1 00:13:40 1992 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
|
||||
|
||||
* posix/glob.c [! ANSI_STRING]: #define strcoll to strcmp.
|
||||
Remove extra decls of free, qsort, malloc, and realloc.
|
||||
|
||||
Wed Jun 24 19:09:04 1992 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
|
||||
|
||||
* posix/glob.c [DIRENT] (direct): Don't define to dirent.
|
||||
[! DIRENT] (direct): Define to dirent.
|
||||
|
||||
Wed Jun 17 17:58:05 1992 Roland McGrath (roland@geech.gnu.ai.mit.edu)
|
||||
|
||||
* posix/glob.c (my_realloc): Test only __GNU_LIBRARY__. Can't trust
|
||||
STDC_HEADERS.
|
||||
|
||||
Tue Jun 16 20:20:01 1992 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
|
||||
|
||||
* posix/glob/Makefile: Moved to posix/glob/Makefile.in.
|
||||
(VPATH, srcdir, CPPFLAGS): Define to be replaced by autoconf.
|
||||
|
||||
* posix/glob.c: Rearranged conditionals for use with autoconf.
|
||||
|
||||
Tue Jun 9 20:15:12 1992 Roland McGrath (roland@geech.gnu.ai.mit.edu)
|
||||
|
||||
* posix/glob/Makefile: Fixed copyright notice.
|
||||
(realclean): Don't remove ~ backup files.
|
||||
|
||||
Tue Jun 2 21:49:22 1992 Roland McGrath (roland@geech.gnu.ai.mit.edu)
|
||||
|
||||
* posix/glob.c (__ptr_t): Define.
|
||||
|
||||
Wed May 27 18:09:40 1992 Roland McGrath (roland@geech.gnu.ai.mit.edu)
|
||||
|
||||
* posix/fnmatch.h (FNM_FILE_NAME): Alias for FNM_PATHNAME.
|
||||
|
||||
Fri May 22 01:52:04 1992 Roland McGrath (roland@geech.gnu.ai.mit.edu)
|
||||
|
||||
* posix/glob.h, posix/fnmatch.h: Use explicit cruft for C++.
|
||||
Define __P and const for C++/ANSI vs old C ourselves, to avoid
|
||||
dependence on <sys/cdefs.h>.
|
||||
|
||||
Sun May 17 15:50:00 1992 Roland McGrath (roland@albert.gnu.ai.mit.edu)
|
||||
|
||||
* posix/glob.c (glob): Don't let us fall off the end without returning.
|
||||
|
||||
Thu May 14 01:45:12 1992 Roland McGrath (roland@geech.gnu.ai.mit.edu)
|
||||
|
||||
* posix/glob.h (GLOB_MAGCHAR): Check user feature-test macros,
|
||||
rather than __USE_BSD, so we don't depend on features.h.
|
||||
|
||||
* posix/glob.h [__USE_BSD] (GLOB_MAGCHAR): Declare.
|
||||
(glob_t): Added member `gl_flags'.
|
||||
* posix/glob.c (glob, glob_in_dir): Set gl_flags member to FLAGS;
|
||||
or in GLOB_MAGCHAR if any metachars are seen.
|
||||
|
||||
Thu Jan 16 18:43:05 1992 Roland McGrath (roland@albert.gnu.ai.mit.edu)
|
||||
|
||||
* posix/glob.c [sgi]: No alloca.h, after all.
|
||||
|
||||
Fri Oct 18 15:27:58 1991 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
|
||||
|
||||
* posix/glob.c [sgi]: Use <sys/dir.h>.
|
||||
|
||||
Tue Jul 23 14:11:29 1991 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
|
||||
|
||||
* posix/glob.c: Don't #include <stddef.h> #ifdef sun.
|
||||
Is there anyone on the face of the planet other than me capable of
|
||||
implementing the ANSI C standard to spec????
|
||||
|
||||
* posix/glob.c [DIRENT]: #include <sys/types.h> before <dirent.h>
|
||||
#ifdef USG.
|
||||
|
||||
|
||||
195
glob/glob.c
195
glob/glob.c
@@ -26,6 +26,7 @@ Cambridge, MA 02139, USA. */
|
||||
|
||||
#include <errno.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
|
||||
/* Comment out all this code if we are using the GNU C Library, and are not
|
||||
@@ -36,8 +37,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>
|
||||
@@ -52,6 +60,8 @@ Cambridge, MA 02139, USA. */
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include <pwd.h>
|
||||
|
||||
#if !defined(__GNU_LIBRARY__) && !defined(STDC_HEADERS)
|
||||
extern int errno;
|
||||
#endif
|
||||
@@ -96,6 +106,8 @@ extern int errno;
|
||||
#define ANSI_STRING
|
||||
#else /* No standard headers. */
|
||||
|
||||
extern char *getenv ();
|
||||
|
||||
#ifdef HAVE_STRING_H
|
||||
#include <string.h>
|
||||
#define ANSI_STRING
|
||||
@@ -173,6 +185,16 @@ extern char *alloca ();
|
||||
|
||||
#endif
|
||||
|
||||
#ifndef __GNU_LIBRARY__
|
||||
#define __stat stat
|
||||
#ifdef STAT_MACROS_BROKEN
|
||||
#undef S_ISDIR
|
||||
#endif
|
||||
#ifndef S_ISDIR
|
||||
#define S_ISDIR(mode) (((mode) & S_IFMT) == S_IFDIR)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef STDC_HEADERS
|
||||
#undef size_t
|
||||
#define size_t unsigned int
|
||||
@@ -197,10 +219,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,
|
||||
@@ -236,6 +254,56 @@ glob (pattern, flags, errfunc, pglob)
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (flags & GLOB_BRACE)
|
||||
{
|
||||
const char *begin = strchr (pattern, '{');
|
||||
if (begin != NULL)
|
||||
{
|
||||
const char *end = strchr (begin + 1, '}');
|
||||
if (end != NULL && end != begin + 1)
|
||||
{
|
||||
size_t restlen = strlen (end + 1) + 1;
|
||||
const char *p, *comma;
|
||||
char *buf;
|
||||
size_t bufsz = 0;
|
||||
int firstc;
|
||||
if (!(flags & GLOB_APPEND))
|
||||
{
|
||||
pglob->gl_pathc = 0;
|
||||
pglob->gl_pathv = NULL;
|
||||
}
|
||||
firstc = pglob->gl_pathc;
|
||||
for (p = begin + 1;; p = comma + 1)
|
||||
{
|
||||
int result;
|
||||
comma = strchr (p, ',');
|
||||
if (comma == NULL)
|
||||
comma = strchr (p, '\0');
|
||||
if ((begin - pattern) + (comma - p) + 1 > bufsz)
|
||||
{
|
||||
if (bufsz * 2 < comma - p + 1)
|
||||
bufsz *= 2;
|
||||
else
|
||||
bufsz = comma - p + 1;
|
||||
buf = __alloca (bufsz);
|
||||
}
|
||||
memcpy (buf, pattern, begin - pattern);
|
||||
memcpy (buf + (begin - pattern), p, comma - p);
|
||||
memcpy (buf + (begin - pattern) + (comma - p), end, restlen);
|
||||
result = glob (buf, (flags & ~(GLOB_NOCHECK|GLOB_NOMAGIC) |
|
||||
GLOB_APPEND), errfunc, pglob);
|
||||
if (result && result != GLOB_NOMATCH)
|
||||
return result;
|
||||
if (*comma == '\0')
|
||||
break;
|
||||
}
|
||||
if (pglob->gl_pathc == firstc &&
|
||||
!(flags & (GLOB_NOCHECK|GLOB_NOMAGIC)))
|
||||
return GLOB_NOMATCH;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Find the filename. */
|
||||
filename = strrchr (pattern, '/');
|
||||
if (filename == NULL)
|
||||
@@ -277,6 +345,35 @@ glob (pattern, flags, errfunc, pglob)
|
||||
|
||||
oldcount = pglob->gl_pathc;
|
||||
|
||||
if ((flags & GLOB_TILDE) && dirname[0] == '~')
|
||||
{
|
||||
if (dirname[1] == '\0')
|
||||
{
|
||||
/* Look up home directory. */
|
||||
dirname = getenv ("HOME");
|
||||
if (dirname == NULL || dirname[0] == '\0')
|
||||
{
|
||||
extern char *getlogin ();
|
||||
char *name = getlogin ();
|
||||
if (name != NULL)
|
||||
{
|
||||
struct passwd *p = getpwnam (name);
|
||||
if (p != NULL)
|
||||
dirname = p->pw_dir;
|
||||
}
|
||||
}
|
||||
if (dirname == NULL || dirname[0] == '\0')
|
||||
dirname = (char *) "~"; /* No luck. */
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Look up specific user's home directory. */
|
||||
struct passwd *p = getpwnam (dirname + 1);
|
||||
if (p != NULL)
|
||||
dirname = p->pw_dir;
|
||||
}
|
||||
}
|
||||
|
||||
if (glob_pattern_p (dirname, !(flags & GLOB_NOESCAPE)))
|
||||
{
|
||||
/* The directory name contains metacharacters, so we
|
||||
@@ -394,9 +491,32 @@ glob (pattern, flags, errfunc, pglob)
|
||||
}
|
||||
}
|
||||
|
||||
if (flags & GLOB_MARK)
|
||||
{
|
||||
/* Append slashes to directory names. */
|
||||
int i;
|
||||
struct stat st;
|
||||
for (i = oldcount; i < pglob->gl_pathc; ++i)
|
||||
if (((flags & GLOB_ALTDIRFUNC) ?
|
||||
(*pglob->gl_stat) (pglob->gl_pathv[i], &st) :
|
||||
__stat (pglob->gl_pathv[i], &st)) == 0 &&
|
||||
S_ISDIR (st.st_mode))
|
||||
{
|
||||
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))
|
||||
/* Sort the vector. */
|
||||
qsort ((__ptr_t) & pglob->gl_pathv[oldcount],
|
||||
qsort ((__ptr_t) &pglob->gl_pathv[oldcount],
|
||||
pglob->gl_pathc - oldcount,
|
||||
sizeof (char *), collated_compare);
|
||||
|
||||
@@ -546,8 +666,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)) ||
|
||||
@@ -559,29 +680,20 @@ glob_in_dir (pattern, directory, flags, errfunc, pglob)
|
||||
{
|
||||
const char *name;
|
||||
size_t len;
|
||||
|
||||
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;
|
||||
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;
|
||||
#ifdef HAVE_D_NAMLEN
|
||||
len = d->d_namlen;
|
||||
len = d->d_namlen;
|
||||
#else
|
||||
len = 0;
|
||||
len = 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
if (fnmatch (pattern, name,
|
||||
(!(flags & GLOB_PERIOD) ? FNM_PERIOD : 0) |
|
||||
((flags & GLOB_NOESCAPE) ? FNM_NOESCAPE : 0)) == 0)
|
||||
@@ -591,12 +703,10 @@ glob_in_dir (pattern, directory, flags, errfunc, pglob)
|
||||
if (len == 0)
|
||||
len = strlen (name);
|
||||
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);
|
||||
if (flags & GLOB_MARK)
|
||||
new->name[len++] = '/';
|
||||
new->name[len] = '\0';
|
||||
new->next = names;
|
||||
names = new;
|
||||
@@ -605,18 +715,20 @@ 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);
|
||||
nfound = 1;
|
||||
names = (struct globlink *) __alloca (sizeof (struct globlink));
|
||||
names->next = NULL;
|
||||
names->name = (char *) malloc (len + ((flags & GLOB_MARK) ? 1 : 0) + 1);
|
||||
names->name = (char *) malloc (len + 1);
|
||||
if (names->name == NULL)
|
||||
goto memory_error;
|
||||
memcpy (names->name, pattern, len);
|
||||
if (flags & GLOB_MARK)
|
||||
names->name[len++] = '/';
|
||||
names->name[len] = '\0';
|
||||
}
|
||||
|
||||
@@ -642,10 +754,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;
|
||||
@@ -653,10 +765,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)
|
||||
@@ -668,4 +780,5 @@ glob_in_dir (pattern, directory, flags, errfunc, pglob)
|
||||
return GLOB_NOSPACE;
|
||||
}
|
||||
|
||||
#endif /* _LIBC or not __GNU_LIBRARY__. */
|
||||
#endif /* Not ELIDE_CODE. */
|
||||
|
||||
|
||||
19
glob/glob.h
19
glob/glob.h
@@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 1991, 1992 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1991, 1992, 1995 Free Software Foundation, Inc.
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
@@ -47,10 +47,16 @@ extern "C"
|
||||
#define GLOB_NOESCAPE (1 << 6)/* Backslashes don't quote metacharacters. */
|
||||
#define GLOB_PERIOD (1 << 7)/* Leading `.' can be matched by metachars. */
|
||||
#define __GLOB_FLAGS (GLOB_ERR|GLOB_MARK|GLOB_NOSORT|GLOB_DOOFFS| \
|
||||
GLOB_NOESCAPE|GLOB_NOCHECK|GLOB_APPEND|GLOB_PERIOD)
|
||||
GLOB_NOESCAPE|GLOB_NOCHECK|GLOB_APPEND| \
|
||||
GLOB_PERIOD|GLOB_ALTDIRFUNC|GLOB_BRACE| \
|
||||
GLOB_NOMAGIC|GLOB_TILDE)
|
||||
|
||||
#if !defined (_POSIX_C_SOURCE) || _POSIX_C_SOURCE < 2 || defined (_BSD_SOURCE)
|
||||
#define GLOB_MAGCHAR (1 << 8)/* Set in gl_flags if any metachars seen. */
|
||||
#define GLOB_ALTDIRFUNC (1 << 9)/* Use gl_opendir et al functions. */
|
||||
#define GLOB_BRACE (1 << 10)/* Expand "{a,b}" to "a" "b". */
|
||||
#define GLOB_NOMAGIC (1 << 11)/* If no magic chars, return the pattern. */
|
||||
#define GLOB_TILDE (1 <<12)/* Expand ~user and ~ to home directories. */
|
||||
#endif
|
||||
|
||||
/* Error returns from `glob'. */
|
||||
@@ -59,12 +65,21 @@ extern "C"
|
||||
#define GLOB_NOMATCH 3 /* No matches found. */
|
||||
|
||||
/* Structure describing a globbing run. */
|
||||
struct stat;
|
||||
typedef struct
|
||||
{
|
||||
int gl_pathc; /* Count of paths matched by the pattern. */
|
||||
char **gl_pathv; /* List of matched pathnames. */
|
||||
int gl_offs; /* Slots to reserve in `gl_pathv'. */
|
||||
int gl_flags; /* Set to FLAGS, maybe | GLOB_MAGCHAR. */
|
||||
|
||||
/* If the GLOB_ALTDIRFUNC flag is set, the following functions
|
||||
are used instead of the normal file access functions. */
|
||||
void (*gl_closedir) __P ((void *));
|
||||
struct dirent *(*gl_readdir) __P ((void *));
|
||||
__ptr_t (*gl_opendir) __P ((const char *));
|
||||
int (*gl_lstat) __P ((const char *, struct stat *));
|
||||
int (*gl_stat) __P ((const char *, struct stat *));
|
||||
} glob_t;
|
||||
|
||||
/* Do glob searching for PATTERN, placing results in PGLOB.
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
@display
|
||||
Copyright @copyright{} 1989, 1991 Free Software Foundation, Inc.
|
||||
675 Mass Ave, Cambridge, MA 02139, USA
|
||||
59 Temple Place -- Suite 330, Boston, MA 02111-1307, USA
|
||||
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
118
job.c
118
job.c
@@ -35,6 +35,12 @@ static char *dos_bename;
|
||||
static int dos_batch_file;
|
||||
#endif /* MSDOS. */
|
||||
|
||||
#ifdef HAVE_FCNTL_H
|
||||
#include <fcntl.h>
|
||||
#else
|
||||
#include <sys/file.h>
|
||||
#endif
|
||||
|
||||
|
||||
/* If NGROUPS_MAX == 0 then try other methods for finding a real value. */
|
||||
#if defined (NGROUPS_MAX) && NGROUPS_MAX == 0
|
||||
@@ -49,7 +55,7 @@ static int dos_batch_file;
|
||||
#endif /* POSIX. */
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_SYS_WAIT_H
|
||||
#if defined (HAVE_SYS_WAIT_H) || defined (HAVE_UNION_WAIT)
|
||||
#include <sys/wait.h>
|
||||
#endif
|
||||
|
||||
@@ -118,28 +124,12 @@ extern int geteuid (), getegid ();
|
||||
extern int setgid (), getgid ();
|
||||
#endif
|
||||
|
||||
#ifndef getdtablesize
|
||||
#ifdef HAVE_GETDTABLESIZE
|
||||
extern int getdtablesize ();
|
||||
#else
|
||||
#ifdef HAVE_SYSCONF_OPEN_MAX
|
||||
#define getdtablesize() ((int) sysconf (_SC_OPEN_MAX))
|
||||
#else
|
||||
#include <sys/param.h>
|
||||
#define getdtablesize() NOFILE
|
||||
#if !defined (NOFILE) && defined (NOFILES_MAX)
|
||||
/* SCO 3.2 "devsys 4.2" defines NOFILES_{MIN,MAX} in lieu of NOFILE. */
|
||||
#define NOFILE NOFILES_MAX
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
extern int getloadavg ();
|
||||
extern int start_remote_job_p ();
|
||||
extern int start_remote_job (), remote_status ();
|
||||
|
||||
RETSIGTYPE child_handler ();
|
||||
void unblock_sigs ();
|
||||
static void free_child (), start_job_command ();
|
||||
static int load_too_high (), job_next_command ();
|
||||
|
||||
@@ -169,6 +159,9 @@ child_error (target_name, exit_code, exit_sig, coredump, ignored)
|
||||
int exit_code, exit_sig, coredump;
|
||||
int ignored;
|
||||
{
|
||||
if (ignored && silent_flag)
|
||||
return;
|
||||
|
||||
if (exit_sig == 0)
|
||||
error (ignored ? "[%s] Error %d (ignored)" :
|
||||
"*** [%s] Error %d",
|
||||
@@ -415,6 +408,11 @@ reap_children (block, err)
|
||||
by start_remote_job_p. */
|
||||
c->remote = start_remote_job_p ();
|
||||
start_job_command (c);
|
||||
/* Fatal signals are left blocked in case we were
|
||||
about to put that child on the chain. But it is
|
||||
already there, so it is safe for a fatal signal to
|
||||
arrive now; it will clean up this child's targets. */
|
||||
unblock_sigs ();
|
||||
if (c->file->command_state == cs_running)
|
||||
/* We successfully started the new command.
|
||||
Loop to reap more children. */
|
||||
@@ -517,7 +515,11 @@ unblock_sigs ()
|
||||
#endif
|
||||
|
||||
/* Start a job to run the commands specified in CHILD.
|
||||
CHILD is updated to reflect the commands and ID of the child process. */
|
||||
CHILD is updated to reflect the commands and ID of the child process.
|
||||
|
||||
NOTE: On return fatal signals are blocked! The caller is responsible
|
||||
for calling `unblock_sigs', once the new child is safely on the chain so
|
||||
it can be cleaned up in the event of a fatal signal. */
|
||||
|
||||
static void
|
||||
start_job_command (child)
|
||||
@@ -552,7 +554,7 @@ start_job_command (child)
|
||||
1 tells the user that -q is saying `something to do'; the exit status
|
||||
for a random error is 2. */
|
||||
if (question_flag && !(flags & COMMANDS_RECURSE))
|
||||
{
|
||||
{
|
||||
child->file->update_status = 1;
|
||||
notice_finished_file (child->file);
|
||||
return;
|
||||
@@ -561,9 +563,9 @@ start_job_command (child)
|
||||
/* There may be some preceding whitespace left if there
|
||||
was nothing but a backslash on the first line. */
|
||||
p = next_token (p);
|
||||
|
||||
|
||||
/* Figure out an argument list from this command line. */
|
||||
|
||||
|
||||
{
|
||||
char *end;
|
||||
argv = construct_command_argv (p, &end, child->file);
|
||||
@@ -600,10 +602,12 @@ start_job_command (child)
|
||||
return;
|
||||
}
|
||||
|
||||
/* Print out the command. */
|
||||
/* Print out the command. If silent, we call `message' with null so it
|
||||
can log the working directory before the command's own error messages
|
||||
appear. */
|
||||
|
||||
if (just_print_flag || (!(flags & COMMANDS_SILENT) && !silent_flag))
|
||||
puts (p);
|
||||
message (0, (just_print_flag || (!(flags & COMMANDS_SILENT) && !silent_flag))
|
||||
? "%s" : (char *) 0, p);
|
||||
|
||||
/* Tell update_goal_chain that a command has been started on behalf of
|
||||
this target. It is important that this happens here and not in
|
||||
@@ -627,7 +631,7 @@ start_job_command (child)
|
||||
|
||||
fflush (stdout);
|
||||
fflush (stderr);
|
||||
|
||||
|
||||
/* Set up a bad standard input that reads from a broken pipe. */
|
||||
|
||||
if (bad_stdin == -1)
|
||||
@@ -641,6 +645,16 @@ start_job_command (child)
|
||||
(void) close (pd[1]);
|
||||
/* Save the read side. */
|
||||
bad_stdin = pd[0];
|
||||
|
||||
/* Set the descriptor to close on exec, so it does not litter any
|
||||
child's descriptor table. When it is dup2'd onto descriptor 0,
|
||||
that descriptor will not close on exec. */
|
||||
#ifdef FD_SETFD
|
||||
#ifndef FD_CLOEXEC
|
||||
#define FD_CLOEXEC 1
|
||||
#endif
|
||||
(void) fcntl (bad_stdin, F_SETFD, FD_CLOEXEC);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -945,23 +959,17 @@ new_job (file)
|
||||
c->environment = 0;
|
||||
|
||||
/* Fetch the first command line to be run. */
|
||||
if (! job_next_command (c))
|
||||
{
|
||||
/* There were no commands! */
|
||||
free_child (c);
|
||||
c->file->update_status = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* The job is now primed. Start it running. */
|
||||
start_waiting_job (c);
|
||||
job_next_command (c);
|
||||
|
||||
if (job_slots == 1)
|
||||
/* Since there is only one job slot, make things run linearly.
|
||||
Wait for the child to die, setting the state to `cs_finished'. */
|
||||
while (file->command_state == cs_running)
|
||||
reap_children (1, 0);
|
||||
}
|
||||
/* The job is now primed. Start it running.
|
||||
(This will notice if there are in fact no commands.) */
|
||||
start_waiting_job (c);
|
||||
|
||||
if (job_slots == 1)
|
||||
/* Since there is only one job slot, make things run linearly.
|
||||
Wait for the child to die, setting the state to `cs_finished'. */
|
||||
while (file->command_state == cs_running)
|
||||
reap_children (1, 0);
|
||||
}
|
||||
|
||||
/* Move CHILD's pointers to the next command for it to execute.
|
||||
@@ -971,7 +979,7 @@ static int
|
||||
job_next_command (child)
|
||||
struct child *child;
|
||||
{
|
||||
if (child->command_ptr == 0 || *child->command_ptr == '\0')
|
||||
while (child->command_ptr == 0 || *child->command_ptr == '\0')
|
||||
{
|
||||
/* There are no more lines in the expansion of this line. */
|
||||
if (child->command_line == child->file->cmds->ncommand_lines)
|
||||
@@ -1058,14 +1066,10 @@ child_execute_job (stdin_fd, stdout_fd, argv, envp)
|
||||
(void) dup2 (stdin_fd, 0);
|
||||
if (stdout_fd != 1)
|
||||
(void) dup2 (stdout_fd, 1);
|
||||
|
||||
/* Free up file descriptors. */
|
||||
{
|
||||
register int d;
|
||||
int max = getdtablesize ();
|
||||
for (d = 3; d < max; ++d)
|
||||
(void) close (d);
|
||||
}
|
||||
if (stdin_fd != 0)
|
||||
(void) close (stdin_fd);
|
||||
if (stdout_fd != 1)
|
||||
(void) close (stdout_fd);
|
||||
|
||||
/* Run the command. */
|
||||
exec_command (argv, envp);
|
||||
@@ -1084,7 +1088,7 @@ exec_command (argv, envp)
|
||||
/* Run the program. */
|
||||
environ = envp;
|
||||
execvp (argv[0], argv);
|
||||
|
||||
|
||||
switch (errno)
|
||||
{
|
||||
case ENOENT:
|
||||
@@ -1108,7 +1112,7 @@ exec_command (argv, envp)
|
||||
|
||||
new_argv = (char **) alloca ((1 + argc + 1) * sizeof (char *));
|
||||
new_argv[0] = shell;
|
||||
new_argv[1] = program;
|
||||
new_argv[1] = argv[0];
|
||||
while (argc > 0)
|
||||
{
|
||||
new_argv[1 + argc] = argv[argc];
|
||||
@@ -1410,14 +1414,14 @@ construct_command_argv_internal (line, restp, shell, ifs)
|
||||
"SHELL -c LINE", with all special chars in LINE escaped.
|
||||
Then recurse, expanding this command line to get the final
|
||||
argument list. */
|
||||
|
||||
|
||||
unsigned int shell_len = strlen (shell);
|
||||
static char minus_c[] = " -c ";
|
||||
unsigned int line_len = strlen (line);
|
||||
|
||||
|
||||
char *new_line = (char *) alloca (shell_len + (sizeof (minus_c) - 1)
|
||||
+ (line_len * 2) + 1);
|
||||
|
||||
|
||||
ap = new_line;
|
||||
bcopy (shell, ap, shell_len);
|
||||
ap += shell_len;
|
||||
@@ -1458,7 +1462,7 @@ construct_command_argv_internal (line, restp, shell, ifs)
|
||||
*ap++ = *p;
|
||||
}
|
||||
*ap = '\0';
|
||||
|
||||
|
||||
new_argv = construct_command_argv_internal (new_line, (char **) NULL,
|
||||
(char *) 0, (char *) 0);
|
||||
}
|
||||
|
||||
70
main.c
70
main.c
@@ -43,7 +43,6 @@ extern double atof ();
|
||||
#endif
|
||||
extern char *mktemp ();
|
||||
|
||||
static void log_working_directory ();
|
||||
static void print_data_base (), print_version ();
|
||||
static void decode_switches (), decode_env_switches ();
|
||||
static void define_makeflags ();
|
||||
@@ -367,6 +366,9 @@ static struct file *
|
||||
enter_command_line_file (name)
|
||||
char *name;
|
||||
{
|
||||
if (name[0] == '\0')
|
||||
fatal ("empty string invalid as file name");
|
||||
|
||||
if (name[0] == '~')
|
||||
{
|
||||
char *expanded = tilde_expand (name);
|
||||
@@ -384,7 +386,7 @@ enter_command_line_file (name)
|
||||
/* Skip following slashes: ".//foo" is "foo", not "/foo". */
|
||||
++name;
|
||||
}
|
||||
|
||||
|
||||
if (*name == '\0')
|
||||
{
|
||||
/* It was all slashes! Move back to the dot and truncate
|
||||
@@ -413,7 +415,6 @@ main (argc, argv, envp)
|
||||
char **argv;
|
||||
char **envp;
|
||||
{
|
||||
extern void init_dir ();
|
||||
extern RETSIGTYPE fatal_error_signal (), child_handler ();
|
||||
register struct file *f;
|
||||
register unsigned int i;
|
||||
@@ -424,7 +425,7 @@ main (argc, argv, envp)
|
||||
default_goal_file = 0;
|
||||
reading_filename = 0;
|
||||
reading_lineno_ptr = 0;
|
||||
|
||||
|
||||
#if !defined (HAVE_STRSIGNAL) && !defined (HAVE_SYS_SIGLIST)
|
||||
signame_init ();
|
||||
#endif
|
||||
@@ -477,16 +478,13 @@ main (argc, argv, envp)
|
||||
#endif /* setvbuf reversed. */
|
||||
#endif /* setlinebuf missing. */
|
||||
|
||||
/* Initialize the directory hashing code. */
|
||||
init_dir ();
|
||||
|
||||
/* Figure out where this program lives. */
|
||||
|
||||
if (argv[0] == 0)
|
||||
argv[0] = "";
|
||||
if (argv[0][0] == '\0')
|
||||
program = "make";
|
||||
else
|
||||
else
|
||||
{
|
||||
program = rindex (argv[0], '/');
|
||||
#ifdef __MSDOS__
|
||||
@@ -685,10 +683,6 @@ main (argc, argv, envp)
|
||||
starting_directory = current_directory;
|
||||
}
|
||||
|
||||
/* Tell the user where he is. */
|
||||
|
||||
if (print_directory_flag)
|
||||
log_working_directory (1);
|
||||
|
||||
/* Read any stdin makefiles into temporary files. */
|
||||
|
||||
@@ -917,7 +911,7 @@ main (argc, argv, envp)
|
||||
d = d->next;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Set up `MAKEFLAGS' specially while remaking makefiles. */
|
||||
define_makeflags (1, 1);
|
||||
@@ -929,11 +923,11 @@ main (argc, argv, envp)
|
||||
#define BOGUS_UPDATE_STATUS 0
|
||||
assert (BOGUS_UPDATE_STATUS);
|
||||
break;
|
||||
|
||||
|
||||
case -1:
|
||||
/* Did nothing. */
|
||||
break;
|
||||
|
||||
|
||||
case 2:
|
||||
/* Failed to update. Figure out if we care. */
|
||||
{
|
||||
@@ -1007,8 +1001,7 @@ main (argc, argv, envp)
|
||||
if (print_data_base_flag)
|
||||
print_data_base ();
|
||||
|
||||
if (print_directory_flag)
|
||||
log_working_directory (0);
|
||||
log_working_directory (0);
|
||||
|
||||
if (makefiles != 0)
|
||||
{
|
||||
@@ -1230,7 +1223,7 @@ handle_non_switch_argument (arg, env)
|
||||
goals. */
|
||||
struct file *f = enter_command_line_file (arg);
|
||||
f->cmd_target = 1;
|
||||
|
||||
|
||||
if (goals == 0)
|
||||
{
|
||||
goals = (struct dep *) xmalloc (sizeof (struct dep));
|
||||
@@ -1372,13 +1365,13 @@ positive integral argument",
|
||||
optarg = argv[optind++];
|
||||
|
||||
if (doit)
|
||||
*(double *) cs->value_ptr
|
||||
*(double *) cs->value_ptr
|
||||
= (optarg != 0 ? atof (optarg)
|
||||
: *(double *) cs->noarg_value);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
/* We've found the switch. Stop looking. */
|
||||
break;
|
||||
}
|
||||
@@ -1778,6 +1771,24 @@ define_makeflags (all, makefile)
|
||||
flags = flags->next;
|
||||
}
|
||||
|
||||
|
||||
/* Define MFLAGS before appending variable definitions. */
|
||||
|
||||
if (p == &flagstring[1])
|
||||
/* No flags. */
|
||||
flagstring[0] = '\0';
|
||||
else if (p[-1] == '-')
|
||||
/* Kill the final space and dash. */
|
||||
p[-2] = '\0';
|
||||
else
|
||||
/* Terminate the string. */
|
||||
*p = '\0';
|
||||
|
||||
/* Since MFLAGS is not parsed for flags, there is no reason to
|
||||
override any makefile redefinition. */
|
||||
(void) define_variable ("MFLAGS", 6, flagstring, o_env, 1);
|
||||
|
||||
|
||||
if (all && command_variables != 0)
|
||||
{
|
||||
/* Now write a reference to $(MAKEOVERRIDES), which contains all the
|
||||
@@ -1842,9 +1853,6 @@ define_makeflags (all, makefile)
|
||||
We should not do this again on the second call, because that is
|
||||
after reading makefiles which might have done `unexport MAKEFLAGS'. */
|
||||
v->export = v_export;
|
||||
/* Since MFLAGS is not parsed for flags, there is no reason to
|
||||
override any makefile redefinition. */
|
||||
(void) define_variable ("MFLAGS", 6, flagstring, o_env, 1);
|
||||
}
|
||||
|
||||
/* Print version information. */
|
||||
@@ -1932,8 +1940,7 @@ die (status)
|
||||
if (print_data_base_flag)
|
||||
print_data_base ();
|
||||
|
||||
if (print_directory_flag)
|
||||
log_working_directory (0);
|
||||
log_working_directory (0);
|
||||
}
|
||||
|
||||
exit (status);
|
||||
@@ -1942,20 +1949,21 @@ die (status)
|
||||
/* Write a message indicating that we've just entered or
|
||||
left (according to ENTERING) the current directory. */
|
||||
|
||||
static void
|
||||
void
|
||||
log_working_directory (entering)
|
||||
int entering;
|
||||
{
|
||||
static int entered = 0;
|
||||
char *message = entering ? "Entering" : "Leaving";
|
||||
|
||||
if (entering)
|
||||
entered = 1;
|
||||
else if (!entered)
|
||||
/* Don't print the leaving message if we
|
||||
haven't printed the entering message. */
|
||||
/* Print nothing without the flag. Don't print the entering message
|
||||
again if we already have. Don't print the leaving message if we
|
||||
haven't printed the entering message. */
|
||||
if (! print_directory_flag || entering == entered)
|
||||
return;
|
||||
|
||||
entered = entering;
|
||||
|
||||
if (print_data_base_flag)
|
||||
fputs ("# ", stdout);
|
||||
|
||||
|
||||
@@ -242,12 +242,12 @@ 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
|
||||
The reason we say ``almost everything'' is that running the command
|
||||
@samp{make maintainer-clean} should not delete @file{configure} even if
|
||||
it 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
|
||||
@@ -257,13 +257,13 @@ 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:
|
||||
To help make users aware of this, the commands for the special
|
||||
@code{maintainer-clean} target 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
|
||||
@smallexample
|
||||
@@echo "This command is intended for maintainers to use; it"
|
||||
@@echo "deletes files that may require special tools to rebuild."
|
||||
@end smallexample
|
||||
|
||||
@item TAGS
|
||||
Update a tags table for this program.
|
||||
@@ -440,7 +440,7 @@ 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{/}.
|
||||
|
||||
@@ -585,19 +585,17 @@ 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}.
|
||||
|
||||
@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
|
||||
|
||||
1
make.h
1
make.h
@@ -259,6 +259,7 @@ extern char *alloca ();
|
||||
|
||||
extern void die ();
|
||||
extern void message (), fatal (), error ();
|
||||
extern void log_working_directory ();
|
||||
extern void makefile_error (), makefile_fatal ();
|
||||
extern void pfatal_with_name (), perror_with_name ();
|
||||
extern char *savestring (), *concat ();
|
||||
|
||||
43
make.texinfo
43
make.texinfo
@@ -8,12 +8,12 @@
|
||||
@c FSF publishers: format makebook.texi instead of using this file directly.
|
||||
|
||||
@set RCSID $Id$
|
||||
@set EDITION 0.48
|
||||
@set VERSION 3.73 Beta
|
||||
@set UPDATED 4 April 1995
|
||||
@set UPDATE-MONTH April 1995
|
||||
@set EDITION 0.49
|
||||
@set VERSION 3.74 Beta
|
||||
@set UPDATED 14 August 1995
|
||||
@set UPDATE-MONTH August 1995
|
||||
@comment The ISBN number might need to change on next publication.
|
||||
@set ISBN 1-882114-50-7
|
||||
@set ISBN 1-882114-78-7
|
||||
|
||||
@c finalout
|
||||
|
||||
@@ -71,8 +71,8 @@ by the Free Software Foundation.
|
||||
Copyright @copyright{} 1988, '89, '90, '91, '92, '93, '94, '95 Free Software Foundation, Inc.
|
||||
@sp 2
|
||||
Published by the Free Software Foundation @*
|
||||
675 Massachusetts Avenue, @*
|
||||
Cambridge, MA 02139 USA @*
|
||||
59 Temple Place -- Suite 330, @*
|
||||
Boston, MA 02111-1307 USA @*
|
||||
Printed copies are available for $20 each. @*
|
||||
ISBN @value{ISBN} @*
|
||||
|
||||
@@ -435,14 +435,6 @@ get this information with the command @samp{make --version}.
|
||||
Be sure also to include the type of machine and operating system you are
|
||||
using. If possible, include the contents of the file @file{config.h}
|
||||
that is generated by the configuration process.
|
||||
|
||||
Non-bug suggestions are always welcome as well. If you have questions
|
||||
about things that are unclear in the documentation or are just obscure
|
||||
features, send a message to the bug reporting address. We cannot
|
||||
guarantee you'll get help with your problem, but many seasoned
|
||||
@code{make} users read the mailing list and they will probably try to
|
||||
help you out. The maintainers sometimes answer such questions as well,
|
||||
when time permits.
|
||||
|
||||
@node Introduction, Makefiles, Overview, Top
|
||||
@comment node-name, next, previous, up
|
||||
@@ -640,11 +632,10 @@ from @code{rm} or any other command.
|
||||
@cindex processing a makefile
|
||||
@cindex makefile, how @code{make} processes
|
||||
|
||||
By default, @code{make} starts with the first rule (not counting rules
|
||||
whose target names start with @samp{.}). This is called the
|
||||
@dfn{default goal}. (@dfn{Goals} are the targets that @code{make}
|
||||
strives ultimately to update. @xref{Goals, , Arguments to Specify the
|
||||
Goals}.)
|
||||
By default, @code{make} starts with the first target (not targets whose
|
||||
names start with @samp{.}). This is called the @dfn{default goal}.
|
||||
(@dfn{Goals} are the targets that @code{make} strives ultimately to
|
||||
update. @xref{Goals, , Arguments to Specify the Goals}.)
|
||||
@cindex default goal
|
||||
@cindex goal, default
|
||||
@cindex goal
|
||||
@@ -2585,13 +2576,13 @@ the new dependencies.
|
||||
Here is the pattern rule to generate a file of dependencies (i.e., a makefile)
|
||||
called @file{@var{name}.d} from a C source file called @file{@var{name}.c}:
|
||||
|
||||
@example
|
||||
@smallexample
|
||||
@group
|
||||
%.d: %.c
|
||||
$(SHELL) -ec '$(CC) -M $(CPPFLAGS) $< \
|
||||
| sed '\''s/$*\\.o[ :]*/& $@@/g'\'' > $@@'
|
||||
@end group
|
||||
@end example
|
||||
@end smallexample
|
||||
|
||||
@noindent
|
||||
@xref{Pattern Rules}, for information on defining pattern rules. The
|
||||
@@ -3573,6 +3564,14 @@ from getting implicit commands (from implicit rules or the
|
||||
@code{.DEFAULT} special target; @pxref{Implicit Rules} and
|
||||
@pxref{Last Resort, ,Defining Last-Resort Default Rules}).@refill
|
||||
|
||||
@c !!! another reason is for canonical stamp files:
|
||||
@ignore
|
||||
foo: stamp-foo ;
|
||||
stamp-foo: foo.in
|
||||
create foo frm foo.in
|
||||
touch $@
|
||||
@end ignore
|
||||
|
||||
You may be inclined to define empty command strings for targets that are
|
||||
not actual files, but only exist so that their dependencies can be
|
||||
remade. However, this is not the best way to do that, because the
|
||||
|
||||
57
misc.c
57
misc.c
@@ -50,9 +50,8 @@ collapse_continuations (line)
|
||||
return;
|
||||
|
||||
out = in;
|
||||
if (out > line)
|
||||
while (out[-1] == '\\')
|
||||
--out;
|
||||
while (out > line && out[-1] == '\\')
|
||||
--out;
|
||||
|
||||
while (*in != '\0')
|
||||
{
|
||||
@@ -174,15 +173,25 @@ concat (s1, s2, s3)
|
||||
/* Print a message on stdout. */
|
||||
|
||||
void
|
||||
message (s1, s2, s3, s4, s5, s6)
|
||||
message (prefix, s1, s2, s3, s4, s5, s6)
|
||||
int prefix;
|
||||
char *s1, *s2, *s3, *s4, *s5, *s6;
|
||||
{
|
||||
if (makelevel == 0)
|
||||
printf ("%s: ", program);
|
||||
else
|
||||
printf ("%s[%u]: ", program, makelevel);
|
||||
printf (s1, s2, s3, s4, s5, s6);
|
||||
putchar ('\n');
|
||||
log_working_directory (1);
|
||||
|
||||
if (s1 != 0)
|
||||
{
|
||||
if (prefix)
|
||||
{
|
||||
if (makelevel == 0)
|
||||
printf ("%s: ", program);
|
||||
else
|
||||
printf ("%s[%u]: ", program, makelevel);
|
||||
}
|
||||
printf (s1, s2, s3, s4, s5, s6);
|
||||
putchar ('\n');
|
||||
}
|
||||
|
||||
fflush (stdout);
|
||||
}
|
||||
|
||||
@@ -193,6 +202,8 @@ void
|
||||
fatal (s1, s2, s3, s4, s5, s6)
|
||||
char *s1, *s2, *s3, *s4, *s5, *s6;
|
||||
{
|
||||
log_working_directory (1);
|
||||
|
||||
if (makelevel == 0)
|
||||
fprintf (stderr, "%s: *** ", program);
|
||||
else
|
||||
@@ -211,6 +222,8 @@ void
|
||||
error (s1, s2, s3, s4, s5, s6)
|
||||
char *s1, *s2, *s3, *s4, *s5, *s6;
|
||||
{
|
||||
log_working_directory (1);
|
||||
|
||||
if (makelevel == 0)
|
||||
fprintf (stderr, "%s: ", program);
|
||||
else
|
||||
@@ -226,6 +239,8 @@ makefile_error (file, lineno, s1, s2, s3, s4, s5, s6)
|
||||
unsigned int lineno;
|
||||
char *s1, *s2, *s3, *s4, *s5, *s6;
|
||||
{
|
||||
log_working_directory (1);
|
||||
|
||||
fprintf (stderr, "%s:%u: ", file, lineno);
|
||||
fprintf (stderr, s1, s2, s3, s4, s5, s6);
|
||||
putc ('\n', stderr);
|
||||
@@ -238,6 +253,8 @@ makefile_fatal (file, lineno, s1, s2, s3, s4, s5, s6)
|
||||
unsigned int lineno;
|
||||
char *s1, *s2, *s3, *s4, *s5, *s6;
|
||||
{
|
||||
log_working_directory (1);
|
||||
|
||||
fprintf (stderr, "%s:%u: *** ", file, lineno);
|
||||
fprintf (stderr, s1, s2, s3, s4, s5, s6);
|
||||
fputs (". Stop.\n", stderr);
|
||||
@@ -716,23 +733,3 @@ get_path_max ()
|
||||
return value;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* On some systems, stat can return EINTR. */
|
||||
|
||||
int
|
||||
safe_stat (name, buf)
|
||||
char *name;
|
||||
struct stat *buf;
|
||||
{
|
||||
int ret;
|
||||
|
||||
#ifdef EINTR
|
||||
do
|
||||
#endif
|
||||
ret = stat (name, buf);
|
||||
#ifdef EINTR
|
||||
while (ret < 0 && errno == EINTR);
|
||||
#endif
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
56
read.c
56
read.c
@@ -37,7 +37,6 @@ static int read_makefile ();
|
||||
static unsigned int readline (), do_define ();
|
||||
static int conditional_line ();
|
||||
static void record_files ();
|
||||
static char *find_semicolon ();
|
||||
|
||||
|
||||
/* A `struct linebuffer' is a structure which holds a line of text.
|
||||
@@ -75,7 +74,7 @@ struct conditionals
|
||||
|
||||
static struct conditionals toplevel_conditionals;
|
||||
static struct conditionals *conditionals = &toplevel_conditionals;
|
||||
|
||||
|
||||
|
||||
/* Default directories to search for include files in */
|
||||
|
||||
@@ -192,6 +191,9 @@ read_all_makefiles (makefiles)
|
||||
/* No default makefile was found. Add the default makefiles to the
|
||||
`read_makefiles' chain so they will be updated if possible. */
|
||||
struct dep *tail = read_makefiles;
|
||||
/* Add them to the tail, after any MAKEFILES variable makefiles. */
|
||||
while (tail != 0 && tail->next != 0)
|
||||
tail = tail->next;
|
||||
for (p = default_makefiles; *p != 0; ++p)
|
||||
{
|
||||
struct dep *d = (struct dep *) xmalloc (sizeof (struct dep));
|
||||
@@ -654,9 +656,16 @@ read_makefile (filename, flags)
|
||||
|
||||
record_waiting_files ();
|
||||
|
||||
/* Look for a semicolon in the unexpanded line. */
|
||||
cmdleft = find_semicolon (lb.buffer);
|
||||
if (cmdleft != 0)
|
||||
/* Search the line for an unquoted ; that is not after an
|
||||
unquoted #. */
|
||||
cmdleft = find_char_unquote (lb.buffer, ";#", 0);
|
||||
if (cmdleft != 0 && *cmdleft == '#')
|
||||
{
|
||||
/* We found a comment before a semicolon. */
|
||||
*cmdleft = '\0';
|
||||
cmdleft = 0;
|
||||
}
|
||||
else if (cmdleft != 0)
|
||||
/* Found one. Cut the line short there before expanding it. */
|
||||
*cmdleft = '\0';
|
||||
|
||||
@@ -668,15 +677,12 @@ read_makefile (filename, flags)
|
||||
|
||||
if (cmdleft == 0)
|
||||
/* Look for a semicolon in the expanded line. */
|
||||
cmdleft = find_semicolon (p);
|
||||
cmdleft = find_char_unquote (p, ";", 0);
|
||||
|
||||
if (cmdleft != 0)
|
||||
/* Cut the line short at the semicolon. */
|
||||
*cmdleft = '\0';
|
||||
|
||||
/* Remove comments from the line. */
|
||||
remove_comments (p);
|
||||
|
||||
p2 = next_token (p);
|
||||
if (*p2 == '\0')
|
||||
{
|
||||
@@ -1248,7 +1254,7 @@ record_files (filenames, pattern, pattern_percent, deps, commands_started,
|
||||
d->name = savestring (buffer, o - buffer);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (!two_colon)
|
||||
{
|
||||
/* Single-colon. Combine these dependencies
|
||||
@@ -1488,19 +1494,6 @@ find_percent (pattern)
|
||||
{
|
||||
return find_char_unquote (pattern, "%", 0);
|
||||
}
|
||||
|
||||
/* Search STRING for an unquoted ; that is not after an unquoted #. */
|
||||
|
||||
static char *
|
||||
find_semicolon (string)
|
||||
char *string;
|
||||
{
|
||||
char *match = find_char_unquote (string, ";#", 0);
|
||||
if (match != 0 && *match == '#')
|
||||
/* We found a comment before a semicolon. No match. */
|
||||
match = 0;
|
||||
return match;
|
||||
}
|
||||
|
||||
/* Parse a string into a sequence of filenames represented as a
|
||||
chain of struct nameseq's in reverse order and return that chain.
|
||||
@@ -1659,7 +1652,7 @@ parse_file_seq (stringp, stopchar, size, strip)
|
||||
/* Trace back from NEW1 (the end of the list) until N
|
||||
(the beginning of the list), rewriting each name
|
||||
with the full archive reference. */
|
||||
|
||||
|
||||
while (new1 != n)
|
||||
{
|
||||
name = concat (libname, new1->name, ")");
|
||||
@@ -1761,7 +1754,7 @@ readline (linebuffer, stream, filename, lineno)
|
||||
else
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
if (!backslash)
|
||||
{
|
||||
p[-1] = '\0';
|
||||
@@ -1819,7 +1812,7 @@ construct_include_path (arg_dirs)
|
||||
dir = expanded;
|
||||
}
|
||||
|
||||
if (safe_stat (dir, &stbuf) == 0 && S_ISDIR (stbuf.st_mode))
|
||||
if (stat (dir, &stbuf) == 0 && S_ISDIR (stbuf.st_mode))
|
||||
{
|
||||
if (idx == max - 1)
|
||||
{
|
||||
@@ -1836,7 +1829,7 @@ construct_include_path (arg_dirs)
|
||||
/* Now add at the end the standard default dirs. */
|
||||
|
||||
for (i = 0; default_include_directories[i] != 0; ++i)
|
||||
if (safe_stat (default_include_directories[i], &stbuf) == 0
|
||||
if (stat (default_include_directories[i], &stbuf) == 0
|
||||
&& S_ISDIR (stbuf.st_mode))
|
||||
dirs[idx++] = default_include_directories[i];
|
||||
|
||||
@@ -1882,7 +1875,7 @@ tilde_expand (name)
|
||||
|
||||
warn_undefined_variables_flag = save;
|
||||
}
|
||||
|
||||
|
||||
is_variable = home_dir[0] != '\0';
|
||||
if (!is_variable)
|
||||
{
|
||||
@@ -1945,13 +1938,16 @@ multi_glob (chain, size)
|
||||
struct nameseq *chain;
|
||||
unsigned int size;
|
||||
{
|
||||
extern void dir_setup_glob ();
|
||||
register struct nameseq *new = 0;
|
||||
register struct nameseq *old;
|
||||
struct nameseq *nexto;
|
||||
glob_t gl;
|
||||
|
||||
dir_setup_glob (&gl);
|
||||
|
||||
for (old = chain; old != 0; old = nexto)
|
||||
{
|
||||
glob_t gl;
|
||||
#ifndef NO_ARCHIVES
|
||||
char *memname;
|
||||
#endif
|
||||
@@ -1985,7 +1981,7 @@ multi_glob (chain, size)
|
||||
memname = 0;
|
||||
#endif
|
||||
|
||||
switch (glob (old->name, GLOB_NOCHECK, NULL, &gl))
|
||||
switch (glob (old->name, GLOB_NOCHECK|GLOB_ALTDIRFUNC, NULL, &gl))
|
||||
{
|
||||
case 0: /* Success. */
|
||||
{
|
||||
|
||||
29
remake.c
29
remake.c
@@ -133,7 +133,7 @@ update_goal_chain (goals, makefiles)
|
||||
by calling update_file above. We check this flag below to
|
||||
decide when to give an "up to date" diagnostic. */
|
||||
g->changed += commands_started - ocommands_started;
|
||||
|
||||
|
||||
stop = 0;
|
||||
if (x != 0 || file->updated)
|
||||
{
|
||||
@@ -195,14 +195,10 @@ update_goal_chain (goals, makefiles)
|
||||
&& file->update_status == 0 && !g->changed
|
||||
/* Never give a message under -s or -q. */
|
||||
&& !silent_flag && !question_flag)
|
||||
{
|
||||
if (file->phony || file->cmds == 0)
|
||||
message ("Nothing to be done for `%s'.",
|
||||
file->name);
|
||||
else
|
||||
message ("`%s' is up to date.", file->name);
|
||||
fflush (stdout);
|
||||
}
|
||||
message (1, ((file->phony || file->cmds == 0)
|
||||
? "Nothing to be done for `%s'."
|
||||
: "`%s' is up to date."),
|
||||
file->name);
|
||||
|
||||
/* This goal is finished. Remove it from the chain. */
|
||||
if (lastgoal == 0)
|
||||
@@ -593,7 +589,9 @@ update_file_1 (file, depth)
|
||||
|
||||
/* Set FILE's `updated' flag and re-check its mtime and the mtime's of all
|
||||
files listed in its `also_make' member. Under -t, this function also
|
||||
touches FILE. */
|
||||
touches FILE.
|
||||
|
||||
On return, FILE->update_status will no longer be -1 if it was. */
|
||||
|
||||
void
|
||||
notice_finished_file (file)
|
||||
@@ -668,6 +666,10 @@ notice_finished_file (file)
|
||||
never be done because the target is already updated. */
|
||||
(void) f_mtime (d->file, 0);
|
||||
}
|
||||
else if (file->update_status == -1)
|
||||
/* Nothing was done for FILE, but it needed nothing done.
|
||||
So mark it now as "succeeded". */
|
||||
file->update_status = 0;
|
||||
}
|
||||
|
||||
/* Check whether another file (whose mtime is THIS_MTIME)
|
||||
@@ -763,10 +765,7 @@ touch_file (file)
|
||||
register struct file *file;
|
||||
{
|
||||
if (!silent_flag)
|
||||
{
|
||||
printf ("touch %s\n", file->name);
|
||||
fflush (stdout);
|
||||
}
|
||||
message (0, "touch %s", file->name);
|
||||
|
||||
#ifndef NO_ARCHIVES
|
||||
if (ar_name (file->name))
|
||||
@@ -1001,7 +1000,7 @@ name_mtime (name)
|
||||
{
|
||||
struct stat st;
|
||||
|
||||
if (safe_stat (name, &st) < 0)
|
||||
if (stat (name, &st) < 0)
|
||||
return (time_t) -1;
|
||||
|
||||
return (time_t) st.st_mtime;
|
||||
|
||||
12
signame.c
12
signame.c
@@ -15,14 +15,22 @@ You should have received a copy of the GNU General Public License
|
||||
along with this program; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <sys/types.h> /* Some systems need this for <signal.h>. */
|
||||
#include <signal.h>
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
/* Some systems declare `sys_siglist in <unistd.h>; if
|
||||
configure defined SYS_SIGLIST_DECLARED, it may expect
|
||||
to find the declaration there. */
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
|
||||
/* Some systems do not define NSIG in <signal.h>. */
|
||||
#ifndef NSIG
|
||||
#ifdef _NSIG
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
char *version_string = "3.73";
|
||||
char *version_string = "3.74.2";
|
||||
|
||||
/*
|
||||
Local variables:
|
||||
|
||||
4
vpath.c
4
vpath.c
@@ -1,5 +1,5 @@
|
||||
/* Implementation of pattern-matching file search paths for GNU Make.
|
||||
Copyright (C) 1988, 1989, 1991, 1992, 1993, 1994 Free Software Foundation, Inc.
|
||||
Copyright (C) 1988, 89, 91, 92, 93, 94, 95 Free Software Foundation, Inc.
|
||||
This file is part of GNU Make.
|
||||
|
||||
GNU Make is free software; you can redistribute it and/or modify
|
||||
@@ -419,7 +419,7 @@ selective_vpath_search (path, file, mtime_ptr)
|
||||
*n = '/';
|
||||
|
||||
if (!exists_in_cache /* Makefile-mentioned file need not exist. */
|
||||
|| safe_stat (name, &st) == 0) /* Does it really exist? */
|
||||
|| stat (name, &st) == 0) /* Does it really exist? */
|
||||
{
|
||||
/* We have found a file.
|
||||
Store the name we found into *FILE for the caller. */
|
||||
|
||||
Reference in New Issue
Block a user