mirror of
https://github.com/mirror/make.git
synced 2026-08-20 00:43:29 +08:00
Compare commits
387 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b134da5505 | ||
|
|
d0b03e9355 | ||
|
|
5dc4b92b60 | ||
|
|
b3fa4b3c7e | ||
|
|
6fa76a7d15 | ||
|
|
4ff6c62456 | ||
|
|
cbb9e38d10 | ||
|
|
9e79637ec3 | ||
|
|
e34540f79b | ||
|
|
09f1e4cf83 | ||
|
|
28ef4c4dac | ||
|
|
3a945a665e | ||
|
|
6dbd348522 | ||
|
|
a9166bb7bc | ||
|
|
4e7ee4fc01 | ||
|
|
b05cb1d99e | ||
|
|
c8a60e7431 | ||
|
|
6d2984e0b2 | ||
|
|
ec50fe2a2b | ||
|
|
c69d4c95bf | ||
|
|
588da9812e | ||
|
|
73846549f6 | ||
|
|
169e6b8c3d | ||
|
|
826ab14b26 | ||
|
|
a3cf773e29 | ||
|
|
9d89ad56bf | ||
|
|
adb1632033 | ||
|
|
8df9d54020 | ||
|
|
9035aa27b7 | ||
|
|
e1d72ad3f1 | ||
|
|
012254e81e | ||
|
|
2858f7a8f1 | ||
|
|
187787286d | ||
|
|
fc0fe4103a | ||
|
|
7f3ffd4019 | ||
|
|
a2ea1bd27f | ||
|
|
3d1cdf4106 | ||
|
|
7052a57152 | ||
|
|
47922a5a65 | ||
|
|
e005a48b9f | ||
|
|
0798a61169 | ||
|
|
ecb3bca9f5 | ||
|
|
c4353af3f9 | ||
|
|
8363e0496d | ||
|
|
4025030d96 | ||
|
|
1e0513335f | ||
|
|
e3d0d562da | ||
|
|
db865774df | ||
|
|
a6a9ebb54f | ||
|
|
9e6ba6a148 | ||
|
|
ede263043c | ||
|
|
a8f7173799 | ||
|
|
a66668aabc | ||
|
|
84f38c9c6f | ||
|
|
5808507144 | ||
|
|
e3ef8e974c | ||
|
|
281cdd5d74 | ||
|
|
3634e15fe3 | ||
|
|
9c95acec4b | ||
|
|
8b55cda094 | ||
|
|
9d9111c450 | ||
|
|
0f686c1e6b | ||
|
|
6eeae809a8 | ||
|
|
5b16b3c015 | ||
|
|
c0ec561e37 | ||
|
|
71aacd9fe0 | ||
|
|
dc7cf1c4b2 | ||
|
|
7f83bfe911 | ||
|
|
45406fc744 | ||
|
|
76468fbaa1 | ||
|
|
2116c80dc7 | ||
|
|
28eecbb94f | ||
|
|
9ad3cb03b7 | ||
|
|
0be25c6986 | ||
|
|
4dfe38353e | ||
|
|
3948640154 | ||
|
|
2c64fb221a | ||
|
|
e90887e68a | ||
|
|
321b447568 | ||
|
|
b5722838c2 | ||
|
|
7a43e6cd30 | ||
|
|
84d159bb64 | ||
|
|
050f9d9f5d | ||
|
|
50b5c15b54 | ||
|
|
fc6cca1c7c | ||
|
|
5d1d6aa6de | ||
|
|
e2403327e9 | ||
|
|
65a7296e2c | ||
|
|
99454e6a1e | ||
|
|
411a01acce | ||
|
|
33654a7af4 | ||
|
|
fa1ec9e1f3 | ||
|
|
fefeb0f7bd | ||
|
|
6cca2382f0 | ||
|
|
44309109fe | ||
|
|
d153373039 | ||
|
|
ccac245bf5 | ||
|
|
f106953139 | ||
|
|
54727192c0 | ||
|
|
20258f42d4 | ||
|
|
4f79de612b | ||
|
|
ea9504a609 | ||
|
|
511cb55530 | ||
|
|
65d7b12aeb | ||
|
|
2968844002 | ||
|
|
a709205e81 | ||
|
|
9391fb8e4c | ||
|
|
4950159344 | ||
|
|
91da8b09df | ||
|
|
e3e88767f1 | ||
|
|
76ae1bc064 | ||
|
|
e24c9e161a | ||
|
|
f0a7421adc | ||
|
|
8204f56f2f | ||
|
|
e97f8e6f57 | ||
|
|
20b68e968a | ||
|
|
9d31f1e1f1 | ||
|
|
2fcce1d3b0 | ||
|
|
1290679bc3 | ||
|
|
dc70a3bc0b | ||
|
|
aa9ec7c2c7 | ||
|
|
04c488df1c | ||
|
|
8de0e41662 | ||
|
|
e94d73997a | ||
|
|
7585dedefc | ||
|
|
57ba55d08c | ||
|
|
886748c02d | ||
|
|
d378e4204d | ||
|
|
e7e9b799c4 | ||
|
|
a3a7581c1a | ||
|
|
3e12cad198 | ||
|
|
e2ffc653aa | ||
|
|
4e58a6ca4c | ||
|
|
41dcca8426 | ||
|
|
161a026602 | ||
|
|
e244062995 | ||
|
|
24fec5cb53 | ||
|
|
b903988475 | ||
|
|
6ea87be73b | ||
|
|
f6490d62cf | ||
|
|
480ad62713 | ||
|
|
acd666ce50 | ||
|
|
be3fb0ae6d | ||
|
|
dd0c939e78 | ||
|
|
fff468765c | ||
|
|
63dff1e0bc | ||
|
|
e746a9c951 | ||
|
|
74d4418f1c | ||
|
|
062e5f6aae | ||
|
|
c495345f7c | ||
|
|
f0239bb0af | ||
|
|
2d29a55137 | ||
|
|
806c7aa46c | ||
|
|
47daa6787e | ||
|
|
eb4d510a74 | ||
|
|
c86587fb9b | ||
|
|
fd688f6e9c | ||
|
|
f96ef9a409 | ||
|
|
09616e5837 | ||
|
|
cf9aa5b70b | ||
|
|
9033f1a656 | ||
|
|
ccfe89b829 | ||
|
|
35f1bbbe23 | ||
|
|
9f88582943 | ||
|
|
b38d9d2ae9 | ||
|
|
132e0eda6c | ||
|
|
c297b2fbd5 | ||
|
|
ec08feae97 | ||
|
|
8c7887ac02 | ||
|
|
08cf536bfb | ||
|
|
b48b02c7f4 | ||
|
|
e7a0e14a43 | ||
|
|
6413a1d08e | ||
|
|
8f34c48e3f | ||
|
|
818bb8940c | ||
|
|
cc4d91d751 | ||
|
|
36d804bd51 | ||
|
|
f95d071efc | ||
|
|
c0deecf9ee | ||
|
|
dd63648825 | ||
|
|
229ba33d0e | ||
|
|
ccbe33db90 | ||
|
|
32efbf8dc3 | ||
|
|
6e3b0629f1 | ||
|
|
51659ed000 | ||
|
|
7827f1bde8 | ||
|
|
922730c406 | ||
|
|
5e91041347 | ||
|
|
9f7ba4a505 | ||
|
|
2745ed943b | ||
|
|
0cb72b4a51 | ||
|
|
73fcfdbe24 | ||
|
|
0ada207e2d | ||
|
|
7bb7ba7849 | ||
|
|
2a294c52d1 | ||
|
|
71515366cd | ||
|
|
d78f2db327 | ||
|
|
30c9fcfec3 | ||
|
|
e2b79aacf7 | ||
|
|
e981c049f4 | ||
|
|
9012013552 | ||
|
|
cda4f25fd4 | ||
|
|
b32b9197ab | ||
|
|
b66145d8bc | ||
|
|
d2fe84cab3 | ||
|
|
c2ea8e2486 | ||
|
|
db2384b9ab | ||
|
|
9b0b3a6e70 | ||
|
|
a71d56b4cc | ||
|
|
10011ce289 | ||
|
|
84a9fd68b7 | ||
|
|
262ca66cb7 | ||
|
|
a1eb3e67cd | ||
|
|
78a4848b83 | ||
|
|
b16829dc46 | ||
|
|
c71e4ac269 | ||
|
|
82e6316607 | ||
|
|
a8de4b93e3 | ||
|
|
6e7fa14c65 | ||
|
|
5206d3f2bc | ||
|
|
e2da48ca55 | ||
|
|
bc26243d90 | ||
|
|
b4db97478e | ||
|
|
4e361d0f01 | ||
|
|
d5d49d2e5a | ||
|
|
191dc2b434 | ||
|
|
6fa74367b7 | ||
|
|
4cee1500a4 | ||
|
|
2602fb8e71 | ||
|
|
bfce132399 | ||
|
|
30cf28ef63 | ||
|
|
a7f3831457 | ||
|
|
bcd11d854b | ||
|
|
bb01a1a810 | ||
|
|
c622dd9bdf | ||
|
|
7092951361 | ||
|
|
88d39b2a22 | ||
|
|
3863dbeb03 | ||
|
|
cca242e6e3 | ||
|
|
7082394702 | ||
|
|
1f0bf7b4db | ||
|
|
b18ce15130 | ||
|
|
c41efad63b | ||
|
|
683c716de3 | ||
|
|
29253a9683 | ||
|
|
9cc98648fd | ||
|
|
d3c192e4a6 | ||
|
|
08905cdcbc | ||
|
|
4b72e38789 | ||
|
|
ce17fda12f | ||
|
|
2df6034eb6 | ||
|
|
dd0fe8f1ee | ||
|
|
37fbc32ba4 | ||
|
|
64bdaa521f | ||
|
|
37ce7efdca | ||
|
|
4b92c539d4 | ||
|
|
a22f67aaf7 | ||
|
|
9fc574683d | ||
|
|
c8e016d07a | ||
|
|
c396f06a21 | ||
|
|
fc47a2c83c | ||
|
|
561b384313 | ||
|
|
88942403a6 | ||
|
|
8733fbd646 | ||
|
|
cf2db2cf3c | ||
|
|
f0cea20864 | ||
|
|
fcb18b988b | ||
|
|
8b24ec18b0 | ||
|
|
df5ba0ef96 | ||
|
|
74475bb939 | ||
|
|
22ffba3660 | ||
|
|
9603eb13a0 | ||
|
|
fde68d03f3 | ||
|
|
56162c4968 | ||
|
|
f78bcc2e72 | ||
|
|
0c23819036 | ||
|
|
91a7257252 | ||
|
|
d5f0b88095 | ||
|
|
3024918fcd | ||
|
|
bdc49369eb | ||
|
|
610526fee7 | ||
|
|
3f60c36245 | ||
|
|
bd88059c38 | ||
|
|
63f3cf925b | ||
|
|
8541e3345d | ||
|
|
d86e4a26c8 | ||
|
|
2c973c0b46 | ||
|
|
e0620ee179 | ||
|
|
dac23b2d0b | ||
|
|
783e6680b2 | ||
|
|
2529deb2bf | ||
|
|
3d3252b8de | ||
|
|
b14b16769c | ||
|
|
e7a525c5d5 | ||
|
|
d369e0531a | ||
|
|
6701f24bbb | ||
|
|
e76076e334 | ||
|
|
673e04af3a | ||
|
|
bc8ac28654 | ||
|
|
95744a1491 | ||
|
|
78f280d541 | ||
|
|
44811ac351 | ||
|
|
6cf0e549f7 | ||
|
|
25d9818333 | ||
|
|
2a905c5e5a | ||
|
|
0ddf0df13c | ||
|
|
b4dcc6f6bd | ||
|
|
c8484a6170 | ||
|
|
7431536bed | ||
|
|
678b14fb7e | ||
|
|
efbe1b6411 | ||
|
|
5fb14db85f | ||
|
|
df99d7af1f | ||
|
|
db561cfc3e | ||
|
|
0feb1dd25f | ||
|
|
e2d8bf4aa4 | ||
|
|
dc27ebc311 | ||
|
|
989d9ecaae | ||
|
|
b0098dfd6a | ||
|
|
40a08e8a62 | ||
|
|
5e728dfa57 | ||
|
|
085eac4c74 | ||
|
|
085caaa900 | ||
|
|
cc28a52f40 | ||
|
|
1e38c11f3c | ||
|
|
58af8d9dd1 | ||
|
|
abe5f64440 | ||
|
|
68b9650616 | ||
|
|
5dfa403ec8 | ||
|
|
f7ecda9a35 | ||
|
|
e99a3aca7e | ||
|
|
73c52a3b12 | ||
|
|
4679c702de | ||
|
|
59cb26b58b | ||
|
|
386e27b622 | ||
|
|
68db062e1e | ||
|
|
a67e842fb1 | ||
|
|
712c43dde1 | ||
|
|
c0e8c1012d | ||
|
|
c97502625c | ||
|
|
9e443adaf6 | ||
|
|
dfefc77263 | ||
|
|
ee7af57e3c | ||
|
|
46a1497b8e | ||
|
|
4603f9f8c6 | ||
|
|
b2a22df721 | ||
|
|
89785948f6 | ||
|
|
8b2aca5930 | ||
|
|
b8ea37e31c | ||
|
|
e044fe76f6 | ||
|
|
557392f016 | ||
|
|
eaecc11501 | ||
|
|
b25f811f51 | ||
|
|
34b0c6b3b4 | ||
|
|
2de9513b20 | ||
|
|
8eb20e9d92 | ||
|
|
32979e8122 | ||
|
|
490f35dda4 | ||
|
|
a579af186b | ||
|
|
01d08292bc | ||
|
|
f9c4aae3bf | ||
|
|
74e456e107 | ||
|
|
f8b096b9fd | ||
|
|
527201342c | ||
|
|
5f1e98e59b | ||
|
|
f4020bfba8 | ||
|
|
4792e6f5c0 | ||
|
|
514eda2bda | ||
|
|
310f677b84 | ||
|
|
f323abd6b3 | ||
|
|
b07e961db1 | ||
|
|
5958f28900 | ||
|
|
fd504b4d84 | ||
|
|
1bb24cbbbb | ||
|
|
b255a75bab | ||
|
|
0569ceb303 | ||
|
|
8021c41954 | ||
|
|
edd7981e49 | ||
|
|
715363eb49 | ||
|
|
c36430699e | ||
|
|
5f99dee5b5 | ||
|
|
9521ecc573 | ||
|
|
cb69b06199 | ||
|
|
21fed1fbcc | ||
|
|
17aef36902 | ||
|
|
98f8d6286e | ||
|
|
d96d52d27d |
@@ -11,7 +11,16 @@ makebook*
|
||||
*.dep *.dvi *.toc *.aux *.log
|
||||
*.cp *.cps *.fn *.fns *.vr *.vrs *.tp *.tps *.ky *.kys *.pg *.pgs
|
||||
|
||||
README aclocal.m4 config.h.in config.h configure Makefile.in
|
||||
build.sh.in build.sh SMakefile config.ami README.DOS Makefile.DOS configh.dos
|
||||
NMakefile config.h.W32 config.h-vms
|
||||
|
||||
.deps .dep_segment
|
||||
|
||||
_*
|
||||
sun4 i386 i386-netbsd hp300-netbsd hp300 rs6000 sun3 news800 amiga
|
||||
hp700 hp834 mips sol2 i486-linux
|
||||
|
||||
customs
|
||||
|
||||
install-sh mkinstalldirs
|
||||
|
||||
12
.purify
Normal file
12
.purify
Normal file
@@ -0,0 +1,12 @@
|
||||
# Solaris (2.5.1) has a couple if issues.
|
||||
#
|
||||
suppress plk malloc; setvbuf "libc*"; main "main.c"
|
||||
suppress umr kstat_read; kstat_chain_update; kstat_open; getloadavg
|
||||
suppress umr kstat_chain_update; kstat_open; getloadavg
|
||||
|
||||
# The command line options stuff leaks a little bit. No big deal.
|
||||
#
|
||||
suppress mlk malloc; xmalloc "misc.c"; decode_env_switches "main.c"
|
||||
suppress plk malloc; xmalloc "misc.c"; decode_env_switches "main.c"
|
||||
suppress mlk malloc; xmalloc "misc.c"; concat "misc.c"; decode_env_switches "main.c"
|
||||
suppress plk malloc; xmalloc "misc.c"; concat "misc.c"; decode_env_switches "main.c"
|
||||
56
AUTHORS
Normal file
56
AUTHORS
Normal file
@@ -0,0 +1,56 @@
|
||||
-----------------------------------
|
||||
|
||||
GNU make development up to version 3.75 by:
|
||||
Roland McGrath <roland@gnu.org>
|
||||
|
||||
|
||||
Development starting with GNU make 3.76 by:
|
||||
Paul D. Smith <psmith@gnu.org>
|
||||
|
||||
|
||||
GNU Make User's Manual
|
||||
Written by:
|
||||
Richard M. Stallman <rms@gnu.org>
|
||||
|
||||
Edited by:
|
||||
Roland McGrath <roland@gnu.org>
|
||||
Bob Chassell <bob@gnu.org>
|
||||
Melissa Weisshaus <melissa@gnu.org>
|
||||
Paul D. Smith <psmith@gnu.org>
|
||||
|
||||
-----------------------------------
|
||||
GNU make porting efforts:
|
||||
|
||||
Port to VMS by:
|
||||
Klaus Kaempf <kkaempf@progis.de>
|
||||
Archive support/Bug fixes by:
|
||||
John W. Eaton <jwe@bevo.che.wisc.edu>
|
||||
Martin Zinser <zinser@decus.decus.de>
|
||||
|
||||
Port to Amiga by:
|
||||
Aaron Digulla <digulla@fh-konstanz.de>
|
||||
|
||||
|
||||
Port to MS-DOS (DJGPP) and MS-Windows 95/NT by:
|
||||
DJ Delorie <dj@delorie.com>
|
||||
Rob Tulloh <rob_tulloh@tivoli.com>
|
||||
Eli Zaretskii <eliz@is.elta.co.il>
|
||||
|
||||
-----------------------------------
|
||||
Other contributors:
|
||||
|
||||
Janet Carson <janet_carson@tivoli.com>
|
||||
Howard Chu <hyc@highlandsun.com>
|
||||
Paul Eggert <eggert@twinsun.com>
|
||||
Klaus Heinz <kamar@ease.rhein-main.de>
|
||||
Michael Joosten
|
||||
Jim Kelton <jim_kelton@tivoli.com>
|
||||
David Lubbren <uhay@rz.uni-karlsruhe.de>
|
||||
Tim Magill <tim.magill@telops.gte.com>
|
||||
Han-Wen Nienhuys <hanwen@cs.uu.nl>
|
||||
Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
|
||||
Carl Staelin (Princeton University)
|
||||
Ian Stewartson (Data Logic Limited)
|
||||
|
||||
With suggestions/comments/bug reports from a cast of ... well ...
|
||||
hundreds, anyway :)
|
||||
5
COPYING
5
COPYING
@@ -2,7 +2,8 @@
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 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.
|
||||
|
||||
@@ -305,7 +306,7 @@ the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
|
||||
287
GNUmakefile
287
GNUmakefile
@@ -1,287 +0,0 @@
|
||||
# GNU Make-specific makefile for GNU Make.
|
||||
|
||||
# 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)
|
||||
# any later version.
|
||||
#
|
||||
# GNU Make is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with GNU Make; see the file COPYING. If not, write to
|
||||
# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
.PHONY: default
|
||||
default:
|
||||
|
||||
# Set `ARCH' to a string for the type of machine.
|
||||
ifndef ARCH
|
||||
ifdef machine
|
||||
ARCH = $(machine)
|
||||
endif # machine
|
||||
endif # not ARCH
|
||||
|
||||
override srcdir := .
|
||||
override CC := $(CC)
|
||||
|
||||
ifeq ($(ARCH),hp300)
|
||||
#customs=yes
|
||||
endif
|
||||
ifdef customs
|
||||
override REMOTE := cstms
|
||||
else
|
||||
override REMOTE := stub
|
||||
endif
|
||||
|
||||
# Get most of the information from the Unix-compatible makefile.
|
||||
include compatMakefile
|
||||
|
||||
MAKE = $(MAKE_COMMAND) $(MAKEOVERRIDES)
|
||||
|
||||
# Remove autoconf magic.
|
||||
prefix = /usr/local
|
||||
exec_prefix = $(prefix)
|
||||
extras := $(filter-out getloadavg.o @%@,$(extras)) getloadavg.o
|
||||
LOADLIBES := $(filter-out @%@,$(LOADLIBES))
|
||||
ALLOCA := $(filter-out @%@,$(ALLOCA))
|
||||
CPPFLAGS := $(filter-out @%@,$(defines) $(CPPFLAGS)) -DHAVE_CONFIG_H
|
||||
|
||||
ifdef AC_MACRODIR
|
||||
configure config.h.in: $(patsubst %,$(AC_MACRODIR)/%.m4,acspecific acgeneral)
|
||||
config.h.in: $(AC_MACRODIR)/acconfig.h
|
||||
endif
|
||||
configure: configure.in aclocal.m4
|
||||
autoconf $(ACFLAGS)
|
||||
test -d CVS && cvs commit -m'autoconf $(ACFLAGS)' $@
|
||||
config.h.in: configure.in aclocal.m4
|
||||
autoheader $(ACFLAGS)
|
||||
test -d CVS && cvs commit -m'autoheader $(ACFLAGS)' $@
|
||||
|
||||
ifdef customs
|
||||
defines := $(defines) -Ipmake/customs -Ipmake/lib/include
|
||||
LOADLIBES := $(addprefix pmake/customs/,customslib.o rpc.o xlog.o) \
|
||||
pmake/lib/sprite/libsprite.a
|
||||
endif
|
||||
|
||||
ifdef ARCH
|
||||
|
||||
ifndef no_libc
|
||||
libc_dir = /home/gd2/gnu/libc/$(ARCH)
|
||||
ifneq ($(wildcard $(libc_dir)),)
|
||||
ifneq ($(wildcard $(libc_dir)/works-for-make),)
|
||||
#CPPFLAGS := -I$(libc_dir)/include
|
||||
#LDFLAGS := -nostdlib $(libc_dir)/lib/start.o
|
||||
#LOADLIBES := $(LOADLIBES) \
|
||||
# $(libc_dir)/lib/mcheck-init.o \
|
||||
# $(libc_dir)/lib/libc.a \
|
||||
# -lgcc \
|
||||
# $(libc_dir)/lib/libc.a
|
||||
CC := $(CC) -b glibc
|
||||
|
||||
# getopt is in libc.
|
||||
GETOPT =
|
||||
#GETOPT_SRC = Don't clear this or dist will break.
|
||||
|
||||
# glob is in libc too.
|
||||
GLOB =
|
||||
|
||||
else
|
||||
|
||||
endif # works-for-make
|
||||
endif # $(libc_dir)
|
||||
endif # !no_libc
|
||||
|
||||
# We know the type of machine, so put the binaries in subdirectories.
|
||||
$(ARCH)/%.o: %.c
|
||||
$(COMPILE.c) -Iglob $< $(OUTPUT_OPTION)
|
||||
$(ARCH)/glob/libglob.a: FORCE
|
||||
$(MAKE) -C $(@D) $(@F)
|
||||
FORCE:
|
||||
objs := $(addprefix $(ARCH)/,$(objs))
|
||||
prog := $(ARCH)/make
|
||||
|
||||
archpfx = $(ARCH)/
|
||||
|
||||
$(archpfx)load.o: load.c
|
||||
$(COMPILE.c) $(LOAD_AVG) $< -o $@
|
||||
$(archpfx)load.dep: load.c
|
||||
$(mkdep) $(LOAD_AVG) $< | sed 's,$*\.o,& $@,' > $@
|
||||
|
||||
CPPFLAGS := -I$(ARCH) -Iglob -DHAVE_CONFIG_H $(filter-out @%@,$(CPPFLAGS))
|
||||
|
||||
ifneq "$(wildcard $(ARCH)/makefile)" ""
|
||||
include $(ARCH)/makefile
|
||||
endif
|
||||
objs := $(objs) $(addprefix $(ARCH)/,$(ALLOCA) $(extras))
|
||||
|
||||
else # Not ARCH
|
||||
prog := make
|
||||
endif
|
||||
|
||||
ifneq "$(findstring gcc,$(CC))" ""
|
||||
CFLAGS = -g -Wall -Wtraditional -Wid-clash-31 -Wpointer-arith \
|
||||
-Wbad-function-cast -Wconversion
|
||||
else
|
||||
CFLAGS = -g
|
||||
endif
|
||||
LDFLAGS = -g
|
||||
|
||||
# Define the command to make dependencies.
|
||||
ifneq "$(findstring gcc,$(CC))" ""
|
||||
# Don't include system directories.
|
||||
mkdep-nolib = $(CC) -MM $(CPPFLAGS)
|
||||
else
|
||||
mkdep-nolib = $(mkdep)
|
||||
endif
|
||||
mkdep = $(CC) -M $(CPPFLAGS)
|
||||
|
||||
depfiles = $(patsubst %.o,%.dep,$(filter %.o,$(objs)))
|
||||
|
||||
|
||||
.PHONY: default
|
||||
default: $(prog)
|
||||
|
||||
$(prog): $(objs) $(globdep) #$(addprefix $(ARCH)/,gmalloc.o mcheck.o)
|
||||
$(CC) $(LDFLAGS) $^ $(globlib) $(LOADLIBES) -o $@.new
|
||||
mv -f $@.new $@
|
||||
|
||||
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 stamp-glob glob/*
|
||||
tar xvf $< glob
|
||||
cvs commit -m'Updated from libc' glob
|
||||
touch $@
|
||||
/home/gd/gnu/libc/posix/glob.tar: force
|
||||
$(MAKE) -C $(@D) $(@F) no_deps=t
|
||||
.PHONY: force
|
||||
force:
|
||||
|
||||
# Make the Unix-compatible Makefile to be distributed by appending
|
||||
# the automatically-generated dependencies to compatMakefile.
|
||||
ifeq ($(mkdep),$(mkdep-nolib))
|
||||
nolib-deps = $(depfiles)
|
||||
else
|
||||
%.dep: %.c
|
||||
$(mkdep-nolib) $< | sed -e 's,$*\.o,$(@:.dep=.o) $@,' > $(@:.dep=.dtm)
|
||||
mv -f $(@:.dep=.dtm) $@
|
||||
nolib-deps = $(patsubst $(archpfx)%,%,$(depfiles))
|
||||
endif
|
||||
# The distributed Makefile.in should contain deps for remote-stub only.
|
||||
Makefile.in: compatMakefile $(nolib-deps:remote-%.dep=remote-stub.dep)
|
||||
(sed 's/^MAKE[ ]*=.*$$/@SET_MAKE@/' $<; \
|
||||
echo '# Automatically generated dependencies.'; \
|
||||
sed -e 's/ [^ ]*\.dep//' -e 's=$(archpfx)==' $(filter-out $<,$^) \
|
||||
) > $@
|
||||
cvs commit -mRegenerated $@
|
||||
|
||||
.SUFFIXES: .dep
|
||||
# Maintain the automatically-generated dependencies.
|
||||
ifndef no_deps
|
||||
include $(depfiles)
|
||||
endif
|
||||
$(archpfx)%.dep: %.c
|
||||
$(mkdep) $< | sed 's,$*\.o,$(@:.dep=.o) $@,' > $@
|
||||
|
||||
ETAGS = etags -T # for v19 etags
|
||||
|
||||
# Run the tests.
|
||||
.PHONY: tests
|
||||
testdir := $(shell ls -d1 make-test-?.? | sort -n +0.10 -0.11 +0.12 | tail -1l)
|
||||
tests:# $(testdir)/run_make_tests.pl $(prog)
|
||||
# cd $(<D); MAKELEVEL=0 perl $(<F)
|
||||
|
||||
build.sh.in: build.template compatMakefile
|
||||
sed -e 's@%objs%@$(filter-out remote-% $(GLOB) $(ALLOCA) $(extras),\
|
||||
$(patsubst $(archpfx)%,%,$(objs)))\
|
||||
$(patsubst %.c,%.o,$(filter %.c,$(globfiles)))@' \
|
||||
$< > $@.new
|
||||
chmod a+x $@.new
|
||||
mv -f $@.new $@
|
||||
cvs commit -mRegenerated $@
|
||||
|
||||
# Make the distribution tar files.
|
||||
|
||||
.PHONY: dist
|
||||
# Figure out the version number from the source of `version.c'.
|
||||
version := \
|
||||
$(strip $(shell sed -e '/=/!d' -e 's/^.*"\(.*\)";$$/\1/' < version.c))
|
||||
tarfiles := make # make-doc
|
||||
tarfiles := $(addsuffix -$(version).tar,$(tarfiles))
|
||||
tarfiles := $(tarfiles:%=%.gz) # no more compress $(tarfiles:%=%.Z)
|
||||
# Depend on default and doc so we don't ship anything that won't compile.
|
||||
dist: cvs-mark default info dvi tests tarfiles
|
||||
.PHONY: tarfiles
|
||||
tarfiles: $(tarfiles)
|
||||
|
||||
distfiles=README INSTALL COPYING ChangeLog NEWS \
|
||||
configure Makefile.in configure.in build.sh.in mkinstalldirs \
|
||||
configh.dos configure.bat \
|
||||
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 \
|
||||
make.info make.info*
|
||||
|
||||
ifndef dist-flavor
|
||||
dist-flavor = alpha
|
||||
endif
|
||||
.PHONY: cvs-mark
|
||||
cvs-mark: $(distfiles)
|
||||
cvs tag -F make-$(subst .,-,$(version))
|
||||
|
||||
dist: local-inst
|
||||
.PHONY: local-inst
|
||||
local-inst: $(prog)
|
||||
install -c -g kmem -o $(USER) -m 2755 $< /usr/local/gnubin/make
|
||||
|
||||
# Put the alpha distribution files in the anonymous FTP directory.
|
||||
alpha-files = $(tarfiles) GNUmakefile compatMakefile $(testdir).tar.Z
|
||||
dist: alpha
|
||||
.PHONY: alpha
|
||||
alpha-dir := ~ftp/gnu
|
||||
alpha-files := $(addprefix $(alpha-dir)/,$(alpha-files))
|
||||
alpha: $(alpha-dir) $(alpha-files)
|
||||
$(alpha-dir)/%: %
|
||||
@rm -f $@
|
||||
cp $< $@
|
||||
|
||||
# Implicit rule to make README and README-doc.
|
||||
%: %.template version.c
|
||||
rm -f $@
|
||||
sed 's/VERSION/$(version)/' < $< > $@
|
||||
# Make sure I don't edit it by accident.
|
||||
chmod a-w $@
|
||||
cvs commit -m'Regenerated for $(version)' $@
|
||||
|
||||
define make-tar
|
||||
@rm -fr make-$(version)
|
||||
ln -s . make-$(version)
|
||||
tar cvhof $@ $(addprefix make-$(version)/,$^)
|
||||
rm -f make-$(version)
|
||||
endef
|
||||
|
||||
%.Z: %; compress -c $< > $@
|
||||
%.gz: %; gzip -9 -c -v $< > $@
|
||||
|
||||
make-$(version).tar: $(distfiles)
|
||||
$(make-tar)
|
||||
|
||||
ifneq (,)
|
||||
tests := $(filter-out %~,$(wildcard tests/*))
|
||||
make-tests-$(version).tar.Z: $(tests)
|
||||
@rm -fr make-tests-$(version)
|
||||
ln -s tests make-tests-$(version)
|
||||
tar cvhf $(@:.Z=) $(patsubst tests/%,make-tests-$(version)/%,$^)
|
||||
rm -f make-tests-$(version)
|
||||
compress -f $(@:.Z=)
|
||||
endif
|
||||
|
||||
$(archpfx)loadtest: $(archpfx)load.o
|
||||
14
INSTALL
14
INSTALL
@@ -1,8 +1,6 @@
|
||||
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.
|
||||
@@ -36,7 +34,13 @@ The simplest way to compile this package is:
|
||||
|
||||
2. Type `make' to compile the package.
|
||||
|
||||
3. Optionally, type `make check' to run any self-tests that come with
|
||||
If you're building GNU make on a system which does not already have
|
||||
a `make', you can use the build.sh shell script to compile. Run
|
||||
`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.
|
||||
|
||||
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
|
||||
@@ -167,7 +171,9 @@ operates.
|
||||
`--quiet'
|
||||
`--silent'
|
||||
`-q'
|
||||
Do not print messages saying which checks are being made.
|
||||
Do not print messages saying which checks are being made. To
|
||||
suppress all normal output, redirect it to `/dev/null' (any error
|
||||
messages will still be shown).
|
||||
|
||||
`--srcdir=DIR'
|
||||
Look for the package's source code in directory DIR. Usually
|
||||
|
||||
519
Makefile.DOS.template
Normal file
519
Makefile.DOS.template
Normal file
@@ -0,0 +1,519 @@
|
||||
# -*-Makefile-*- template for DJGPP
|
||||
# Makefile.in generated automatically by automake 1.2 from Makefile.am
|
||||
|
||||
# Copyright (C) 1994, 1995-1998, 1999 Free Software Foundation, Inc.
|
||||
# This Makefile.DOS is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy, distribute and modify it.
|
||||
|
||||
# -*-Makefile-*-, or close enough
|
||||
|
||||
|
||||
SHELL = /bin/sh
|
||||
|
||||
srcdir = .
|
||||
VPATH = $(srcdir)
|
||||
# $DJDIR is defined automatically by DJGPP to point
|
||||
# to the root of the DJGPP installation tree.
|
||||
prefix = ${DJDIR}
|
||||
exec_prefix = ${prefix}
|
||||
|
||||
bindir = ${exec_prefix}/bin
|
||||
datadir = ${prefix}/share
|
||||
libdir = ${prefix}/lib
|
||||
infodir = ${prefix}/info
|
||||
# DJGPP doesn't have separate man tree, use info instead.
|
||||
mandir = ${prefix}/info
|
||||
includedir = ${prefix}/include
|
||||
oldincludedir = c:/djgpp/include
|
||||
|
||||
pkgdatadir = $(datadir)/make
|
||||
pkglibdir = $(libdir)/make
|
||||
pkgincludedir = $(includedir)/make
|
||||
|
||||
INSTALL = ${bindir}/ginstall -c
|
||||
INSTALL_PROGRAM = ${bindir}/ginstall -c
|
||||
INSTALL_DATA = ${bindir}/ginstall -c -m 644
|
||||
INSTALL_SCRIPT = ${bindir}/ginstall -c
|
||||
transform = s,x,x,
|
||||
|
||||
# This will fail even if they don't have a Unix-like shell (stock DOS
|
||||
# shell doesn't know about `false'). The only difference is that they
|
||||
# get "Error -1" instead of "Error 1".
|
||||
EXIT_FAIL = false
|
||||
|
||||
NORMAL_INSTALL = :
|
||||
PRE_INSTALL = :
|
||||
POST_INSTALL = :
|
||||
NORMAL_UNINSTALL = :
|
||||
PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
AR = ar
|
||||
CC = gcc
|
||||
CPP = gcc -E
|
||||
LIBOBJS =
|
||||
MAKEINFO = ${bindir}/makeinfo
|
||||
PACKAGE = make
|
||||
RANLIB = ranlib
|
||||
REMOTE = stub
|
||||
VERSION = %VERSION%
|
||||
|
||||
AUTOMAKE_OPTIONS = 1.2
|
||||
|
||||
bin_PROGRAMS = %PROGRAMS%
|
||||
|
||||
make_SOURCES = %SOURCES%
|
||||
# This should include the glob/ prefix
|
||||
libglob_a_SOURCES = %GLOB_SOURCES%
|
||||
make_LDADD = glob/libglob.a
|
||||
|
||||
info_TEXINFOS = make.texinfo
|
||||
man_MANS = make.1
|
||||
|
||||
INCLUDES = -I$(srcdir)/glob -DLIBDIR=\"c:/djgpp/lib\" -DINCLUDEDIR=\"c:/djgpp/include\"
|
||||
|
||||
BUILT_SOURCES = README build.sh.in
|
||||
|
||||
EXTRA_DIST = $(BUILT_SOURCES) $(man_MANS) README.customs remote-cstms.c make-stds.texi texinfo.tex SCOPTIONS SMakefile Makefile.ami README.Amiga config.ami amiga.c amiga.h NMakefile README.DOS configh.dos configure.bat makefile.com README.W32 build_w32.bat config.h.W32 subproc.bat make.lnk config.h-vms makefile.vms readme.vms vmsdir.h vmsfunctions.c vmsify.c
|
||||
|
||||
SUBDIRS = glob
|
||||
mkinstalldirs = ${bindir}/gmkdir -p
|
||||
CONFIG_HEADER = config.h
|
||||
CONFIG_CLEAN_FILES = build.sh
|
||||
PROGRAMS = $(bin_PROGRAMS)
|
||||
|
||||
|
||||
DEFS = -I. -I$(srcdir) -I.
|
||||
CPPFLAGS = -DHAVE_CONFIG_H
|
||||
LDFLAGS =
|
||||
LIBS =
|
||||
make_OBJECTS = %OBJECTS%
|
||||
make_DEPENDENCIES = glob/libglob.a
|
||||
make_LDFLAGS =
|
||||
libglob_a_LIBADD =
|
||||
libglob_a_OBJECTS = %GLOB_OBJECTS%
|
||||
noinst_LIBRARIES = glob/libglob.a
|
||||
CFLAGS = -O2 -g
|
||||
COMPILE = $(CC) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS)
|
||||
LINK = $(CC) $(CFLAGS) $(LDFLAGS) -o $@
|
||||
TEXI2DVI = texi2dvi
|
||||
TEXINFO_TEX = $(srcdir)/texinfo.tex
|
||||
INFO_DEPS = make.info
|
||||
DVIS = make.dvi
|
||||
TEXINFOS = make.texinfo
|
||||
man1dir = $(mandir)/man1
|
||||
MANS = $(man_MANS)
|
||||
|
||||
NROFF = nroff
|
||||
DIST_COMMON = README AUTHORS COPYING ChangeLog INSTALL Makefile.am Makefile.in NEWS acconfig.h aclocal.m4 alloca.c build.sh.in config.h.in configure configure.in getloadavg.c install-sh missing mkinstalldirs stamp-h.in texinfo.tex
|
||||
|
||||
|
||||
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
|
||||
|
||||
TAR = gtar
|
||||
GZIP = --best
|
||||
SOURCES = $(make_SOURCES)
|
||||
OBJECTS = $(make_OBJECTS)
|
||||
HEADERS = $(wildcard $(srcdir)/*.h)
|
||||
|
||||
default: all
|
||||
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .S .c .dvi .info .o .ps .s .texi .texinfo .txi
|
||||
|
||||
mostlyclean-hdr:
|
||||
|
||||
clean-hdr:
|
||||
|
||||
distclean-hdr:
|
||||
-rm -f config.h
|
||||
|
||||
maintainer-clean-hdr:
|
||||
|
||||
mostlyclean-binPROGRAMS:
|
||||
|
||||
clean-binPROGRAMS:
|
||||
-test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
|
||||
|
||||
distclean-binPROGRAMS:
|
||||
|
||||
maintainer-clean-binPROGRAMS:
|
||||
|
||||
install-binPROGRAMS: $(bin_PROGRAMS)
|
||||
@$(NORMAL_INSTALL)
|
||||
$(mkinstalldirs) $(DESTDIR)$(bindir)
|
||||
@list='$(bin_PROGRAMS)'; for p in $$list; do if test -f $$p; then echo " $(INSTALL_PROGRAM) $$p $(bindir)/`echo $$p | sed '$(transform)'`"; $(INSTALL_PROGRAM) $$p $(bindir)/`echo $$p | sed '$(transform)'`; else :; fi; done
|
||||
|
||||
uninstall-binPROGRAMS:
|
||||
$(NORMAL_UNINSTALL)
|
||||
list='$(bin_PROGRAMS)'; for p in $$list; do rm -f $(bindir)/`echo $$p|sed '$(transform)'`.exe; done
|
||||
|
||||
.c.o:
|
||||
$(COMPILE) -c $<
|
||||
|
||||
.s.o:
|
||||
$(COMPILE) -c $<
|
||||
|
||||
.S.o:
|
||||
$(COMPILE) -c $<
|
||||
|
||||
clean-noinstLIBRARIES:
|
||||
-test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES)
|
||||
|
||||
mostlyclean-compile:
|
||||
-rm -f *.o *.exe make.new core
|
||||
|
||||
clean-compile:
|
||||
|
||||
distclean-compile:
|
||||
-rm -f *.tab.c *_tab.c
|
||||
|
||||
maintainer-clean-compile:
|
||||
|
||||
make: $(make_OBJECTS) $(make_DEPENDENCIES)
|
||||
@command.com /c if exist make del make
|
||||
@command.com /c if exist make.exe del make.exe
|
||||
$(LINK) $(make_LDFLAGS) $(make_OBJECTS) $(make_LDADD) $(LIBS)
|
||||
|
||||
make.info: make.texinfo
|
||||
make.dvi: make.texinfo
|
||||
|
||||
|
||||
DVIPS = dvips
|
||||
|
||||
.texi.info:
|
||||
$(MAKEINFO) $(srcdir)/$< -o ./$@
|
||||
|
||||
.texi.dvi:
|
||||
TEXINPUTS="$(srcdir);$$TEXINPUTS" MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $<
|
||||
|
||||
.texi:
|
||||
$(MAKEINFO) $(srcdir)/$< -o ./$@
|
||||
|
||||
.texinfo.info:
|
||||
$(MAKEINFO) $(srcdir)/$< -o ./$@
|
||||
|
||||
.texinfo:
|
||||
$(MAKEINFO) $(srcdir)/$< -o ./$@
|
||||
|
||||
.texinfo.dvi:
|
||||
TEXINPUTS="$(srcdir);$$TEXINPUTS" MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $<
|
||||
|
||||
.txi.info:
|
||||
$(MAKEINFO) $(srcdir)/$< -o ./$@
|
||||
|
||||
.txi.dvi:
|
||||
TEXINPUTS="$(srcdir);$$TEXINPUTS" MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $<
|
||||
|
||||
.dvi.ps:
|
||||
$(DVIPS) $< -o $@
|
||||
|
||||
install-info-am: $(INFO_DEPS)
|
||||
@$(NORMAL_INSTALL)
|
||||
$(mkinstalldirs) $(DESTDIR)$(infodir)
|
||||
@for file in $(INFO_DEPS) make.i; do d=$(srcdir); for ifile in `cd $$d && echo $$file $$file-[0-9] $$file-[0-9][0-9] $$file[0-9] $$file[0-9][0-9]`; do if test -f $$d/$$ifile; then echo " $(INSTALL_DATA) $$d/$$ifile $(DESTDIR)$(infodir)/$$ifile"; $(INSTALL_DATA) $$d/$$ifile $(DESTDIR)$(infodir)/$$ifile; else : ; fi; done; done
|
||||
@$(POST_INSTALL)
|
||||
@if $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then for file in $(INFO_DEPS); do echo " install-info --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/$$file"; install-info --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/$$file || :; done; else : ; fi
|
||||
|
||||
uninstall-info:
|
||||
$(PRE_UNINSTALL)
|
||||
@if $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then ii=yes; else ii=; fi; for file in $(INFO_DEPS); do test -z $ii || install-info --info-dir=$(DESTDIR)$(infodir) --remove $$file; done
|
||||
$(NORMAL_UNINSTALL)
|
||||
for file in $(INFO_DEPS) make.i; do (cd $(DESTDIR)$(infodir) && rm -f $$file $$file-[0-9] $$file-[0-9][0-9] $$file[0-9] $$file[0-9][0-9]); done
|
||||
|
||||
dist-info: $(INFO_DEPS)
|
||||
for base in $(INFO_DEPS); do d=$(srcdir); for file in `cd $$d && eval echo $$base*`; do test -f $(distdir)/$$file || ln $$d/$$file $(distdir)/$$file 2> /dev/null || cp -p $$d/$$file $(distdir)/$$file; done; done
|
||||
|
||||
mostlyclean-aminfo:
|
||||
-rm -f make.aux make.cp make.cps make.dvi make.fn make.fns make.ky \
|
||||
make.kys make.ps make.log make.pg make.toc make.tp make.tps \
|
||||
make.vr make.vrs make.op make.tr make.cv make.cn
|
||||
|
||||
clean-aminfo:
|
||||
|
||||
distclean-aminfo:
|
||||
|
||||
maintainer-clean-aminfo:
|
||||
for i in $(INFO_DEPS) make.i; do rm -f `eval echo $$i*`; done
|
||||
|
||||
install-man1:
|
||||
$(mkinstalldirs) $(DESTDIR)$(man1dir)
|
||||
@list='$(man1_MANS)'; \
|
||||
l2='$(man_MANS)'; for i in $$l2; do \
|
||||
case "$$i" in \
|
||||
*.1*) list="$$list $$i" ;; \
|
||||
esac; \
|
||||
done; \
|
||||
for i in $$list; do \
|
||||
if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \
|
||||
else file=$$i; fi; \
|
||||
ext=`echo $$i | sed -e 's/^.*\\.//'`; \
|
||||
inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
|
||||
inst=`echo $$inst | sed '$(transform)'`.$$ext; \
|
||||
echo " $(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst"; \
|
||||
$(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst; \
|
||||
done
|
||||
|
||||
uninstall-man1:
|
||||
@list='$(man1_MANS)'; \
|
||||
l2='$(man_MANS)'; for i in $$l2; do \
|
||||
case "$$i" in \
|
||||
*.1*) list="$$list $$i" ;; \
|
||||
esac; \
|
||||
done; \
|
||||
for i in $$list; do \
|
||||
ext=`echo $$i | sed -e 's/^.*\\.//'`; \
|
||||
inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
|
||||
inst=`echo $$inst | sed '$(transform)'`.$$ext; \
|
||||
echo " rm -f $(DESTDIR)$(man1dir)/$$inst"; \
|
||||
rm -f $(DESTDIR)$(man1dir)/$$inst; \
|
||||
done
|
||||
install-man: $(MANS)
|
||||
@$(NORMAL_INSTALL)
|
||||
$(MAKE) install-man1
|
||||
uninstall-man:
|
||||
@$(NORMAL_UNINSTALL)
|
||||
$(MAKE) uninstall-man1
|
||||
|
||||
# Assume that the only thing to do in glob is to build libglob.a,
|
||||
# but do a sanity check: if $SUBDIRS will ever have more than
|
||||
# a single directory, yell bloody murder.
|
||||
all-recursive:
|
||||
ifeq ($(words $(SUBDIRS)), 1)
|
||||
@command.com /c if not exist glob\\nul md glob
|
||||
@echo Making all in $(SUBDIRS)
|
||||
$(MAKE) -C $(SUBDIRS) -f ../Makefile INCLUDES='-I$(srcdir) -I$(srcdir)/glob' DEFS='-I.. -I$(srcdir)' VPATH=$(srcdir)/glob libglob.a
|
||||
else
|
||||
@echo FATAL: There is more than one directory in "($(SUBDIRS))"
|
||||
@$(EXIT_FAIL)
|
||||
endif
|
||||
|
||||
$(SUBDIRS):
|
||||
command.com /c md $@
|
||||
|
||||
libglob.a: $(libglob_a_OBJECTS)
|
||||
command.com /c if exist libglob.a del libglob.a
|
||||
$(AR) cru libglob.a $(libglob_a_OBJECTS) $(libglob_a_LIBADD)
|
||||
$(RANLIB) libglob.a
|
||||
|
||||
mostlyclean-recursive clean-recursive distclean-recursive maintainer-clean-recursive:
|
||||
ifeq ($(words $(SUBDIRS)), 1)
|
||||
@echo Making $(shell echo $@ | sed s/-recursive//) in $(SUBDIRS)
|
||||
$(MAKE) -C $(SUBDIRS) -f ../Makefile $(shell echo $@ | sed s/-recursive//)-am
|
||||
else
|
||||
@echo FATAL: There is more than one directory in "($(SUBDIRS))"
|
||||
@$(EXIT_FAIL)
|
||||
endif
|
||||
|
||||
tags-in-glob: $(libglob_a_SOURCES)
|
||||
etags $(addprefix $(srcdir)/,$^) -o ./glob/TAGS
|
||||
|
||||
tags-recursive:
|
||||
ifeq ($(words $(SUBDIRS)), 1)
|
||||
$(MAKE) tags-in-glob
|
||||
else
|
||||
@echo FATAL: There is more than one directory in "($(SUBDIRS))"
|
||||
@$(EXIT_FAIL)
|
||||
endif
|
||||
|
||||
tags: TAGS
|
||||
|
||||
ID: $(HEADERS) $(SOURCES)
|
||||
mkid $(srcdir)/$(SOURCES) $(srcdir)/$(libglob_a_SOURCES) ./config.h $(HEADERS)
|
||||
|
||||
TAGS: tags-recursive $(HEADERS) $(srcdir)/$(SOURCES) config.h $(TAGS_DEPENDENCIES)
|
||||
etags -i ./glob/TAGS $(ETAGS_ARGS) $(srcdir)/$(SOURCES) ./config.h $(HEADERS)
|
||||
|
||||
mostlyclean-tags:
|
||||
|
||||
clean-tags:
|
||||
|
||||
distclean-tags:
|
||||
-rm -f TAGS ID
|
||||
|
||||
maintainer-clean-tags:
|
||||
|
||||
distdir = $(PACKAGE)-$(VERSION)
|
||||
top_distdir = $(distdir)
|
||||
|
||||
# This target untars the dist file and tries a VPATH configuration. Then
|
||||
# it guarantees that the distribution is self-contained by making another
|
||||
# tarfile.
|
||||
distcheck: dist
|
||||
rm -rf $(distdir)
|
||||
GZIP=$(GZIP) $(TAR) zxf $(distdir).tar.gz
|
||||
mkdir $(distdir)/=build
|
||||
mkdir $(distdir)/=inst
|
||||
dc_install_base=`cd $(distdir)/=inst && pwd`; cd $(distdir)/=build && ../configure --srcdir=.. --prefix=$$dc_install_base && $(MAKE) && $(MAKE) dvi && $(MAKE) check && $(MAKE) install && $(MAKE) installcheck && $(MAKE) dist
|
||||
rm -rf $(distdir)
|
||||
@echo "========================"; echo "$(distdir).tar.gz is ready for distribution"; echo "========================"
|
||||
dist: distdir
|
||||
-chmod -R a+r $(distdir)
|
||||
GZIP=$(GZIP) $(TAR) chozf $(distdir).tar.gz $(distdir)
|
||||
rm -rf $(distdir)
|
||||
dist-all: distdir
|
||||
-chmod -R a+r $(distdir)
|
||||
GZIP=$(GZIP) $(TAR) chozf $(distdir).tar.gz $(distdir)
|
||||
rm -rf $(distdir)
|
||||
distdir: $(DISTFILES)
|
||||
rm -rf $(distdir)
|
||||
mkdir $(distdir)
|
||||
-chmod 777 $(distdir)
|
||||
@for file in $(DISTFILES); do d=$(srcdir); test -f $(distdir)/$$file || ln $$d/$$file $(distdir)/$$file 2> /dev/null || cp -p $$d/$$file $(distdir)/$$file; done; for subdir in $(SUBDIRS); do test -d $(distdir)/$$subdir || mkdir $(distdir)/$$subdir || exit 1; chmod 777 $(distdir)/$$subdir; (cd $$subdir && $(MAKE) top_distdir=../$(top_distdir)/$$subdir distdir=../$(distdir)/$$subdir distdir) || exit 1; done
|
||||
$(MAKE) top_distdir="$(top_distdir)" distdir="$(distdir)" dist-info
|
||||
$(MAKE) top_distdir="$(top_distdir)" distdir="$(distdir)" dist-hook
|
||||
|
||||
info: $(INFO_DEPS) info-recursive
|
||||
dvi: $(DVIS) dvi-recursive
|
||||
check: all-am
|
||||
$(MAKE) check-recursive check-local
|
||||
installcheck: installcheck-recursive
|
||||
all-recursive-am: config.h
|
||||
$(MAKE) all-recursive
|
||||
|
||||
all-am: Makefile $(INFO_DEPS) $(PROGRAMS) config.h
|
||||
|
||||
install-exec-am: install-binPROGRAMS
|
||||
|
||||
install-data-am: install-info-am
|
||||
|
||||
uninstall-am: uninstall-binPROGRAMS uninstall-info
|
||||
|
||||
install-exec: install-exec-recursive install-exec-am
|
||||
@$(NORMAL_INSTALL)
|
||||
|
||||
install-data: install-data-recursive install-data-am
|
||||
@$(NORMAL_INSTALL)
|
||||
|
||||
install: install-recursive install-exec-am install-data-am
|
||||
@:
|
||||
|
||||
uninstall: uninstall-recursive uninstall-am
|
||||
|
||||
all: all-recursive-am all-am
|
||||
|
||||
install-strip:
|
||||
$(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install
|
||||
installdirs: installdirs-recursive
|
||||
$(mkinstalldirs) $(bindir) $(infodir)
|
||||
|
||||
|
||||
mostlyclean-generic:
|
||||
-test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
|
||||
|
||||
clean-generic:
|
||||
-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
|
||||
|
||||
distclean-generic:
|
||||
-rm -f Makefile $(DISTCLEANFILES)
|
||||
-rm -f config.cache config.log stamp-h stamp-h[0-9]*
|
||||
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
|
||||
|
||||
maintainer-clean-generic:
|
||||
-test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
|
||||
-test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
|
||||
mostlyclean-am: mostlyclean-hdr mostlyclean-binPROGRAMS mostlyclean-compile mostlyclean-aminfo mostlyclean-tags mostlyclean-generic
|
||||
|
||||
clean-am: clean-hdr clean-binPROGRAMS clean-compile clean-aminfo clean-tags clean-generic mostlyclean-am
|
||||
|
||||
distclean-am: distclean-hdr distclean-binPROGRAMS distclean-compile distclean-aminfo distclean-tags distclean-generic clean-am
|
||||
|
||||
maintainer-clean-am: maintainer-clean-hdr maintainer-clean-binPROGRAMS maintainer-clean-compile maintainer-clean-aminfo maintainer-clean-tags maintainer-clean-generic distclean-am
|
||||
|
||||
mostlyclean: mostlyclean-recursive mostlyclean-am
|
||||
|
||||
clean: clean-noinstLIBRARIES clean-recursive clean-am
|
||||
|
||||
distclean: distclean-recursive distclean-am
|
||||
rm -f config.status
|
||||
|
||||
maintainer-clean: maintainer-clean-recursive maintainer-clean-am
|
||||
@echo "This command is intended for maintainers to use;"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
rm -f config.status
|
||||
|
||||
.PHONY: default mostlyclean-hdr distclean-hdr clean-hdr \
|
||||
maintainer-clean-hdr mostlyclean-binPROGRAMS distclean-binPROGRAMS \
|
||||
clean-binPROGRAMS maintainer-clean-binPROGRAMS uninstall-binPROGRAMS \
|
||||
install-binPROGRAMS mostlyclean-compile distclean-compile clean-compile \
|
||||
maintainer-clean-compile install-info-am uninstall-info \
|
||||
mostlyclean-aminfo distclean-aminfo clean-aminfo \
|
||||
maintainer-clean-aminfo install-data-recursive uninstall-data-recursive \
|
||||
install-exec-recursive uninstall-exec-recursive installdirs-recursive \
|
||||
uninstalldirs-recursive all-recursive check-recursive \
|
||||
installcheck-recursive info-recursive dvi-recursive \
|
||||
mostlyclean-recursive distclean-recursive clean-recursive \
|
||||
maintainer-clean-recursive tags tags-recursive mostlyclean-tags \
|
||||
distclean-tags clean-tags maintainer-clean-tags distdir \
|
||||
mostlyclean-depend distclean-depend clean-depend \
|
||||
maintainer-clean-depend info dvi check-local installcheck \
|
||||
all-recursive-am all-am install-exec-am install-data-am uninstall-am \
|
||||
install-exec install-data install uninstall all installdirs \
|
||||
mostlyclean-generic distclean-generic clean-generic \
|
||||
maintainer-clean-generic clean mostlyclean distclean maintainer-clean
|
||||
|
||||
|
||||
# --------------- Local DIST Section
|
||||
|
||||
# Install the w32 subdirectory
|
||||
#
|
||||
dist-hook:
|
||||
(cd $(srcdir); \
|
||||
w32=`find w32 -follow \( -name CVS -prune \) -o -type f -print`; \
|
||||
tar chf - $$w32) \
|
||||
| (cd $(distdir); tar xfBp -)
|
||||
|
||||
# --------------- Local CHECK Section
|
||||
|
||||
check-local: check-loadavg check-regression
|
||||
.PHONY: check-loadavg check-regression
|
||||
|
||||
# > check-loadavg
|
||||
#
|
||||
loadavg: loadavg.c config.h
|
||||
@rm -f loadavg
|
||||
$(LINK) -DTEST $(make_LDFLAGS) loadavg.c $(LIBS)
|
||||
# We copy getloadavg.c into a different file rather than compiling it
|
||||
# directly because some compilers clobber getloadavg.o in the process.
|
||||
loadavg.c: getloadavg.c
|
||||
ln $(srcdir)/getloadavg.c loadavg.c || \
|
||||
cp $(srcdir)/getloadavg.c loadavg.c
|
||||
check-loadavg: loadavg
|
||||
@echo The system uptime program believes the load average to be:
|
||||
-uptime
|
||||
@echo The GNU load average checking code believes:
|
||||
-./loadavg
|
||||
|
||||
# > check-regression
|
||||
#
|
||||
# Look for the make test suite, and run it if found. Look in MAKE_TEST if
|
||||
# specified, or else in the srcdir or the distdir, their parents, and _their_
|
||||
# parents.
|
||||
#
|
||||
check-regression:
|
||||
here=`pwd`; testdir=""; \
|
||||
case "$(MAKE_TEST)" in "") \
|
||||
for d1 in $$here $(srcdir); do \
|
||||
for d2 in ../.. .. .; do \
|
||||
all=`echo $$d1/$$d2/make-test-[0-9]*/run_make_tests`; \
|
||||
case "$$all" in \
|
||||
"$$d1/$$d2/make-test-[0-9]*/run_make_tests") : ;; \
|
||||
*) try=`for x in $$all; do echo $$x; done | sort | tail -1`;\
|
||||
testdir=`dirname $$try` ;; esac; \
|
||||
done; done ;; \
|
||||
*) testdir="$(MAKE_TEST)" ;; \
|
||||
esac; \
|
||||
case "$$testdir" in \
|
||||
"") echo "Couldn't find make-test-* test suite."; exit 0;; \
|
||||
esac; \
|
||||
echo "cd $$testdir && ./run_make_tests -make_path $$here/make"; \
|
||||
cd $$testdir && ./run_make_tests -make_path $$here/make
|
||||
|
||||
# --------------- Maintainer's Section
|
||||
|
||||
# Note this requires GNU make. Not to worry, since it will only be included
|
||||
# in the Makefile if we're in the maintainer's environment.
|
||||
#include $(srcdir)/maintMakefile
|
||||
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
.NOEXPORT:
|
||||
134
Makefile.am
Normal file
134
Makefile.am
Normal file
@@ -0,0 +1,134 @@
|
||||
# This is a -*-Makefile-*-, or close enough
|
||||
|
||||
AUTOMAKE_OPTIONS = 1.4
|
||||
|
||||
bin_PROGRAMS = make
|
||||
|
||||
make_SOURCES = main.c commands.c job.c dir.c file.c misc.c read.c remake.c \
|
||||
rule.c implicit.c default.c variable.c expand.c function.c \
|
||||
vpath.c version.c ar.c arscan.c remote-$(REMOTE).c \
|
||||
commands.h dep.h filedef.h job.h make.h rule.h variable.h \
|
||||
signame.c signame.h \
|
||||
getopt.c getopt1.c getopt.h
|
||||
make_LDADD = @LIBOBJS@ @ALLOCA@ @GLOBLIB@
|
||||
|
||||
info_TEXINFOS = make.texinfo
|
||||
man_MANS = make.1
|
||||
|
||||
INCLUDES = -DLIBDIR=\"$(libdir)\" -DINCLUDEDIR=\"$(includedir)\"
|
||||
|
||||
EXTRA_DIST = README build.sh.in $(man_MANS) README.customs remote-cstms.c\
|
||||
make-stds.texi texinfo.tex SCOPTIONS SMakefile\
|
||||
README.Amiga Makefile.ami config.ami make.lnk amiga.c amiga.h\
|
||||
README.DOS Makefile.DOS configure.bat dosbuild.bat configh.dos\
|
||||
README.W32 NMakefile config.h.W32 build_w32.bat subproc.bat\
|
||||
readme.vms makefile.vms makefile.com config.h-vms vmsdir.h\
|
||||
vmsfunctions.c vmsify.c
|
||||
|
||||
SUBDIRS = glob
|
||||
|
||||
MOSTLYCLEANFILES = loadavg.c
|
||||
CLEANFILES = loadavg
|
||||
|
||||
|
||||
# --------------- Local INSTALL Section
|
||||
|
||||
# If necessary, change the gid of the app and turn on the setgid flag.
|
||||
#
|
||||
|
||||
# Whether or not make needs to be installed setgid.
|
||||
# The value should be either `true' or `false'.
|
||||
# On many systems, the getloadavg function (used to implement the `-l'
|
||||
# switch) will not work unless make is installed setgid kmem.
|
||||
#
|
||||
inst_setgid = @NEED_SETGID@
|
||||
|
||||
# Install make setgid to this group so it can get the load average.
|
||||
#
|
||||
inst_group = @KMEM_GROUP@
|
||||
|
||||
install-exec-local:
|
||||
@if $(inst_setgid); then \
|
||||
app=$(DESTDIR)$(bindir)/`echo $(bin_PROGRAMS)|sed '$(transform)'`; \
|
||||
if chgrp $(inst_group) $$app && chmod g+s $$app; then \
|
||||
echo "chgrp $(inst_group) $$app && chmod g+s $$app"; \
|
||||
else \
|
||||
echo "$$app needs to be owned by group $(inst_group) and setgid;"; \
|
||||
echo "otherwise the \`-l' option will probably not work."; \
|
||||
echo "You may need special privileges to complete the installation"; \
|
||||
echo "of $$app."; \
|
||||
fi; \
|
||||
else true; fi
|
||||
|
||||
# --------------- Local DIST Section
|
||||
|
||||
# Install the w32 subdirectory
|
||||
#
|
||||
dist-hook:
|
||||
(cd $(srcdir); \
|
||||
w32=`find w32 -follow \( -name CVS -prune \) -o \( -name \*.orig -o -name \*.rej -o -name \*~ -prune \) -o -type f -print`; \
|
||||
tar chf - $$w32) \
|
||||
| (cd $(distdir); tar xfBp -)
|
||||
|
||||
|
||||
# --------------- Local CHECK Section
|
||||
|
||||
check-local: check-loadavg check-regression
|
||||
.PHONY: check-loadavg check-regression
|
||||
|
||||
# > check-loadavg
|
||||
#
|
||||
loadavg: loadavg.c config.h
|
||||
@rm -f loadavg
|
||||
$(LINK) -I. -I$(srcdir) -DHAVE_CONFIG_H -DTEST $(make_LDFLAGS) loadavg.c $(LIBS)
|
||||
|
||||
# We copy getloadavg.c into a different file rather than compiling it
|
||||
# directly because some compilers clobber getloadavg.o in the process.
|
||||
#
|
||||
loadavg.c: getloadavg.c
|
||||
ln $(srcdir)/getloadavg.c loadavg.c || \
|
||||
cp $(srcdir)/getloadavg.c loadavg.c
|
||||
|
||||
check-loadavg: loadavg
|
||||
@echo The system uptime program believes the load average to be:
|
||||
-uptime
|
||||
@echo The GNU load average checking code believes:
|
||||
-./loadavg
|
||||
|
||||
# > check-regression
|
||||
#
|
||||
# Look for the make test suite, and run it if found. Look in MAKE_TEST if
|
||||
# specified, or else in the srcdir or the distdir, their parents, and _their_
|
||||
# parents.
|
||||
#
|
||||
MAKETESTFLAGS =
|
||||
|
||||
check-regression: all
|
||||
@here=`pwd`; testdir=""; \
|
||||
case "$(MAKE_TEST)" in "") \
|
||||
for d1 in $$here $(srcdir); do \
|
||||
for d2 in ../.. .. .; do \
|
||||
all=`echo $$d1/$$d2/make-test-[0-9]*/run_make_tests`; \
|
||||
case "$$all" in \
|
||||
"$$d1/$$d2/make-test-[0-9]*/run_make_tests") : ;; \
|
||||
*) try=`for x in $$all; do echo $$x; done | sort | tail -1`;\
|
||||
testdir=`dirname $$try` ;; esac; \
|
||||
done; done ;; \
|
||||
*) testdir="$(MAKE_TEST)" ;; \
|
||||
esac; \
|
||||
case "$$testdir" in \
|
||||
"") echo "Couldn't find make-test-* regression test suite."; exit 0;; \
|
||||
esac; \
|
||||
echo "cd $$testdir && ./run_make_tests -make $$here/make $(MAKETESTFLAGS)"; \
|
||||
cd $$testdir && ./run_make_tests -make $$here/make $(MAKETESTFLAGS)
|
||||
|
||||
|
||||
# --------------- Local CLEAN section
|
||||
|
||||
maintainer-clean-local:
|
||||
-test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
|
||||
|
||||
|
||||
# --------------- Maintainer's Section
|
||||
|
||||
@MAINT_MAKEFILE@
|
||||
@@ -3,7 +3,7 @@
|
||||
#
|
||||
# Copyright (C) 1988, 89, 91, 92, 93, 94, 1995 Free Software Foundation, Inc.
|
||||
# This file is part of GNU Make.
|
||||
#
|
||||
#
|
||||
# GNU Make is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2, or (at your option)
|
||||
@@ -11,27 +11,24 @@
|
||||
#
|
||||
# GNU Make is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# 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.
|
||||
# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
# Boston, MA 02111-1307, USA.
|
||||
|
||||
#
|
||||
# Makefile for GNU Make
|
||||
#
|
||||
|
||||
# Ultrix 2.2 make doesn't expand the value of VPATH.
|
||||
VPATH = @srcdir@
|
||||
# This must repeat the value, because configure will remove `VPATH = .'.
|
||||
srcdir = @srcdir@
|
||||
CC = sc
|
||||
RM = delete
|
||||
|
||||
CC = @CC@
|
||||
|
||||
CFLAGS = @CFLAGS@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
CFLAGS =
|
||||
CPPFLAGS =
|
||||
LDFLAGS =
|
||||
|
||||
# Define these for your system as follows:
|
||||
# -DNO_ARCHIVES To disable `ar' archive support.
|
||||
@@ -42,16 +39,16 @@ LDFLAGS = @LDFLAGS@
|
||||
# so beware.
|
||||
# NeXT 1.0a uses an old version of GCC, which required -D__inline=inline.
|
||||
# See also `config.h'.
|
||||
defines = @DEFS@ -DLIBDIR=\"$(libdir)\" -DINCLUDEDIR=\"$(includedir)\"
|
||||
defines =
|
||||
|
||||
# Which flavor of remote job execution support to use.
|
||||
# The code is found in `remote-$(REMOTE).c'.
|
||||
REMOTE = @REMOTE@
|
||||
REMOTE = stub
|
||||
|
||||
# If you are using the GNU C library, or have the GNU getopt functions in
|
||||
# your C library, you can comment these out.
|
||||
GETOPT = getopt.o getopt1.o
|
||||
GETOPT_SRC = $(srcdir)/getopt.c $(srcdir)/getopt1.c $(srcdir)/getopt.h
|
||||
GETOPT_SRC = $(srcdir)getopt.c $(srcdir)getopt1.c $(srcdir)getopt.h
|
||||
|
||||
# If you are using the GNU C library, or have the GNU glob functions in
|
||||
# your C library, you can comment this out. GNU make uses special hooks
|
||||
@@ -59,36 +56,36 @@ GETOPT_SRC = $(srcdir)/getopt.c $(srcdir)/getopt1.c $(srcdir)/getopt.h
|
||||
# cache for globbing), so you must use the GNU functions even if your
|
||||
# system's C library has the 1003.2 glob functions already. Also, the glob
|
||||
# functions in the AIX and HPUX C libraries are said to be buggy.
|
||||
GLOB = glob/libglob.a
|
||||
GLOB = glob/glob.lib
|
||||
|
||||
# If your system doesn't have alloca, or the one provided is bad, define this.
|
||||
ALLOCA = @ALLOCA@
|
||||
ALLOCA_SRC = $(srcdir)/alloca.c
|
||||
ALLOCA = alloca.o
|
||||
ALLOCA_SRC = $(srcdir)alloca.c
|
||||
|
||||
# If your system needs extra libraries loaded in, define them here.
|
||||
# System V probably need -lPW for alloca. HP-UX 7.0's alloca in
|
||||
# libPW.a is broken on HP9000s300 and HP9000s400 machines. Use
|
||||
# alloca.c instead on those machines.
|
||||
LOADLIBES = @LIBS@
|
||||
LOADLIBES =
|
||||
|
||||
# Any extra object files your system needs.
|
||||
extras = @LIBOBJS@
|
||||
extras = amiga.o
|
||||
|
||||
# Common prefix for machine-independent installed files.
|
||||
prefix = @prefix@
|
||||
prefix =
|
||||
# Common prefix for machine-dependent installed files.
|
||||
exec_prefix = @exec_prefix@
|
||||
exec_prefix =
|
||||
|
||||
# Directory to install `make' in.
|
||||
bindir = $(exec_prefix)/bin
|
||||
bindir = sc:c
|
||||
# Directory to find libraries in for `-lXXX'.
|
||||
libdir = $(exec_prefix)/lib
|
||||
libdir = lib:
|
||||
# Directory to search by default for included makefiles.
|
||||
includedir = $(prefix)/include
|
||||
includedir = include:
|
||||
# Directory to install the Info files in.
|
||||
infodir = $(prefix)/info
|
||||
infodir = doc:
|
||||
# Directory to install the man page in.
|
||||
mandir = $(prefix)/man/man$(manext)
|
||||
mandir = t:
|
||||
# Number to put on the man page filename.
|
||||
manext = 1
|
||||
# Prefix to put on installed `make' binary file name.
|
||||
@@ -100,16 +97,16 @@ manprefix = $(binprefix)
|
||||
# The value should be either `true' or `false'.
|
||||
# On many systems, the getloadavg function (used to implement the `-l'
|
||||
# switch) will not work unless make is installed setgid kmem.
|
||||
install_setgid = @NEED_SETGID@
|
||||
install_setgid = false
|
||||
# Install make setgid to this group so it can read /dev/kmem.
|
||||
group = @KMEM_GROUP@
|
||||
group = sys
|
||||
|
||||
# Program to install `make'.
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
INSTALL_PROGRAM = copy
|
||||
# Program to install the man page.
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_DATA = copy
|
||||
# Generic install program.
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL = copy
|
||||
|
||||
# Program to format Texinfo source into Info files.
|
||||
MAKEINFO = makeinfo
|
||||
@@ -122,20 +119,20 @@ CTAGS = ctags -w
|
||||
|
||||
objs = commands.o job.o dir.o file.o misc.o main.o read.o remake.o \
|
||||
rule.o implicit.o default.o variable.o expand.o function.o \
|
||||
vpath.o version.o ar.o arscan.o signame.o remote-$(REMOTE).o \
|
||||
$(GLOB) $(GETOPT) $(ALLOCA) $(extras)
|
||||
srcs = $(srcdir)/commands.c $(srcdir)/job.c $(srcdir)/dir.c \
|
||||
$(srcdir)/file.c $(srcdir)/getloadavg.c $(srcdir)/misc.c \
|
||||
$(srcdir)/main.c $(srcdir)/read.c $(srcdir)/remake.c \
|
||||
$(srcdir)/rule.c $(srcdir)/implicit.c $(srcdir)/default.c \
|
||||
$(srcdir)/variable.c $(srcdir)/expand.c $(srcdir)/function.c \
|
||||
$(srcdir)/vpath.c $(srcdir)/version.c \
|
||||
$(srcdir)/remote-$(REMOTE).c \
|
||||
$(srcdir)/ar.c $(srcdir)/arscan.c \
|
||||
$(srcdir)/signame.c $(srcdir)/signame.h $(GETOPT_SRC) \
|
||||
$(srcdir)/commands.h $(srcdir)/dep.h $(srcdir)/file.h \
|
||||
$(srcdir)/job.h $(srcdir)/make.h $(srcdir)/rule.h \
|
||||
$(srcdir)/variable.h $(ALLOCA_SRC) $(srcdir)/config.h.in
|
||||
vpath.o version.o ar.o arscan.o signame.o remote-$(REMOTE).o \
|
||||
$(GETOPT) $(ALLOCA) $(extras)
|
||||
srcs = $(srcdir)commands.c $(srcdir)job.c $(srcdir)dir.c \
|
||||
$(srcdir)file.c $(srcdir)getloadavg.c $(srcdir)misc.c \
|
||||
$(srcdir)main.c $(srcdir)read.c $(srcdir)remake.c \
|
||||
$(srcdir)rule.c $(srcdir)implicit.c $(srcdir)default.c \
|
||||
$(srcdir)variable.c $(srcdir)expand.c $(srcdir)function.c \
|
||||
$(srcdir)vpath.c $(srcdir)version.c \
|
||||
$(srcdir)remote-$(REMOTE).c \
|
||||
$(srcdir)ar.c $(srcdir)arscan.c \
|
||||
$(srcdir)signame.c $(srcdir)signame.h $(GETOPT_SRC) \
|
||||
$(srcdir)commands.h $(srcdir)dep.h $(srcdir)filedep.h \
|
||||
$(srcdir)job.h $(srcdir)make.h $(srcdir)rule.h \
|
||||
$(srcdir)variable.h $(ALLOCA_SRC) $(srcdir)config.h.in
|
||||
|
||||
|
||||
.SUFFIXES:
|
||||
@@ -148,46 +145,50 @@ dvi: make.dvi
|
||||
.PHONY: all check info dvi
|
||||
|
||||
make.info: make.texinfo
|
||||
$(MAKEINFO) -I$(srcdir) $(srcdir)/make.texinfo -o make.info
|
||||
$(MAKEINFO) -I$(srcdir) $(srcdir)make.texinfo -o make.info
|
||||
|
||||
make.dvi: make.texinfo
|
||||
$(TEXI2DVI) $(srcdir)/make.texinfo
|
||||
$(TEXI2DVI) $(srcdir)make.texinfo
|
||||
|
||||
make.ps: make.dvi
|
||||
dvi2ps make.dvi > make.ps
|
||||
|
||||
make: $(objs)
|
||||
$(CC) $(LDFLAGS) $(objs) $(LOADLIBES) -o make.new
|
||||
mv -f make.new make
|
||||
make: $(objs) $(GLOB)
|
||||
$(CC) Link $(LDFLAGS) $(objs) Lib $(GLOB) $(LOADLIBES) To make.new
|
||||
-delete make
|
||||
rename make.new make
|
||||
|
||||
TMPFILE = t:Make$$
|
||||
|
||||
$(GLOB):
|
||||
cd glob @@\
|
||||
$(MAKE) -$(MAKEFLAGS) -f Makefile
|
||||
|
||||
# -I. is needed to find config.h in the build directory.
|
||||
OUTPUT_OPTION =
|
||||
.c.o:
|
||||
$(CC) $(defines) -c -I. -I$(srcdir) -I$(srcdir)/glob \
|
||||
$(CC) $(defines) IDir "" IDir glob \
|
||||
$(CPPFLAGS) $(CFLAGS) $< $(OUTPUT_OPTION)
|
||||
|
||||
# For some losing Unix makes.
|
||||
SHELL = /bin/sh
|
||||
MAKE = make
|
||||
#@SET_MAKE@
|
||||
|
||||
glob/libglob.a: FORCE config.h
|
||||
cd glob; $(MAKE) libglob.a
|
||||
FORCE:
|
||||
|
||||
tagsrcs = $(srcs) $(srcdir)/remote-*.c
|
||||
TAGS: $(tagsrcs)
|
||||
$(ETAGS) $(tagsrcs)
|
||||
tags: $(tagsrcs)
|
||||
$(CTAGS) $(tagsrcs)
|
||||
tagsrcs = $(srcs) $(srcdir)remote-*.c
|
||||
|
||||
.PHONY: install installdirs
|
||||
install: installdirs \
|
||||
$(bindir)/$(binprefix)make $(infodir)/make.info \
|
||||
$(mandir)/$(manprefix)make.$(manext)
|
||||
$(bindir)$(binprefix)make $(infodir)make.info \
|
||||
$(mandir)$(manprefix)make.$(manext)
|
||||
|
||||
installdirs:
|
||||
$(SHELL) ${srcdir}/mkinstalldirs $(bindir) $(infodir) $(mandir)
|
||||
|
||||
$(bindir)/$(binprefix)make: make
|
||||
$(bindir)$(binprefix)make: make
|
||||
$(INSTALL_PROGRAM) make $@.new
|
||||
@if $(install_setgid); then \
|
||||
if chgrp $(group) $@.new && chmod g+s $@.new; then \
|
||||
@@ -199,11 +200,11 @@ $(bindir)/$(binprefix)make: make
|
||||
fi; \
|
||||
else true; fi
|
||||
# Some systems can't deal with renaming onto a running binary.
|
||||
-rm -f $@.old
|
||||
-$(RM) $@.old
|
||||
-mv $@ $@.old
|
||||
mv $@.new $@
|
||||
|
||||
$(infodir)/make.info: make.info
|
||||
$(infodir)make.info: make.info
|
||||
if [ -r ./make.info ]; then dir=.; else dir=$(srcdir); fi; \
|
||||
for file in $${dir}/make.info*; do \
|
||||
name="`basename $$file`"; \
|
||||
@@ -220,8 +221,8 @@ $(infodir)/make.info: make.info
|
||||
install-info --infodir=$(infodir) $$dir/make.info; \
|
||||
else true; fi
|
||||
|
||||
$(mandir)/$(manprefix)make.$(manext): make.man
|
||||
$(INSTALL_DATA) $(srcdir)/make.man $@
|
||||
$(mandir)$(manprefix)make.$(manext): make.man
|
||||
$(INSTALL_DATA) $(srcdir)make.man $@
|
||||
|
||||
|
||||
loadavg: loadavg.c config.h
|
||||
@@ -230,8 +231,8 @@ loadavg: loadavg.c config.h
|
||||
# We copy getloadavg.c into a different file rather than compiling it
|
||||
# directly because some compilers clobber getloadavg.o in the process.
|
||||
loadavg.c: getloadavg.c
|
||||
ln $(srcdir)/getloadavg.c loadavg.c || \
|
||||
cp $(srcdir)/getloadavg.c loadavg.c
|
||||
ln $(srcdir)getloadavg.c loadavg.c || \
|
||||
cp $(srcdir)getloadavg.c loadavg.c
|
||||
check-loadavg: loadavg
|
||||
@echo The system uptime program believes the load average to be:
|
||||
-uptime
|
||||
@@ -242,34 +243,23 @@ check: check-loadavg
|
||||
|
||||
.PHONY: clean realclean distclean mostlyclean
|
||||
clean: glob-clean
|
||||
-rm -f make loadavg *.o core make.dvi
|
||||
-$(RM) make loadavg "#?.o" core make.dvi
|
||||
|
||||
distclean: clean glob-realclean
|
||||
-rm -f Makefile config.h config.status build.sh stamp-config
|
||||
-rm -f config.log config.cache
|
||||
-rm -f TAGS tags
|
||||
-rm -f make.?? make.??s make.log make.toc make.*aux
|
||||
-rm -f loadavg.c
|
||||
-$(RM) Makefile config.h config.status build.sh
|
||||
-$(RM) config.log config.cache
|
||||
-$(RM) TAGS tags
|
||||
-$(RM) make.?? make.??s make.log make.toc make.*aux
|
||||
-$(RM) loadavg.c
|
||||
|
||||
realclean: distclean
|
||||
-rm -f make.info*
|
||||
-$(RM) make.info*
|
||||
mostlyclean: clean
|
||||
|
||||
.PHONY: glob-clean glob-realclean
|
||||
glob-clean glob-realclean:
|
||||
cd glob; $(MAKE) $@
|
||||
|
||||
Makefile: config.status $(srcdir)/Makefile.in
|
||||
$(SHELL) config.status
|
||||
glob/Makefile: config.status $(srcdir)/glob/Makefile.in
|
||||
$(SHELL) config.status
|
||||
config.h: stamp-config ;
|
||||
stamp-config: config.status $(srcdir)/config.h.in
|
||||
$(SHELL) config.status
|
||||
touch stamp-config
|
||||
|
||||
#configure: configure.in aclocal.m4
|
||||
# cd $(srcdir) && autoconf $(ACFLAGS)
|
||||
#config.h.in: configure.in aclocal.m4
|
||||
# cd $(srcdir) && autoheader $(ACFLAGS)
|
||||
cd glob @@\
|
||||
$(MAKE) $@
|
||||
|
||||
# This tells versions [3.59,3.63) of GNU make not to export all variables.
|
||||
.NOEXPORT:
|
||||
@@ -281,3 +271,35 @@ $(objs): config.h
|
||||
|
||||
# Automatically generated dependencies will be put at the end of the file.
|
||||
|
||||
# Automatically generated dependencies.
|
||||
commands.o: commands.c make.h dep.h filedef.h variable.h job.h \
|
||||
commands.h
|
||||
job.o: job.c make.h job.h filedef.h commands.h variable.h
|
||||
dir.o: dir.c make.h
|
||||
file.o: file.c make.h dep.h filedef.h job.h commands.h variable.h
|
||||
misc.o: misc.c make.h dep.h
|
||||
main.o: main.c make.h dep.h filedef.h variable.h job.h commands.h \
|
||||
getopt.h
|
||||
read.o: read.c make.h dep.h filedef.h job.h commands.h variable.h \
|
||||
glob/glob.h
|
||||
remake.o: remake.c make.h filedef.h job.h commands.h dep.h
|
||||
rule.o: rule.c make.h dep.h filedef.h job.h commands.h variable.h \
|
||||
rule.h
|
||||
implicit.o: implicit.c make.h rule.h dep.h filedef.h
|
||||
default.o: default.c make.h rule.h dep.h filedef.h job.h commands.h \
|
||||
variable.h
|
||||
variable.o: variable.c make.h dep.h filedef.h job.h commands.h \
|
||||
variable.h
|
||||
expand.o: expand.c make.h filedef.h job.h commands.h variable.h
|
||||
function.o: function.c make.h filedef.h variable.h dep.h job.h \
|
||||
commands.h amiga.h
|
||||
vpath.o: vpath.c make.h filedef.h variable.h
|
||||
version.o: version.c
|
||||
ar.o: ar.c make.h filedef.h dep.h
|
||||
arscan.o: arscan.c make.h
|
||||
signame.o: signame.c signame.h
|
||||
remote-stub.o: remote-stub.c make.h filedef.h job.h commands.h
|
||||
getopt.o: getopt.c
|
||||
getopt1.o : getopt1.c getopt.h
|
||||
getloadavg.o: getloadavg.c
|
||||
amiga.o: amiga.c make.h variable.h amiga.h
|
||||
307
Makefile.in
307
Makefile.in
@@ -1,307 +0,0 @@
|
||||
# NOTE: If you have no `make' program at all to process this makefile, run
|
||||
# `build.sh' instead.
|
||||
#
|
||||
# Copyright (C) 1988, 89, 91, 92, 93, 94, 1995 Free Software Foundation, Inc.
|
||||
# This file is part of GNU Make.
|
||||
#
|
||||
# GNU Make is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# GNU Make is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with GNU Make; see the file COPYING. If not, write to
|
||||
# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
#
|
||||
# Makefile for GNU Make
|
||||
#
|
||||
|
||||
# Ultrix 2.2 make doesn't expand the value of VPATH.
|
||||
VPATH = @srcdir@
|
||||
# This must repeat the value, because configure will remove `VPATH = .'.
|
||||
srcdir = @srcdir@
|
||||
|
||||
CC = @CC@
|
||||
|
||||
CFLAGS = @CFLAGS@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
|
||||
# Define these for your system as follows:
|
||||
# -DNO_ARCHIVES To disable `ar' archive support.
|
||||
# -DNO_FLOAT To avoid using floating-point numbers.
|
||||
# -DENUM_BITFIELDS If the compiler isn't GCC but groks enum foo:2.
|
||||
# Some compilers apparently accept this
|
||||
# without complaint but produce losing code,
|
||||
# so beware.
|
||||
# NeXT 1.0a uses an old version of GCC, which required -D__inline=inline.
|
||||
# See also `config.h'.
|
||||
defines = @DEFS@ -DLIBDIR=\"$(libdir)\" -DINCLUDEDIR=\"$(includedir)\"
|
||||
|
||||
# Which flavor of remote job execution support to use.
|
||||
# The code is found in `remote-$(REMOTE).c'.
|
||||
REMOTE = @REMOTE@
|
||||
|
||||
# If you are using the GNU C library, or have the GNU getopt functions in
|
||||
# your C library, you can comment these out.
|
||||
GETOPT = getopt.o getopt1.o
|
||||
GETOPT_SRC = $(srcdir)/getopt.c $(srcdir)/getopt1.c $(srcdir)/getopt.h
|
||||
|
||||
# If you are using the GNU C library, or have the GNU glob functions in
|
||||
# your C library, you can comment this out. GNU make uses special hooks
|
||||
# into the glob functions to be more efficient (by using make's directory
|
||||
# cache for globbing), so you must use the GNU functions even if your
|
||||
# system's C library has the 1003.2 glob functions already. Also, the glob
|
||||
# functions in the AIX and HPUX C libraries are said to be buggy.
|
||||
GLOB = glob/libglob.a
|
||||
|
||||
# If your system doesn't have alloca, or the one provided is bad, define this.
|
||||
ALLOCA = @ALLOCA@
|
||||
ALLOCA_SRC = $(srcdir)/alloca.c
|
||||
|
||||
# If your system needs extra libraries loaded in, define them here.
|
||||
# System V probably need -lPW for alloca. HP-UX 7.0's alloca in
|
||||
# libPW.a is broken on HP9000s300 and HP9000s400 machines. Use
|
||||
# alloca.c instead on those machines.
|
||||
LOADLIBES = @LIBS@
|
||||
|
||||
# Any extra object files your system needs.
|
||||
extras = @LIBOBJS@
|
||||
|
||||
# Common prefix for machine-independent installed files.
|
||||
prefix = @prefix@
|
||||
# Common prefix for machine-dependent installed files.
|
||||
exec_prefix = @exec_prefix@
|
||||
|
||||
# Directory to install `make' in.
|
||||
bindir = $(exec_prefix)/bin
|
||||
# Directory to find libraries in for `-lXXX'.
|
||||
libdir = $(exec_prefix)/lib
|
||||
# Directory to search by default for included makefiles.
|
||||
includedir = $(prefix)/include
|
||||
# Directory to install the Info files in.
|
||||
infodir = $(prefix)/info
|
||||
# Directory to install the man page in.
|
||||
mandir = $(prefix)/man/man$(manext)
|
||||
# Number to put on the man page filename.
|
||||
manext = 1
|
||||
# Prefix to put on installed `make' binary file name.
|
||||
binprefix =
|
||||
# Prefix to put on installed `make' man page file name.
|
||||
manprefix = $(binprefix)
|
||||
|
||||
# Whether or not make needs to be installed setgid.
|
||||
# The value should be either `true' or `false'.
|
||||
# On many systems, the getloadavg function (used to implement the `-l'
|
||||
# switch) will not work unless make is installed setgid kmem.
|
||||
install_setgid = @NEED_SETGID@
|
||||
# Install make setgid to this group so it can read /dev/kmem.
|
||||
group = @KMEM_GROUP@
|
||||
|
||||
# Program to install `make'.
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
# Program to install the man page.
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
# Generic install program.
|
||||
INSTALL = @INSTALL@
|
||||
|
||||
# Program to format Texinfo source into Info files.
|
||||
MAKEINFO = makeinfo
|
||||
# Program to format Texinfo source into DVI files.
|
||||
TEXI2DVI = texi2dvi
|
||||
|
||||
# Programs to make tags files.
|
||||
ETAGS = etags -w
|
||||
CTAGS = ctags -w
|
||||
|
||||
objs = commands.o job.o dir.o file.o misc.o main.o read.o remake.o \
|
||||
rule.o implicit.o default.o variable.o expand.o function.o \
|
||||
vpath.o version.o ar.o arscan.o signame.o remote-$(REMOTE).o \
|
||||
$(GLOB) $(GETOPT) $(ALLOCA) $(extras)
|
||||
srcs = $(srcdir)/commands.c $(srcdir)/job.c $(srcdir)/dir.c \
|
||||
$(srcdir)/file.c $(srcdir)/getloadavg.c $(srcdir)/misc.c \
|
||||
$(srcdir)/main.c $(srcdir)/read.c $(srcdir)/remake.c \
|
||||
$(srcdir)/rule.c $(srcdir)/implicit.c $(srcdir)/default.c \
|
||||
$(srcdir)/variable.c $(srcdir)/expand.c $(srcdir)/function.c \
|
||||
$(srcdir)/vpath.c $(srcdir)/version.c \
|
||||
$(srcdir)/remote-$(REMOTE).c \
|
||||
$(srcdir)/ar.c $(srcdir)/arscan.c \
|
||||
$(srcdir)/signame.c $(srcdir)/signame.h $(GETOPT_SRC) \
|
||||
$(srcdir)/commands.h $(srcdir)/dep.h $(srcdir)/file.h \
|
||||
$(srcdir)/job.h $(srcdir)/make.h $(srcdir)/rule.h \
|
||||
$(srcdir)/variable.h $(ALLOCA_SRC) $(srcdir)/config.h.in
|
||||
|
||||
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .o .c .h .ps .dvi .info .texinfo
|
||||
|
||||
all: make
|
||||
info: make.info
|
||||
dvi: make.dvi
|
||||
# Some makes apparently use .PHONY as the default goal if it is before `all'.
|
||||
.PHONY: all check info dvi
|
||||
|
||||
make.info: make.texinfo
|
||||
$(MAKEINFO) -I$(srcdir) $(srcdir)/make.texinfo -o make.info
|
||||
|
||||
make.dvi: make.texinfo
|
||||
$(TEXI2DVI) $(srcdir)/make.texinfo
|
||||
|
||||
make.ps: make.dvi
|
||||
dvi2ps make.dvi > make.ps
|
||||
|
||||
make: $(objs)
|
||||
$(CC) $(LDFLAGS) $(objs) $(LOADLIBES) -o make.new
|
||||
mv -f make.new make
|
||||
|
||||
# -I. is needed to find config.h in the build directory.
|
||||
.c.o:
|
||||
$(CC) $(defines) -c -I. -I$(srcdir) -I$(srcdir)/glob \
|
||||
$(CPPFLAGS) $(CFLAGS) $< $(OUTPUT_OPTION)
|
||||
|
||||
# For some losing Unix makes.
|
||||
SHELL = /bin/sh
|
||||
@SET_MAKE@
|
||||
|
||||
glob/libglob.a: FORCE config.h
|
||||
cd glob; $(MAKE) libglob.a
|
||||
FORCE:
|
||||
|
||||
tagsrcs = $(srcs) $(srcdir)/remote-*.c
|
||||
TAGS: $(tagsrcs)
|
||||
$(ETAGS) $(tagsrcs)
|
||||
tags: $(tagsrcs)
|
||||
$(CTAGS) $(tagsrcs)
|
||||
|
||||
.PHONY: install installdirs
|
||||
install: installdirs \
|
||||
$(bindir)/$(binprefix)make $(infodir)/make.info \
|
||||
$(mandir)/$(manprefix)make.$(manext)
|
||||
|
||||
installdirs:
|
||||
$(SHELL) ${srcdir}/mkinstalldirs $(bindir) $(infodir) $(mandir)
|
||||
|
||||
$(bindir)/$(binprefix)make: make
|
||||
$(INSTALL_PROGRAM) make $@.new
|
||||
@if $(install_setgid); then \
|
||||
if chgrp $(group) $@.new && chmod g+s $@.new; then \
|
||||
echo "chgrp $(group) $@.new && chmod g+s $@.new"; \
|
||||
else \
|
||||
echo "$@ needs to be owned by group $(group) and setgid;"; \
|
||||
echo "otherwise the \`-l' option will probably not work."; \
|
||||
echo "You may need special privileges to install $@."; \
|
||||
fi; \
|
||||
else true; fi
|
||||
# Some systems can't deal with renaming onto a running binary.
|
||||
-rm -f $@.old
|
||||
-mv $@ $@.old
|
||||
mv $@.new $@
|
||||
|
||||
$(infodir)/make.info: make.info
|
||||
if [ -r ./make.info ]; then dir=.; else dir=$(srcdir); fi; \
|
||||
for file in $${dir}/make.info*; do \
|
||||
name="`basename $$file`"; \
|
||||
$(INSTALL_DATA) $$file \
|
||||
`echo $@ | sed "s,make.info\$$,$$name,"`; \
|
||||
done
|
||||
# Run install-info only if it exists.
|
||||
# Use `if' instead of just prepending `-' to the
|
||||
# line so we notice real errors from install-info.
|
||||
# We use `$(SHELL) -c' because some shells do not
|
||||
# fail gracefully when there is an unknown command.
|
||||
if $(SHELL) -c 'install-info --version' >/dev/null 2>&1; then \
|
||||
if [ -r ./make.info ]; then dir=.; else dir=$(srcdir); fi; \
|
||||
install-info --infodir=$(infodir) $$dir/make.info; \
|
||||
else true; fi
|
||||
|
||||
$(mandir)/$(manprefix)make.$(manext): make.man
|
||||
$(INSTALL_DATA) $(srcdir)/make.man $@
|
||||
|
||||
|
||||
loadavg: loadavg.c config.h
|
||||
$(CC) $(defines) -DTEST -I. -I$(srcdir) $(CFLAGS) $(LDFLAGS) \
|
||||
loadavg.c $(LOADLIBES) -o $@
|
||||
# We copy getloadavg.c into a different file rather than compiling it
|
||||
# directly because some compilers clobber getloadavg.o in the process.
|
||||
loadavg.c: getloadavg.c
|
||||
ln $(srcdir)/getloadavg.c loadavg.c || \
|
||||
cp $(srcdir)/getloadavg.c loadavg.c
|
||||
check-loadavg: loadavg
|
||||
@echo The system uptime program believes the load average to be:
|
||||
-uptime
|
||||
@echo The GNU load average checking code believes:
|
||||
./loadavg
|
||||
check: check-loadavg
|
||||
|
||||
|
||||
.PHONY: clean realclean distclean mostlyclean
|
||||
clean: glob-clean
|
||||
-rm -f make loadavg *.o core make.dvi
|
||||
distclean: clean glob-realclean
|
||||
-rm -f Makefile config.h config.status build.sh stamp-config
|
||||
-rm -f config.log config.cache
|
||||
-rm -f TAGS tags
|
||||
-rm -f make.?? make.??s make.log make.toc make.*aux
|
||||
-rm -f loadavg.c
|
||||
realclean: distclean
|
||||
-rm -f make.info*
|
||||
mostlyclean: clean
|
||||
|
||||
.PHONY: glob-clean glob-realclean
|
||||
glob-clean glob-realclean:
|
||||
cd glob; $(MAKE) $@
|
||||
|
||||
Makefile: config.status $(srcdir)/Makefile.in
|
||||
$(SHELL) config.status
|
||||
glob/Makefile: config.status $(srcdir)/glob/Makefile.in
|
||||
$(SHELL) config.status
|
||||
config.h: stamp-config ;
|
||||
stamp-config: config.status $(srcdir)/config.h.in
|
||||
$(SHELL) config.status
|
||||
touch stamp-config
|
||||
|
||||
#configure: configure.in aclocal.m4
|
||||
# cd $(srcdir) && autoconf $(ACFLAGS)
|
||||
#config.h.in: configure.in aclocal.m4
|
||||
# cd $(srcdir) && autoheader $(ACFLAGS)
|
||||
|
||||
# This tells versions [3.59,3.63) of GNU make not to export all variables.
|
||||
.NOEXPORT:
|
||||
|
||||
# The automatically generated dependencies below may omit config.h
|
||||
# because it is included with ``#include <config.h>'' rather than
|
||||
# ``#include "config.h"''. So we add the explicit dependency to make sure.
|
||||
$(objs): config.h
|
||||
|
||||
# Automatically generated dependencies will be put at the end of the file.
|
||||
|
||||
# Automatically generated dependencies.
|
||||
commands.o: commands.c make.h dep.h commands.h file.h variable.h job.h
|
||||
job.o: job.c make.h commands.h job.h file.h variable.h
|
||||
dir.o: dir.c make.h
|
||||
file.o: file.c make.h commands.h dep.h file.h variable.h
|
||||
misc.o: misc.c make.h dep.h
|
||||
main.o: main.c make.h commands.h dep.h file.h variable.h job.h getopt.h
|
||||
read.o: read.c make.h commands.h dep.h file.h variable.h glob/glob.h
|
||||
remake.o: remake.c make.h commands.h job.h dep.h file.h
|
||||
rule.o : rule.c make.h config.h commands.h dep.h file.h variable.h rule.h
|
||||
implicit.o : implicit.c make.h rule.h dep.h file.h
|
||||
default.o: default.c make.h rule.h dep.h file.h commands.h variable.h
|
||||
variable.o : variable.c make.h commands.h variable.h dep.h file.h
|
||||
expand.o: expand.c make.h commands.h file.h variable.h
|
||||
function.o: function.c make.h variable.h dep.h commands.h job.h
|
||||
vpath.o: vpath.c make.h file.h variable.h
|
||||
version.o: version.c
|
||||
ar.o : ar.c make.h file.h dep.h
|
||||
arscan.o: arscan.c make.h
|
||||
signame.o: signame.c signame.h
|
||||
remote-stub.o : remote-stub.c make.h commands.h
|
||||
getopt.o: getopt.c getopt.h
|
||||
getopt1.o : getopt1.c getopt.h
|
||||
getloadavg.o: getloadavg.c
|
||||
183
NEWS
183
NEWS
@@ -1,14 +1,171 @@
|
||||
GNU make NEWS -- history of user-visible changes. 11 December 1995
|
||||
GNU make NEWS -*-indented-text-*-
|
||||
History of user-visible changes.
|
||||
21 Jul 1999
|
||||
|
||||
Copyright (C) 1992, 1993, 1994, 1995 Free Software Foundation, Inc.
|
||||
Copyright (C) 1992,93,94,95,96,97,98,1999 Free Software Foundation, Inc.
|
||||
See the end for copying conditions.
|
||||
|
||||
Please send GNU make bug reports to bug-gnu-utils@prep.ai.mit.edu.
|
||||
All changes mentioned here are more fully described in the GNU make
|
||||
manual, which is contained in this distribution as the file make.texinfo.
|
||||
|
||||
Please send GNU make bug reports to bug-make@gnu.org.
|
||||
|
||||
Version 3.78
|
||||
|
||||
* Two new functions, $(error ...) and $(warning ...) are available. The
|
||||
former will cause make to fail and exit immediately upon expansion of
|
||||
the function, with the text provided as the error message. The latter
|
||||
causes the text provided to be printed as a warning message, but make
|
||||
proceeds normally.
|
||||
|
||||
* A new function $(call ...) is available. This allows users to create
|
||||
their own parameterized macros and invoke them later. Original
|
||||
implementation of this function was provided by Han-Wen Nienhuys
|
||||
<hanwen@cs.uu.nl>.
|
||||
|
||||
* A new function $(if ...) is available. It provides if-then-else
|
||||
capabilities in a builtin function. Original implementation of this
|
||||
function was provided by Han-Wen Nienhuys <hanwen@cs.uu.nl>.
|
||||
|
||||
* Make defines a new variable, .LIBPATTERNS. This variable controls how
|
||||
library dependency expansion (dependencies like ``-lfoo'') is performed.
|
||||
|
||||
* Make accepts CRLF sequences as well as traditional LF, for
|
||||
compatibility with makefiles created on other operating systems.
|
||||
|
||||
* Make accepts a new option: -R, or --no-builtin-variables. This option
|
||||
disables the definition of the rule-specific builtin variables (CC,
|
||||
LD, AR, etc.). Specifying this option forces -r (--no-builtin-rules)
|
||||
as well.
|
||||
|
||||
* A "job server" feature, suggested by Howard Chu <hyc@highlandsun.com>.
|
||||
|
||||
On systems that support POSIX pipe(2) semantics, GNU make can now pass
|
||||
-jN options to submakes rather than forcing them all to use -j1. The
|
||||
top make and all its sub-make processes use a pipe to communicate with
|
||||
each other to ensure that no more than N jobs are started across all
|
||||
makes. To get the old behavior of -j back, you can configure make
|
||||
with the --disable-job-server option.
|
||||
|
||||
* The confusing term "dependency" has been replaced by the more accurate
|
||||
and standard term "prerequisite", both in the manual and in all GNU make
|
||||
output.
|
||||
|
||||
Version 3.77
|
||||
|
||||
* Implement BSD make's "?=" variable assignment operator. The variable
|
||||
is assigned the specified value only if that variable is not already
|
||||
defined.
|
||||
|
||||
* Make defines a new variable, "CURDIR", to contain the current working
|
||||
directory (after the -C option, if any, has been processed).
|
||||
Modifying this variable has no effect on the operation of make.
|
||||
|
||||
* Make defines a new default RCS rule, for new-style master file
|
||||
storage: ``% :: RCS/%'' (note no ``,v'' suffix).
|
||||
|
||||
Make defines new default rules for DOS-style C++ file naming
|
||||
conventions, with ``.cpp'' suffixes. All the same rules as for
|
||||
``.cc'' and ``.C'' suffixes are provided, along with LINK.cpp and
|
||||
COMPILE.cpp macros (which default to the same value as LINK.cc and
|
||||
COMPILE.cc). Note CPPFLAGS is still C preprocessor flags! You should
|
||||
use CXXFLAGS to change C++ compiler flags.
|
||||
|
||||
* A new feature, "target-specific variable values", has been added.
|
||||
This is a large change so please see the appropriate sections of the
|
||||
manual for full details. Briefly, syntax like this:
|
||||
|
||||
TARGET: VARIABLE = VALUE
|
||||
|
||||
defines VARIABLE as VALUE within the context of TARGET. This is
|
||||
similar to SunOS make's "TARGET := VARIABLE = VALUE" feature. Note
|
||||
that the assignment may be of any type, not just recursive, and that
|
||||
the override keyword is available.
|
||||
|
||||
COMPATIBILITY: This new syntax means that if you have any rules where
|
||||
the first or second dependency has an equal sign (=) in its name,
|
||||
you'll have to escape them with a backslash: "foo : bar\=baz".
|
||||
Further, if you have any dependencies which already contain "\=",
|
||||
you'll have to escape both of them: "foo : bar\\\=baz".
|
||||
|
||||
* A new appendix listing the most common error and warning messages
|
||||
generated by GNU make, with some explanation, has been added to the
|
||||
GNU make User's Manual.
|
||||
|
||||
* Updates to the GNU make Customs library support (see README.customs).
|
||||
|
||||
* Updates to the Windows 95/NT port from Rob Tulloh (see README.W32),
|
||||
and to the DOS port from Eli Zaretski (see README.DOS).
|
||||
|
||||
Version 3.76.1
|
||||
|
||||
* Small (but serious) bug fix. Quick rollout to get into the GNU source CD.
|
||||
|
||||
Version 3.76
|
||||
|
||||
* GNU make now uses automake to control Makefile.in generation. This
|
||||
should make it more consistent with the GNU standards.
|
||||
|
||||
* VPATH functionality has been changed to incorporate the VPATH+ patch,
|
||||
previously maintained by Paul Smith <psmith@baynetworks.com>. See the
|
||||
manual.
|
||||
|
||||
* Make defines a new variable, `MAKECMDGOALS', to contain the goals that
|
||||
were specified on the command line, if any. Modifying this variable
|
||||
has no effect on the operation of make.
|
||||
|
||||
* A new function, `$(wordlist S,E,TEXT)', is available: it returns a
|
||||
list of words from number S to number E (inclusive) of TEXT.
|
||||
|
||||
* Instead of an error, detection of future modification times gives a
|
||||
warning and continues. The warning is repeated just before GNU make
|
||||
exits, so it is less likely to be lost.
|
||||
|
||||
* Fix the $(basename) and $(suffix) functions so they only operate on
|
||||
the last filename, not the entire string:
|
||||
|
||||
Command Old Result New Result
|
||||
------- ---------- ----------
|
||||
$(basename a.b) a a
|
||||
$(basename a.b/c) a a.b/c
|
||||
$(suffix a.b) b b
|
||||
$(suffix a.b/c) b/c <empty>
|
||||
|
||||
* The $(strip) function now removes newlines as well as TABs and spaces.
|
||||
|
||||
* The $(shell) function now changes CRLF (\r\n) pairs to a space as well
|
||||
as newlines (\n).
|
||||
|
||||
* Updates to the Windows 95/NT port from Rob Tulloh (see README.W32).
|
||||
|
||||
* Eli Zaretskii has updated the port to 32-bit protected mode on MSDOS
|
||||
and MS-Windows, building with the DJGPP v2 port of GNU C/C++ compiler
|
||||
and utilities. See README.DOS for details, and direct all questions
|
||||
concerning this port to Eli Zaretskii <eliz@is.elta.co.il> or DJ
|
||||
Delorie <dj@delorie.com>.
|
||||
|
||||
* John W. Eaton has updated the VMS port to support libraries and VPATH.
|
||||
|
||||
Version 3.75
|
||||
|
||||
* The directory messages printed by `-w' and implicitly in sub-makes,
|
||||
are now omitted if Make runs no commands and has no other messages to print.
|
||||
|
||||
* Make now detects files that for whatever reason have modification times
|
||||
in the future and gives an error. Files with such impossible timestamps
|
||||
can result from unsynchronized clocks, or archived distributions
|
||||
containing bogus timestamps; they confuse Make's dependency engine
|
||||
thoroughly.
|
||||
|
||||
* The new directive `sinclude' is now recognized as another name for
|
||||
`-include', for compatibility with some other Makes.
|
||||
|
||||
* Aaron Digulla has contributed a port to AmigaDOS. See README.Amiga for
|
||||
details, and direct all Amiga-related questions to <digulla@fh-konstanz.de>.
|
||||
|
||||
* Rob Tulloh of Tivoli Systems has contributed a port to Windows NT or 95.
|
||||
See README.W32 for details, and direct all Windows-related questions to
|
||||
<rob_tulloh@tivoli.com>.
|
||||
|
||||
Version 3.73
|
||||
|
||||
@@ -23,7 +180,8 @@ Version 3.72
|
||||
* DJ Delorie has ported Make to MS-DOS using the GO32 extender.
|
||||
He is maintaining the DOS port, not the GNU Make maintainer;
|
||||
please direct bugs and questions for DOS to <djgpp@sun.soe.clarkson.edu>.
|
||||
MS-DOS binaries are available for FTP from oak.oakland.edu:pub/msdos/djgpp.
|
||||
MS-DOS binaries are available for FTP from ftp.simtel.net in
|
||||
/pub/simtelnet/gnu/djgpp/.
|
||||
|
||||
* The `MAKEFLAGS' variable (in the environment or in a makefile) can now
|
||||
contain variable definitions itself; these are treated just like
|
||||
@@ -545,18 +703,11 @@ Version 3.05
|
||||
----------------------------------------------------------------------
|
||||
Copyright information:
|
||||
|
||||
Copyright (C) 1992, 1993, 1994, 1995 Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to anyone to make or distribute verbatim copies
|
||||
of this document as received, in any medium, provided that the
|
||||
copyright notice and this permission notice are preserved,
|
||||
thus giving the recipient permission to redistribute in turn.
|
||||
copyright notice and this permission notice are preserved, thus
|
||||
giving the recipient permission to redistribute in turn.
|
||||
|
||||
Permission is granted to distribute modified versions
|
||||
of this document, or of portions of it,
|
||||
under the above conditions, provided also that they
|
||||
carry prominent notices stating who last changed them.
|
||||
|
||||
Local variables:
|
||||
version-control: never
|
||||
end:
|
||||
Permission is granted to distribute modified versions of this
|
||||
document, or of portions of it, under the above conditions, provided
|
||||
also that they carry prominent notices stating who last changed them.
|
||||
|
||||
119
NMakefile.template
Normal file
119
NMakefile.template
Normal file
@@ -0,0 +1,119 @@
|
||||
# NOTE: If you have no `make' program at all to process this makefile, run
|
||||
# `build_w32.bat' instead.
|
||||
#
|
||||
# Copyright (C) 1988,89,91,92,93,94,95,96,97 Free Software Foundation, Inc.
|
||||
# This file is part of GNU Make.
|
||||
#
|
||||
# GNU Make is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# GNU Make is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with GNU Make; see the file COPYING. If not, write to
|
||||
# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
# Boston, MA 02111-1307, USA.
|
||||
|
||||
#
|
||||
# NMakefile for GNU Make
|
||||
#
|
||||
|
||||
LINK = link
|
||||
CC = cl
|
||||
|
||||
OUTDIR=.
|
||||
MAKEFILE=NMakefile
|
||||
SUBPROC_MAKEFILE=NMakefile
|
||||
|
||||
CFLAGS_any = /nologo /MT /W3 /GX /Zi /YX /I . /I glob /I w32/include /D WIN32 /D WINDOWS32 /D _CONSOLE /D HAVE_CONFIG_H
|
||||
CFLAGS_debug = $(CFLAGS_any) /Od /D DEBUG /D _DEBUG /FR.\WinDebug/ /Fp.\WinDebug/make.pch /Fo.\WinDebug/ /Fd.\WinDebug/make.pdb
|
||||
CFLAGS_release = $(CFLAGS_any) /O2 /D NDEBUG /FR.\WinRel/ /Fp.\WinRel/make.pch /Fo.\WinRel/
|
||||
|
||||
LDFLAGS_debug = w32\subproc\WinDebug\subproc.lib /NOLOGO /SUBSYSTEM:console\
|
||||
/INCREMENTAL:no /PDB:WinDebug/make.pdb /MACHINE:I386 \
|
||||
/OUT:WinDebug/make.exe /DEBUG
|
||||
LDFLAGS_release = w32\subproc\WinRel\subproc.lib /NOLOGO /SUBSYSTEM:console\
|
||||
/INCREMENTAL:no /MACHINE:I386 /OUT:WinRel/make.exe
|
||||
|
||||
all: config.h subproc Release Debug
|
||||
|
||||
#
|
||||
# Make sure we build the subproc library first. It has it's own
|
||||
# makefile. To be portable to Windows 95, we put the instructions
|
||||
# on how to build the library into a batch file. On NT, we could
|
||||
# simply have done foo && bar && dog, but this doesn't port.
|
||||
#
|
||||
subproc: w32/subproc/WinDebug/subproc.lib w32/subproc/WinRel/subproc.lib
|
||||
|
||||
w32/subproc/WinDebug/subproc.lib w32/subproc/WinRel/subproc.lib:
|
||||
subproc.bat $(SUBPROC_MAKEFILE) $(MAKE)
|
||||
|
||||
config.h: config.h.W32
|
||||
copy $? $@
|
||||
|
||||
Release:
|
||||
$(MAKE) /f $(MAKEFILE) LDFLAGS="$(LDFLAGS_release)" CFLAGS="$(CFLAGS_release)" OUTDIR=WinRel WinRel/make.exe
|
||||
Debug:
|
||||
$(MAKE) /f $(MAKEFILE) LDFLAGS="$(LDFLAGS_debug)" CFLAGS="$(CFLAGS_debug)" OUTDIR=WinDebug WinDebug/make.exe
|
||||
|
||||
clean:
|
||||
rmdir /s /q WinDebug WinRel
|
||||
rmdir /s /q w32\subproc\WinDebug w32\subproc\WinRel
|
||||
erase config.h
|
||||
erase *.pdb
|
||||
|
||||
$(OUTDIR):
|
||||
if not exist .\$@\nul mkdir .\$@
|
||||
|
||||
LIBS = kernel32.lib user32.lib advapi32.lib
|
||||
|
||||
OBJS = \
|
||||
$(OUTDIR)/ar.obj \
|
||||
$(OUTDIR)/arscan.obj \
|
||||
$(OUTDIR)/commands.obj \
|
||||
$(OUTDIR)/default.obj \
|
||||
$(OUTDIR)/dir.obj \
|
||||
$(OUTDIR)/expand.obj \
|
||||
$(OUTDIR)/file.obj \
|
||||
$(OUTDIR)/function.obj \
|
||||
$(OUTDIR)/getloadavg.obj \
|
||||
$(OUTDIR)/getopt.obj \
|
||||
$(OUTDIR)/getopt1.obj \
|
||||
$(OUTDIR)/implicit.obj \
|
||||
$(OUTDIR)/job.obj \
|
||||
$(OUTDIR)/main.obj \
|
||||
$(OUTDIR)/misc.obj \
|
||||
$(OUTDIR)/read.obj \
|
||||
$(OUTDIR)/remake.obj \
|
||||
$(OUTDIR)/remote-stub.obj \
|
||||
$(OUTDIR)/rule.obj \
|
||||
$(OUTDIR)/signame.obj \
|
||||
$(OUTDIR)/variable.obj \
|
||||
$(OUTDIR)/version.obj \
|
||||
$(OUTDIR)/vpath.obj \
|
||||
$(OUTDIR)/glob.obj \
|
||||
$(OUTDIR)/fnmatch.obj \
|
||||
$(OUTDIR)/dirent.obj \
|
||||
$(OUTDIR)/pathstuff.obj
|
||||
|
||||
$(OUTDIR)/make.exe: $(OUTDIR) $(OBJS)
|
||||
$(LINK) @<<
|
||||
$(LDFLAGS) $(LIBS) $(OBJS)
|
||||
<<
|
||||
|
||||
.c{$(OUTDIR)}.obj:
|
||||
$(CC) $(CFLAGS) /c $<
|
||||
|
||||
$(OUTDIR)/glob.obj : glob/glob.c
|
||||
$(CC) $(CFLAGS) /c $?
|
||||
$(OUTDIR)/fnmatch.obj : glob/fnmatch.c
|
||||
$(CC) $(CFLAGS) /c $?
|
||||
$(OUTDIR)/dirent.obj : w32/compat/dirent.c
|
||||
$(CC) $(CFLAGS) /c $?
|
||||
$(OUTDIR)/pathstuff.obj : w32/pathstuff.c
|
||||
$(CC) $(CFLAGS) /c $?
|
||||
32
README
32
README
@@ -1,32 +0,0 @@
|
||||
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.
|
||||
|
||||
For general building and installation instructions, see the file INSTALL.
|
||||
If you need to build GNU Make and have no other `make' program to use,
|
||||
you can use the shell script `build.sh' instead. To do this, first run
|
||||
`configure' as described in INSTALL. Then, instead of typing `make' to
|
||||
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.
|
||||
|
||||
One area that is often a problem in configuration and porting is the code
|
||||
to check the system's current load average. To make it easier to test and
|
||||
debug this code, you can do `make check-loadavg' to see if it works
|
||||
properly on your system. (You must run `configure' beforehand, but you
|
||||
need not build Make itself to run this test.)
|
||||
|
||||
See the file NEWS for what has changed since previous releases.
|
||||
|
||||
GNU Make is fully documented in make.texinfo. See the section entitled
|
||||
`Problems and Bugs' for information on submitting bug reports.
|
||||
|
||||
GNU Make is free software. See the file COPYING for copying conditions.
|
||||
61
README.Amiga
Normal file
61
README.Amiga
Normal file
@@ -0,0 +1,61 @@
|
||||
Short: Port of GNU make with SAS/C (no ixemul.library required)
|
||||
Author: GNU, Amiga port by Aaron "Optimizer" Digulla
|
||||
Uploader: Aaron "Optimizer" Digulla (digulla@fh-konstanz.de)
|
||||
Type: dev/c
|
||||
|
||||
This is a pure Amiga port of GNU make. It needs no extra libraries or
|
||||
anything. It has the following features (in addition to any features of
|
||||
GNU make):
|
||||
|
||||
- Runs Amiga-Commands with SystemTags() (Execute)
|
||||
- Can run multi-line statements
|
||||
- Allows to use Device-Names in targets:
|
||||
|
||||
c:make : make.o
|
||||
|
||||
is ok. To distinguish between device-names and target : or ::, MAKE
|
||||
looks for spaces. If there are any around :, it's taken as a target
|
||||
delimiter, if there are none, it's taken as the name of a device. Note
|
||||
that "make:make.o" tries to create "make.o" on the device "make:".
|
||||
- Replaces @@ by a newline in any command line:
|
||||
|
||||
if exists make @@\
|
||||
delete make.bak quiet @@\
|
||||
rename make make.bak @@\
|
||||
endif @@\
|
||||
$(CC) Link Make.o To make
|
||||
|
||||
works. Note that the @@ must stand alone (ie. "make@@\" is illegal).
|
||||
Also be carefull that there is a space after the "\" (ie, at the
|
||||
beginning of the next line).
|
||||
- Can be made resident to save space and time
|
||||
- Amiga specific wildcards can be used in $(wildcard ...)
|
||||
|
||||
BUGS:
|
||||
- The line
|
||||
|
||||
dummy.h : src/*.c
|
||||
|
||||
tries to make dummy.h from "src/*.c" (ie. no wildcard-expansion takes
|
||||
place). You have to use "$(wildcard src/*.c)" instead.
|
||||
|
||||
COMPILING FROM SCRATCH
|
||||
----------------------
|
||||
|
||||
To recompile, you need SAS/C 6.51. make itself is not neccessary, there
|
||||
is an smakefile.
|
||||
|
||||
1. Copy config.ami to config.h
|
||||
2. If you use make to compie, copy Makefile.ami to Makefile and
|
||||
glob/Makefile.ami to glob/Makefile. Copy make into the current
|
||||
directory.
|
||||
|
||||
3. Run smake/make
|
||||
|
||||
INSTALLATION
|
||||
|
||||
Copy make somewhere in your search path (eg. sc:c or sc:bin).
|
||||
If you plan to use recursive makes, install make resident:
|
||||
|
||||
Resident make Add
|
||||
|
||||
297
README.DOS.template
Normal file
297
README.DOS.template
Normal file
@@ -0,0 +1,297 @@
|
||||
Port of GNU Make to 32-bit protected mode on MSDOS and MS-Windows.
|
||||
|
||||
Builds with DJGPP v2 port of GNU C/C++ compiler and utilities.
|
||||
|
||||
|
||||
New (since 3.74) DOS-specific features:
|
||||
|
||||
1. Supports long filenames when run from DOS box on Windows 9x.
|
||||
|
||||
2. Supports both stock DOS COMMAND.COM and Unix-style shells
|
||||
(details in ``Notes'' below).
|
||||
|
||||
3. Supports DOS drive letters in dependencies and pattern rules.
|
||||
|
||||
4. Better support for DOS-style backslashes in pathnames (but see
|
||||
``Notes'' below).
|
||||
|
||||
5. The $(shell) built-in can run arbitrary complex commands,
|
||||
including pipes and redirection, even when COMMAND.COM is your
|
||||
shell.
|
||||
|
||||
6. Can be built without floating-point code (see below).
|
||||
|
||||
7. Supports signals in child programs and restores the original
|
||||
directory if the child was interrupted.
|
||||
|
||||
8. Can be built without (a previous version of) Make.
|
||||
|
||||
9. The build process requires only standard tools. (Optional
|
||||
targets like "install:" and "clean:" still need additional
|
||||
programs, though, see below.)
|
||||
|
||||
|
||||
To build:
|
||||
|
||||
1. Unzip the archive, preserving the directory structure (-d switch
|
||||
if you use PKUNZIP). If you build Make on Windows 95, use an
|
||||
unzip program that supports long filenames in zip files.
|
||||
|
||||
If you are unpacking an official GNU source distribution, use
|
||||
either DJTAR (which is part of the DJGPP development
|
||||
environment), or the DJGPP port of GNU Tar.
|
||||
|
||||
2. Invoke the `configure.bat' batch file.
|
||||
|
||||
If you are building Make in-place, i.e. in the same directory
|
||||
where its sources are kept, just type "configure.bat" and press
|
||||
[Enter]. Otherwise, you need to supply the path to the source
|
||||
directory as an argument to the batch file, like this:
|
||||
|
||||
c:\djgpp\gnu\make-%VERSION%\configure.bat c:/djgpp/gnu/make-%VERSION%
|
||||
|
||||
Note the forward slashes in the source path argument: you MUST
|
||||
use them here.
|
||||
|
||||
3. If configure.bat doesn't find a working Make, it will suggest to
|
||||
use the `dosbuild.bat' batch file to build Make. Either do as it
|
||||
suggests or install another Make program (a pre-compiled binary
|
||||
should be available from the usual DJGPP sites) and rerun
|
||||
configure.bat.
|
||||
|
||||
4. If you will need to run Make on machines without an FPU, you
|
||||
might consider building a version of Make which doesn't issue
|
||||
floating-point instructions (they don't help much on MSDOS
|
||||
anyway). To this end, edit the Makefile created by
|
||||
configure.bat and add -DNO_FLOAT to the value of CPPFLAGS.
|
||||
|
||||
5. Invoke Make.
|
||||
|
||||
If you are building from outside of the source directory, you
|
||||
need to tell Make where the sources are, like this:
|
||||
|
||||
make srcdir=c:/djgpp/gnu/make-%VERSION%
|
||||
|
||||
(configure.bat will tell you this when it finishes). You MUST
|
||||
use a full, not relative, name of the source directory here, or
|
||||
else Make might fail.
|
||||
|
||||
6. After Make finishes, if you have a Unix-style shell installed,
|
||||
you can use the `install' target to install the package. You
|
||||
will also need GNU Fileutils and GNU Sed for this (they should
|
||||
be available from the DJGPP sites).
|
||||
|
||||
Without a Unix-style shell, you will have to install programs
|
||||
and the docs manually. Copy make.exe to a directory on your
|
||||
PATH, make.i* info files to your Info directory, and update the
|
||||
file `dir' in your Info directory by adding the following item
|
||||
to the main menu:
|
||||
|
||||
* Make: (make.info). The GNU make utility.
|
||||
|
||||
If you have the `install-info' program (from the GNU Texinfo
|
||||
package), it will do that for you if you invoke it like this:
|
||||
|
||||
install-info --info-dir=c:/djgpp/info c:/djgpp/info/make.info
|
||||
|
||||
(If your Info directory is other than C:\DJGPP\INFO, change this
|
||||
command accordingly.)
|
||||
|
||||
7. The `clean' targets also require Unix-style shell, and GNU Sed
|
||||
and `rm' programs (the latter from Fileutils).
|
||||
|
||||
|
||||
|
||||
Notes:
|
||||
-----
|
||||
|
||||
1. The shell issue.
|
||||
|
||||
This is probably the most significant improvement, first
|
||||
introduced in the port of GNU Make 3.75.
|
||||
|
||||
The original behavior of GNU Make is to invoke commands
|
||||
directly, as long as they don't include characters special to
|
||||
the shell or internal shell commands, because that is faster.
|
||||
When shell features like redirection or filename wildcards are
|
||||
involved, Make calls the shell.
|
||||
|
||||
This port supports both DOS shells (the stock COMMAND.COM and its
|
||||
4DOS/NDOS replacements), and Unix-style shells (tested with the
|
||||
venerable Stewartson's `ms_sh' 2.3 and the DJGPP port of `bash' by
|
||||
Daisuke Aoyama <jack@st.rim.or.jp>).
|
||||
|
||||
When the $SHELL variable points to a Unix-style shell, Make
|
||||
works just like you'd expect on Unix, calling the shell for any
|
||||
command that involves characters special to the shell or
|
||||
internal shell commands. The only difference is that, since
|
||||
there is no standard way to pass command lines longer than the
|
||||
infamous DOS 126-character limit, this port of Make writes the
|
||||
command line to a temporary disk file and then invokes the shell
|
||||
on that file.
|
||||
|
||||
If $SHELL points to a DOS-style shell, however, Make will not
|
||||
call it automatically, as it does with Unix shells. Stock
|
||||
COMMAND.COM is too dumb and would unnecessarily limit the
|
||||
functionality of Make. For example, you would not be able to
|
||||
use long command lines in commands that use redirection or
|
||||
pipes. Therefore, when presented with a DOS shell, this port of
|
||||
Make will emulate most of the shell functionality, like
|
||||
redirection and pipes, and shall only call the shell when a
|
||||
batch file or a command internal to the shell is invoked. (Even
|
||||
when a command is an internal shell command, Make will first
|
||||
search the $PATH for it, so that if a Makefile calls `mkdir',
|
||||
you can install, say, a port of GNU `mkdir' and have it called
|
||||
in that case.)
|
||||
|
||||
The key to all this is the extended functionality of `spawn' and
|
||||
`system' functions from the DJGPP library; this port just calls
|
||||
`system' where it would invoke the shell on Unix. The most
|
||||
important aspect of these functions is that they use a special
|
||||
mechanism to pass long (up to 16KB) command lines to DJGPP
|
||||
programs. In addition, `system' emulates some internal
|
||||
commands, like `cd' (so that you can now use forward slashes
|
||||
with it, and can also change the drive if the directory is on
|
||||
another drive). Another aspect worth mentioning is that you can
|
||||
call Unix shell scripts directly, provided that the shell whose
|
||||
name is mentioned on the first line of the script is installed
|
||||
anywhere along the $PATH. It is impossible to tell here
|
||||
everything about these functions; refer to the DJGPP library
|
||||
reference for more details.
|
||||
|
||||
The $(shell) built-in is implemented in this port by calling
|
||||
`popen'. Since `popen' calls `system', the above considerations
|
||||
are valid for $(shell) as well. In particular, you can put
|
||||
arbitrary complex commands, including pipes and redirection,
|
||||
inside $(shell), which is in many cases a valid substitute for
|
||||
the Unix-style command substitution (`command`) feature.
|
||||
|
||||
|
||||
2. "SHELL=/bin/sh" -- or is it?
|
||||
|
||||
Many Unix Makefiles include a line which sets the SHELL, for
|
||||
those versions of Make which don't have this as the default.
|
||||
Since many DOS systems don't have `sh' installed (in fact, most
|
||||
of them don't even have a `/bin' directory), this port takes
|
||||
such directives with a grain of salt. It will only honor such a
|
||||
directive if the basename of the shell name (like `sh' in the
|
||||
above example) can indeed be found in the directory that is
|
||||
mentioned in the SHELL= line (`/bin' in the above example), or
|
||||
in the current working directory, or anywhere on the $PATH (in
|
||||
that order). If the basename doesn't include a filename
|
||||
extension, Make will look for any known extension that indicates
|
||||
an executable file (.exe, .com, .bat, .btm, .sh, and even .sed
|
||||
and .pl). If any such file is found, then $SHELL will be
|
||||
defined to the exact pathname of that file, and that shell will
|
||||
hence be used for the rest of processing. But if the named
|
||||
shell is *not* found, the line which sets it will be effectively
|
||||
ignored, leaving the value of $SHELL as it was before. Since a
|
||||
lot of decisions that this port makes depend on the gender of
|
||||
the shell, I feel it doesn't make any sense to tailor Make's
|
||||
behavior to a shell which is nowhere to be found.
|
||||
|
||||
Note that the above special handling of "SHELL=" only happens
|
||||
for Makefiles; if you set $SHELL in the environment or on the
|
||||
Make command line, you are expected to give the complete
|
||||
pathname of the shell, including the filename extension.
|
||||
|
||||
The default value of $SHELL is computed as on Unix (see the Make
|
||||
manual for details), except that if $SHELL is not defined in the
|
||||
environment, $COMSPEC is used. Also, if an environment variable
|
||||
named $MAKESHELL is defined, it takes precedence over both
|
||||
$COMSPEC and $SHELL. Note that, unlike Unix, $SHELL in the
|
||||
environment *is* used to set the shell (since on MSDOS, it's
|
||||
unlikely that the interactive shell will not be suitable for
|
||||
Makefile processing).
|
||||
|
||||
The bottom line is that you can now write Makefiles where some
|
||||
of the targets require a real (i.e. Unix-like) shell, which will
|
||||
nevertheless work when such shell is not available (provided, of
|
||||
course, that the commands which should always work, don't
|
||||
require such a shell). More important, you can convert Unix
|
||||
Makefiles to MSDOS and leave the line which sets the shell
|
||||
intact, so that people who do have Unixy shell could use it for
|
||||
targets which aren't converted to DOS (like `install' and
|
||||
`uninstall', for example).
|
||||
|
||||
|
||||
3. Default directories.
|
||||
|
||||
GNU Make knows about standard directories where it searches for
|
||||
library and include files mentioned in the Makefile. Since
|
||||
MSDOS machines don't have standard places for these, this port
|
||||
will search ${DJDIR}/lib and ${DJDIR}/include respectively.
|
||||
$DJDIR is defined automatically by the DJGPP startup code as the
|
||||
root of the DJGPP installation tree (unless you've tampered with
|
||||
the DJGPP.ENV file). This should provide reasonable default
|
||||
values, unless you moved parts of DJGPP to other directories.
|
||||
|
||||
|
||||
4. Letter-case in filenames.
|
||||
|
||||
If you run Make on Windows 9x, you should be aware of the
|
||||
letter-case issue. Make is internally case-sensitive, but all
|
||||
file operations are case-insensitive on Windows 9x, so
|
||||
e.g. files `FAQ', `faq' and `Faq' all refer to the same file, as
|
||||
far as Windows is concerned. The underlying DJGPP C library
|
||||
functions honor the letter-case of the filenames they get from
|
||||
the OS, except that by default, they down-case 8+3 DOS filenames
|
||||
which are stored in upper case in the directory and would break
|
||||
many Makefiles otherwise. (The details of which filenames are
|
||||
converted to lower case are explained in the DJGPP libc docs,
|
||||
under the `_preserve_fncase' and `_lfn_gen_short_fname'
|
||||
functions, but as a thumb rule, any filename that is stored in
|
||||
upper case in the directory, is a valid DOS 8+3 filename and
|
||||
doesn't include characters invalid on MSDOS FAT filesystems,
|
||||
will be automatically down-cased.) User reports that I have
|
||||
indicate that this default behavior is generally what you'd
|
||||
expect; however, your input is most welcome.
|
||||
|
||||
In any case, if you hit a situation where you must force Make to
|
||||
get the 8+3 DOS filenames in upper case, set FNCASE=y in the
|
||||
environment or in the Makefile.
|
||||
|
||||
|
||||
5. DOS-style pathnames.
|
||||
|
||||
There are a lot of places throughout the program sources which
|
||||
make implicit assumptions about the pathname syntax. In
|
||||
particular, the directories are assumed to be separated by `/',
|
||||
and any pathname which doesn't begin with a `/' is assumed to be
|
||||
relative to the current directory. This port attempts to
|
||||
support DOS-style pathnames which might include the drive letter
|
||||
and use backslashes instead of forward slashes. However, this
|
||||
support is not complete; I feel that pursuing this support too
|
||||
far might break some more important features, particularly if
|
||||
you use a Unix-style shell (where a backslash is a quote
|
||||
character). I only consider support of backslashes desirable
|
||||
because some Makefiles invoke non-DJGPP programs which don't
|
||||
understand forward slashes. A notable example of such programs
|
||||
is the standard programs which come with MSDOS. Otherwise, you
|
||||
are advised to stay away from backslashes whenever possible. In
|
||||
particular, filename globbing won't work on pathnames with
|
||||
backslashes, because the GNU `glob' library doesn't support them
|
||||
(backslash is special in filename wildcards, and I didn't want
|
||||
to break that).
|
||||
|
||||
One feature which *does* work with backslashes is the filename-
|
||||
related built-in functions such as $(dir), $(notdir), etc.
|
||||
Drive letters in pathnames are also fully supported.
|
||||
|
||||
|
||||
|
||||
Bug reports:
|
||||
-----------
|
||||
|
||||
Bugs that are clearly related to the MSDOS/DJGPP port should be
|
||||
reported first on the comp.os.msdos.djgpp news group (if you cannot
|
||||
post to Usenet groups, write to the DJGPP mailing list,
|
||||
<djgpp@delorie.com>, which is an email gateway into the above news
|
||||
group). For other bugs, please follow the procedure explained in
|
||||
the "Bugs" chapter of the Info docs. If you don't have an Info
|
||||
reader, look up that chapter in the `make.i1' file with any text
|
||||
browser/editor.
|
||||
|
||||
|
||||
Enjoy,
|
||||
Eli Zaretskii <eliz@is.elta.co.il>
|
||||
222
README.W32
Normal file
222
README.W32
Normal file
@@ -0,0 +1,222 @@
|
||||
Port of GNU make to Windows NT and Windows 95
|
||||
Builds natively with MSVC 2.x or MSVC 4.x compilers.
|
||||
|
||||
To build with nmake on Windows NT or Windows 95:
|
||||
|
||||
1. Make sure cl.exe is in your %Path%. Example:
|
||||
|
||||
set Path=%Path%;c:/msdev/bin
|
||||
|
||||
2. Make sure %include% is set to msvc include directory. Example:
|
||||
|
||||
set include=c:/msdev/include
|
||||
|
||||
3. Make sure %lib% is set to msvc lib directory. Example:
|
||||
|
||||
set lib=c:/msdev/lib
|
||||
|
||||
4. nmake /f NMakefile
|
||||
|
||||
|
||||
There is a bat file (build_w32.bat) for folks who have fear of nmake.
|
||||
|
||||
Outputs:
|
||||
|
||||
WinDebug/make.exe
|
||||
WinRel/make.exe
|
||||
|
||||
|
||||
-- Notes/Caveats --
|
||||
|
||||
GNU make and sh.exe:
|
||||
|
||||
This port prefers you have a working sh.exe somewhere on your
|
||||
system. If you don't have sh.exe, port falls back to
|
||||
MSDOS mode for launching programs (via a batch file).
|
||||
The MSDOS mode style execution has not been tested too
|
||||
carefully though (I use GNU bash as sh.exe).
|
||||
|
||||
There are very few true ports of Bourne shell for NT right now.
|
||||
There is a version of GNU bash available from Cygnus gnu-win32
|
||||
porting effort. Other possibilities are to get the MKS version
|
||||
of sh.exe or to build your own with a package like
|
||||
NutCracker (DataFocus) or Portage (Consensys).
|
||||
|
||||
Tivoli uses a homegrown port of GNU bash which is not (yet)
|
||||
freely available. It may be available someday, but I am not in control
|
||||
of this decision nor do I influence it. Sorry!
|
||||
|
||||
GNU make and Cygnus GNU WIN32 tools (BATCH_MODE_ONLY_SHELL)
|
||||
|
||||
GNU make now has support for the Cygnus GNU WIN32 toolset. The
|
||||
GNU WIN32 version of Bourne shell does not behave well when
|
||||
invoked as 'sh -c' from CreateProcess(). The main problem is it
|
||||
seems to have a hard time handling quoted strings correctly. This
|
||||
problem goes away when invoking the Cygnus shell on a shell script.
|
||||
|
||||
To work around this difficulty, this version of make supports
|
||||
a new batch mode. When BATCH_MODE_ONLY_SHELL is defined at compile
|
||||
time, make forces all command lines to be executed via script
|
||||
files instead of by command line.
|
||||
|
||||
A native WIN32 system with no Bourne shell will also run
|
||||
in batch mode. All command lines will be put into batch files
|
||||
and executed via $(COMSPEC) (%COMSPEC%).
|
||||
|
||||
If you wish to use Cygnus' GNUWIN32 shell, be sure you define
|
||||
BATCH_MODE_ONLY_SHELL in the config.h.W32 prior to building make.
|
||||
The new feataure was tested with the b18 version of the Cygnus
|
||||
user tools.
|
||||
|
||||
GNU make and MKS shell
|
||||
|
||||
There is now semi-official support for the MKS shell. To turn this
|
||||
support on, define HAVE_MKS_SHELL in the config.h.W32 before you
|
||||
build make. Do not define BATCH_MODE_ONLY_SHELL if you turn
|
||||
on HAVE_MKS_SHELL.
|
||||
|
||||
GNU make handling of drive letters in pathnames (PATH, vpath, VPATH):
|
||||
|
||||
There is a caveat that should be noted with respect to handling
|
||||
single character pathnames on Windows systems. When colon is
|
||||
used in PATH variables, make tries to be smart about knowing when
|
||||
you are using colon as a separator versus colon as a drive
|
||||
letter. Unfortunately, something as simple as the string 'x:/'
|
||||
could be interpreted 2 ways: (x and /) or (x:/).
|
||||
|
||||
Make chooses to interpret a letter plus colon (e.g. x:/) as a
|
||||
drive letter pathname. If it is necessary to use single
|
||||
character directories in paths (VPATH, vpath, Path, PATH), the
|
||||
user must do one of two things:
|
||||
|
||||
a. Use semicolon as the separator to disambiguate colon. For
|
||||
example use 'x;/' if you want to say 'x' and '/' are
|
||||
separate components.
|
||||
|
||||
b. Qualify the directory name so that there is more than
|
||||
one character in the path(s) used. For example, none
|
||||
of these settings are ambiguous:
|
||||
|
||||
./x:./y
|
||||
/some/path/x:/some/path/y
|
||||
x:/some/path/x:x:/some/path/y
|
||||
|
||||
These caveats affect Windows systems only (Windows NT and
|
||||
Windows 95) and can be ignored for other platforms.
|
||||
|
||||
Please note that you are free to mix colon and semi-colon in the
|
||||
specification of paths. Make is able to figure out the intended
|
||||
result and convert the paths internally to the format needed
|
||||
when interacting with the operating system.
|
||||
|
||||
You are encouraged to use colon as the separator character.
|
||||
This should ease the pain of deciding how to handle various path
|
||||
problems which exist between platforms. If colon is used on
|
||||
both Unix and Windows systems, then no ifdef'ing will be
|
||||
necessary in the makefile source.
|
||||
|
||||
GNU make test suite:
|
||||
|
||||
I verified all functionality with a slightly modified version
|
||||
of make-test-0.4.5 (modifications to get test suite to run
|
||||
on Windows NT). All tests pass in an environment that includes
|
||||
sh.exe. Tested on both Windows NT and Windows 95.
|
||||
|
||||
Building GNU make on Windows NT and Windows 95 with Microsoft Visual C
|
||||
|
||||
I did not provide a Visual C project file with this port as
|
||||
the project file would not be considered freely distributable
|
||||
(or so I think). It is easy enough to create one though if
|
||||
you know how to use Visual C.
|
||||
|
||||
I build the program statically to avoid problems locating DLL's
|
||||
on machines that may not have MSVC runtime installed. If you
|
||||
prefer, you can change make to build with shared libraries by
|
||||
changing /MT to /MD in the NMakefile (or build_w32.bat).
|
||||
|
||||
Program has not been built under non-Intel architectures (yet).
|
||||
|
||||
I have not tried to build with any other compilers than MSVC.
|
||||
|
||||
Pathnames and white space:
|
||||
|
||||
Unlike Unix, Windows 95/NT systems encourage pathnames which
|
||||
contain white space (e.g. C:\Program Files\). These sorts of pathnames
|
||||
are legal under Unix too, but are never encouraged. There is
|
||||
at least one place in make (VPATH/vpath handling) where paths
|
||||
containing white space will simply not work. There may be others
|
||||
too. I chose to not try and port make in such a way so that
|
||||
these sorts of paths could be handled. I offer these suggestions
|
||||
as workarounds:
|
||||
|
||||
1. Use 8.3 notation
|
||||
2. Rename the directory so it does not contain white space.
|
||||
|
||||
If you are unhappy with this choice, this is free software
|
||||
and you are free to take a crack at making this work. The code
|
||||
in w32/pathstuff.c and vpath.c would be the places to start.
|
||||
|
||||
Pathnames and Case insensitivity:
|
||||
|
||||
Unlike Unix, Windows 95/NT systems are case insensitive but case
|
||||
preserving. For example if you tell the file system to create a
|
||||
file named "Target", it will preserve the case. Subsequent access to
|
||||
the file with other case permutations will succeed (i.e. opening a
|
||||
file named "target" or "TARGET" will open the file "Target").
|
||||
|
||||
By default, GNU make retains its case sensitivity when comparing
|
||||
target names and existing files or directories. It can be
|
||||
configured, however, into a case preserving and case insensitive
|
||||
mode by adding a define for HAVE_CASE_INSENSITIVE_FS to
|
||||
config.h.W32.
|
||||
|
||||
For example, the following makefile will create a file named
|
||||
Target in the directory subdir which will subsequently be used
|
||||
to satisfy the dependency of SUBDIR/DepTarget on SubDir/TARGET.
|
||||
Without HAVE_CASE_INSENSITIVE_FS configured, the dependency link
|
||||
will not be made:
|
||||
|
||||
subdir/Target:
|
||||
touch $@
|
||||
|
||||
SUBDIR/DepTarget: SubDir/TARGET
|
||||
cp $^ $@
|
||||
|
||||
Reliance on this behavior also eliminates the ability of GNU make
|
||||
to use case in comparison of matching rules. For example, it is
|
||||
not possible to set up a C++ rule using %.C that is different
|
||||
than a C rule using %.c. GNU make will consider these to be the
|
||||
same rule and will issue a warning.
|
||||
|
||||
SAMBA/NTFS/VFAT:
|
||||
|
||||
I have not had any success building the debug version of this
|
||||
package using SAMBA as my file server. The reason seems to be
|
||||
related to the way VC++ 4.0 changes the case name of the pdb
|
||||
filename it is passed on the command line. It seems to change
|
||||
the name always to to lower case. I contend that
|
||||
the VC++ compiler should not change the casename of files that
|
||||
are passed as arguments on the command line. I don't think this
|
||||
was a problem in MSVC 2.x, but I know it is a problem in MSVC 4.x.
|
||||
|
||||
The package builds fine on VFAT and NTFS filesystems.
|
||||
|
||||
Most all of the development I have done to date has been using
|
||||
NTFS and long file names. I have not done any considerable work
|
||||
under VFAT. VFAT users may wish to be aware that this port
|
||||
of make does respect case sensitivity.
|
||||
|
||||
Version 3.76 contains some preliminary support for FAT. Make
|
||||
now tries to work around some difficulties with stat'ing of
|
||||
files and caching of filenames and directories internally.
|
||||
There is still a known problem with filenames sometimes being
|
||||
found to have modification dates in the future which cause make
|
||||
to complain about the file and exit (remake.c).
|
||||
|
||||
Bug reports:
|
||||
|
||||
Please submit bugs via the normal bug reporting mechanism
|
||||
which is described in one of the Texinfo files. If you don't
|
||||
have Texinfo for Windows NT or Windows 95, these files are simple
|
||||
text files and can be read with a text editor.
|
||||
|
||||
73
README.customs
Normal file
73
README.customs
Normal file
@@ -0,0 +1,73 @@
|
||||
-*-indented-text-*-
|
||||
|
||||
GNU make can utilize the Customs library, distributed with Pmake, to
|
||||
provide builds distributed across multiple hosts.
|
||||
|
||||
In order to utilize this capability, you must first download and build
|
||||
the Customs library. It is contained in the Pmake distribution, which
|
||||
can be obtained at:
|
||||
|
||||
ftp://ftp.icsi.berkeley.edu/pub/ai/stolcke/software/
|
||||
|
||||
This integration was tested (superficially) with Pmake 2.1.33.
|
||||
|
||||
|
||||
BUILDING CUSTOMS
|
||||
----------------
|
||||
|
||||
First, build pmake and Customs. You need to build pmake first, because
|
||||
Customs require pmake to build. Unfortunately, this is not trivial;
|
||||
please see the pmake and Customs documentation for details. The best
|
||||
place to look for instructions is in the pmake-2.1.33/INSTALL file.
|
||||
|
||||
Note that the 2.1.33 Pmake distribution comes with a set of patches to
|
||||
GNU make, distributed in the pmake-2.1.33/etc/gnumake/ directory. These
|
||||
patches are based on GNU make 3.75 (there are patches for earlier
|
||||
versions of GNU make, also). The parts of this patchfile which relate
|
||||
directly to Customs support have already been incorporated into this
|
||||
version of GNU make, so you should _NOT_ apply the patch file.
|
||||
|
||||
However, there are a few non-Customs specific (as far as I could tell)
|
||||
changes here which are not incorporated (for example, the modification
|
||||
to try expanding -lfoo to libfoo.so). If you rely on these changes
|
||||
you'll need to re-apply them by hand.
|
||||
|
||||
Install the Customs library and header files according to the
|
||||
documentation. You should also install the man pages (contrary to
|
||||
comments in the documentation, they weren't installed automatically for
|
||||
me; I had to cd to the ``pmake-2.1.33/doc'' directory and run ``pmake
|
||||
install'' there directly).
|
||||
|
||||
|
||||
BUILDING GNU MAKE
|
||||
-----------------
|
||||
|
||||
Once you've installed Customs, you can build GNU make to use it. When
|
||||
configuring GNU make, merely use the ``--with-customs=DIR'' option.
|
||||
Provide the directory containing the ``lib'' and ``include/customs''
|
||||
subdirectories as DIR. For example, if you installed the customs
|
||||
library in /usr/local/lib and the headers in /usr/local/include/customs,
|
||||
then you'd pass ``--with-customs=/usr/local'' as an option to configure.
|
||||
|
||||
Run make (or use build.sh) normally to build GNU make as described in
|
||||
the INSTALL file.
|
||||
|
||||
See the documentation for Customs for information on starting and
|
||||
configuring Customs.
|
||||
|
||||
|
||||
PROBLEMS
|
||||
--------
|
||||
|
||||
SunOS 4.1.x:
|
||||
The customs/sprite.h header file #includes the <malloc.h> header
|
||||
files; this conflicts with GNU make's configuration so you'll get a
|
||||
compile error if you use GCC (or any other ANSI-capable C compiler).
|
||||
|
||||
I commented out the #include in sprite.h:107:
|
||||
|
||||
#if defined(sun) || defined(ultrix) || defined(hpux) || defined(sgi)
|
||||
/* #include <malloc.h> */
|
||||
#else
|
||||
|
||||
YMMV.
|
||||
@@ -1,19 +1,59 @@
|
||||
This directory contains the VERSION test release of GNU Make.
|
||||
All bugs reported for previous test releases have been fixed.
|
||||
Some bugs surely remain.
|
||||
This directory contains the %VERSION% release of GNU Make.
|
||||
|
||||
See the file NEWS for the user-visible changes from previous releases.
|
||||
In addition, there have been bugs fixed.
|
||||
|
||||
For general building and installation instructions, see the file INSTALL.
|
||||
|
||||
If you need to build GNU Make and have no other `make' program to use,
|
||||
you can use the shell script `build.sh' instead. To do this, first run
|
||||
`configure' as described in INSTALL. Then, instead of typing `make' to
|
||||
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.
|
||||
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.
|
||||
|
||||
GNU make is fully documented in the GNU Make manual, which is contained
|
||||
in this distribution as the file make.texinfo. You can also find
|
||||
on-line and preformatted (PostScript and DVI) versions at the FSF's web
|
||||
site. There is information there about ordering hardcopy documentation.
|
||||
|
||||
http://www.gnu.org/
|
||||
http://www.gnu.org/doc/doc.html
|
||||
http://www.gnu.org/manual/manual.html
|
||||
|
||||
You can also find the latest versions of GNU Make from there.
|
||||
|
||||
Please send GNU make bug reports to bug-make@gnu.org. Please see the
|
||||
section of the manual entitles `Problems and Bugs' for information on
|
||||
submitting bug reports.
|
||||
|
||||
If you need help using GNU make, try these forums:
|
||||
|
||||
help-make@gnu.org
|
||||
help-utils@gnu.org
|
||||
news:gnu.utils.help
|
||||
news:gnu.utils.bug
|
||||
|
||||
Also:
|
||||
|
||||
- See README.customs for details on integrating GNU make with the
|
||||
Customs distributed build environment from the Pmake distribution.
|
||||
|
||||
- See README.W32 for details about GNU Make on Windows NT or 95.
|
||||
|
||||
- See README.Amiga for details about GNU Make on AmigaDOS.
|
||||
|
||||
- See README.DOS for compilation instructions on MS-DOS and MS-Windows
|
||||
using DJGPP tools.
|
||||
|
||||
A precompiled binary of the MSDOS port of GNU Make is available as part
|
||||
of DJGPP; see the WWW page http://www.delorie.com/djgpp/ for more
|
||||
information.
|
||||
|
||||
It has been reported that the XLC 1.2 compiler on AIX 3.2 is buggy such
|
||||
that if you compile make with `cc -O' on AIX 3.2, it will not work correctly.
|
||||
It is said that using `cc' without `-O' does work.
|
||||
@@ -24,9 +64,5 @@ debug this code, you can do `make check-loadavg' to see if it works
|
||||
properly on your system. (You must run `configure' beforehand, but you
|
||||
need not build Make itself to run this test.)
|
||||
|
||||
See the file NEWS for what has changed since previous releases.
|
||||
|
||||
GNU Make is fully documented in make.texinfo. See the section entitled
|
||||
`Problems and Bugs' for information on submitting bug reports.
|
||||
|
||||
GNU Make is free software. See the file COPYING for copying conditions.
|
||||
|
||||
13
SCOPTIONS
Normal file
13
SCOPTIONS
Normal file
@@ -0,0 +1,13 @@
|
||||
ERRORREXX
|
||||
OPTIMIZE
|
||||
NOVERSION
|
||||
OPTIMIZERTIME
|
||||
OPTIMIZERALIAS
|
||||
DEFINE INCLUDEDIR="include:"
|
||||
DEFINE LIBDIR="lib:"
|
||||
DEFINE NO_ALLOCA
|
||||
DEFINE NO_FLOAT
|
||||
DEFINE NO_ARCHIVES
|
||||
IGNORE=161
|
||||
IGNORE=100
|
||||
STARTUP=cres
|
||||
213
SMakefile.template
Normal file
213
SMakefile.template
Normal file
@@ -0,0 +1,213 @@
|
||||
# NOTE: If you have no `make' program at all to process this makefile, run
|
||||
# `build.sh' instead.
|
||||
#
|
||||
# Copyright (C) 1988, 89, 91, 92, 93, 94, 1995 Free Software Foundation, Inc.
|
||||
# This file is part of GNU Make.
|
||||
#
|
||||
# GNU Make is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# GNU Make is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with GNU Make; see the file COPYING. If not, write to
|
||||
# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
# Boston, MA 02111-1307, USA.
|
||||
|
||||
#
|
||||
# Makefile for GNU Make
|
||||
#
|
||||
|
||||
# Ultrix 2.2 make doesn't expand the value of VPATH.
|
||||
VPATH = /make-%VERSION%/
|
||||
# This must repeat the value, because configure will remove `VPATH = .'.
|
||||
srcdir = /make-%VERSION%/
|
||||
|
||||
CC = sc
|
||||
RM = delete
|
||||
MAKE = smake
|
||||
|
||||
CFLAGS =
|
||||
CPPFLAGS =
|
||||
LDFLAGS =
|
||||
|
||||
# Define these for your system as follows:
|
||||
# -DNO_ARCHIVES To disable `ar' archive support.
|
||||
# -DNO_FLOAT To avoid using floating-point numbers.
|
||||
# -DENUM_BITFIELDS If the compiler isn't GCC but groks enum foo:2.
|
||||
# Some compilers apparently accept this
|
||||
# without complaint but produce losing code,
|
||||
# so beware.
|
||||
# NeXT 1.0a uses an old version of GCC, which required -D__inline=inline.
|
||||
# See also `config.h'.
|
||||
defines =
|
||||
|
||||
# Which flavor of remote job execution support to use.
|
||||
# The code is found in `remote-$(REMOTE).c'.
|
||||
REMOTE = stub
|
||||
|
||||
# If you are using the GNU C library, or have the GNU getopt functions in
|
||||
# your C library, you can comment these out.
|
||||
GETOPT = getopt.o getopt1.o
|
||||
GETOPT_SRC = $(srcdir)getopt.c $(srcdir)getopt1.c $(srcdir)getopt.h
|
||||
|
||||
# If you are using the GNU C library, or have the GNU glob functions in
|
||||
# your C library, you can comment this out. GNU make uses special hooks
|
||||
# into the glob functions to be more efficient (by using make's directory
|
||||
# cache for globbing), so you must use the GNU functions even if your
|
||||
# system's C library has the 1003.2 glob functions already. Also, the glob
|
||||
# functions in the AIX and HPUX C libraries are said to be buggy.
|
||||
GLOB = Lib glob/glob.lib
|
||||
|
||||
# If your system doesn't have alloca, or the one provided is bad, define this.
|
||||
ALLOCA = alloca.o
|
||||
ALLOCA_SRC = $(srcdir)alloca.c
|
||||
|
||||
# If your system needs extra libraries loaded in, define them here.
|
||||
# System V probably need -lPW for alloca. HP-UX 7.0's alloca in
|
||||
# libPW.a is broken on HP9000s300 and HP9000s400 machines. Use
|
||||
# alloca.c instead on those machines.
|
||||
LOADLIBES =
|
||||
|
||||
# Any extra object files your system needs.
|
||||
extras = amiga.o
|
||||
|
||||
# Common prefix for machine-independent installed files.
|
||||
prefix =
|
||||
# Common prefix for machine-dependent installed files.
|
||||
exec_prefix =
|
||||
|
||||
# Directory to install `make' in.
|
||||
bindir = sc:c
|
||||
# Directory to find libraries in for `-lXXX'.
|
||||
libdir = lib:
|
||||
# Directory to search by default for included makefiles.
|
||||
includedir = include:
|
||||
# Directory to install the Info files in.
|
||||
infodir = doc:
|
||||
# Directory to install the man page in.
|
||||
mandir = t:
|
||||
# Number to put on the man page filename.
|
||||
manext = 1
|
||||
# Prefix to put on installed `make' binary file name.
|
||||
binprefix =
|
||||
# Prefix to put on installed `make' man page file name.
|
||||
manprefix = $(binprefix)
|
||||
|
||||
# Whether or not make needs to be installed setgid.
|
||||
# The value should be either `true' or `false'.
|
||||
# On many systems, the getloadavg function (used to implement the `-l'
|
||||
# switch) will not work unless make is installed setgid kmem.
|
||||
install_setgid = false
|
||||
# Install make setgid to this group so it can read /dev/kmem.
|
||||
group = sys
|
||||
|
||||
# Program to install `make'.
|
||||
INSTALL_PROGRAM = copy
|
||||
# Program to install the man page.
|
||||
INSTALL_DATA = copy
|
||||
# Generic install program.
|
||||
INSTALL = copy
|
||||
|
||||
# Program to format Texinfo source into Info files.
|
||||
MAKEINFO = makeinfo
|
||||
# Program to format Texinfo source into DVI files.
|
||||
TEXI2DVI = texi2dvi
|
||||
|
||||
# Programs to make tags files.
|
||||
ETAGS = etags -w
|
||||
CTAGS = ctags -w
|
||||
|
||||
objs = commands.o job.o dir.o file.o misc.o main.o read.o remake.o \
|
||||
rule.o implicit.o default.o variable.o expand.o function.o \
|
||||
vpath.o version.o ar.o arscan.o signame.o remote-$(REMOTE).o \
|
||||
$(GLOB) $(GETOPT) $(ALLOCA) $(extras)
|
||||
srcs = $(srcdir)commands.c $(srcdir)job.c $(srcdir)dir.c \
|
||||
$(srcdir)file.c $(srcdir)getloadavg.c $(srcdir)misc.c \
|
||||
$(srcdir)main.c $(srcdir)read.c $(srcdir)remake.c \
|
||||
$(srcdir)rule.c $(srcdir)implicit.c $(srcdir)default.c \
|
||||
$(srcdir)variable.c $(srcdir)expand.c $(srcdir)function.c \
|
||||
$(srcdir)vpath.c $(srcdir)version.c \
|
||||
$(srcdir)remote-$(REMOTE).c \
|
||||
$(srcdir)ar.c $(srcdir)arscan.c \
|
||||
$(srcdir)signame.c $(srcdir)signame.h $(GETOPT_SRC) \
|
||||
$(srcdir)commands.h $(srcdir)dep.h $(srcdir)file.h \
|
||||
$(srcdir)job.h $(srcdir)make.h $(srcdir)rule.h \
|
||||
$(srcdir)variable.h $(ALLOCA_SRC) $(srcdir)config.h.in
|
||||
|
||||
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .o .c .h .ps .dvi .info .texinfo
|
||||
|
||||
all: make
|
||||
info: make.info
|
||||
dvi: make.dvi
|
||||
# Some makes apparently use .PHONY as the default goal if it is before `all'.
|
||||
.PHONY: all check info dvi
|
||||
|
||||
make.info: make.texinfo
|
||||
$(MAKEINFO) -I$(srcdir) $(srcdir)make.texinfo -o make.info
|
||||
|
||||
make.dvi: make.texinfo
|
||||
$(TEXI2DVI) $(srcdir)make.texinfo
|
||||
|
||||
make.ps: make.dvi
|
||||
dvi2ps make.dvi > make.ps
|
||||
|
||||
make: $(objs) glob/glob.lib
|
||||
$(CC) Link $(LDFLAGS) $(objs) $(LOADLIBES) To make.new
|
||||
-delete quiet make
|
||||
rename make.new make
|
||||
|
||||
# -I. is needed to find config.h in the build directory.
|
||||
.c.o:
|
||||
$(CC) $(defines) IDir "" IDir $(srcdir)glob \
|
||||
$(CPPFLAGS) $(CFLAGS) $< $(OUTPUT_OPTION)
|
||||
|
||||
glob/glob.lib:
|
||||
execute <<
|
||||
cd glob
|
||||
smake
|
||||
<
|
||||
|
||||
tagsrcs = $(srcs) $(srcdir)remote-*.c
|
||||
TAGS: $(tagsrcs)
|
||||
$(ETAGS) $(tagsrcs)
|
||||
tags: $(tagsrcs)
|
||||
$(CTAGS) $(tagsrcs)
|
||||
|
||||
.PHONY: install installdirs
|
||||
install:
|
||||
copy make sc:c
|
||||
|
||||
loadavg: loadavg.c config.h
|
||||
$(CC) $(defines) -DTEST -I. -I$(srcdir) $(CFLAGS) $(LDFLAGS) \
|
||||
loadavg.c $(LOADLIBES) -o $@
|
||||
|
||||
clean: glob-clean
|
||||
-$(RM) -f make loadavg *.o core make.dvi
|
||||
|
||||
distclean: clean glob-realclean
|
||||
-$(RM) -f Makefile config.h config.status build.sh
|
||||
-$(RM) -f config.log config.cache
|
||||
-$(RM) -f TAGS tags
|
||||
-$(RM) -f make.?? make.??s make.log make.toc make.*aux
|
||||
-$(RM) -f loadavg.c
|
||||
|
||||
realclean: distclean
|
||||
-$(RM) -f make.info*
|
||||
|
||||
mostlyclean: clean
|
||||
|
||||
.PHONY: glob-clean glob-realclean
|
||||
|
||||
glob-clean glob-realclean:
|
||||
execute <<
|
||||
cd glob
|
||||
smake $@
|
||||
<
|
||||
51
TODO.private
Normal file
51
TODO.private
Normal file
@@ -0,0 +1,51 @@
|
||||
-*-Indented-Text-*-
|
||||
GNU Make TODO List
|
||||
------------------
|
||||
|
||||
This list comes both from the authors and from users of GNU make.
|
||||
|
||||
They are listed in no particular order!
|
||||
|
||||
Also, I don't gaurantee that all of them will be ultimately deemed "good
|
||||
ideas" and implemented. These are just the ones that, at first blush,
|
||||
seem to have some merit (and that I can remember).
|
||||
|
||||
However, if you see something here you really, really want, speak up.
|
||||
All other things being equal, I will tend to implement things that seem
|
||||
to maximize user satisfaction.
|
||||
|
||||
Also, this list doesn't include things which I'm pretty sure would
|
||||
require serious, fundamental change to GNU make; those things belong on
|
||||
the mythical "Make 4.0" list. I admit, that line can be somewhat fuzzy :)
|
||||
|
||||
|
||||
* Per-target variable definitions (a la SunOS make's ":=" feature, but
|
||||
note the syntax here will definitely be different!)
|
||||
|
||||
* Multi-token pattern rule matching (allow %1/%2.c : %1/obj/%2.o, etc.)
|
||||
|
||||
* More robust clock skew detection algorithm.
|
||||
|
||||
* Provide MAKETARGETS and MAKEVARIABLES variables, containing the
|
||||
names of the targets and variables defined in the makefile.
|
||||
|
||||
* If the user asks for parallelization, rebuild any "include"'d files
|
||||
in parallel as well (helps esp. when there are many .d files to be
|
||||
built).
|
||||
|
||||
* Allow variables/functions to expand to other make rules which are
|
||||
then interpreted, with newlines handled correctly.
|
||||
|
||||
* More intelligent submake handling when doing parallel makes:
|
||||
currently each submake gets a "-j 1" option. It would be good if
|
||||
make was smart enough to give some/all its slots to the submake
|
||||
(esp. if there is no other rule that can be run by the parent in
|
||||
parallel, a common situation). Doing this perfectly might be too
|
||||
hard, but something less than perfect is certainly possible.
|
||||
|
||||
* Option to check more than timestamps to determine if targets have
|
||||
changed (MD5 checksumming?)
|
||||
|
||||
* Some sort of operating-system independent way of handling paths
|
||||
would be outstanding, so makefiles can be written for UNIX, VMS,
|
||||
DOS, MS-Windows, Amiga, etc. with a minimum of specialization.
|
||||
29
acconfig.h
29
acconfig.h
@@ -1,9 +1,22 @@
|
||||
/* Name of this package (needed by automake) */
|
||||
#undef PACKAGE
|
||||
|
||||
/* Version of this package (needed by automake) */
|
||||
#undef VERSION
|
||||
|
||||
/* Define to the name of the SCCS `get' command. */
|
||||
#undef SCCS_GET
|
||||
|
||||
/* Define this if the SCCS `get' command understands the `-G<file>' option. */
|
||||
#undef SCCS_GET_MINUS_G
|
||||
|
||||
/* Define this to enable job server support in GNU make. */
|
||||
#undef MAKE_JOBSERVER
|
||||
|
||||
/* Define to be the nanoseconds member of struct stat's st_mtim,
|
||||
if it exists. */
|
||||
#undef ST_MTIM_NSEC
|
||||
|
||||
/* Define this if the C library defines the variable `sys_siglist'. */
|
||||
#undef HAVE_SYS_SIGLIST
|
||||
|
||||
@@ -13,5 +26,17 @@
|
||||
/* Define this if you have the `union wait' type in <sys/wait.h>. */
|
||||
#undef HAVE_UNION_WAIT
|
||||
|
||||
/* Define this if the POSIX.1 call `sysconf (_SC_OPEN_MAX)' works properly. */
|
||||
#undef HAVE_SYSCONF_OPEN_MAX
|
||||
/* Define to `unsigned long' or `unsigned long long'
|
||||
if <inttypes.h> doesn't define. */
|
||||
#undef uintmax_t
|
||||
|
||||
/* These are for AC_FUNC_SELECT */
|
||||
|
||||
/* Define if the system doesn't provide fd_set. */
|
||||
#undef fd_set
|
||||
|
||||
/* Define the type of the first arg to select(). */
|
||||
#undef fd_set_size_t
|
||||
|
||||
/* Define this if select() args need to be cast away from fd_set (HP-UX). */
|
||||
#undef SELECT_FD_SET_CAST
|
||||
|
||||
299
acinclude.m4
Normal file
299
acinclude.m4
Normal file
@@ -0,0 +1,299 @@
|
||||
dnl acinclude.m4 -- Extra macros needed for GNU make.
|
||||
dnl
|
||||
dnl Automake will incorporate this into its generated aclocal.m4.
|
||||
|
||||
dnl ---------------------------------------------------------------------------
|
||||
dnl Got this from the lynx 2.8 distribution.
|
||||
dnl by T.E.Dickey <dickey@clark.net>
|
||||
dnl and Jim Spath <jspath@mail.bcpl.lib.md.us>
|
||||
dnl and Philippe De Muyter <phdm@macqel.be>
|
||||
dnl
|
||||
dnl Created: 1997/1/28
|
||||
dnl Updated: 1997/12/23
|
||||
dnl ---------------------------------------------------------------------------
|
||||
dnl After checking for functions in the default $LIBS, make a further check
|
||||
dnl for the functions that are netlib-related (these aren't always in the
|
||||
dnl libc, etc., and have to be handled specially because there are conflicting
|
||||
dnl and broken implementations.
|
||||
dnl Common library requirements (in order):
|
||||
dnl -lresolv -lsocket -lnsl
|
||||
dnl -lnsl -lsocket
|
||||
dnl -lsocket
|
||||
dnl -lbsd
|
||||
AC_DEFUN([CF_NETLIBS],[
|
||||
cf_test_netlibs=no
|
||||
AC_MSG_CHECKING(for network libraries)
|
||||
AC_CACHE_VAL(cf_cv_netlibs,[
|
||||
AC_MSG_RESULT(working...)
|
||||
cf_cv_netlibs=""
|
||||
cf_test_netlibs=yes
|
||||
AC_CHECK_FUNCS(gethostname,,[
|
||||
CF_RECHECK_FUNC(gethostname,nsl,cf_cv_netlibs,[
|
||||
CF_RECHECK_FUNC(gethostname,socket,cf_cv_netlibs)])])
|
||||
#
|
||||
# FIXME: sequent needs this library (i.e., -lsocket -linet -lnsl), but
|
||||
# I don't know the entrypoints - 97/7/22 TD
|
||||
AC_CHECK_LIB(inet,main,cf_cv_netlibs="-linet $cf_cv_netlibs")
|
||||
#
|
||||
if test "$ac_cv_func_lsocket" != no ; then
|
||||
AC_CHECK_FUNCS(socket,,[
|
||||
CF_RECHECK_FUNC(socket,socket,cf_cv_netlibs,[
|
||||
CF_RECHECK_FUNC(socket,bsd,cf_cv_netlibs)])])
|
||||
fi
|
||||
#
|
||||
AC_CHECK_FUNCS(gethostbyname,,[
|
||||
CF_RECHECK_FUNC(gethostbyname,nsl,cf_cv_netlibs)])
|
||||
#
|
||||
AC_CHECK_FUNCS(strcasecmp,,[
|
||||
CF_RECHECK_FUNC(strcasecmp,resolv,cf_cv_netlibs)])
|
||||
])
|
||||
LIBS="$LIBS $cf_cv_netlibs"
|
||||
test $cf_test_netlibs = no && echo "$cf_cv_netlibs" >&AC_FD_MSG
|
||||
])dnl
|
||||
dnl ---------------------------------------------------------------------------
|
||||
dnl Re-check on a function to see if we can pick it up by adding a library.
|
||||
dnl $1 = function to check
|
||||
dnl $2 = library to check in
|
||||
dnl $3 = environment to update (e.g., $LIBS)
|
||||
dnl $4 = what to do if this fails
|
||||
dnl
|
||||
dnl This uses 'unset' if the shell happens to support it, but leaves the
|
||||
dnl configuration variable set to 'unknown' if not. This is a little better
|
||||
dnl than the normal autoconf test, which gives misleading results if a test
|
||||
dnl for the function is made (e.g., with AC_CHECK_FUNC) after this macro is
|
||||
dnl used (autoconf does not distinguish between a null token and one that is
|
||||
dnl set to 'no').
|
||||
AC_DEFUN([CF_RECHECK_FUNC],[
|
||||
AC_CHECK_LIB($2,$1,[
|
||||
CF_UPPER(cf_tr_func,$1)
|
||||
AC_DEFINE_UNQUOTED(HAVE_$cf_tr_func)
|
||||
ac_cv_func_$1=yes
|
||||
$3="-l$2 [$]$3"],[
|
||||
ac_cv_func_$1=unknown
|
||||
unset ac_cv_func_$1 2>/dev/null
|
||||
$4],
|
||||
[[$]$3])
|
||||
])dnl
|
||||
dnl ---------------------------------------------------------------------------
|
||||
dnl Make an uppercase version of a variable
|
||||
dnl $1=uppercase($2)
|
||||
AC_DEFUN([CF_UPPER],
|
||||
[
|
||||
changequote(,)dnl
|
||||
$1=`echo $2 | tr '[a-z]' '[A-Z]'`
|
||||
changequote([,])dnl
|
||||
])dnl
|
||||
|
||||
dnl ---------------------------------------------------------------------------
|
||||
dnl Got this from the GNU fileutils 3.16r distribution
|
||||
dnl by Paul Eggert <eggert@twinsun.com>
|
||||
dnl ---------------------------------------------------------------------------
|
||||
|
||||
dnl The problem is that the default compilation flags in Solaris 2.6 won't
|
||||
dnl let programs access large files; you need to tell the compiler that
|
||||
dnl you actually want your programs to work on large files. For more
|
||||
dnl details about this brain damage please see:
|
||||
dnl http://www.sas.com/standards/large.file/x_open.20Mar96.html
|
||||
|
||||
AC_DEFUN(AC_LFS,
|
||||
[dnl
|
||||
# If available, prefer support for large files unless the user specified
|
||||
# one of the CPPFLAGS, LDFLAGS, or LIBS variables.
|
||||
AC_MSG_CHECKING(whether large file support needs explicit enabling)
|
||||
ac_getconfs=''
|
||||
ac_result=yes
|
||||
ac_set=''
|
||||
ac_shellvars='CPPFLAGS LDFLAGS LIBS'
|
||||
for ac_shellvar in $ac_shellvars; do
|
||||
case $ac_shellvar in
|
||||
CPPFLAGS) ac_lfsvar=LFS_CFLAGS ;;
|
||||
*) ac_lfsvar=LFS_$ac_shellvar ;;
|
||||
esac
|
||||
eval test '"${'$ac_shellvar'+set}"' = set && ac_set=$ac_shellvar
|
||||
(getconf $ac_lfsvar) >/dev/null 2>&1 || { ac_result=no; break; }
|
||||
ac_getconf=`getconf $ac_lfsvar`
|
||||
ac_getconfs=$ac_getconfs$ac_getconf
|
||||
eval ac_test_$ac_shellvar=\$ac_getconf
|
||||
done
|
||||
case "$ac_result$ac_getconfs" in
|
||||
yes) ac_result=no ;;
|
||||
esac
|
||||
case "$ac_result$ac_set" in
|
||||
yes?*) ac_result="yes, but $ac_set is already set, so use its settings"
|
||||
esac
|
||||
AC_MSG_RESULT($ac_result)
|
||||
case $ac_result in
|
||||
yes)
|
||||
for ac_shellvar in $ac_shellvars; do
|
||||
eval $ac_shellvar=\$ac_test_$ac_shellvar
|
||||
done ;;
|
||||
esac
|
||||
])
|
||||
|
||||
|
||||
dnl ---------------------------------------------------------------------------
|
||||
dnl From Paul Eggert <eggert@twinsun.com>
|
||||
|
||||
dnl Define HAVE_INTTYPES_H if <inttypes.h> exists,
|
||||
dnl doesn't clash with <sys/types.h>, and declares uintmax_t.
|
||||
|
||||
AC_DEFUN(jm_AC_HEADER_INTTYPES_H,
|
||||
[
|
||||
if test x = y; then
|
||||
dnl This code is deliberately never run via ./configure.
|
||||
dnl FIXME: this is a gross hack to make autoheader put an entry
|
||||
dnl for `HAVE_INTTYPES_H' in config.h.in.
|
||||
AC_CHECK_FUNCS(INTTYPES_H)
|
||||
fi
|
||||
AC_CACHE_CHECK([for inttypes.h], jm_ac_cv_header_inttypes_h,
|
||||
[AC_TRY_COMPILE(
|
||||
[#include <sys/types.h>
|
||||
#include <inttypes.h>],
|
||||
[uintmax_t i = (uintmax_t) -1;],
|
||||
jm_ac_cv_header_inttypes_h=yes,
|
||||
jm_ac_cv_header_inttypes_h=no)])
|
||||
if test $jm_ac_cv_header_inttypes_h = yes; then
|
||||
ac_kludge=HAVE_INTTYPES_H
|
||||
AC_DEFINE_UNQUOTED($ac_kludge)
|
||||
fi
|
||||
])
|
||||
|
||||
|
||||
dnl ---------------------------------------------------------------------------
|
||||
dnl From Paul Eggert <eggert@twinsun.com>
|
||||
|
||||
AC_DEFUN(AC_STRUCT_ST_MTIM_NSEC,
|
||||
[AC_CACHE_CHECK([for nanoseconds member of struct stat.st_mtim],
|
||||
ac_cv_struct_st_mtim_nsec,
|
||||
[ac_save_CPPFLAGS="$CPPFLAGS"
|
||||
ac_cv_struct_st_mtim_nsec=no
|
||||
# tv_nsec -- the usual case
|
||||
# _tv_nsec -- Solaris 2.6, if
|
||||
# (defined _XOPEN_SOURCE && _XOPEN_SOURCE_EXTENDED == 1
|
||||
# && !defined __EXTENSIONS__)
|
||||
# st__tim.tv_nsec -- UnixWare 2.1.2
|
||||
for ac_val in tv_nsec _tv_nsec st__tim.tv_nsec; do
|
||||
CPPFLAGS="$ac_save_CPPFLAGS -DST_MTIM_NSEC=$ac_val"
|
||||
AC_TRY_COMPILE([#include <sys/types.h>
|
||||
#include <sys/stat.h>], [struct stat s; s.st_mtim.ST_MTIM_NSEC;],
|
||||
[ac_cv_struct_st_mtim_nsec=$ac_val; break])
|
||||
done
|
||||
CPPFLAGS="$ac_save_CPPFLAGS"])
|
||||
|
||||
if test $ac_cv_struct_st_mtim_nsec != no; then
|
||||
AC_DEFINE_UNQUOTED(ST_MTIM_NSEC, $ac_cv_struct_st_mtim_nsec)
|
||||
fi
|
||||
]
|
||||
)
|
||||
|
||||
dnl ---------------------------------------------------------------------------
|
||||
dnl From Paul Eggert <eggert@twinsun.com>
|
||||
|
||||
dnl Define uintmax_t to `unsigned long' or `unsigned long long'
|
||||
dnl if <inttypes.h> does not exist.
|
||||
|
||||
AC_DEFUN(jm_AC_TYPE_UINTMAX_T,
|
||||
[
|
||||
AC_REQUIRE([jm_AC_HEADER_INTTYPES_H])
|
||||
if test $jm_ac_cv_header_inttypes_h = no; then
|
||||
AC_CACHE_CHECK([for unsigned long long], ac_cv_type_unsigned_long_long,
|
||||
[AC_TRY_COMPILE([],
|
||||
[unsigned long long i = (unsigned long long) -1;],
|
||||
ac_cv_type_unsigned_long_long=yes,
|
||||
ac_cv_type_unsigned_long_long=no)])
|
||||
if test $ac_cv_type_unsigned_long_long = yes; then
|
||||
AC_DEFINE(uintmax_t, unsigned long long)
|
||||
else
|
||||
AC_DEFINE(uintmax_t, unsigned long)
|
||||
fi
|
||||
fi
|
||||
])
|
||||
|
||||
|
||||
dnl ---------------------------------------------------------------------------
|
||||
dnl From Steve Robbins <steve@nyongwa.montreal.qc.ca>
|
||||
|
||||
dnl From a proposed change made on the autoconf list on 2 Feb 1999
|
||||
dnl http://sourceware.cygnus.com/ml/autoconf/1999-02/msg00001.html
|
||||
dnl Patch for AIX 3.2 by Lars Hecking <lhecking@nmrc.ucc.ie> on 17 May 1999
|
||||
|
||||
AC_DEFUN(AC_FUNC_SELECT,
|
||||
[AC_CHECK_FUNCS(select)
|
||||
if test "$ac_cv_func_select" = yes; then
|
||||
AC_CHECK_HEADERS(unistd.h sys/types.h sys/time.h sys/select.h sys/socket.h)
|
||||
AC_MSG_CHECKING([argument types of select()])
|
||||
AC_CACHE_VAL(ac_cv_type_fd_set_size_t,dnl
|
||||
[AC_CACHE_VAL(ac_cv_type_fd_set,dnl
|
||||
[for ac_cv_type_fd_set in 'fd_set' 'int' 'void'; do
|
||||
for ac_cv_type_fd_set_size_t in 'int' 'size_t' 'unsigned long' 'unsigned'; do
|
||||
for ac_type_timeval in 'struct timeval' 'const struct timeval'; do
|
||||
AC_TRY_COMPILE(dnl
|
||||
[#ifdef HAVE_SYS_TIME_H
|
||||
#include <sys/time.h>
|
||||
#endif
|
||||
#ifdef HAVE_SYS_TYPES_H
|
||||
#include <sys/types.h>
|
||||
#endif
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
#ifdef HAVE_SYS_SELECT_H
|
||||
#include <sys/select.h>
|
||||
#endif
|
||||
#ifdef HAVE_SYS_SOCKET_H
|
||||
#include <sys/socket.h>
|
||||
#endif],
|
||||
[#ifdef __STDC__
|
||||
extern select ($ac_cv_type_fd_set_size_t,
|
||||
$ac_cv_type_fd_set *, $ac_cv_type_fd_set *, $ac_cv_type_fd_set *,
|
||||
$ac_type_timeval *);
|
||||
#else
|
||||
extern select ();
|
||||
$ac_cv_type_fd_set_size_t s;
|
||||
$ac_cv_type_fd_set *p;
|
||||
$ac_type_timeval *t;
|
||||
#endif],
|
||||
[ac_found=yes ; break 3],ac_found=no)
|
||||
done
|
||||
done
|
||||
done
|
||||
])dnl AC_CACHE_VAL
|
||||
])dnl AC_CACHE_VAL
|
||||
if test "$ac_found" = no; then
|
||||
AC_MSG_ERROR([can't determine argument types])
|
||||
fi
|
||||
|
||||
AC_MSG_RESULT([select($ac_cv_type_fd_set_size_t,$ac_cv_type_fd_set *,...)])
|
||||
AC_DEFINE_UNQUOTED(fd_set_size_t, $ac_cv_type_fd_set_size_t)
|
||||
ac_cast=
|
||||
if test "$ac_cv_type_fd_set" != fd_set; then
|
||||
# Arguments 2-4 are not fd_set. Some weirdo systems use fd_set type for
|
||||
# FD_SET macros, but insist that you cast the argument to select. I don't
|
||||
# understand why that might be, but it means we cannot define fd_set.
|
||||
AC_EGREP_CPP(dnl
|
||||
changequote(<<,>>)dnl
|
||||
<<(^|[^a-zA-Z_0-9])fd_set[^a-zA-Z_0-9]>>dnl
|
||||
changequote([,]),dnl
|
||||
[#ifdef HAVE_SYS_TIME_H
|
||||
#include <sys/time.h>
|
||||
#endif
|
||||
#ifdef HAVE_SYS_TYPES_H
|
||||
#include <sys/types.h>
|
||||
#endif
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
#ifdef HAVE_SYS_SELECT_H
|
||||
#include <sys/select.h>
|
||||
#endif
|
||||
#ifdef HAVE_SYS_SOCKET_H
|
||||
#include <sys/socket.h>
|
||||
#endif],dnl
|
||||
# We found fd_set type in a header, need special cast
|
||||
ac_cast="($ac_cv_type_fd_set *)",dnl
|
||||
# No fd_set type; it is safe to define it
|
||||
AC_DEFINE_UNQUOTED(fd_set,$ac_cv_type_fd_set))
|
||||
fi
|
||||
AC_DEFINE_UNQUOTED(SELECT_FD_SET_CAST,$ac_cast)
|
||||
fi
|
||||
])
|
||||
19
aclocal.m4
vendored
19
aclocal.m4
vendored
@@ -1,19 +0,0 @@
|
||||
dnl
|
||||
dnl Check for a symbol
|
||||
dnl
|
||||
AC_DEFUN(AC_CHECK_SYMBOL, [dnl
|
||||
AC_MSG_CHECKING(for $1)
|
||||
AC_CACHE_VAL(ac_cv_check_symbol_$1, [dnl
|
||||
AC_TRY_LINK(,
|
||||
changequote(,)dnl
|
||||
extern char *$1[]; puts(*$1);,
|
||||
changequote([,])dnl
|
||||
ac_cv_check_symbol_$1=yes, ac_cv_check_symbol_$1=no)])
|
||||
if test "$ac_cv_check_symbol_$1" = yes; then
|
||||
changequote(,)dnl
|
||||
ac_tr_symbol=`echo $1 | tr '[a-z]' '[A-Z]'`
|
||||
changequote([,])dnl
|
||||
AC_DEFINE_UNQUOTED(HAVE_${ac_tr_symbol})
|
||||
fi
|
||||
AC_MSG_RESULT($ac_cv_check_symbol_$1)])dnl
|
||||
dnl
|
||||
16
alloca.c
16
alloca.c
@@ -25,6 +25,13 @@
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_STRING_H
|
||||
#include <string.h>
|
||||
#endif
|
||||
#ifdef HAVE_STDLIB_H
|
||||
#include <stdlib.h>
|
||||
#endif
|
||||
|
||||
#ifdef emacs
|
||||
#include "blockinput.h"
|
||||
#endif
|
||||
@@ -66,7 +73,9 @@ typedef void *pointer;
|
||||
typedef char *pointer;
|
||||
#endif
|
||||
|
||||
#ifndef NULL
|
||||
#define NULL 0
|
||||
#endif
|
||||
|
||||
/* Different portions of Emacs need to call different versions of
|
||||
malloc. The Emacs executable needs alloca to call xmalloc, because
|
||||
@@ -171,7 +180,7 @@ alloca (size)
|
||||
#endif
|
||||
|
||||
/* Reclaim garbage, defined as all alloca'd storage that
|
||||
was allocated from deeper in the stack than currently. */
|
||||
was allocated from deeper in the stack than currently. */
|
||||
|
||||
{
|
||||
register header *hp; /* Traverses linked list. */
|
||||
@@ -209,6 +218,9 @@ alloca (size)
|
||||
register pointer new = malloc (sizeof (header) + size);
|
||||
/* Address of header. */
|
||||
|
||||
if (new == 0)
|
||||
abort();
|
||||
|
||||
((header *) new)->h.next = last_alloca_header;
|
||||
((header *) new)->h.deep = depth;
|
||||
|
||||
@@ -338,7 +350,7 @@ struct stk_trailer
|
||||
|
||||
#ifdef CRAY2
|
||||
/* Determine a "stack measure" for an arbitrary ADDRESS.
|
||||
I doubt that "lint" will like this much. */
|
||||
I doubt that "lint" will like this much. */
|
||||
|
||||
static long
|
||||
i00afunc (long *address)
|
||||
|
||||
123
amiga.c
Normal file
123
amiga.c
Normal file
@@ -0,0 +1,123 @@
|
||||
/* Running commands on Amiga
|
||||
Copyright (C) 1995, 1996 Free Software Foundation, Inc.
|
||||
This file is part of GNU Make.
|
||||
|
||||
GNU Make is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
|
||||
GNU Make is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GNU Make; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
|
||||
MA 02111-1307, USA. */
|
||||
|
||||
#include "make.h"
|
||||
#include "variable.h"
|
||||
#include "amiga.h"
|
||||
#include <assert.h>
|
||||
#include <exec/memory.h>
|
||||
#include <dos/dostags.h>
|
||||
#include <proto/exec.h>
|
||||
#include <proto/dos.h>
|
||||
|
||||
static const char Amiga_version[] = "$VER: Make 3.74.3 (12.05.96) \n"
|
||||
"Amiga Port by A. Digulla (digulla@home.lake.de)";
|
||||
|
||||
int
|
||||
MyExecute (argv)
|
||||
char ** argv;
|
||||
{
|
||||
char * buffer, * ptr;
|
||||
char ** aptr;
|
||||
int len = 0;
|
||||
int status;
|
||||
|
||||
for (aptr=argv; *aptr; aptr++)
|
||||
{
|
||||
len += strlen (*aptr) + 4;
|
||||
}
|
||||
|
||||
buffer = AllocMem (len, MEMF_ANY);
|
||||
|
||||
if (!buffer)
|
||||
fatal (NILF, "MyExecute: Cannot allocate space for calling a command");
|
||||
|
||||
ptr = buffer;
|
||||
|
||||
for (aptr=argv; *aptr; aptr++)
|
||||
{
|
||||
if (((*aptr)[0] == ';' && !(*aptr)[1]))
|
||||
{
|
||||
*ptr ++ = '"';
|
||||
strcpy (ptr, *aptr);
|
||||
ptr += strlen (ptr);
|
||||
*ptr ++ = '"';
|
||||
}
|
||||
else if ((*aptr)[0] == '@' && (*aptr)[1] == '@' && !(*aptr)[2])
|
||||
{
|
||||
*ptr ++ = '\n';
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
strcpy (ptr, *aptr);
|
||||
ptr += strlen (ptr);
|
||||
}
|
||||
*ptr ++ = ' ';
|
||||
*ptr = 0;
|
||||
}
|
||||
|
||||
ptr[-1] = '\n';
|
||||
|
||||
status = SystemTags (buffer,
|
||||
SYS_UserShell, TRUE,
|
||||
TAG_END);
|
||||
|
||||
FreeMem (buffer, len);
|
||||
|
||||
if (SetSignal(0L,0L) & SIGBREAKF_CTRL_C)
|
||||
status = 20;
|
||||
|
||||
/* Warnings don't count */
|
||||
if (status == 5)
|
||||
status = 0;
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
char *
|
||||
wildcard_expansion (wc, o)
|
||||
char * wc, * o;
|
||||
{
|
||||
# define PATH_SIZE 1024
|
||||
struct AnchorPath * apath;
|
||||
|
||||
if ( (apath = AllocMem (sizeof (struct AnchorPath) + PATH_SIZE,
|
||||
MEMF_CLEAR))
|
||||
)
|
||||
{
|
||||
apath->ap_Strlen = PATH_SIZE;
|
||||
|
||||
if (MatchFirst (wc, apath) == 0)
|
||||
{
|
||||
do
|
||||
{
|
||||
o = variable_buffer_output (o, apath->ap_Buf,
|
||||
strlen (apath->ap_Buf));
|
||||
o = variable_buffer_output (o, " ",1);
|
||||
} while (MatchNext (apath) == 0);
|
||||
}
|
||||
|
||||
MatchEnd (apath);
|
||||
FreeMem (apath, sizeof (struct AnchorPath) + PATH_SIZE);
|
||||
}
|
||||
|
||||
return o;
|
||||
}
|
||||
|
||||
22
amiga.h
Normal file
22
amiga.h
Normal file
@@ -0,0 +1,22 @@
|
||||
/* Definitions for amiga specific things
|
||||
Copyright (C) 1995, 1996 Free Software Foundation, Inc.
|
||||
This file is part of GNU Make.
|
||||
|
||||
GNU Make is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
|
||||
GNU Make is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GNU Make; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
|
||||
MA 02111-1307, USA. */
|
||||
|
||||
extern int MyExecute PARAMS ((char ** argv));
|
||||
extern char * wildcard_expansion PARAMS ((char * wc, char * o));
|
||||
|
||||
56
ar.c
56
ar.c
@@ -1,5 +1,5 @@
|
||||
/* Interface to `ar' archives for GNU Make.
|
||||
Copyright (C) 1988, 1989, 1990, 1991, 1992, 1993 Free Software Foundation, Inc.
|
||||
Copyright (C) 1988,89,90,91,92,93,97 Free Software Foundation, Inc.
|
||||
This file is part of GNU Make.
|
||||
|
||||
GNU Make is free software; you can redistribute it and/or modify
|
||||
@@ -14,21 +14,23 @@ 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. */
|
||||
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
#include "make.h"
|
||||
|
||||
#ifndef NO_ARCHIVES
|
||||
|
||||
#include "file.h"
|
||||
#include "filedef.h"
|
||||
#include "dep.h"
|
||||
#include <fnmatch.h>
|
||||
|
||||
/* Defined in arscan.c. */
|
||||
extern long int ar_scan ();
|
||||
extern int ar_member_touch ();
|
||||
extern int ar_name_equal ();
|
||||
|
||||
extern long int ar_scan PARAMS ((char *archive, long int (*function) (), long int arg));
|
||||
extern int ar_name_equal PARAMS ((char *name, char *mem, int truncated));
|
||||
#ifndef VMS
|
||||
extern int ar_member_touch PARAMS ((char *arname, char *memname));
|
||||
#endif
|
||||
|
||||
/* Return nonzero if NAME is an archive-member reference, zero if not.
|
||||
An archive-member reference is a name like `lib(member)'.
|
||||
@@ -40,12 +42,12 @@ ar_name (name)
|
||||
char *name;
|
||||
{
|
||||
char *p = index (name, '('), *end = name + strlen (name) - 1;
|
||||
|
||||
|
||||
if (p == 0 || p == name || *end != ')')
|
||||
return 0;
|
||||
|
||||
if (p[1] == '(' && end[-1] == ')')
|
||||
fatal ("attempt to use unsupported feature: `%s'", name);
|
||||
fatal (NILF, _("attempt to use unsupported feature: `%s'"), name);
|
||||
|
||||
return 1;
|
||||
}
|
||||
@@ -66,9 +68,10 @@ ar_parse_name (name, arname_p, memname_p)
|
||||
|
||||
if (memname_p != 0)
|
||||
*memname_p = savestring (p + 1, end - (p + 1));
|
||||
}
|
||||
}
|
||||
|
||||
static long int ar_member_date_1 ();
|
||||
static long int ar_member_date_1 PARAMS ((int desc, char *mem, int truncated, long int hdrpos,
|
||||
long int datapos, long int size, long int date, int uid, int gid, int mode, char *name));
|
||||
|
||||
/* Return the modtime of NAME. */
|
||||
|
||||
@@ -130,6 +133,15 @@ ar_member_date_1 (desc, mem, truncated,
|
||||
|
||||
/* Set the archive-member NAME's modtime to now. */
|
||||
|
||||
#ifdef VMS
|
||||
int
|
||||
ar_touch (name)
|
||||
char *name;
|
||||
{
|
||||
error (NILF, _("touch archive member is not available on VMS"));
|
||||
return -1;
|
||||
}
|
||||
#else
|
||||
int
|
||||
ar_touch (name)
|
||||
char *name;
|
||||
@@ -158,22 +170,24 @@ ar_touch (name)
|
||||
switch (ar_member_touch (arname, memname))
|
||||
{
|
||||
case -1:
|
||||
error ("touch: Archive `%s' does not exist", arname);
|
||||
error (NILF, _("touch: Archive `%s' does not exist"), arname);
|
||||
break;
|
||||
case -2:
|
||||
error ("touch: `%s' is not a valid archive", arname);
|
||||
error (NILF, _("touch: `%s' is not a valid archive"), arname);
|
||||
break;
|
||||
case -3:
|
||||
perror_with_name ("touch: ", arname);
|
||||
break;
|
||||
case 1:
|
||||
error ("touch: Member `%s' does not exist in `%s'", memname, arname);
|
||||
error (NILF,
|
||||
_("touch: Member `%s' does not exist in `%s'"), memname, arname);
|
||||
break;
|
||||
case 0:
|
||||
val = 0;
|
||||
break;
|
||||
default:
|
||||
error ("touch: Bad return code from ar_member_touch on `%s'", name);
|
||||
error (NILF,
|
||||
_("touch: Bad return code from ar_member_touch on `%s'"), name);
|
||||
}
|
||||
|
||||
if (!arname_used)
|
||||
@@ -182,6 +196,7 @@ ar_touch (name)
|
||||
|
||||
return val;
|
||||
}
|
||||
#endif /* !VMS */
|
||||
|
||||
/* State of an `ar_glob' run, passed to `ar_glob_match'. */
|
||||
|
||||
@@ -221,15 +236,6 @@ ar_glob_match (desc, mem, truncated,
|
||||
return 0L;
|
||||
}
|
||||
|
||||
/* Alphabetic sorting function for `qsort'. */
|
||||
|
||||
static int
|
||||
ar_glob_alphacompare (a, b)
|
||||
char **a, **b;
|
||||
{
|
||||
return strcmp (*a, *b);
|
||||
}
|
||||
|
||||
/* Return nonzero if PATTERN contains any metacharacters.
|
||||
Metacharacters can be quoted with backslashes if QUOTE is nonzero. */
|
||||
static int
|
||||
@@ -304,7 +310,7 @@ ar_glob (arname, member_pattern, size)
|
||||
names[i++] = n->name;
|
||||
|
||||
/* Sort them alphabetically. */
|
||||
qsort ((char *) names, i, sizeof (*names), ar_glob_alphacompare);
|
||||
qsort ((char *) names, i, sizeof (*names), alpha_compare);
|
||||
|
||||
/* Put them back into the chain in the sorted order. */
|
||||
i = 0;
|
||||
|
||||
463
arscan.c
463
arscan.c
@@ -1,19 +1,20 @@
|
||||
/* Library function for scanning an archive file.
|
||||
Copyright (C) 1987, 89, 91, 92, 93, 94, 95 Free Software Foundation, Inc.
|
||||
Copyright (C) 1987,89,91,92,93,94,95,97 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
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
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, 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.
|
||||
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. */
|
||||
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., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
USA. */
|
||||
|
||||
#include "make.h"
|
||||
|
||||
@@ -25,6 +26,172 @@
|
||||
|
||||
#ifndef NO_ARCHIVES
|
||||
|
||||
#ifdef VMS
|
||||
#include <lbrdef.h>
|
||||
#include <mhddef.h>
|
||||
#include <credef.h>
|
||||
#include <descrip.h>
|
||||
#include <ctype.h>
|
||||
#if __DECC
|
||||
#include <unixlib.h>
|
||||
#include <lbr$routines.h>
|
||||
#endif
|
||||
|
||||
#define uppercasify(str) {char *str1; for (str1 = str; *str1; str1++) *str1 = _toupper(*str1);}
|
||||
|
||||
static void *VMS_lib_idx;
|
||||
|
||||
static char *VMS_saved_memname;
|
||||
|
||||
static time_t VMS_member_date;
|
||||
|
||||
static long int (*VMS_function) ();
|
||||
|
||||
static int
|
||||
VMS_get_member_info (module, rfa)
|
||||
struct dsc$descriptor_s *module;
|
||||
unsigned long *rfa;
|
||||
{
|
||||
int status, i;
|
||||
long int fnval;
|
||||
|
||||
time_t val;
|
||||
|
||||
static struct dsc$descriptor_s bufdesc =
|
||||
{ 0, DSC$K_DTYPE_T, DSC$K_CLASS_S, NULL };
|
||||
|
||||
struct mhddef *mhd;
|
||||
char filename[128];
|
||||
|
||||
bufdesc.dsc$a_pointer = filename;
|
||||
bufdesc.dsc$w_length = sizeof (filename);
|
||||
|
||||
status = lbr$set_module (&VMS_lib_idx, rfa, &bufdesc,
|
||||
&bufdesc.dsc$w_length, 0);
|
||||
if (! status)
|
||||
{
|
||||
error (NILF, _("lbr$set_module failed to extract module info, status = %d"),
|
||||
status);
|
||||
|
||||
lbr$close (&VMS_lib_idx);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
mhd = (struct mhddef *) filename;
|
||||
|
||||
val = decc$fix_time (&mhd->mhd$l_datim);
|
||||
|
||||
for (i = 0; i < module->dsc$w_length; i++)
|
||||
filename[i] = _tolower (module->dsc$a_pointer[i]);
|
||||
|
||||
filename[i] = '\0';
|
||||
|
||||
VMS_member_date = (time_t) -1;
|
||||
|
||||
fnval =
|
||||
(*VMS_function) (-1, filename, 0, 0, 0, 0, val, 0, 0, 0,
|
||||
VMS_saved_memname);
|
||||
|
||||
if (fnval)
|
||||
{
|
||||
VMS_member_date = fnval;
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* Takes three arguments ARCHIVE, FUNCTION and ARG.
|
||||
|
||||
Open the archive named ARCHIVE, find its members one by one,
|
||||
and for each one call FUNCTION with the following arguments:
|
||||
archive file descriptor for reading the data,
|
||||
member name,
|
||||
member name might be truncated flag,
|
||||
member header position in file,
|
||||
member data position in file,
|
||||
member data size,
|
||||
member date,
|
||||
member uid,
|
||||
member gid,
|
||||
member protection mode,
|
||||
ARG.
|
||||
|
||||
NOTE: on VMS systems, only name, date, and arg are meaningful!
|
||||
|
||||
The descriptor is poised to read the data of the member
|
||||
when FUNCTION is called. It does not matter how much
|
||||
data FUNCTION reads.
|
||||
|
||||
If FUNCTION returns nonzero, we immediately return
|
||||
what FUNCTION returned.
|
||||
|
||||
Returns -1 if archive does not exist,
|
||||
Returns -2 if archive has invalid format.
|
||||
Returns 0 if have scanned successfully. */
|
||||
|
||||
long int
|
||||
ar_scan (archive, function, arg)
|
||||
char *archive;
|
||||
long int (*function) ();
|
||||
long int arg;
|
||||
{
|
||||
char *p;
|
||||
|
||||
static struct dsc$descriptor_s libdesc =
|
||||
{ 0, DSC$K_DTYPE_T, DSC$K_CLASS_S, NULL };
|
||||
|
||||
unsigned long func = LBR$C_READ;
|
||||
unsigned long type = LBR$C_TYP_UNK;
|
||||
unsigned long index = 1;
|
||||
|
||||
int status;
|
||||
|
||||
status = lbr$ini_control (&VMS_lib_idx, &func, &type, 0);
|
||||
|
||||
if (! status)
|
||||
{
|
||||
error (NILF, _("lbr$ini_control failed with status = %d"),status);
|
||||
return -2;
|
||||
}
|
||||
|
||||
libdesc.dsc$a_pointer = archive;
|
||||
libdesc.dsc$w_length = strlen (archive);
|
||||
|
||||
status = lbr$open (&VMS_lib_idx, &libdesc, 0, 0, 0, 0, 0);
|
||||
|
||||
if (! status)
|
||||
{
|
||||
error (NILF, _("unable to open library `%s' to lookup member `%s'"),
|
||||
archive, (char *)arg);
|
||||
return -1;
|
||||
}
|
||||
|
||||
VMS_saved_memname = (char *)arg;
|
||||
|
||||
/* For comparison, delete .obj from arg name. */
|
||||
|
||||
p = rindex (VMS_saved_memname, '.');
|
||||
if (p)
|
||||
*p = '\0';
|
||||
|
||||
VMS_function = function;
|
||||
|
||||
VMS_member_date = (time_t) -1;
|
||||
lbr$get_index (&VMS_lib_idx, &index, VMS_get_member_info, 0);
|
||||
|
||||
/* Undo the damage. */
|
||||
if (p)
|
||||
*p = '.';
|
||||
|
||||
lbr$close (&VMS_lib_idx);
|
||||
|
||||
return VMS_member_date > 0 ? VMS_member_date : 0;
|
||||
}
|
||||
|
||||
#else /* !VMS */
|
||||
|
||||
/* SCO Unix's compiler defines both of these. */
|
||||
#ifdef M_UNIX
|
||||
#undef M_XENIX
|
||||
@@ -47,11 +214,46 @@
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include <ar.h>
|
||||
/* On AIX, define these symbols to be sure to get both archive formats.
|
||||
AIX 4.3 introduced the "big" archive format to support 64-bit object
|
||||
files, so on AIX 4.3 systems we need to support both the "normal" and
|
||||
"big" archive formats. An archive's format is indicated in the
|
||||
"fl_magic" field of the "FL_HDR" structure. For a normal archive,
|
||||
this field will be the string defined by the AIAMAG symbol. For a
|
||||
"big" archive, it will be the string defined by the AIAMAGBIG symbol
|
||||
(at least on AIX it works this way).
|
||||
|
||||
Note: we'll define these symbols regardless of which AIX version
|
||||
we're compiling on, but this is okay since we'll use the new symbols
|
||||
only if they're present. */
|
||||
#ifdef _AIX
|
||||
# define __AR_SMALL__
|
||||
# define __AR_BIG__
|
||||
#endif
|
||||
|
||||
#ifndef WINDOWS32
|
||||
# include <ar.h>
|
||||
#else
|
||||
/* These should allow us to read Windows (VC++) libraries (according to Frank
|
||||
* Libbrecht <frankl@abzx.belgium.hp.com>)
|
||||
*/
|
||||
# include <windows.h>
|
||||
# include <windef.h>
|
||||
# include <io.h>
|
||||
# define ARMAG IMAGE_ARCHIVE_START
|
||||
# define SARMAG IMAGE_ARCHIVE_START_SIZE
|
||||
# define ar_hdr _IMAGE_ARCHIVE_MEMBER_HEADER
|
||||
# define ar_name Name
|
||||
# define ar_mode Mode
|
||||
# define ar_size Size
|
||||
# define ar_date Date
|
||||
# define ar_uid UserID
|
||||
# define ar_gid GroupID
|
||||
#endif
|
||||
|
||||
/* Cray's <ar.h> apparently defines this. */
|
||||
#ifndef AR_HDR_SIZE
|
||||
#define AR_HDR_SIZE (sizeof (struct ar_hdr))
|
||||
# define AR_HDR_SIZE (sizeof (struct ar_hdr))
|
||||
#endif
|
||||
|
||||
/* Takes three arguments ARCHIVE, FUNCTION and ARG.
|
||||
@@ -89,6 +291,10 @@ ar_scan (archive, function, arg)
|
||||
{
|
||||
#ifdef AIAMAG
|
||||
FL_HDR fl_header;
|
||||
#ifdef AIAMAGBIG
|
||||
int big_archive = 0;
|
||||
FL_HDR_BIG fl_header_big;
|
||||
#endif
|
||||
#else
|
||||
int long_name = 0;
|
||||
#endif
|
||||
@@ -110,11 +316,42 @@ ar_scan (archive, function, arg)
|
||||
#ifdef AIAMAG
|
||||
{
|
||||
register int nread = read (desc, (char *) &fl_header, FL_HSZ);
|
||||
if (nread != FL_HSZ || bcmp (fl_header.fl_magic, AIAMAG, SAIAMAG))
|
||||
|
||||
if (nread != FL_HSZ)
|
||||
{
|
||||
(void) close (desc);
|
||||
return -2;
|
||||
}
|
||||
#ifdef AIAMAGBIG
|
||||
/* If this is a "big" archive, then set the flag and
|
||||
re-read the header into the "big" structure. */
|
||||
if (!bcmp (fl_header.fl_magic, AIAMAGBIG, SAIAMAG))
|
||||
{
|
||||
big_archive = 1;
|
||||
|
||||
/* seek back to beginning of archive */
|
||||
if (lseek (desc, 0, 0) < 0)
|
||||
{
|
||||
(void) close (desc);
|
||||
return -2;
|
||||
}
|
||||
|
||||
/* re-read the header into the "big" structure */
|
||||
nread = read (desc, (char *) &fl_header_big, FL_HSZ_BIG);
|
||||
if (nread != FL_HSZ_BIG)
|
||||
{
|
||||
(void) close (desc);
|
||||
return -2;
|
||||
}
|
||||
}
|
||||
else
|
||||
#endif
|
||||
/* Check to make sure this is a "normal" archive. */
|
||||
if (bcmp (fl_header.fl_magic, AIAMAG, SAIAMAG))
|
||||
{
|
||||
(void) close (desc);
|
||||
return -2;
|
||||
}
|
||||
}
|
||||
#else
|
||||
{
|
||||
@@ -142,8 +379,18 @@ ar_scan (archive, function, arg)
|
||||
long int member_offset;
|
||||
long int last_member_offset;
|
||||
|
||||
sscanf (fl_header.fl_fstmoff, "%12ld", &member_offset);
|
||||
sscanf (fl_header.fl_lstmoff, "%12ld", &last_member_offset);
|
||||
#ifdef AIAMAGBIG
|
||||
if ( big_archive )
|
||||
{
|
||||
sscanf (fl_header_big.fl_fstmoff, "%20ld", &member_offset);
|
||||
sscanf (fl_header_big.fl_lstmoff, "%20ld", &last_member_offset);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
sscanf (fl_header.fl_fstmoff, "%12ld", &member_offset);
|
||||
sscanf (fl_header.fl_lstmoff, "%12ld", &last_member_offset);
|
||||
}
|
||||
|
||||
if (member_offset == 0)
|
||||
{
|
||||
@@ -164,6 +411,9 @@ ar_scan (archive, function, arg)
|
||||
{
|
||||
register int nread;
|
||||
struct ar_hdr member_header;
|
||||
#ifdef AIAMAGBIG
|
||||
struct ar_hdr_big member_header_big;
|
||||
#endif
|
||||
#ifdef AIAMAG
|
||||
char name[256];
|
||||
int name_len;
|
||||
@@ -186,34 +436,73 @@ ar_scan (archive, function, arg)
|
||||
}
|
||||
|
||||
#ifdef AIAMAG
|
||||
#define AR_MEMHDR (AR_HDR_SIZE - sizeof (member_header._ar_name))
|
||||
nread = read (desc, (char *) &member_header, AR_MEMHDR);
|
||||
#define AR_MEMHDR_SZ(x) (sizeof(x) - sizeof (x._ar_name))
|
||||
|
||||
if (nread != AR_MEMHDR)
|
||||
#ifdef AIAMAGBIG
|
||||
if (big_archive)
|
||||
{
|
||||
(void) close (desc);
|
||||
return -2;
|
||||
nread = read (desc, (char *) &member_header_big,
|
||||
AR_MEMHDR_SZ(member_header_big) );
|
||||
|
||||
if (nread != AR_MEMHDR_SZ(member_header_big))
|
||||
{
|
||||
(void) close (desc);
|
||||
return -2;
|
||||
}
|
||||
|
||||
sscanf (member_header_big.ar_namlen, "%4d", &name_len);
|
||||
nread = read (desc, name, name_len);
|
||||
|
||||
if (nread != name_len)
|
||||
{
|
||||
(void) close (desc);
|
||||
return -2;
|
||||
}
|
||||
|
||||
name[name_len] = 0;
|
||||
|
||||
sscanf (member_header_big.ar_date, "%12ld", &dateval);
|
||||
sscanf (member_header_big.ar_uid, "%12d", &uidval);
|
||||
sscanf (member_header_big.ar_gid, "%12d", &gidval);
|
||||
sscanf (member_header_big.ar_mode, "%12o", &eltmode);
|
||||
sscanf (member_header_big.ar_size, "%20ld", &eltsize);
|
||||
|
||||
data_offset = (member_offset + AR_MEMHDR_SZ(member_header_big)
|
||||
+ name_len + 2);
|
||||
}
|
||||
|
||||
sscanf (member_header.ar_namlen, "%4d", &name_len);
|
||||
nread = read (desc, name, name_len);
|
||||
|
||||
if (nread != name_len)
|
||||
else
|
||||
#endif
|
||||
{
|
||||
(void) close (desc);
|
||||
return -2;
|
||||
nread = read (desc, (char *) &member_header,
|
||||
AR_MEMHDR_SZ(member_header) );
|
||||
|
||||
if (nread != AR_MEMHDR_SZ(member_header))
|
||||
{
|
||||
(void) close (desc);
|
||||
return -2;
|
||||
}
|
||||
|
||||
sscanf (member_header.ar_namlen, "%4d", &name_len);
|
||||
nread = read (desc, name, name_len);
|
||||
|
||||
if (nread != name_len)
|
||||
{
|
||||
(void) close (desc);
|
||||
return -2;
|
||||
}
|
||||
|
||||
name[name_len] = 0;
|
||||
|
||||
sscanf (member_header.ar_date, "%12ld", &dateval);
|
||||
sscanf (member_header.ar_uid, "%12d", &uidval);
|
||||
sscanf (member_header.ar_gid, "%12d", &gidval);
|
||||
sscanf (member_header.ar_mode, "%12o", &eltmode);
|
||||
sscanf (member_header.ar_size, "%12ld", &eltsize);
|
||||
|
||||
data_offset = (member_offset + AR_MEMHDR_SZ(member_header)
|
||||
+ name_len + 2);
|
||||
}
|
||||
|
||||
name[name_len] = 0;
|
||||
|
||||
sscanf (member_header.ar_date, "%12ld", &dateval);
|
||||
sscanf (member_header.ar_uid, "%12d", &uidval);
|
||||
sscanf (member_header.ar_gid, "%12d", &gidval);
|
||||
sscanf (member_header.ar_mode, "%12o", &eltmode);
|
||||
sscanf (member_header.ar_size, "%12ld", &eltsize);
|
||||
|
||||
if ((data_offset = member_offset + AR_MEMHDR + name_len + 2) % 2)
|
||||
++data_offset;
|
||||
data_offset += data_offset % 2;
|
||||
|
||||
fnval =
|
||||
(*function) (desc, name, 0,
|
||||
@@ -228,8 +517,20 @@ ar_scan (archive, function, arg)
|
||||
break;
|
||||
|
||||
if (nread != AR_HDR_SIZE
|
||||
#ifdef ARFMAG
|
||||
|| bcmp (member_header.ar_fmag, ARFMAG, 2)
|
||||
#if defined(ARFMAG) || defined(ARFZMAG)
|
||||
|| (
|
||||
# ifdef ARFMAG
|
||||
bcmp (member_header.ar_fmag, ARFMAG, 2)
|
||||
# else
|
||||
1
|
||||
# endif
|
||||
&&
|
||||
# ifdef ARFZMAG
|
||||
bcmp (member_header.ar_fmag, ARFZMAG, 2)
|
||||
# else
|
||||
1
|
||||
# endif
|
||||
)
|
||||
#endif
|
||||
)
|
||||
{
|
||||
@@ -277,7 +578,7 @@ ar_scan (archive, function, arg)
|
||||
&& name[2] == '/')
|
||||
{
|
||||
int namesize = atoi (name + 3);
|
||||
|
||||
|
||||
name = (char *) alloca (namesize + 1);
|
||||
nread = read (desc, name, namesize);
|
||||
if (nread != namesize)
|
||||
@@ -327,7 +628,12 @@ ar_scan (archive, function, arg)
|
||||
/* End of the chain. */
|
||||
break;
|
||||
|
||||
sscanf (member_header.ar_nxtmem, "%12ld", &member_offset);
|
||||
#ifdef AIAMAGBIG
|
||||
if (big_archive)
|
||||
sscanf (member_header_big.ar_nxtmem, "%20ld", &member_offset);
|
||||
else
|
||||
#endif
|
||||
sscanf (member_header.ar_nxtmem, "%12ld", &member_offset);
|
||||
|
||||
if (lseek (desc, member_offset, 0) != member_offset)
|
||||
{
|
||||
@@ -351,7 +657,7 @@ ar_scan (archive, function, arg)
|
||||
(void) close (desc);
|
||||
return -2;
|
||||
}
|
||||
|
||||
|
||||
/* The names are separated by newlines. Some formats have
|
||||
a trailing slash. Null terminate the strings for
|
||||
convenience. */
|
||||
@@ -365,7 +671,7 @@ ar_scan (archive, function, arg)
|
||||
clear[-1] = '\0';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
is_namemap = 0;
|
||||
}
|
||||
|
||||
@@ -379,6 +685,7 @@ ar_scan (archive, function, arg)
|
||||
close (desc);
|
||||
return 0;
|
||||
}
|
||||
#endif /* !VMS */
|
||||
|
||||
/* Return nonzero iff NAME matches MEM.
|
||||
If TRUNCATED is nonzero, MEM may be truncated to
|
||||
@@ -395,38 +702,7 @@ ar_name_equal (name, mem, truncated)
|
||||
if (p != 0)
|
||||
name = p + 1;
|
||||
|
||||
/* We no longer use this kludge, since we
|
||||
now support long archive member names. */
|
||||
|
||||
#if 0 && !defined (AIAMAG) && !defined (APOLLO)
|
||||
|
||||
{
|
||||
/* `reallylongname.o' matches `reallylongnam.o'.
|
||||
If member names have a trailing slash, that's `reallylongna.o'. */
|
||||
|
||||
struct ar_hdr h;
|
||||
unsigned int max = sizeof (h.ar_name);
|
||||
unsigned int namelen, memlen;
|
||||
|
||||
if (strncmp (name, mem, max - 3))
|
||||
return 0;
|
||||
|
||||
namelen = strlen (name);
|
||||
memlen = strlen (mem);
|
||||
|
||||
if (namelen > memlen && memlen >= max - 1
|
||||
&& name[namelen - 2] == '.' && name[namelen - 1] == 'o'
|
||||
&& mem[memlen - 2] == '.' && mem[memlen - 1] == 'o')
|
||||
return 1;
|
||||
|
||||
if (namelen != memlen)
|
||||
return 0;
|
||||
|
||||
return (namelen < max - 3 || !strcmp (name + max - 3, mem + max - 3));
|
||||
}
|
||||
|
||||
#else /* AIX or APOLLO. */
|
||||
|
||||
#ifndef VMS
|
||||
if (truncated)
|
||||
{
|
||||
#ifdef AIAMAG
|
||||
@@ -434,22 +710,19 @@ ar_name_equal (name, mem, truncated)
|
||||
abort ();
|
||||
#else
|
||||
struct ar_hdr hdr;
|
||||
return !strncmp (name, mem,
|
||||
sizeof (hdr.ar_name) -
|
||||
#if !defined (__hpux) && !defined (cray)
|
||||
1
|
||||
return strneq (name, mem, sizeof(hdr.ar_name) - 1);
|
||||
#else
|
||||
2
|
||||
return strneq (name, mem, sizeof(hdr.ar_name) - 2);
|
||||
#endif /* !__hpux && !cray */
|
||||
);
|
||||
#endif
|
||||
#endif /* !AIAMAG */
|
||||
}
|
||||
#endif /* !VMS */
|
||||
|
||||
return !strcmp (name, mem);
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifndef VMS
|
||||
/* ARGSUSED */
|
||||
static long int
|
||||
ar_member_pos (desc, mem, truncated,
|
||||
@@ -502,12 +775,9 @@ ar_member_touch (arname, memname)
|
||||
if (AR_HDR_SIZE != write (fd, (char *) &ar_hdr, AR_HDR_SIZE))
|
||||
goto lose;
|
||||
/* The file's mtime is the time we we want. */
|
||||
#ifdef EINTR
|
||||
while (fstat (fd, &statbuf) < 0 && errno == EINTR);
|
||||
#else
|
||||
fstat (fd, &statbuf);
|
||||
#endif
|
||||
#if defined(ARFMAG) || defined(AIAMAG)
|
||||
while (fstat (fd, &statbuf) < 0 && EINTR_SET)
|
||||
;
|
||||
#if defined(ARFMAG) || defined(ARFZMAG) || defined(AIAMAG) || defined(WINDOWS32)
|
||||
/* Advance member's time to that time */
|
||||
for (i = 0; i < sizeof ar_hdr.ar_date; i++)
|
||||
ar_hdr.ar_date[i] = ' ';
|
||||
@@ -532,6 +802,7 @@ ar_member_touch (arname, memname)
|
||||
errno = i;
|
||||
return -3;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef TEST
|
||||
|
||||
@@ -546,11 +817,11 @@ describe_member (desc, name, truncated,
|
||||
{
|
||||
extern char *ctime ();
|
||||
|
||||
printf ("Member `%s'%s: %ld bytes at %ld (%ld).\n",
|
||||
name, truncated ? " (name might be truncated)" : "",
|
||||
printf (_("Member `%s'%s: %ld bytes at %ld (%ld).\n"),
|
||||
name, truncated ? _(" (name might be truncated)") : "",
|
||||
size, hdrpos, datapos);
|
||||
printf (" Date %s", ctime (&date));
|
||||
printf (" uid = %d, gid = %d, mode = 0%o.\n", uid, gid, mode);
|
||||
printf (_(" Date %s"), ctime (&date));
|
||||
printf (_(" uid = %d, gid = %d, mode = 0%o.\n"), uid, gid, mode);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
69
build.sh.in
69
build.sh.in
@@ -1,69 +0,0 @@
|
||||
#!/bin/sh
|
||||
# Shell script to build GNU Make in the absence of any `make' program.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1993, 1994 Free Software Foundation, Inc.
|
||||
# This file is part of GNU Make.
|
||||
#
|
||||
# GNU Make is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# GNU Make is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with GNU Make; see the file COPYING. If not, write to
|
||||
# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
# See Makefile.in for comments describing these variables.
|
||||
|
||||
srcdir='@srcdir@'
|
||||
CC='@CC@'
|
||||
CFLAGS='@CFLAGS@'
|
||||
CPPFLAGS='@CPPFLAGS@'
|
||||
LDFLAGS='@LDFLAGS@'
|
||||
defines='@DEFS@ -DLIBDIR="${libdir}" -DINCLUDEDIR="${includedir}"'
|
||||
ALLOCA='@ALLOCA@'
|
||||
LOADLIBES='@LIBS@'
|
||||
extras='@LIBOBJS@'
|
||||
REMOTE='@REMOTE@'
|
||||
|
||||
# Common prefix for machine-independent installed files.
|
||||
prefix='@prefix@'
|
||||
# Common prefix for machine-dependent installed files.
|
||||
exec_prefix='@exec_prefix@'
|
||||
# Directory to find libraries in for `-lXXX'.
|
||||
libdir=${exec_prefix}/lib
|
||||
# Directory to search by default for included makefiles.
|
||||
includedir=${prefix}/include
|
||||
|
||||
# Exit as soon as any command fails.
|
||||
set -e
|
||||
|
||||
# These are all the objects we need to link together.
|
||||
objs="commands.o job.o dir.o file.o misc.o main.o read.o remake.o rule.o implicit.o default.o variable.o expand.o function.o vpath.o version.o ar.o arscan.o signame.o getopt.o getopt1.o glob/glob.o glob/fnmatch.o remote-${REMOTE}.o ${extras} ${ALLOCA}"
|
||||
|
||||
# Compile the source files into those objects.
|
||||
for file in `echo ${objs} | sed 's/\.o/.c/g'`; do
|
||||
echo compiling ${file}...
|
||||
$CC $defines $CPPFLAGS $CFLAGS \
|
||||
-c -I. -I${srcdir} -I${srcdir}/glob ${srcdir}/$file
|
||||
done
|
||||
|
||||
# The object files were actually all put in the current directory.
|
||||
# Remove the source directory names from the list.
|
||||
srcobjs="$objs"
|
||||
objs=
|
||||
for obj in $srcobjs; do
|
||||
objs="$objs `basename $obj`"
|
||||
done
|
||||
|
||||
# Link all the objects together.
|
||||
echo linking make...
|
||||
$CC $LDFLAGS $objs $LOADLIBES -o make.new
|
||||
echo done
|
||||
mv -f make.new make
|
||||
@@ -2,9 +2,9 @@
|
||||
# Shell script to build GNU Make in the absence of any `make' program.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1993, 1994 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1993, 1994, 1997 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)
|
||||
@@ -14,10 +14,11 @@
|
||||
# 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.
|
||||
# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
# Boston, MA 02111-1307, USA.
|
||||
|
||||
# See Makefile.in for comments describing these variables.
|
||||
|
||||
@@ -31,6 +32,7 @@ ALLOCA='@ALLOCA@'
|
||||
LOADLIBES='@LIBS@'
|
||||
extras='@LIBOBJS@'
|
||||
REMOTE='@REMOTE@'
|
||||
GLOBLIB='@GLOBLIB@'
|
||||
|
||||
# Common prefix for machine-independent installed files.
|
||||
prefix='@prefix@'
|
||||
@@ -47,11 +49,15 @@ set -e
|
||||
# These are all the objects we need to link together.
|
||||
objs="%objs% remote-${REMOTE}.o ${extras} ${ALLOCA}"
|
||||
|
||||
if [ x"$GLOBLIB" != x ]; then
|
||||
objs="$objs %globobjs%"
|
||||
fi
|
||||
|
||||
# Compile the source files into those objects.
|
||||
for file in `echo ${objs} | sed 's/\.o/.c/g'`; do
|
||||
echo compiling ${file}...
|
||||
$CC $defines $CPPFLAGS $CFLAGS \
|
||||
-c -I. -I${srcdir} -I${srcdir}/glob ${srcdir}/$file
|
||||
-c -I. -I${srcdir} ${srcdir}/$file
|
||||
done
|
||||
|
||||
# The object files were actually all put in the current directory.
|
||||
|
||||
137
build_w32.bat
Normal file
137
build_w32.bat
Normal file
@@ -0,0 +1,137 @@
|
||||
set make=gnumake
|
||||
cd w32\subproc
|
||||
echo "Creating the subproc library"
|
||||
%ComSpec% /c build.bat
|
||||
cd ..\..
|
||||
del link.dbg link.rel
|
||||
del config.h
|
||||
copy config.h.W32 config.h
|
||||
echo off
|
||||
echo "Creating GNU make for Windows 95/NT"
|
||||
echo on
|
||||
if not exist .\WinDebug\nul mkdir .\WinDebug
|
||||
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D TIVOLI /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c variable.c
|
||||
echo WinDebug\variable.obj >>link.dbg
|
||||
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c rule.c
|
||||
echo WinDebug\rule.obj >>link.dbg
|
||||
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c remote-stub.c
|
||||
echo WinDebug\remote-stub.obj >>link.dbg
|
||||
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c commands.c
|
||||
echo WinDebug\commands.obj >>link.dbg
|
||||
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c file.c
|
||||
echo WinDebug\file.obj >>link.dbg
|
||||
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c getloadavg.c
|
||||
echo WinDebug\getloadavg.obj >>link.dbg
|
||||
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c default.c
|
||||
echo WinDebug\default.obj >>link.dbg
|
||||
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c signame.c
|
||||
echo WinDebug\signame.obj >>link.dbg
|
||||
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c expand.c
|
||||
echo WinDebug\expand.obj >>link.dbg
|
||||
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c dir.c
|
||||
echo WinDebug\dir.obj >>link.dbg
|
||||
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c main.c
|
||||
echo WinDebug\main.obj >>link.dbg
|
||||
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c getopt1.c
|
||||
echo WinDebug\getopt1.obj >>link.dbg
|
||||
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c job.c
|
||||
echo WinDebug\job.obj >>link.dbg
|
||||
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c read.c
|
||||
echo WinDebug\read.obj >>link.dbg
|
||||
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c version.c
|
||||
echo WinDebug\version.obj >>link.dbg
|
||||
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c getopt.c
|
||||
echo WinDebug\getopt.obj >>link.dbg
|
||||
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c arscan.c
|
||||
echo WinDebug\arscan.obj >>link.dbg
|
||||
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c remake.c
|
||||
echo WinDebug\remake.obj >>link.dbg
|
||||
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c misc.c
|
||||
echo WinDebug\misc.obj >>link.dbg
|
||||
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c ar.c
|
||||
echo WinDebug\ar.obj >>link.dbg
|
||||
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c function.c
|
||||
echo WinDebug\function.obj >>link.dbg
|
||||
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c vpath.c
|
||||
echo WinDebug\vpath.obj >>link.dbg
|
||||
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c implicit.c
|
||||
echo WinDebug\implicit.obj >>link.dbg
|
||||
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c .\w32\compat\dirent.c
|
||||
echo WinDebug\dirent.obj >>link.dbg
|
||||
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c .\glob\glob.c
|
||||
echo WinDebug\glob.obj >>link.dbg
|
||||
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c .\glob\fnmatch.c
|
||||
echo WinDebug\fnmatch.obj >>link.dbg
|
||||
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c .\w32\pathstuff.c
|
||||
echo WinDebug\pathstuff.obj >>link.dbg
|
||||
echo off
|
||||
echo "Linking WinDebug/%make%.exe"
|
||||
rem link.exe kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib w32\subproc\windebug\subproc.lib /NOLOGO /SUBSYSTEM:console /INCREMENTAL:yes /PDB:.\WinDebug/%make%.pdb /DEBUG /MACHINE:I386 /OUT:.\WinDebug/%make%.exe .\WinDebug/variable.obj .\WinDebug/rule.obj .\WinDebug/remote-stub.obj .\WinDebug/commands.obj .\WinDebug/file.obj .\WinDebug/getloadavg.obj .\WinDebug/default.obj .\WinDebug/signame.obj .\WinDebug/expand.obj .\WinDebug/dir.obj .\WinDebug/main.obj .\WinDebug/getopt1.obj .\WinDebug/job.obj .\WinDebug/read.obj .\WinDebug/version.obj .\WinDebug/getopt.obj .\WinDebug/arscan.obj .\WinDebug/remake.obj .\WinDebug/misc.obj .\WinDebug/ar.obj .\WinDebug/function.obj .\WinDebug/vpath.obj .\WinDebug/implicit.obj .\WinDebug/dirent.obj .\WinDebug/glob.obj .\WinDebug/fnmatch.obj .\WinDebug/pathstuff.obj
|
||||
echo kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib w32\subproc\windebug\subproc.lib >>link.dbg
|
||||
link.exe /NOLOGO /SUBSYSTEM:console /INCREMENTAL:yes /PDB:.\WinDebug/%make%.pdb /DEBUG /MACHINE:I386 /OUT:.\WinDebug/%make%.exe @link.dbg
|
||||
if not exist .\WinDebug/%make%.exe echo "WinDebug build failed"
|
||||
if exist .\WinDebug/%make%.exe echo "WinDebug build succeeded!"
|
||||
if not exist .\WinRel\nul mkdir .\WinRel
|
||||
echo on
|
||||
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D TIVOLI /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c variable.c
|
||||
echo WinRel\variable.obj >>link.rel
|
||||
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c rule.c
|
||||
echo WinRel\rule.obj >>link.rel
|
||||
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c remote-stub.c
|
||||
echo WinRel\remote-stub.obj >>link.rel
|
||||
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c commands.c
|
||||
echo WinRel\commands.obj >>link.rel
|
||||
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c file.c
|
||||
echo WinRel\file.obj >>link.rel
|
||||
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c getloadavg.c
|
||||
echo WinRel\getloadavg.obj >>link.rel
|
||||
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c default.c
|
||||
echo WinRel\default.obj >>link.rel
|
||||
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c signame.c
|
||||
echo WinRel\signame.obj >>link.rel
|
||||
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c expand.c
|
||||
echo WinRel\expand.obj >>link.rel
|
||||
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c dir.c
|
||||
echo WinRel\dir.obj >>link.rel
|
||||
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c main.c
|
||||
echo WinRel\main.obj >>link.rel
|
||||
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c getopt1.c
|
||||
echo WinRel\getopt1.obj >>link.rel
|
||||
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c job.c
|
||||
echo WinRel\job.obj >>link.rel
|
||||
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c read.c
|
||||
echo WinRel\read.obj >>link.rel
|
||||
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c version.c
|
||||
echo WinRel\version.obj >>link.rel
|
||||
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c getopt.c
|
||||
echo WinRel\getopt.obj >>link.rel
|
||||
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c arscan.c
|
||||
echo WinRel\arscan.obj >>link.rel
|
||||
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c remake.c
|
||||
echo WinRel\remake.obj >>link.rel
|
||||
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c misc.c
|
||||
echo WinRel\misc.obj >>link.rel
|
||||
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c ar.c
|
||||
echo WinRel\ar.obj >>link.rel
|
||||
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c function.c
|
||||
echo WinRel\function.obj >>link.rel
|
||||
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c vpath.c
|
||||
echo WinRel\vpath.obj >>link.rel
|
||||
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c implicit.c
|
||||
echo WinRel\implicit.obj >>link.rel
|
||||
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c .\w32\compat\dirent.c
|
||||
echo WinRel\dirent.obj >>link.rel
|
||||
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c .\glob\glob.c
|
||||
echo WinRel\glob.obj >>link.rel
|
||||
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c .\glob\fnmatch.c
|
||||
echo WinRel\fnmatch.obj >>link.rel
|
||||
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c .\w32\pathstuff.c
|
||||
echo WinRel\pathstuff.obj >>link.rel
|
||||
echo off
|
||||
echo "Linking WinRel/%make%.exe"
|
||||
rem link.exe kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib w32\subproc\winrel\subproc.lib /NOLOGO /SUBSYSTEM:console /INCREMENTAL:no /PDB:.\WinRel/%make%.pdb /MACHINE:I386 /OUT:.\WinRel/%make%.exe .\WinRel/variable.obj .\WinRel/rule.obj .\WinRel/remote-stub.obj .\WinRel/commands.obj .\WinRel/file.obj .\WinRel/getloadavg.obj .\WinRel/default.obj .\WinRel/signame.obj .\WinRel/expand.obj .\WinRel/dir.obj .\WinRel/main.obj .\WinRel/getopt1.obj .\WinRel/job.obj .\WinRel/read.obj .\WinRel/version.obj .\WinRel/getopt.obj .\WinRel/arscan.obj .\WinRel/remake.obj .\WinRel/misc.obj .\WinRel/ar.obj .\WinRel/function.obj .\WinRel/vpath.obj .\WinRel/implicit.obj .\WinRel/dirent.obj .\WinRel/glob.obj .\WinRel/fnmatch.obj .\WinRel/pathstuff.obj
|
||||
echo kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib w32\subproc\winrel\subproc.lib >>link.rel
|
||||
link.exe /NOLOGO /SUBSYSTEM:console /INCREMENTAL:no /PDB:.\WinRel/%make%.pdb /MACHINE:I386 /OUT:.\WinRel/%make%.exe @link.rel
|
||||
if not exist .\WinRel/%make%.exe echo "WinRel build failed"
|
||||
if exist .\WinRel/%make%.exe echo "WinRel build succeeded!"
|
||||
echo on
|
||||
86
commands.c
86
commands.c
@@ -1,5 +1,5 @@
|
||||
/* Command processing for GNU Make.
|
||||
Copyright (C) 1988, 89, 91, 92, 93, 94, 95 Free Software Foundation, Inc.
|
||||
Copyright (C) 1988,89,91,92,93,94,95,96,97 Free Software Foundation, Inc.
|
||||
This file is part of GNU Make.
|
||||
|
||||
GNU Make is free software; you can redistribute it and/or modify
|
||||
@@ -14,16 +14,17 @@ 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. */
|
||||
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
#include "make.h"
|
||||
#include "dep.h"
|
||||
#include "commands.h"
|
||||
#include "file.h"
|
||||
#include "filedef.h"
|
||||
#include "variable.h"
|
||||
#include "job.h"
|
||||
#include "commands.h"
|
||||
|
||||
extern int remote_kill ();
|
||||
extern int remote_kill PARAMS ((int id, int sig));
|
||||
|
||||
#ifndef HAVE_UNISTD_H
|
||||
extern int getpid ();
|
||||
@@ -87,7 +88,7 @@ set_file_variables (file)
|
||||
for (d = enter_file (".SUFFIXES")->deps; d != 0; d = d->next)
|
||||
{
|
||||
unsigned int slen = strlen (dep_name (d));
|
||||
if (len > slen && !strncmp (dep_name (d), name + (len - slen), slen))
|
||||
if (len > slen && strneq (dep_name (d), name + (len - slen), slen))
|
||||
{
|
||||
file->stem = savestring (name, len - slen);
|
||||
break;
|
||||
@@ -154,8 +155,11 @@ set_file_variables (file)
|
||||
|
||||
bcopy (c, cp, len);
|
||||
cp += len;
|
||||
#if VMS
|
||||
*cp++ = ',';
|
||||
#else
|
||||
*cp++ = ' ';
|
||||
|
||||
#endif
|
||||
if (! d->changed)
|
||||
qmark_len -= len + 1; /* Don't space in $? for this one. */
|
||||
}
|
||||
@@ -193,13 +197,20 @@ set_file_variables (file)
|
||||
|
||||
bcopy (c, cp, len);
|
||||
cp += len;
|
||||
#if VMS
|
||||
*cp++ = ',';
|
||||
#else
|
||||
*cp++ = ' ';
|
||||
|
||||
#endif
|
||||
if (d->changed)
|
||||
{
|
||||
bcopy (c, qp, len);
|
||||
qp += len;
|
||||
#if VMS
|
||||
*qp++ = ',';
|
||||
#else
|
||||
*qp++ = ' ';
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -333,6 +344,7 @@ execute_file_commands (file)
|
||||
/* We are all out of commands.
|
||||
If we have gotten this far, all the previous commands
|
||||
have run successfully, so we have winning update status. */
|
||||
set_command_state (file, cs_running);
|
||||
file->update_status = 0;
|
||||
notice_finished_file (file);
|
||||
return;
|
||||
@@ -359,10 +371,25 @@ RETSIGTYPE
|
||||
fatal_error_signal (sig)
|
||||
int sig;
|
||||
{
|
||||
#ifdef __MSDOS__
|
||||
#ifdef __MSDOS__
|
||||
extern int dos_status, dos_command_running;
|
||||
|
||||
if (dos_command_running)
|
||||
{
|
||||
/* That was the child who got the signal, not us. */
|
||||
dos_status |= (sig << 8);
|
||||
return;
|
||||
}
|
||||
remove_intermediates (1);
|
||||
exit (1);
|
||||
#else /* Not MSDOS. */
|
||||
exit (EXIT_FAILURE);
|
||||
#else /* not __MSDOS__ */
|
||||
#ifdef _AMIGA
|
||||
remove_intermediates (1);
|
||||
if (sig == SIGINT)
|
||||
fputs (_("*** Break.\n"), stderr);
|
||||
|
||||
exit (10);
|
||||
#else /* not Amiga */
|
||||
handling_fatal_signal = 1;
|
||||
|
||||
/* Set the handling for this signal to the default.
|
||||
@@ -383,7 +410,14 @@ fatal_error_signal (sig)
|
||||
/* If we got a signal that means the user
|
||||
wanted to kill make, remove pending targets. */
|
||||
|
||||
if (sig == SIGTERM || sig == SIGINT || sig == SIGHUP || sig == SIGQUIT)
|
||||
if (sig == SIGTERM || sig == SIGINT
|
||||
#ifdef SIGHUP
|
||||
|| sig == SIGHUP
|
||||
#endif
|
||||
#ifdef SIGQUIT
|
||||
|| sig == SIGQUIT
|
||||
#endif
|
||||
)
|
||||
{
|
||||
register struct child *c;
|
||||
|
||||
@@ -410,16 +444,19 @@ fatal_error_signal (sig)
|
||||
|
||||
remove_intermediates (1);
|
||||
|
||||
#ifdef SIGQUIT
|
||||
if (sig == SIGQUIT)
|
||||
/* We don't want to send ourselves SIGQUIT, because it will
|
||||
cause a core dump. Just exit instead. */
|
||||
exit (1);
|
||||
exit (EXIT_FAILURE);
|
||||
#endif
|
||||
|
||||
/* Signal the same code; this time it will really be fatal. The signal
|
||||
will be unblocked when we return and arrive then to kill us. */
|
||||
if (kill (getpid (), sig) < 0)
|
||||
pfatal_with_name ("kill");
|
||||
#endif /* MSDOS. */
|
||||
#endif /* not Amiga */
|
||||
#endif /* not __MSDOS__ */
|
||||
}
|
||||
|
||||
/* Delete FILE unless it's precious or not actually a file (phony),
|
||||
@@ -438,13 +475,13 @@ delete_target (file, on_behalf_of)
|
||||
#ifndef NO_ARCHIVES
|
||||
if (ar_name (file->name))
|
||||
{
|
||||
if (ar_member_date (file->name) != file->last_mtime)
|
||||
if (ar_member_date (file->name) != FILE_TIMESTAMP_S (file->last_mtime))
|
||||
{
|
||||
if (on_behalf_of)
|
||||
error ("*** [%s] Archive member `%s' may be bogus; not deleted",
|
||||
error (NILF, _("*** [%s] Archive member `%s' may be bogus; not deleted"),
|
||||
on_behalf_of, file->name);
|
||||
else
|
||||
error ("*** Archive member `%s' may be bogus; not deleted",
|
||||
error (NILF, _("*** Archive member `%s' may be bogus; not deleted"),
|
||||
file->name);
|
||||
}
|
||||
return;
|
||||
@@ -453,12 +490,12 @@ delete_target (file, on_behalf_of)
|
||||
|
||||
if (stat (file->name, &st) == 0
|
||||
&& S_ISREG (st.st_mode)
|
||||
&& (time_t) st.st_mtime != file->last_mtime)
|
||||
&& FILE_TIMESTAMP_STAT_MODTIME (st) != file->last_mtime)
|
||||
{
|
||||
if (on_behalf_of)
|
||||
error ("*** [%s] Deleting file `%s'", on_behalf_of, file->name);
|
||||
error (NILF, _("*** [%s] Deleting file `%s'"), on_behalf_of, file->name);
|
||||
else
|
||||
error ("*** Deleting file `%s'", file->name);
|
||||
error (NILF, _("*** Deleting file `%s'"), file->name);
|
||||
if (unlink (file->name) < 0
|
||||
&& errno != ENOENT) /* It disappeared; so what. */
|
||||
perror_with_name ("unlink: ", file->name);
|
||||
@@ -496,12 +533,13 @@ print_commands (cmds)
|
||||
{
|
||||
register char *s;
|
||||
|
||||
fputs ("# commands to execute", stdout);
|
||||
fputs (_("# commands to execute"), stdout);
|
||||
|
||||
if (cmds->filename == 0)
|
||||
puts (" (built-in):");
|
||||
if (cmds->fileinfo.filenm == 0)
|
||||
puts (_(" (built-in):"));
|
||||
else
|
||||
printf (" (from `%s', line %u):\n", cmds->filename, cmds->lineno);
|
||||
printf (_(" (from `%s', line %lu):\n"),
|
||||
cmds->fileinfo.filenm, cmds->fileinfo.lineno);
|
||||
|
||||
s = cmds->commands;
|
||||
while (*s != '\0')
|
||||
|
||||
14
commands.h
14
commands.h
@@ -14,15 +14,15 @@ 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. */
|
||||
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
/* Structure that gives the commands to make a file
|
||||
and information about where these commands came from. */
|
||||
|
||||
struct commands
|
||||
{
|
||||
char *filename; /* File that contains commands. */
|
||||
unsigned int lineno; /* Line number in file. */
|
||||
struct floc fileinfo; /* Where commands were defined. */
|
||||
char *commands; /* Commands text. */
|
||||
unsigned int ncommand_lines;/* Number of command lines. */
|
||||
char **command_lines; /* Commands chopped up into lines. */
|
||||
@@ -36,7 +36,7 @@ struct commands
|
||||
#define COMMANDS_SILENT 2 /* Silent: @. */
|
||||
#define COMMANDS_NOERROR 4 /* No errors: -. */
|
||||
|
||||
extern void execute_file_commands ();
|
||||
extern void print_commands ();
|
||||
extern void delete_child_targets ();
|
||||
extern void chop_commands ();
|
||||
extern void execute_file_commands PARAMS ((struct file *file));
|
||||
extern void print_commands PARAMS ((struct commands *cmds));
|
||||
extern void delete_child_targets PARAMS ((struct child *child));
|
||||
extern void chop_commands PARAMS ((struct commands *cmds));
|
||||
|
||||
310
config.ami.template
Normal file
310
config.ami.template
Normal file
@@ -0,0 +1,310 @@
|
||||
/* config.h.in. Generated automatically from configure.in by autoheader. */
|
||||
|
||||
/* Define if on AIX 3.
|
||||
System headers sometimes define this.
|
||||
We just want to avoid a redefinition error message. */
|
||||
#ifndef _ALL_SOURCE
|
||||
/* #undef _ALL_SOURCE */
|
||||
#endif
|
||||
|
||||
/* Define if using alloca.c. */
|
||||
#define C_ALLOCA
|
||||
|
||||
/* Define if the closedir function returns void instead of int. */
|
||||
/* #undef CLOSEDIR_VOID */
|
||||
|
||||
/* Define to empty if the keyword does not work. */
|
||||
/* #undef const */
|
||||
|
||||
/* Define to one of _getb67, GETB67, getb67 for Cray-2 and Cray-YMP systems.
|
||||
This function is required for alloca.c support on those systems. */
|
||||
/* #undef CRAY_STACKSEG_END */
|
||||
|
||||
/* Define for DGUX with <sys/dg_sys_info.h>. */
|
||||
/* #undef DGUX */
|
||||
|
||||
/* Define if the `getloadavg' function needs to be run setuid or setgid. */
|
||||
/* #undef GETLOADAVG_PRIVILEGED */
|
||||
|
||||
/* Define to `int' if <sys/types.h> doesn't define. */
|
||||
#define gid_t int
|
||||
|
||||
/* Define if you have alloca, as a function or macro. */
|
||||
/* #undef HAVE_ALLOCA */
|
||||
|
||||
/* Define if you have <alloca.h> and it should be used (not on Ultrix). */
|
||||
/* #undef HAVE_ALLOCA_H */
|
||||
|
||||
/* Define if you don't have vprintf but do have _doprnt. */
|
||||
/* #undef HAVE_DOPRNT */
|
||||
|
||||
/* Define if your system has a working fnmatch function. */
|
||||
/* #undef HAVE_FNMATCH */
|
||||
|
||||
/* Define if your system has its own `getloadavg' function. */
|
||||
/* #undef HAVE_GETLOADAVG */
|
||||
|
||||
/* Define if you have the getmntent function. */
|
||||
/* #undef HAVE_GETMNTENT */
|
||||
|
||||
/* Define if the `long double' type works. */
|
||||
/* #undef HAVE_LONG_DOUBLE */
|
||||
|
||||
/* Define if you support file names longer than 14 characters. */
|
||||
#define HAVE_LONG_FILE_NAMES 1
|
||||
|
||||
/* Define if you have a working `mmap' system call. */
|
||||
/* #undef HAVE_MMAP */
|
||||
|
||||
/* Define if system calls automatically restart after interruption
|
||||
by a signal. */
|
||||
/* #undef HAVE_RESTARTABLE_SYSCALLS */
|
||||
|
||||
/* Define if your struct stat has st_blksize. */
|
||||
/* #undef HAVE_ST_BLKSIZE */
|
||||
|
||||
/* Define if your struct stat has st_blocks. */
|
||||
/* #undef HAVE_ST_BLOCKS */
|
||||
|
||||
/* Define if you have the strcoll function and it is properly defined. */
|
||||
#define HAVE_STRCOLL 1
|
||||
|
||||
/* Define if your struct stat has st_rdev. */
|
||||
#define HAVE_ST_RDEV 1
|
||||
|
||||
/* Define if you have the strftime function. */
|
||||
#define HAVE_STRFTIME 1
|
||||
|
||||
/* Define if you have <sys/wait.h> that is POSIX.1 compatible. */
|
||||
/* #undef HAVE_SYS_WAIT_H */
|
||||
|
||||
/* Define if your struct tm has tm_zone. */
|
||||
/* #undef HAVE_TM_ZONE */
|
||||
|
||||
/* Define if you don't have tm_zone but do have the external array
|
||||
tzname. */
|
||||
#define HAVE_TZNAME 1
|
||||
|
||||
/* Define if you have <unistd.h>. */
|
||||
#define HAVE_UNISTD_H 1
|
||||
|
||||
/* Define if utime(file, NULL) sets file's timestamp to the present. */
|
||||
/* #undef HAVE_UTIME_NULL */
|
||||
|
||||
/* Define if you have <vfork.h>. */
|
||||
/* #undef HAVE_VFORK_H */
|
||||
|
||||
/* Define if you have the vprintf function. */
|
||||
#define HAVE_VPRINTF 1
|
||||
|
||||
/* Define if you have the wait3 system call. */
|
||||
/* #undef HAVE_WAIT3 */
|
||||
|
||||
/* Define if on MINIX. */
|
||||
/* #undef _MINIX */
|
||||
|
||||
/* Define if your struct nlist has an n_un member. */
|
||||
/* #undef NLIST_NAME_UNION */
|
||||
|
||||
/* Define if you have <nlist.h>. */
|
||||
/* #undef NLIST_STRUCT */
|
||||
|
||||
/* Define if your C compiler doesn't accept -c and -o together. */
|
||||
/* #undef NO_MINUS_C_MINUS_O */
|
||||
|
||||
/* Define to `int' if <sys/types.h> doesn't define. */
|
||||
#define pid_t int
|
||||
|
||||
/* Define if the system does not provide POSIX.1 features except
|
||||
with this defined. */
|
||||
/* #undef _POSIX_1_SOURCE */
|
||||
|
||||
/* Define if you need to in order for stat and other things to work. */
|
||||
/* #undef _POSIX_SOURCE */
|
||||
|
||||
/* Define as the return type of signal handlers (int or void). */
|
||||
#define RETSIGTYPE void
|
||||
|
||||
/* Define if the setvbuf function takes the buffering type as its second
|
||||
argument and the buffer pointer as the third, as on System V
|
||||
before release 3. */
|
||||
/* #undef SETVBUF_REVERSED */
|
||||
|
||||
/* If using the C implementation of alloca, define if you know the
|
||||
direction of stack growth for your system; otherwise it will be
|
||||
automatically deduced at run-time.
|
||||
STACK_DIRECTION > 0 => grows toward higher addresses
|
||||
STACK_DIRECTION < 0 => grows toward lower addresses
|
||||
STACK_DIRECTION = 0 => direction of growth unknown
|
||||
*/
|
||||
#define STACK_DIRECTION -1
|
||||
|
||||
/* Define if the `S_IS*' macros in <sys/stat.h> do not work properly. */
|
||||
/* #undef STAT_MACROS_BROKEN */
|
||||
|
||||
/* Define if you have the ANSI C header files. */
|
||||
#define STDC_HEADERS
|
||||
|
||||
/* Define on System V Release 4. */
|
||||
/* #undef SVR4 */
|
||||
|
||||
/* Define if `sys_siglist' is declared by <signal.h>. */
|
||||
/* #undef SYS_SIGLIST_DECLARED */
|
||||
|
||||
/* Define to `int' if <sys/types.h> doesn't define. */
|
||||
#define uid_t int
|
||||
|
||||
/* Define for Encore UMAX. */
|
||||
/* #undef UMAX */
|
||||
|
||||
/* Define for Encore UMAX 4.3 that has <inq_status/cpustats.h>
|
||||
instead of <sys/cpustats.h>. */
|
||||
/* #undef UMAX4_3 */
|
||||
|
||||
/* Define vfork as fork if vfork does not work. */
|
||||
/* #undef vfork */
|
||||
|
||||
/* Name of this package (needed by automake) */
|
||||
#define PACKAGE "%PACKAGE%"
|
||||
|
||||
/* Version of this package (needed by automake) */
|
||||
#define VERSION "%VERSION%"
|
||||
|
||||
/* Define to the name of the SCCS `get' command. */
|
||||
#define SCCS_GET "get"
|
||||
|
||||
/* Define this if the SCCS `get' command understands the `-G<file>' option. */
|
||||
/* #undef SCCS_GET_MINUS_G */
|
||||
|
||||
/* Define this to enable job server support in GNU make. */
|
||||
/* #undef MAKE_JOBSERVER */
|
||||
|
||||
/* Define to be the nanoseconds member of struct stat's st_mtim,
|
||||
if it exists. */
|
||||
/* #undef ST_MTIM_NSEC */
|
||||
|
||||
/* Define this if the C library defines the variable `sys_siglist'. */
|
||||
/* #undef HAVE_SYS_SIGLIST */
|
||||
|
||||
/* Define this if the C library defines the variable `_sys_siglist'. */
|
||||
/* #undef HAVE__SYS_SIGLIST */
|
||||
|
||||
/* Define this if you have the `union wait' type in <sys/wait.h>. */
|
||||
/* #undef HAVE_UNION_WAIT */
|
||||
|
||||
/* Define if you have the dup2 function. */
|
||||
/* #undef HAVE_DUP2 */
|
||||
|
||||
/* Define if you have the getcwd function. */
|
||||
#define HAVE_GETCWD 1
|
||||
|
||||
/* Define if you have the getgroups function. */
|
||||
/* #undef HAVE_GETGROUPS */
|
||||
|
||||
/* Define if you have the gethostbyname function. */
|
||||
/* #undef HAVE_GETHOSTBYNAME */
|
||||
|
||||
/* Define if you have the gethostname function. */
|
||||
/* #undef HAVE_GETHOSTNAME */
|
||||
|
||||
/* Define if you have the memmove function. */
|
||||
#define HAVE_MEMMOVE 1
|
||||
|
||||
/* Define if you have the mktemp function. */
|
||||
#define HAVE_MKTEMP 1
|
||||
|
||||
/* Define if you have the psignal function. */
|
||||
/* #undef HAVE_PSIGNAL */
|
||||
|
||||
/* Define if you have the pstat_getdynamic function. */
|
||||
/* #undef HAVE_PSTAT_GETDYNAMIC */
|
||||
|
||||
/* Define if you have the setegid function. */
|
||||
/* #undef HAVE_SETEGID */
|
||||
|
||||
/* Define if you have the seteuid function. */
|
||||
/* #undef HAVE_SETEUID */
|
||||
|
||||
/* Define if you have the setlinebuf function. */
|
||||
/* #undef HAVE_SETLINEBUF */
|
||||
|
||||
/* Define if you have the setregid function. */
|
||||
/* #undef HAVE_SETREGID */
|
||||
|
||||
/* Define if you have the setreuid function. */
|
||||
/* #undef HAVE_SETREUID */
|
||||
|
||||
/* Define if you have the sigsetmask function. */
|
||||
/* #undef HAVE_SIGSETMASK */
|
||||
|
||||
/* Define if you have the socket function. */
|
||||
/* #undef HAVE_SOCKET */
|
||||
|
||||
/* Define if you have the strcasecmp function. */
|
||||
/* #undef HAVE_STRCASECMP */
|
||||
|
||||
/* Define if you have the strerror function. */
|
||||
#define HAVE_STRERROR 1
|
||||
|
||||
/* Define if you have the strsignal function. */
|
||||
/* #undef HAVE_STRSIGNAL */
|
||||
|
||||
/* Define if you have the wait3 function. */
|
||||
/* #undef HAVE_WAIT3 */
|
||||
|
||||
/* Define if you have the waitpid function. */
|
||||
/* #undef HAVE_WAITPID */
|
||||
|
||||
/* Define if you have the <dirent.h> header file. */
|
||||
#define HAVE_DIRENT_H 1
|
||||
|
||||
/* Define if you have the <fcntl.h> header file. */
|
||||
#define HAVE_FCNTL_H 1
|
||||
|
||||
/* Define if you have the <limits.h> header file. */
|
||||
#define HAVE_LIMITS_H 1
|
||||
|
||||
/* Define if you have the <mach/mach.h> header file. */
|
||||
/* #undef HAVE_MACH_MACH_H */
|
||||
|
||||
/* Define if you have the <memory.h> header file. */
|
||||
/* #undef HAVE_MEMORY_H */
|
||||
|
||||
/* Define if you have the <ndir.h> header file. */
|
||||
/* #undef HAVE_NDIR_H */
|
||||
|
||||
/* Define if you have the <stdlib.h> header file. */
|
||||
/* #undef HAVE_STDLIB_H */
|
||||
|
||||
/* Define if you have the <string.h> header file. */
|
||||
#define HAVE_STRING_H 1
|
||||
|
||||
/* Define if you have the <sys/dir.h> header file. */
|
||||
#define HAVE_SYS_DIR_H 1
|
||||
|
||||
/* Define if you have the <sys/ndir.h> header file. */
|
||||
/* #undef HAVE_SYS_NDIR_H */
|
||||
|
||||
/* Define if you have the <sys/param.h> header file. */
|
||||
/* #undef HAVE_SYS_PARAM_H */
|
||||
|
||||
/* Define if you have the <sys/timeb.h> header file. */
|
||||
/* #undef HAVE_SYS_TIMEB_H */
|
||||
|
||||
/* Define if you have the <sys/wait.h> header file. */
|
||||
/* #undef HAVE_SYS_WAIT_H */
|
||||
|
||||
/* Define if you have the <unistd.h> header file. */
|
||||
#define HAVE_UNISTD_H 1
|
||||
|
||||
/* Define if you have the dgc library (-ldgc). */
|
||||
/* #undef HAVE_LIBDGC */
|
||||
|
||||
/* Define if you have the kstat library (-lkstat). */
|
||||
/* #undef HAVE_LIBKSTAT */
|
||||
|
||||
/* Define if you have the sun library (-lsun). */
|
||||
/* #undef HAVE_LIBSUN */
|
||||
|
||||
/* Define for Case Insensitve behavior */
|
||||
#define HAVE_CASE_INSENSITIVE_FS
|
||||
343
config.h-vms.template
Normal file
343
config.h-vms.template
Normal file
@@ -0,0 +1,343 @@
|
||||
/* config.h-vms. Generated by hand by Klaus Kämpf <kkaempf@progis.de> */
|
||||
/* config.h. Generated automatically by configure. */
|
||||
/* config.h.in. Generated automatically from configure.in by autoheader. */
|
||||
|
||||
/* Define if on AIX 3.
|
||||
System headers sometimes define this.
|
||||
We just want to avoid a redefinition error message. */
|
||||
#ifndef _ALL_SOURCE
|
||||
/* #undef _ALL_SOURCE */
|
||||
#endif
|
||||
|
||||
/* Define if using alloca.c. */
|
||||
/* #undef C_ALLOCA */
|
||||
|
||||
/* Define if the closedir function returns void instead of int. */
|
||||
/* #undef CLOSEDIR_VOID */
|
||||
|
||||
/* Define to empty if the keyword does not work. */
|
||||
/* #undef const */
|
||||
|
||||
/* Define to one of _getb67, GETB67, getb67 for Cray-2 and Cray-YMP systems.
|
||||
This function is required for alloca.c support on those systems. */
|
||||
/* #undef CRAY_STACKSEG_END */
|
||||
|
||||
/* Define for DGUX with <sys/dg_sys_info.h>. */
|
||||
/* #undef DGUX */
|
||||
|
||||
/* Define if the `getloadavg' function needs to be run setuid or setgid. */
|
||||
/* #undef GETLOADAVG_PRIVILEGED */
|
||||
|
||||
/* Define to `int' if <sys/types.h> doesn't define. */
|
||||
/* #undef gid_t */
|
||||
|
||||
/* Define if you have alloca, as a function or macro. */
|
||||
#define HAVE_ALLOCA 1
|
||||
|
||||
/* Define if you have <alloca.h> and it should be used (not on Ultrix). */
|
||||
/* #undef HAVE_ALLOCA_H */
|
||||
|
||||
/* Define if you don't have vprintf but do have _doprnt. */
|
||||
/* #undef HAVE_DOPRNT */
|
||||
|
||||
/* Define if your system has a working fnmatch function. */
|
||||
/* #undef HAVE_FNMATCH */
|
||||
|
||||
/* Define if your system has its own `getloadavg' function. */
|
||||
/* #undef HAVE_GETLOADAVG */
|
||||
|
||||
/* Define if you have the getmntent function. */
|
||||
/* #undef HAVE_GETMNTENT */
|
||||
|
||||
/* Define if the `long double' type works. */
|
||||
/* #undef HAVE_LONG_DOUBLE */
|
||||
|
||||
/* Define if you support file names longer than 14 characters. */
|
||||
#define HAVE_LONG_FILE_NAMES 1
|
||||
|
||||
/* Define if you have a working `mmap' system call. */
|
||||
/* #undef HAVE_MMAP */
|
||||
|
||||
/* Define if system calls automatically restart after interruption
|
||||
by a signal. */
|
||||
/* #undef HAVE_RESTARTABLE_SYSCALLS */
|
||||
|
||||
/* Define if your struct stat has st_blksize. */
|
||||
/* #undef HAVE_ST_BLKSIZE */
|
||||
|
||||
/* Define if your struct stat has st_blocks. */
|
||||
/* #undef HAVE_ST_BLOCKS */
|
||||
|
||||
/* Define if you have the strcoll function and it is properly defined. */
|
||||
/* #undef HAVE_STRCOLL */
|
||||
|
||||
/* Define if your struct stat has st_rdev. */
|
||||
/* #undef HAVE_ST_RDEV */
|
||||
|
||||
/* Define if you have the strftime function. */
|
||||
/* #undef HAVE_STRFTIME */
|
||||
|
||||
/* Define if you have <sys/wait.h> that is POSIX.1 compatible. */
|
||||
/* #undef HAVE_SYS_WAIT_H */
|
||||
|
||||
/* Define if your struct tm has tm_zone. */
|
||||
/* #undef HAVE_TM_ZONE */
|
||||
|
||||
/* Define if you don't have tm_zone but do have the external array
|
||||
tzname. */
|
||||
/* #undef HAVE_TZNAME */
|
||||
|
||||
/* Define if you have <unistd.h>. */
|
||||
#ifdef __DECC
|
||||
#define HAVE_UNISTD_H 1
|
||||
#endif
|
||||
|
||||
/* Define if utime(file, NULL) sets file's timestamp to the present. */
|
||||
/* #undef HAVE_UTIME_NULL */
|
||||
|
||||
/* Define if you have <vfork.h>. */
|
||||
/* #undef HAVE_VFORK_H */
|
||||
|
||||
/* Define if you have the vprintf function. */
|
||||
#define HAVE_VPRINTF 1
|
||||
|
||||
/* Define if you have the wait3 system call. */
|
||||
/* #undef HAVE_WAIT3 */
|
||||
|
||||
/* Define if on MINIX. */
|
||||
/* #undef _MINIX */
|
||||
|
||||
/* Define if your struct nlist has an n_un member. */
|
||||
/* #undef NLIST_NAME_UNION */
|
||||
|
||||
/* Define if you have <nlist.h>. */
|
||||
/* #undef NLIST_STRUCT */
|
||||
|
||||
/* Define if your C compiler doesn't accept -c and -o together. */
|
||||
/* #undef NO_MINUS_C_MINUS_O */
|
||||
|
||||
/* Define to `int' if <sys/types.h> doesn't define. */
|
||||
/* #undef pid_t */
|
||||
|
||||
/* Define if the system does not provide POSIX.1 features except
|
||||
with this defined. */
|
||||
/* #undef _POSIX_1_SOURCE */
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <ctype.h>
|
||||
#include <signal.h>
|
||||
|
||||
/* Define if you need to in order for stat and other things to work. */
|
||||
#define _POSIX_C_SOURCE 1
|
||||
|
||||
/* Define as the return type of signal handlers (int or void). */
|
||||
#define RETSIGTYPE void
|
||||
|
||||
/* Define if the setvbuf function takes the buffering type as its second
|
||||
argument and the buffer pointer as the third, as on System V
|
||||
before release 3. */
|
||||
/* #undef SETVBUF_REVERSED */
|
||||
|
||||
/* If using the C implementation of alloca, define if you know the
|
||||
direction of stack growth for your system; otherwise it will be
|
||||
automatically deduced at run-time.
|
||||
STACK_DIRECTION > 0 => grows toward higher addresses
|
||||
STACK_DIRECTION < 0 => grows toward lower addresses
|
||||
STACK_DIRECTION = 0 => direction of growth unknown
|
||||
*/
|
||||
/* #undef STACK_DIRECTION */
|
||||
|
||||
/* Define if the `S_IS*' macros in <sys/stat.h> do not work properly. */
|
||||
/* #undef STAT_MACROS_BROKEN */
|
||||
|
||||
/* Define if you have the ANSI C header files. */
|
||||
/* #undef STDC_HEADERS */
|
||||
|
||||
/* Define on System V Release 4. */
|
||||
/* #undef SVR4 */
|
||||
|
||||
/* Define if `sys_siglist' is declared by <signal.h>. */
|
||||
/* #undef SYS_SIGLIST_DECLARED */
|
||||
|
||||
/* Define to `int' if <sys/types.h> doesn't define. */
|
||||
/* #undef uid_t */
|
||||
|
||||
/* Define for Encore UMAX. */
|
||||
/* #undef UMAX */
|
||||
|
||||
/* Define for Encore UMAX 4.3 that has <inq_status/cpustats.h>
|
||||
instead of <sys/cpustats.h>. */
|
||||
/* #undef UMAX4_3 */
|
||||
|
||||
/* Define vfork as fork if vfork does not work. */
|
||||
/* #undef vfork */
|
||||
|
||||
/* Name of this package (needed by automake) */
|
||||
#define PACKAGE "%PACKAGE%"
|
||||
|
||||
/* Version of this package (needed by automake) */
|
||||
#define VERSION "%VERSION%"
|
||||
|
||||
/* Define to the name of the SCCS `get' command. */
|
||||
/* #undef SCCS_GET */
|
||||
|
||||
/* Define this if the SCCS `get' command understands the `-G<file>' option. */
|
||||
/* #undef SCCS_GET_MINUS_G */
|
||||
|
||||
/* Define this to enable job server support in GNU make. */
|
||||
/* #undef MAKE_JOBSERVER */
|
||||
|
||||
/* Define to be the nanoseconds member of struct stat's st_mtim,
|
||||
if it exists. */
|
||||
/* #undef ST_MTIM_NSEC */
|
||||
|
||||
/* Define this if the C library defines the variable `sys_siglist'. */
|
||||
/* #undefine HAVE_SYS_SIGLIST */
|
||||
|
||||
/* Define this if the C library defines the variable `_sys_siglist'. */
|
||||
/* #undef HAVE__SYS_SIGLIST */
|
||||
|
||||
/* Define this if you have the `union wait' type in <sys/wait.h>. */
|
||||
/* #undef HAVE_UNION_WAIT */
|
||||
|
||||
/* Define if you have the dup2 function. */
|
||||
#define HAVE_DUP2 1
|
||||
|
||||
/* Define if you have the getcwd function. */
|
||||
#define HAVE_GETCWD 1
|
||||
|
||||
/* Define if you have the getgroups function. */
|
||||
/* #undef HAVE_GETGROUPS */
|
||||
|
||||
/* Define if you have the gethostbyname function. */
|
||||
/* #undef HAVE_GETHOSTBYNAME */
|
||||
|
||||
/* Define if you have the gethostname function. */
|
||||
/* #undef HAVE_GETHOSTNAME */
|
||||
|
||||
/* Define if you have the getloadavg function. */
|
||||
/* #undef HAVE_GETLOADAVG */
|
||||
|
||||
/* Define if you have the memmove function. */
|
||||
#define HAVE_MEMMOVE 1
|
||||
|
||||
/* Define if you have the mktemp function. */
|
||||
#define HAVE_MKTEMP 1
|
||||
|
||||
/* Define if you have the psignal function. */
|
||||
/* #undef HAVE_PSIGNAL */
|
||||
|
||||
/* Define if you have the pstat_getdynamic function. */
|
||||
/* #undef HAVE_PSTAT_GETDYNAMIC */
|
||||
|
||||
/* Define if you have the setegid function. */
|
||||
/* #undef HAVE_SETEGID */
|
||||
|
||||
/* Define if you have the seteuid function. */
|
||||
/* #undef HAVE_SETEUID */
|
||||
|
||||
/* Define if you have the setlinebuf function. */
|
||||
/* #undef HAVE_SETLINEBUF */
|
||||
|
||||
/* Define if you have the setregid function. */
|
||||
/* #undefine HAVE_SETREGID */
|
||||
|
||||
/* Define if you have the setreuid function. */
|
||||
/* #define HAVE_SETREUID */
|
||||
|
||||
/* Define if you have the sigsetmask function. */
|
||||
#define HAVE_SIGSETMASK 1
|
||||
|
||||
/* Define if you have the socket function. */
|
||||
/* #undef HAVE_SOCKET */
|
||||
|
||||
/* Define if you have the strcasecmp function. */
|
||||
/* #undef HAVE_STRCASECMP */
|
||||
|
||||
/* Define if you have the strerror function. */
|
||||
#define HAVE_STRERROR 1
|
||||
|
||||
/* Define if you have the strsignal function. */
|
||||
/* #undef HAVE_STRSIGNAL */
|
||||
|
||||
/* Define if you have the wait3 function. */
|
||||
/* #undef HAVE_WAIT3 */
|
||||
|
||||
/* Define if you have the waitpid function. */
|
||||
/* #undef HAVE_WAITPID */
|
||||
|
||||
/* Define if you have the <dirent.h> header file. */
|
||||
/* #undef HAVE_DIRENT_H */
|
||||
|
||||
/* Define if you have the <fcntl.h> header file. */
|
||||
#ifdef __DECC
|
||||
#define HAVE_FCNTL_H 1
|
||||
#endif
|
||||
|
||||
/* Define if you have the <limits.h> header file. */
|
||||
#define HAVE_LIMITS_H 1
|
||||
|
||||
/* Define if you have the <mach/mach.h> header file. */
|
||||
/* #undef HAVE_MACH_MACH_H */
|
||||
|
||||
/* Define if you have the <memory.h> header file. */
|
||||
/* #undef HAVE_MEMORY_H */
|
||||
|
||||
/* Define if you have the <ndir.h> header file. */
|
||||
/* #undef HAVE_NDIR_H */
|
||||
|
||||
/* Define if you have the <stdlib.h> header file. */
|
||||
#define HAVE_STDLIB_H 1
|
||||
|
||||
/* Define if you have the <string.h> header file. */
|
||||
#define HAVE_STRING_H 1
|
||||
|
||||
/* Define if you have the <sys/dir.h> header file. */
|
||||
/* #undef HAVE_SYS_DIR_H */
|
||||
|
||||
/* Define if you have the <sys/ndir.h> header file. */
|
||||
/* #undef HAVE_SYS_NDIR_H */
|
||||
|
||||
/* Define if you have the <sys/param.h> header file. */
|
||||
/* #undef HAVE_SYS_PARAM_H */
|
||||
|
||||
/* Define if you have the <sys/timeb.h> header file. */
|
||||
#define HAVE_SYS_TIMEB_H 1
|
||||
|
||||
/* Define if you have the <sys/wait.h> header file. */
|
||||
/* #undef HAVE_SYS_WAIT_H */
|
||||
|
||||
/* Define if you have the <unistd.h> header file. */
|
||||
/* #undef HAVE_UNISTD_H */
|
||||
|
||||
/* Define if you have the dgc library (-ldgc). */
|
||||
/* #undef HAVE_LIBDGC */
|
||||
|
||||
/* Define if you have the kstat library (-lkstat). */
|
||||
/* #undef HAVE_LIBKSTAT */
|
||||
|
||||
/* Define if you have the sun library (-lsun). */
|
||||
/* #undef HAVE_LIBSUN */
|
||||
|
||||
/* VMS specific */
|
||||
|
||||
#define HAVE_VMSDIR_H 1
|
||||
#define INCLUDEDIR "sys$sysroot:[syslib]"
|
||||
#define LIBDIR "sys$sysroot:[syslib]"
|
||||
|
||||
/* Avoid broken RTL functions on OpenVMS */
|
||||
#include <unixlib.h>
|
||||
#define getopt gnu_getopt
|
||||
#define optarg gnu_optarg
|
||||
#define optopt gnu_optopt
|
||||
#define optind gnu_optind
|
||||
#define opterr gnu_opterr
|
||||
|
||||
#if defined (__cplusplus) || (defined (__STDC__) && __STDC__)
|
||||
#undef PARAMS
|
||||
#define PARAMS(protos) protos
|
||||
#else /* Not C++ or ANSI C. */
|
||||
#undef PARAMS
|
||||
#define PARAMS(protos) ()
|
||||
#endif /* C++ or ANSI C. */
|
||||
|
||||
@@ -4,125 +4,143 @@
|
||||
System headers sometimes define this.
|
||||
We just want to avoid a redefinition error message. */
|
||||
#ifndef _ALL_SOURCE
|
||||
#undef _ALL_SOURCE
|
||||
/* #undef _ALL_SOURCE */
|
||||
#endif
|
||||
|
||||
/* Define if using alloca.c. */
|
||||
#undef C_ALLOCA
|
||||
/* #undef C_ALLOCA */
|
||||
|
||||
/* Define if the closedir function returns void instead of int. */
|
||||
/* #undef CLOSEDIR_VOID */
|
||||
|
||||
/* Define to empty if the keyword does not work. */
|
||||
#undef const
|
||||
/* #undef const */
|
||||
|
||||
/* Define to one of _getb67, GETB67, getb67 for Cray-2 and Cray-YMP systems.
|
||||
This function is required for alloca.c support on those systems. */
|
||||
#undef CRAY_STACKSEG_END
|
||||
/* #undef CRAY_STACKSEG_END */
|
||||
|
||||
/* Define for DGUX with <sys/dg_sys_info.h>. */
|
||||
#undef DGUX
|
||||
/* #undef DGUX */
|
||||
|
||||
/* Define if the `getloadavg' function needs to be run setuid or setgid. */
|
||||
#undef GETLOADAVG_PRIVILEGED
|
||||
/* #undef GETLOADAVG_PRIVILEGED */
|
||||
|
||||
/* Define to `int' if <sys/types.h> doesn't define. */
|
||||
#undef gid_t
|
||||
#define gid_t int
|
||||
|
||||
/* Define if you have alloca, as a function or macro. */
|
||||
#undef HAVE_ALLOCA
|
||||
#define HAVE_ALLOCA 1
|
||||
|
||||
/* Define if you have <alloca.h> and it should be used (not on Ultrix). */
|
||||
#undef HAVE_ALLOCA_H
|
||||
/* #undef HAVE_ALLOCA_H */
|
||||
|
||||
/* Define if you don't have vprintf but do have _doprnt. */
|
||||
#undef HAVE_DOPRNT
|
||||
/* #undef HAVE_DOPRNT */
|
||||
|
||||
/* Define if your system has a working fnmatch function. */
|
||||
/* #undef HAVE_FNMATCH */
|
||||
|
||||
/* Define if your system has its own `getloadavg' function. */
|
||||
#undef HAVE_GETLOADAVG
|
||||
/* #undef HAVE_GETLOADAVG */
|
||||
|
||||
/* Define if you have the getmntent function. */
|
||||
#undef HAVE_GETMNTENT
|
||||
/* #undef HAVE_GETMNTENT */
|
||||
|
||||
/* Define if the `long double' type works. */
|
||||
#undef HAVE_LONG_DOUBLE
|
||||
/* #undef HAVE_LONG_DOUBLE */
|
||||
|
||||
/* Define if you support file names longer than 14 characters. */
|
||||
#undef HAVE_LONG_FILE_NAMES
|
||||
#define HAVE_LONG_FILE_NAMES 1
|
||||
|
||||
/* Define if you have a working `mmap' system call. */
|
||||
#undef HAVE_MMAP
|
||||
/* #undef HAVE_MMAP */
|
||||
|
||||
/* Define if system calls automatically restart after interruption
|
||||
by a signal. */
|
||||
#undef HAVE_RESTARTABLE_SYSCALLS
|
||||
/* #undef HAVE_RESTARTABLE_SYSCALLS */
|
||||
|
||||
/* Define if your struct stat has st_blksize. */
|
||||
#undef HAVE_ST_BLKSIZE
|
||||
/* #undef HAVE_ST_BLKSIZE */
|
||||
|
||||
/* Define if your struct stat has st_blocks. */
|
||||
#undef HAVE_ST_BLOCKS
|
||||
/* #undef HAVE_ST_BLOCKS */
|
||||
|
||||
/* Define if you have the strcoll function and it is properly defined. */
|
||||
#undef HAVE_STRCOLL
|
||||
#define HAVE_STRCOLL 1
|
||||
|
||||
/* Define if your struct stat has st_rdev. */
|
||||
#undef HAVE_ST_RDEV
|
||||
#define HAVE_ST_RDEV 1
|
||||
|
||||
/* Define if you have the strftime function. */
|
||||
#undef HAVE_STRFTIME
|
||||
#define HAVE_STRFTIME 1
|
||||
|
||||
/* Define if you have <sys/wait.h> that is POSIX.1 compatible. */
|
||||
#undef HAVE_SYS_WAIT_H
|
||||
/* #undef HAVE_SYS_WAIT_H */
|
||||
|
||||
/* Define if your struct tm has tm_zone. */
|
||||
#undef HAVE_TM_ZONE
|
||||
/* #undef HAVE_TM_ZONE */
|
||||
|
||||
/* Define if you don't have tm_zone but do have the external array
|
||||
tzname. */
|
||||
#undef HAVE_TZNAME
|
||||
#define HAVE_TZNAME 1
|
||||
|
||||
/* Define if you have <unistd.h>. */
|
||||
#undef HAVE_UNISTD_H
|
||||
/* #undef HAVE_UNISTD_H */
|
||||
|
||||
/* Define if utime(file, NULL) sets file's timestamp to the present. */
|
||||
#undef HAVE_UTIME_NULL
|
||||
#define HAVE_UTIME_NULL 1
|
||||
|
||||
/* Define if you have <vfork.h>. */
|
||||
#undef HAVE_VFORK_H
|
||||
/* #undef HAVE_VFORK_H */
|
||||
|
||||
/* Define if you have the vprintf function. */
|
||||
#undef HAVE_VPRINTF
|
||||
#define HAVE_VPRINTF 1
|
||||
|
||||
/* Define if you have the wait3 system call. */
|
||||
#undef HAVE_WAIT3
|
||||
/* #undef HAVE_WAIT3 */
|
||||
|
||||
/* Define if on MINIX. */
|
||||
#undef _MINIX
|
||||
/* #undef _MINIX */
|
||||
|
||||
/* Define if your struct nlist has an n_un member. */
|
||||
#undef NLIST_NAME_UNION
|
||||
/* #undef NLIST_NAME_UNION */
|
||||
|
||||
/* Define if you have <nlist.h>. */
|
||||
#undef NLIST_STRUCT
|
||||
/* #undef NLIST_STRUCT */
|
||||
|
||||
/* Define if your C compiler doesn't accept -c and -o together. */
|
||||
#undef NO_MINUS_C_MINUS_O
|
||||
/* #undef NO_MINUS_C_MINUS_O */
|
||||
|
||||
/* Define to `int' if <sys/types.h> doesn't define. */
|
||||
#undef pid_t
|
||||
#define pid_t int
|
||||
|
||||
/* Define if the system does not provide POSIX.1 features except
|
||||
with this defined. */
|
||||
#undef _POSIX_1_SOURCE
|
||||
/* #undef _POSIX_1_SOURCE */
|
||||
|
||||
/* Define if you need to in order for stat and other things to work. */
|
||||
#undef _POSIX_SOURCE
|
||||
#define _POSIX_SOURCE 1
|
||||
|
||||
/* Define as the return type of signal handlers (int or void). */
|
||||
#undef RETSIGTYPE
|
||||
#define RETSIGTYPE void
|
||||
|
||||
/* Define if the setvbuf function takes the buffering type as its second
|
||||
argument and the buffer pointer as the third, as on System V
|
||||
before release 3. */
|
||||
#undef SETVBUF_REVERSED
|
||||
/* #undef SETVBUF_REVERSED */
|
||||
|
||||
/* If using the C implementation of alloca, define if you know the
|
||||
direction of stack growth for your system; otherwise it will be
|
||||
@@ -131,137 +149,204 @@
|
||||
STACK_DIRECTION < 0 => grows toward lower addresses
|
||||
STACK_DIRECTION = 0 => direction of growth unknown
|
||||
*/
|
||||
#undef STACK_DIRECTION
|
||||
/* #undef STACK_DIRECTION */
|
||||
|
||||
/* Define if the `S_IS*' macros in <sys/stat.h> do not work properly. */
|
||||
#undef STAT_MACROS_BROKEN
|
||||
/* #undef STAT_MACROS_BROKEN */
|
||||
|
||||
/* Define if you have the ANSI C header files. */
|
||||
#undef STDC_HEADERS
|
||||
#define STDC_HEADERS 1
|
||||
|
||||
/* Define on System V Release 4. */
|
||||
#undef SVR4
|
||||
/* #undef SVR4 */
|
||||
|
||||
/* Define if `sys_siglist' is declared by <signal.h>. */
|
||||
#undef SYS_SIGLIST_DECLARED
|
||||
/* #undef SYS_SIGLIST_DECLARED */
|
||||
|
||||
/* Define to `int' if <sys/types.h> doesn't define. */
|
||||
#undef uid_t
|
||||
#define uid_t int
|
||||
|
||||
/* Define for Encore UMAX. */
|
||||
#undef UMAX
|
||||
/* #undef UMAX */
|
||||
|
||||
/* Define for Encore UMAX 4.3 that has <inq_status/cpustats.h>
|
||||
instead of <sys/cpustats.h>. */
|
||||
#undef UMAX4_3
|
||||
/* #undef UMAX4_3 */
|
||||
|
||||
/* Define vfork as fork if vfork does not work. */
|
||||
#undef vfork
|
||||
/* #undef vfork */
|
||||
|
||||
/* Name of this package (needed by automake) */
|
||||
#define PACKAGE "%PACKAGE%"
|
||||
|
||||
/* Version of this package (needed by automake) */
|
||||
#define VERSION "%VERSION%"
|
||||
|
||||
/* Define to the name of the SCCS `get' command. */
|
||||
#undef SCCS_GET
|
||||
#define SCCS_GET "echo no sccs get"
|
||||
|
||||
/* Define this if the SCCS `get' command understands the `-G<file>' option. */
|
||||
#undef SCCS_GET_MINUS_G
|
||||
/* #undef SCCS_GET_MINUS_G */
|
||||
|
||||
/* Define this to enable job server support in GNU make. */
|
||||
/* #undef MAKE_JOBSERVER */
|
||||
|
||||
/* Define to be the nanoseconds member of struct stat's st_mtim,
|
||||
if it exists. */
|
||||
/* #undef ST_MTIM_NSEC */
|
||||
|
||||
/* Define this if the C library defines the variable `sys_siglist'. */
|
||||
#undef HAVE_SYS_SIGLIST
|
||||
/* #undef HAVE_SYS_SIGLIST */
|
||||
|
||||
/* Define this if the C library defines the variable `_sys_siglist'. */
|
||||
#undef HAVE__SYS_SIGLIST
|
||||
/* #undef HAVE__SYS_SIGLIST */
|
||||
|
||||
/* Define this if you have the `union wait' type in <sys/wait.h>. */
|
||||
#undef HAVE_UNION_WAIT
|
||||
|
||||
/* Define this if the POSIX.1 call `sysconf (_SC_OPEN_MAX)' works properly. */
|
||||
#undef HAVE_SYSCONF_OPEN_MAX
|
||||
/* #undef HAVE_UNION_WAIT */
|
||||
|
||||
/* Define if you have the dup2 function. */
|
||||
#undef HAVE_DUP2
|
||||
#define HAVE_DUP2 1
|
||||
|
||||
/* Define if you have the getcwd function. */
|
||||
#undef HAVE_GETCWD
|
||||
#define HAVE_GETCWD 1
|
||||
|
||||
/* Define if you have the getgroups function. */
|
||||
#undef HAVE_GETGROUPS
|
||||
/* #undef HAVE_GETGROUPS */
|
||||
|
||||
/* Define if you have the gethostbyname function. */
|
||||
/* #undef HAVE_GETHOSTBYNAME */
|
||||
|
||||
/* Define if you have the gethostname function. */
|
||||
/* #undef HAVE_GETHOSTNAME */
|
||||
|
||||
/* Define if you have the getloadavg function. */
|
||||
/* #undef HAVE_GETLOADAVG */
|
||||
|
||||
/* Define if you have the memmove function. */
|
||||
#undef HAVE_MEMMOVE
|
||||
#define HAVE_MEMMOVE 1
|
||||
|
||||
/* Define if you have the mktemp function. */
|
||||
#undef HAVE_MKTEMP
|
||||
#define HAVE_MKTEMP 1
|
||||
|
||||
/* Define if you have the psignal function. */
|
||||
#undef HAVE_PSIGNAL
|
||||
/* #undef HAVE_PSIGNAL */
|
||||
|
||||
/* Define if you have the pstat_getdynamic function. */
|
||||
/* #undef HAVE_PSTAT_GETDYNAMIC */
|
||||
|
||||
/* Define if you have the setegid function. */
|
||||
#undef HAVE_SETEGID
|
||||
/* #undef HAVE_SETEGID */
|
||||
|
||||
/* Define if you have the seteuid function. */
|
||||
#undef HAVE_SETEUID
|
||||
/* #undef HAVE_SETEUID */
|
||||
|
||||
/* Define if you have the setlinebuf function. */
|
||||
#undef HAVE_SETLINEBUF
|
||||
/* #undef HAVE_SETLINEBUF */
|
||||
|
||||
/* Define if you have the setregid function. */
|
||||
#undef HAVE_SETREGID
|
||||
/* #undef HAVE_SETREGID */
|
||||
|
||||
/* Define if you have the setreuid function. */
|
||||
#undef HAVE_SETREUID
|
||||
/* #undef HAVE_SETREUID */
|
||||
|
||||
/* Define if you have the sigsetmask function. */
|
||||
#undef HAVE_SIGSETMASK
|
||||
/* #undef HAVE_SIGSETMASK */
|
||||
|
||||
/* Define if you have the socket function. */
|
||||
/* #undef HAVE_SOCKET */
|
||||
|
||||
/* Define if you have the strcasecmp function. */
|
||||
/* #undef HAVE_STRCASECMP */
|
||||
|
||||
/* Define if you have the strerror function. */
|
||||
#undef HAVE_STRERROR
|
||||
#define HAVE_STRERROR 1
|
||||
|
||||
/* Define if you have the strsignal function. */
|
||||
#undef HAVE_STRSIGNAL
|
||||
/* #undef HAVE_STRSIGNAL */
|
||||
|
||||
/* Define if you have the wait3 function. */
|
||||
#undef HAVE_WAIT3
|
||||
/* #undef HAVE_WAIT3 */
|
||||
|
||||
/* Define if you have the waitpid function. */
|
||||
#undef HAVE_WAITPID
|
||||
/* #undef HAVE_WAITPID */
|
||||
|
||||
/* Define if you have the <dirent.h> header file. */
|
||||
#undef HAVE_DIRENT_H
|
||||
#define HAVE_DIRENT_H 1
|
||||
|
||||
/* Define if you have the <fcntl.h> header file. */
|
||||
#undef HAVE_FCNTL_H
|
||||
#define HAVE_FCNTL_H 1
|
||||
|
||||
/* Define if you have the <limits.h> header file. */
|
||||
#undef HAVE_LIMITS_H
|
||||
#define HAVE_LIMITS_H 1
|
||||
|
||||
/* Define if you have the <mach/mach.h> header file. */
|
||||
#undef HAVE_MACH_MACH_H
|
||||
/* #undef HAVE_MACH_MACH_H */
|
||||
|
||||
/* Define if you have the <memory.h> header file. */
|
||||
#undef HAVE_MEMORY_H
|
||||
#define HAVE_MEMORY_H 1
|
||||
|
||||
/* Define if you have the <ndir.h> header file. */
|
||||
#undef HAVE_NDIR_H
|
||||
/* #undef HAVE_NDIR_H */
|
||||
|
||||
/* Define if you have the <string.h> header file. */
|
||||
#undef HAVE_STRING_H
|
||||
#define HAVE_STRING_H 1
|
||||
|
||||
/* Define if you have the <sys/dir.h> header file. */
|
||||
#undef HAVE_SYS_DIR_H
|
||||
/* #undef HAVE_SYS_DIR_H */
|
||||
|
||||
/* Define if you have the <sys/ndir.h> header file. */
|
||||
#undef HAVE_SYS_NDIR_H
|
||||
/* #undef HAVE_SYS_NDIR_H */
|
||||
|
||||
/* Define if you have the <sys/param.h> header file. */
|
||||
#undef HAVE_SYS_PARAM_H
|
||||
/* #undef HAVE_SYS_PARAM_H */
|
||||
|
||||
/* Define if you have the <sys/timeb.h> header file. */
|
||||
#undef HAVE_SYS_TIMEB_H
|
||||
#define HAVE_SYS_TIMEB_H 1
|
||||
|
||||
/* Define if you have the <sys/wait.h> header file. */
|
||||
#undef HAVE_SYS_WAIT_H
|
||||
/* #undef HAVE_SYS_WAIT_H */
|
||||
|
||||
/* Define if you have the <unistd.h> header file. */
|
||||
#undef HAVE_UNISTD_H
|
||||
/* #undef HAVE_UNISTD_H */
|
||||
|
||||
/* Define if you have the dgc library (-ldgc). */
|
||||
#undef HAVE_LIBDGC
|
||||
/* #undef HAVE_LIBDGC */
|
||||
|
||||
/* Define if you have the kstat library (-lkstat). */
|
||||
/* #undef HAVE_LIBKSTAT */
|
||||
|
||||
/* Define if you have the sun library (-lsun). */
|
||||
#undef HAVE_LIBSUN
|
||||
/* #undef HAVE_LIBSUN */
|
||||
|
||||
/*
|
||||
* Refer to README.W32 for info on the following settings
|
||||
*/
|
||||
|
||||
/*
|
||||
Define if you have the Cygnus GNU WIN32 tool set or a shell
|
||||
that does not grok 'sh -c quoted-command-line' correctly.
|
||||
*/
|
||||
#undef BATCH_MODE_ONLY_SHELL
|
||||
|
||||
/*
|
||||
Define if you have the MKS tool set or shell. Do NOT define
|
||||
BATCH_MODE_ONLY_SHELL if you define HAVE_MKS_SHELL
|
||||
*/
|
||||
#undef HAVE_MKS_SHELL
|
||||
|
||||
/* Define if you prefer Case Insensitve behavior */
|
||||
#undef HAVE_CASE_INSENSITIVE_FS
|
||||
@@ -1,68 +1,49 @@
|
||||
/* Generated automatically from configure.in by autoheader. DO NOT EDIT! */
|
||||
|
||||
#define INCLUDEDIR "c:/djgpp/include"
|
||||
#define LIBDIR "c:/djgpp/lib"
|
||||
/* Many things are defined already by a system header. */
|
||||
#include <sys/config.h>
|
||||
|
||||
/* Define if you have dirent.h. */
|
||||
#define DIRENT
|
||||
/* Name of this package (needed by automake) */
|
||||
#define PACKAGE "%PACKAGE%"
|
||||
|
||||
/* Define if you have the strcoll function and it is properly defined. */
|
||||
#define HAVE_STRCOLL
|
||||
/* Version of this package (needed by automake) */
|
||||
#define VERSION "%VERSION%"
|
||||
|
||||
/* Define if you have unistd.h. */
|
||||
#define HAVE_UNISTD_H
|
||||
|
||||
/* Define as the return type of signal handlers (int or void). */
|
||||
#define RETSIGTYPE void
|
||||
|
||||
/* Define if you have the ANSI C header files. */
|
||||
#ifndef STDC_HEADERS
|
||||
#define STDC_HEADERS
|
||||
#endif
|
||||
#if __DJGPP__ > 2 || __DJGPP_MINOR__ > 1
|
||||
|
||||
/* Define if `sys_siglist' is declared by <signal.h>. */
|
||||
#define SYS_SIGLIST_DECLARED
|
||||
# define SYS_SIGLIST_DECLARED 1
|
||||
|
||||
/* Define if you have getdtablesize. */
|
||||
#define HAVE_GETDTABLESIZE
|
||||
/* Define this if the C library defines the variable `_sys_siglist'. */
|
||||
# define HAVE_SYS_SIGLIST 1
|
||||
|
||||
/* Define if you have dup2. */
|
||||
#define HAVE_DUP2
|
||||
#else
|
||||
|
||||
/* Define if you have sys_siglist. */
|
||||
#undef HAVE_SYS_SIGLIST
|
||||
/* Define NSIG. */
|
||||
# define NSIG SIGMAX
|
||||
|
||||
/* Define if you have _sys_siglist. */
|
||||
#undef HAVE__SYS_SIGLIST
|
||||
|
||||
/* Define if you have psignal. */
|
||||
#define HAVE_PSIGNAL
|
||||
|
||||
/* Define if you have getcwd. */
|
||||
#define HAVE_GETCWD
|
||||
#endif
|
||||
|
||||
/* Define if you have sigsetmask. */
|
||||
#define HAVE_SIGSETMASK
|
||||
|
||||
/* Define if you have setlinebuf. */
|
||||
#define HAVE_SETLINEBUF
|
||||
|
||||
/* Define if you have the <limits.h> header file. */
|
||||
#define HAVE_LIMITS_H
|
||||
|
||||
/* Define if you have the <sys/param.h> header file. */
|
||||
#undef HAVE_SYS_PARAM_H
|
||||
|
||||
/* Define if you have the <fcntl.h> header file. */
|
||||
#define HAVE_FCNTL_H
|
||||
|
||||
/* Define if you have the <string.h> header file. */
|
||||
#define HAVE_STRING_H
|
||||
#define HAVE_SIGSETMASK 1
|
||||
|
||||
/* Define if you have the <memory.h> header file. */
|
||||
#define HAVE_MEMORY_H
|
||||
#define HAVE_MEMORY_H 1
|
||||
|
||||
/* Define if you have the `strerror' function. */
|
||||
#define HAVE_STRERROR
|
||||
/* Define if you have the memmove function. */
|
||||
#define HAVE_MEMMOVE 1
|
||||
|
||||
#define SCCS_GET "get"
|
||||
|
||||
/* Define to `unsigned long' or `unsigned long long'
|
||||
if <inttypes.h> doesn't define. */
|
||||
#define uintmax_t unsigned long long
|
||||
|
||||
/* Define the type of the first arg to select(). */
|
||||
#define fd_set_size_t int
|
||||
|
||||
/* Define if you have the select function. */
|
||||
#define HAVE_SELECT 1
|
||||
|
||||
/* Define if you have the vprintf library function. */
|
||||
#undef HAVE_VPRINTF
|
||||
#define HAVE_VPRINTF 1
|
||||
|
||||
@@ -1,44 +1,44 @@
|
||||
@echo off
|
||||
echo Configuring MAKE for go32
|
||||
rem This batch file assumes a unix-type "sed" program
|
||||
echo Configuring MAKE for DJGPP
|
||||
|
||||
update configh.dos config.h
|
||||
rem The SmallEnv trick protects against too small environment block,
|
||||
rem in which case the values will be truncated and the whole thing
|
||||
rem goes awry. COMMAND.COM will say "Out of environment space", but
|
||||
rem many people don't care, so we force them to care by refusing to go.
|
||||
|
||||
echo # Makefile generated by "configure.bat"> Makefile
|
||||
rem Where is the srcdir?
|
||||
set XSRC=.
|
||||
if not "%XSRC%"=="." goto SmallEnv
|
||||
if "%1%"=="" goto SrcDone
|
||||
set XSRC=%1
|
||||
if not "%XSRC%"=="%1" goto SmallEnv
|
||||
|
||||
if exist config.sed del config.sed
|
||||
:SrcDone
|
||||
|
||||
echo ": try_sl ">> config.sed
|
||||
echo "/\\$/ { ">> config.sed
|
||||
echo " N ">> config.sed
|
||||
echo " s/[ ]*\\\n[ ]*/ / ">> config.sed
|
||||
echo " b try_sl ">> config.sed
|
||||
echo "} ">> config.sed
|
||||
update %XSRC%/configh.dos ./config.h
|
||||
|
||||
echo "s/@srcdir@/./ ">> config.sed
|
||||
echo "s/@CC@/gcc/ ">> config.sed
|
||||
echo "s/@CFLAGS@/-O2 -g/ ">> config.sed
|
||||
echo "s/@CPPFLAGS@/-DHAVE_CONFIG_H/ ">> config.sed
|
||||
echo "s/@LDFLAGS@// ">> config.sed
|
||||
echo "s/@RANLIB@/ranlib/ ">> config.sed
|
||||
echo "s/@DEFS@// ">> config.sed
|
||||
echo "s/@REMOTE@/stub/ ">> config.sed
|
||||
echo "s/@ALLOCA@// ">> config.sed
|
||||
echo "s/@LIBS@// ">> config.sed
|
||||
echo "s/@LIBOBJS@// ">> config.sed
|
||||
echo "s/@SET_MAKE@// ">> config.sed
|
||||
echo "s/^Makefile *:/_Makefile:/ ">> config.sed
|
||||
echo "s/^config.h *:/_config.h:/ ">> config.sed
|
||||
echo "s/^defines *=.*$/defines =/ ">> config.sed
|
||||
echo "/mv -f make.new make/d ">> config.sed
|
||||
rem Do they have Make?
|
||||
redir -o junk.$$$ -eo make -n -f NUL
|
||||
rem REDIR will return 1 if it cannot run Make.
|
||||
rem If it can run Make, it will usually return 2,
|
||||
rem but 0 is also OK with us.
|
||||
if errorlevel 2 goto MakeOk
|
||||
if not errorlevel 1 goto MakeOk
|
||||
if exist junk.$$$ del junk.$$$
|
||||
echo No Make program found--use DOSBUILD.BAT to build Make.
|
||||
goto End
|
||||
|
||||
echo "s/cd glob; $(MAKE)/$(MAKE) -C glob/ ">> config.sed
|
||||
rem They do have Make. Generate the Makefile.
|
||||
|
||||
sed -e "s/^\"//" -e "s/\"$//" -e "s/[ ]*$//" config.sed > config2.sed
|
||||
sed -f config2.sed Makefile.in >> Makefile
|
||||
del config.sed
|
||||
del config2.sed
|
||||
:MakeOk
|
||||
del junk.$$$
|
||||
update %XSRC%/Makefile.DOS ./Makefile
|
||||
echo Done.
|
||||
if not "%XSRC%"=="." echo Invoke Make thus: "make srcdir=%XSRC%"
|
||||
goto End
|
||||
|
||||
cd glob
|
||||
call configure
|
||||
cd ..
|
||||
:SmallEnv
|
||||
echo Your environment is too small. Please enlarge it and run me again.
|
||||
|
||||
:End
|
||||
set XRSC=
|
||||
|
||||
203
configure.in
203
configure.in
@@ -1,28 +1,42 @@
|
||||
dnl Process this file with autoconf to produce a configure script.
|
||||
AC_REVISION([$Id$])
|
||||
AC_PREREQ(2.1)dnl dnl Minimum Autoconf version required.
|
||||
AC_PREREQ(2.13)dnl dnl Minimum Autoconf version required.
|
||||
AC_INIT(vpath.c)dnl dnl A distinctive file to look for in srcdir.
|
||||
AC_CONFIG_HEADER(config.h)
|
||||
AC_CONFIG_SUBDIRS(glob) dnl Run configure in glob subdirectory.
|
||||
|
||||
AM_INIT_AUTOMAKE(make, 3.77.94)
|
||||
AM_CONFIG_HEADER(config.h)
|
||||
|
||||
dnl Regular configure stuff
|
||||
|
||||
AC_PROG_MAKE_SET
|
||||
AC_PROG_CC
|
||||
AC_PROG_INSTALL
|
||||
AC_CHECK_PROG(AR, ar, ar, ar)
|
||||
AC_PROG_RANLIB
|
||||
AC_PROG_CPP dnl Later checks need this.
|
||||
AC_AIX
|
||||
AC_ISC_POSIX
|
||||
AC_MINIX
|
||||
|
||||
dnl This test must come as early as possible after the compiler configuration
|
||||
dnl tests, because the choice of the file model can (in principle) affect
|
||||
dnl whether functions and headers are available, whether they work, etc.
|
||||
AC_LFS
|
||||
|
||||
AC_HEADER_STDC
|
||||
AC_HEADER_DIRENT
|
||||
AC_TYPE_UID_T dnl Also does gid_t.
|
||||
AC_TYPE_PID_T
|
||||
AC_TYPE_SIGNAL
|
||||
AC_CHECK_HEADERS(unistd.h limits.h sys/param.h fcntl.h string.h memory.h \
|
||||
sys/timeb.h)
|
||||
AC_CHECK_HEADERS(stdlib.h unistd.h limits.h sys/param.h fcntl.h string.h \
|
||||
memory.h sys/timeb.h)
|
||||
AC_PROG_CC_C_O
|
||||
AC_C_CONST dnl getopt needs this.
|
||||
AC_HEADER_STAT
|
||||
|
||||
AC_STRUCT_ST_MTIM_NSEC
|
||||
jm_AC_TYPE_UINTMAX_T
|
||||
|
||||
AC_SUBST(LIBOBJS)
|
||||
|
||||
AC_DEFUN(AC_CHECK_SYMBOL, [dnl
|
||||
@@ -38,19 +52,27 @@ changequote([,])dnl
|
||||
fi
|
||||
AC_MSG_RESULT($ac_cv_check_symbol_$1)])dnl
|
||||
|
||||
AC_CHECK_FUNCS(psignal mktemp \
|
||||
dup2 getcwd sigsetmask getgroups setlinebuf \
|
||||
seteuid setegid setreuid setregid strerror strsignal)
|
||||
# clock_gettime is in -lposix4 in Solaris 2.6.
|
||||
AC_CHECK_LIB(posix4, clock_gettime)
|
||||
|
||||
AC_CHECK_FUNCS(memmove strdup psignal mktemp pstat_getdynamic \
|
||||
clock_gettime dup2 getcwd sigsetmask sigaction getgroups \
|
||||
setlinebuf seteuid setegid setreuid setregid pipe \
|
||||
strerror strsignal)
|
||||
AC_CHECK_SYMBOL(sys_siglist)
|
||||
AC_CHECK_SYMBOL(_sys_siglist)
|
||||
AC_FUNC_ALLOCA
|
||||
AC_FUNC_VFORK
|
||||
AC_FUNC_VPRINTF
|
||||
AC_FUNC_STRCOLL
|
||||
AC_FUNC_CLOSEDIR_VOID
|
||||
AC_FUNC_SETVBUF_REVERSED
|
||||
AC_FUNC_GETLOADAVG
|
||||
AC_FUNC_STRCOLL
|
||||
AC_FUNC_SELECT
|
||||
AC_CHECK_LIB(kstat, kstat_open)
|
||||
|
||||
# Check out the wait reality.
|
||||
AC_CHECK_HEADERS(sys/wait.h) AC_CHECK_FUNCS(waitpid wait3)
|
||||
AC_CHECK_HEADERS(sys/wait.h)
|
||||
AC_CHECK_FUNCS(waitpid wait3)
|
||||
AC_MSG_CHECKING(for union wait)
|
||||
AC_CACHE_VAL(make_cv_union_wait, [dnl
|
||||
AC_TRY_LINK([#include <sys/types.h>
|
||||
@@ -84,33 +106,158 @@ AC_DECL_SYS_SIGLIST
|
||||
AC_CHECK_LIB(sun, getpwnam)
|
||||
|
||||
AC_SUBST(REMOTE) REMOTE=stub
|
||||
AC_ARG_WITH(customs, [export jobs with the Customs daemon (NOT SUPPORTED)],
|
||||
[REMOTE=cstms LIBS="$LIBS libcustoms.a"])
|
||||
make_try_customs=no
|
||||
AC_ARG_WITH(customs,
|
||||
[ --with-customs=DIR Enable remote jobs via Customs--see README.customs],
|
||||
[case "$withval" in
|
||||
n|no) ;;
|
||||
*) make_cppflags="$CPPFLAGS"
|
||||
case "$withval" in
|
||||
y|ye|yes) ;;
|
||||
*) CPPFLAGS="$CPPFLAGS -I$with_customs/include/customs"
|
||||
make_ldflags="$LDFLAGS -L$with_customs/lib" ;;
|
||||
esac
|
||||
CF_NETLIBS
|
||||
AC_CHECK_HEADER(customs.h,
|
||||
REMOTE=cstms
|
||||
LIBS="$LIBS -lcustoms" LDFLAGS="$make_ldflags",
|
||||
with_customs=no
|
||||
CPPFLAGS="$make_cppflags" make_badcust=yes)
|
||||
;;
|
||||
esac])
|
||||
|
||||
echo checking for location of SCCS get command
|
||||
dnl See if we can handle the job server feature, and if the user wants it.
|
||||
|
||||
AC_ARG_ENABLE(job-server,
|
||||
[ --disable-job-server Disallow recursive make communication during -jN],
|
||||
[make_cv_job_server="$enableval" user_job_server="$enableval"],
|
||||
[make_cv_job_server="yes"])
|
||||
|
||||
has_wait_nohang=yes
|
||||
case "$ac_cv_func_waitpid/$ac_cv_func_wait3" in
|
||||
no/no) has_wait_nohang=no ;;
|
||||
esac
|
||||
|
||||
case "$ac_cv_func_pipe/$ac_cv_func_sigaction/$has_wait_nohang/$make_cv_job_server" in
|
||||
yes/yes/yes/yes) AC_DEFINE(MAKE_JOBSERVER) ;;
|
||||
esac
|
||||
|
||||
dnl Allow building with dmalloc
|
||||
|
||||
AC_ARG_ENABLE(dmalloc,
|
||||
[ --enable-dmalloc Enable support for the dmalloc debugging library],
|
||||
[make_cv_dmalloc="$enableval"],
|
||||
[make_cv_dmalloc="no"])
|
||||
|
||||
case "$make_cv_dmalloc" in
|
||||
yes) AC_CHECK_HEADERS(dmalloc.h)
|
||||
AC_CHECK_LIB(dmalloc, dmalloc_shutdown)
|
||||
CPPFLAGS="$CPPFLAGS -DDMALLOC_FUNC_CHECK" ;;
|
||||
esac
|
||||
|
||||
AC_CACHE_CHECK(for location of SCCS get command, make_cv_path_sccs_get, [
|
||||
if test -f /usr/sccs/get; then
|
||||
SCCS_GET=/usr/sccs/get
|
||||
AC_DEFINE(SCCS_GET, "/usr/sccs/get")
|
||||
make_cv_path_sccs_get=/usr/sccs/get
|
||||
else
|
||||
SCCS_GET=get
|
||||
AC_DEFINE(SCCS_GET, "get")
|
||||
fi
|
||||
make_cv_path_sccs_get=get
|
||||
fi])
|
||||
AC_DEFINE_UNQUOTED(SCCS_GET,["$make_cv_path_sccs_get"])
|
||||
|
||||
ac_clean_files="$ac_clean_files s.conftest conftoast" # Remove these later.
|
||||
if ( /usr/sccs/admin -n s.conftest || admin -n s.conftest ) >/dev/null 2>&1 &&
|
||||
test -f s.conftest; then
|
||||
# We successfully created an SCCS file.
|
||||
echo checking if SCCS get command understands -G
|
||||
if $SCCS_GET -Gconftoast s.conftest >/dev/null 2>&1 &&
|
||||
test -f conftoast; then
|
||||
AC_DEFINE(SCCS_GET_MINUS_G)
|
||||
fi
|
||||
AC_CACHE_CHECK(if SCCS get command understands -G, make_cv_sys_get_minus_G, [
|
||||
if $make_cv_path_sccs_get -Gconftoast s.conftest >/dev/null 2>&1 &&
|
||||
test -f conftoast; then
|
||||
make_cv_sys_get_minus_G=yes
|
||||
else
|
||||
make_cv_sys_get_minus_G=no
|
||||
fi])
|
||||
case "$make_cv_sys_get_minus_G" in
|
||||
yes) AC_DEFINE(SCCS_GET_MINUS_G);;
|
||||
esac
|
||||
fi
|
||||
rm -f s.conftest conftoast
|
||||
|
||||
AC_OUTPUT(Makefile build.sh, [
|
||||
# Makefile uses this timestamp file to know when to remake Makefile,
|
||||
# build.sh, and glob/Makefile.
|
||||
touch stamp-config])
|
||||
AC_MSG_CHECKING(if system libc has GNU glob)
|
||||
AC_CACHE_VAL(make_cv_sys_gnu_glob, [
|
||||
AC_TRY_CPP([
|
||||
#include <features.h>
|
||||
#include <glob.h>
|
||||
#include <fnmatch.h>
|
||||
|
||||
#define GLOB_INTERFACE_VERSION 1
|
||||
#if defined _LIBC || !defined __GNU_LIBRARY__ || __GNU_LIBRARY__ <= 1
|
||||
# error no gnu glob
|
||||
#else
|
||||
# include <gnu-versions.h>
|
||||
# if _GNU_GLOB_INTERFACE_VERSION != GLOB_INTERFACE_VERSION
|
||||
# error no gnu glob
|
||||
# endif
|
||||
#endif
|
||||
], make_cv_sys_gnu_glob=yes, make_cv_sys_gnu_glob=no)])
|
||||
case "$make_cv_sys_gnu_glob" in
|
||||
yes) AC_MSG_RESULT(yes) ;;
|
||||
no) AC_MSG_RESULT([no; using local copy])
|
||||
CPPFLAGS="$CPPFLAGS -I$srcdir/glob"
|
||||
AC_SUBST(GLOBLIB) GLOBLIB=glob/libglob.a
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
MAINT_MAKEFILE=/dev/null
|
||||
if test -r $srcdir/maintMakefile; then
|
||||
MAINT_MAKEFILE="$srcdir/maintMakefile"
|
||||
fi
|
||||
AC_SUBST_FILE(MAINT_MAKEFILE)
|
||||
|
||||
AC_OUTPUT(build.sh Makefile glob/Makefile)
|
||||
|
||||
dnl If we don't yet have build.sh.in, build.sh is a bogus 0-length file
|
||||
dnl so remove it.
|
||||
|
||||
test -f build.sh.in || rm -f build.sh
|
||||
|
||||
|
||||
case "$make_badcust" in
|
||||
yes) echo
|
||||
echo "WARNING: --with-customs specified but no customs.h could be found;"
|
||||
echo " disabling Customs support."
|
||||
echo ;;
|
||||
esac
|
||||
|
||||
case "$with_customs" in
|
||||
""|n|no|y|ye|yes) ;;
|
||||
*) if test -f "$with_customs/lib/libcustoms.a"; then
|
||||
:
|
||||
else
|
||||
echo
|
||||
echo "WARNING: \`$with_customs/lib' does not appear to contain the"
|
||||
echo " Customs library. You must build and install Customs"
|
||||
echo " before compiling GNU make."
|
||||
echo
|
||||
fi ;;
|
||||
esac
|
||||
|
||||
case "$has_wait_nohang" in
|
||||
no) echo
|
||||
echo "WARNING: Your system has neither waitpid() nor wait3()."
|
||||
echo " Without one of these, signal handling is unreliable."
|
||||
echo " You should be aware that running GNU make with -j"
|
||||
echo " could result in erratic behavior."
|
||||
echo ;;
|
||||
esac
|
||||
|
||||
case "$make_cv_job_server/$user_job_server" in
|
||||
no/yes) echo
|
||||
echo "WARNING: Make job server requires a POSIX-ish system that"
|
||||
echo " supports the pipe(), sigaction(), and either"
|
||||
echo " waitpid() or wait3() functions. Your system doesn't"
|
||||
echo " appear to provide one or more of those."
|
||||
echo " Disabling job server support."
|
||||
echo ;;
|
||||
esac
|
||||
|
||||
dnl Local Variables:
|
||||
dnl comment-start: "dnl "
|
||||
|
||||
170
default.c
170
default.c
@@ -1,5 +1,5 @@
|
||||
/* Data base of default implicit rules for GNU Make.
|
||||
Copyright (C) 1988, 89, 90, 91, 92, 93, 94, 1995 Free Software Foundation, Inc.
|
||||
Copyright (C) 1988,89,90,91,92,93,94,95,96 Free Software Foundation, Inc.
|
||||
This file is part of GNU Make.
|
||||
|
||||
GNU Make is free software; you can redistribute it and/or modify
|
||||
@@ -14,12 +14,14 @@ 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. */
|
||||
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
#include "make.h"
|
||||
#include "rule.h"
|
||||
#include "dep.h"
|
||||
#include "file.h"
|
||||
#include "filedef.h"
|
||||
#include "job.h"
|
||||
#include "commands.h"
|
||||
#include "variable.h"
|
||||
|
||||
@@ -35,9 +37,15 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||
a `.c' or `.p' or ... file rather than from a .s file. */
|
||||
|
||||
static char default_suffixes[]
|
||||
= ".out .a .ln .o .c .cc .C .p .f .F .r .y .l .s .S \
|
||||
#ifdef VMS
|
||||
= ".exe .olb .ln .obj .c .cc .pas .p .for .f .r .y .l .mar \
|
||||
.mod .sym .def .h .info .dvi .tex .texinfo .texi .txinfo \
|
||||
.w .ch .cweb .web .com .sh .elc .el";
|
||||
#else
|
||||
= ".out .a .ln .o .c .cc .C .cpp .p .f .F .r .y .l .s .S \
|
||||
.mod .sym .def .h .info .dvi .tex .texinfo .texi .txinfo \
|
||||
.w .ch .web .sh .elc .el";
|
||||
#endif
|
||||
|
||||
static struct pspec default_pattern_rules[] =
|
||||
{
|
||||
@@ -47,9 +55,13 @@ static struct pspec default_pattern_rules[] =
|
||||
/* The X.out rules are only in BSD's default set because
|
||||
BSD Make has no null-suffix rules, so `foo.out' and
|
||||
`foo' are the same thing. */
|
||||
#ifdef VMS
|
||||
{ "%.exe", "%",
|
||||
"copy $< $@" },
|
||||
#else
|
||||
{ "%.out", "%",
|
||||
"@rm -f $@ \n cp $< $@" },
|
||||
|
||||
#endif
|
||||
/* Syntax is "ctangle foo.w foo.ch foo.c". */
|
||||
{ "%.c", "%.w %.ch",
|
||||
"$(CTANGLE) $^ $@" },
|
||||
@@ -61,23 +73,80 @@ static struct pspec default_pattern_rules[] =
|
||||
|
||||
static struct pspec default_terminal_rules[] =
|
||||
{
|
||||
#ifdef VMS
|
||||
/* RCS. */
|
||||
{ "%", "%$$5lv", /* Multinet style */
|
||||
"if f$$search($@) .nes. \"\" then +$(CHECKOUT,v)" },
|
||||
{ "%", "[.$$rcs]%$$5lv", /* Multinet style */
|
||||
"if f$$search($@) .nes. \"\" then +$(CHECKOUT,v)" },
|
||||
{ "%", "%_v", /* Normal style */
|
||||
"if f$$search($@) .nes. \"\" then +$(CHECKOUT,v)" },
|
||||
{ "%", "[.rcs]%_v", /* Normal style */
|
||||
"if f$$search($@) .nes. \"\" then +$(CHECKOUT,v)" },
|
||||
|
||||
/* SCCS. */
|
||||
/* ain't no SCCS on vms */
|
||||
#else
|
||||
/* RCS. */
|
||||
{ "%", "%,v",
|
||||
"+$(CHECKOUT,v)" },
|
||||
"$(CHECKOUT,v)" },
|
||||
{ "%", "RCS/%,v",
|
||||
"+$(CHECKOUT,v)" },
|
||||
"$(CHECKOUT,v)" },
|
||||
{ "%", "RCS/%",
|
||||
"$(CHECKOUT,v)" },
|
||||
|
||||
/* SCCS. */
|
||||
{ "%", "s.%",
|
||||
"$(GET) $(GFLAGS) $(SCCS_OUTPUT_OPTION) $<" },
|
||||
{ "%", "SCCS/s.%",
|
||||
"$(GET) $(GFLAGS) $(SCCS_OUTPUT_OPTION) $<" },
|
||||
|
||||
#endif /* !VMS */
|
||||
{ 0, 0, 0 }
|
||||
};
|
||||
|
||||
static char *default_suffix_rules[] =
|
||||
{
|
||||
#ifdef VMS
|
||||
".obj.exe",
|
||||
"$(LINK.obj) $^ $(LOADLIBES) $(LDLIBS) /exe=$@",
|
||||
".mar.exe",
|
||||
"$(LINK.mar) $^ $(LOADLIBES) $(LDLIBS) /exe=$@",
|
||||
".c.exe",
|
||||
"$(COMPILE.c) $^ \n $(LINK.obj) $(subst .c,.obj,$^) $(LOADLIBES) $(LDLIBS) /exe=$@",
|
||||
".cc.exe",
|
||||
"$(COMPILE.cc) $^ \n $(LINK.obj) $(subst .cc,.obj,$^) $(LOADLIBES) $(LDLIBS) /exe=$@",
|
||||
".for.exe",
|
||||
"$(COMPILE.for) $^ \n $(LINK.obj) $(subst .for,.obj,$^) $(LOADLIBES) $(LDLIBS) /exe=$@",
|
||||
".pas.exe",
|
||||
"$(COMPILE.pas) $^ \n $(LINK.obj) $(subst .pas,.obj,$^) $(LOADLIBES) $(LDLIBS) /exe=$@",
|
||||
|
||||
".com",
|
||||
"copy $< >$@",
|
||||
|
||||
".mar.obj",
|
||||
"$(COMPILE.mar) /obj=$@ $<",
|
||||
".c.obj",
|
||||
"$(COMPILE.c) /obj=$@ $<",
|
||||
".cc.obj",
|
||||
"$(COMPILE.cc) /obj=$@ $<",
|
||||
".for.obj",
|
||||
"$(COMPILE.for) /obj=$@ $<",
|
||||
".pas.obj",
|
||||
"$(COMPILE.pas) /obj=$@ $<",
|
||||
|
||||
".y.c",
|
||||
"$(YACC.y) $< \n rename y_tab.c $@",
|
||||
".l.c",
|
||||
"$(LEX.l) $< \n rename lexyy.c $@",
|
||||
|
||||
".texinfo.info",
|
||||
"$(MAKEINFO) $<",
|
||||
|
||||
".tex.dvi",
|
||||
"$(TEX) $<",
|
||||
|
||||
#else /* ! VMS */
|
||||
|
||||
".o",
|
||||
"$(LINK.o) $^ $(LOADLIBES) $(LDLIBS) -o $@",
|
||||
".s",
|
||||
@@ -90,6 +159,8 @@ static char *default_suffix_rules[] =
|
||||
"$(LINK.cc) $^ $(LOADLIBES) $(LDLIBS) -o $@",
|
||||
".C",
|
||||
"$(LINK.C) $^ $(LOADLIBES) $(LDLIBS) -o $@",
|
||||
".cpp",
|
||||
"$(LINK.cpp) $^ $(LOADLIBES) $(LDLIBS) -o $@",
|
||||
".f",
|
||||
"$(LINK.f) $^ $(LOADLIBES) $(LDLIBS) -o $@",
|
||||
".p",
|
||||
@@ -112,19 +183,21 @@ static char *default_suffix_rules[] =
|
||||
".S.o",
|
||||
"$(COMPILE.S) -o $@ $<",
|
||||
".c.o",
|
||||
"$(COMPILE.c) $< $(OUTPUT_OPTION)",
|
||||
"$(COMPILE.c) $(OUTPUT_OPTION) $<",
|
||||
".cc.o",
|
||||
"$(COMPILE.cc) $< $(OUTPUT_OPTION)",
|
||||
"$(COMPILE.cc) $(OUTPUT_OPTION) $<",
|
||||
".C.o",
|
||||
"$(COMPILE.C) $< $(OUTPUT_OPTION)",
|
||||
"$(COMPILE.C) $(OUTPUT_OPTION) $<",
|
||||
".cpp.o",
|
||||
"$(COMPILE.cpp) $(OUTPUT_OPTION) $<",
|
||||
".f.o",
|
||||
"$(COMPILE.f) $< $(OUTPUT_OPTION)",
|
||||
"$(COMPILE.f) $(OUTPUT_OPTION) $<",
|
||||
".p.o",
|
||||
"$(COMPILE.p) $< $(OUTPUT_OPTION)",
|
||||
"$(COMPILE.p) $(OUTPUT_OPTION) $<",
|
||||
".F.o",
|
||||
"$(COMPILE.F) $< $(OUTPUT_OPTION)",
|
||||
"$(COMPILE.F) $(OUTPUT_OPTION) $<",
|
||||
".r.o",
|
||||
"$(COMPILE.r) $< $(OUTPUT_OPTION)",
|
||||
"$(COMPILE.r) $(OUTPUT_OPTION) $<",
|
||||
".mod.o",
|
||||
"$(COMPILE.mod) -o $@ $<",
|
||||
|
||||
@@ -149,9 +222,9 @@ static char *default_suffix_rules[] =
|
||||
"@$(RM) $@ \n $(LEX.l) $< > $@",
|
||||
|
||||
".F.f",
|
||||
"$(PREPROCESS.F) $< $(OUTPUT_OPTION)",
|
||||
"$(PREPROCESS.F) $(OUTPUT_OPTION) $<",
|
||||
".r.f",
|
||||
"$(PREPROCESS.r) $< $(OUTPUT_OPTION)",
|
||||
"$(PREPROCESS.r) $(OUTPUT_OPTION) $<",
|
||||
|
||||
/* This might actually make lex.yy.c if there's no %R%
|
||||
directive in $*.l, but in that case why were you
|
||||
@@ -195,11 +268,52 @@ static char *default_suffix_rules[] =
|
||||
".web.tex",
|
||||
"$(WEAVE) $<",
|
||||
|
||||
#endif /* !VMS */
|
||||
|
||||
0, 0,
|
||||
};
|
||||
|
||||
static char *default_variables[] =
|
||||
{
|
||||
#ifdef VMS
|
||||
"AR", "library/obj",
|
||||
"ARFLAGS", "/replace",
|
||||
"AS", "macro",
|
||||
"CC", "cc",
|
||||
"C++", "gcc/plus",
|
||||
"CXX", "gcc/plus",
|
||||
"CO", "co",
|
||||
"CPP", "$(CC) /preprocess_only",
|
||||
"FC", "fortran",
|
||||
/* System V uses these, so explicit rules using them should work.
|
||||
However, there is no way to make implicit rules use them and FC. */
|
||||
"F77", "$(FC)",
|
||||
"F77FLAGS", "$(FFLAGS)",
|
||||
"LD", "link",
|
||||
"LEX", "lex",
|
||||
"PC", "pascal",
|
||||
"YACC", "yacc", /* Or "bison -y" */
|
||||
"MAKEINFO", "makeinfo",
|
||||
"TEX", "tex",
|
||||
"TEXINDEX", "texindex",
|
||||
|
||||
"RM", "delete/nolog",
|
||||
|
||||
"LINK.obj", "$(LD) $(LDFLAGS)",
|
||||
"COMPILE.c", "$(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH)",
|
||||
"COMPILE.cc", "$(C++) $(C++FLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c",
|
||||
"YACC.y", "$(YACC) $(YFLAGS)",
|
||||
"LEX.l", "$(LEX) $(LFLAGS)",
|
||||
"COMPILE.for", "$(FC) $(FFLAGS) $(TARGET_ARCH)",
|
||||
"COMPILE.pas", "$(PC) $(PFLAGS) $(CPPFLAGS) $(TARGET_ARCH)",
|
||||
"COMPILE.mar", "$(AS) $(ASFLAGS) $(TARGET_MACH)",
|
||||
"LINT.c", "$(LINT) $(LINTFLAGS) $(CPPFLAGS) $(TARGET_ARCH)",
|
||||
|
||||
"MV", "rename/new_version",
|
||||
"CP", "copy",
|
||||
|
||||
#else /* !VMS */
|
||||
|
||||
"AR", "ar",
|
||||
"ARFLAGS", "rv",
|
||||
"AS", "as",
|
||||
@@ -214,8 +328,8 @@ static char *default_variables[] =
|
||||
/* This expands to $(CO) $(COFLAGS) $< $@ if $@ does not exist,
|
||||
and to the empty string if $@ does exist. */
|
||||
"CHECKOUT,v",
|
||||
"$(patsubst $@-noexist,$(CO) $(COFLAGS) $< $@,\
|
||||
$(filter-out $@,$(firstword $(wildcard $@) $@-noexist)))",
|
||||
"+$(patsubst $@-noexist,$(CO) $(COFLAGS) $< $@,\
|
||||
$(filter-out $@,$(firstword $(wildcard $@) $@-noexist)))",
|
||||
|
||||
"CO", "co",
|
||||
"CPP", "$(CC) -E",
|
||||
@@ -279,8 +393,10 @@ static char *default_variables[] =
|
||||
"LINK.c", "$(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) $(TARGET_ARCH)",
|
||||
"COMPILE.cc", "$(CXX) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c",
|
||||
"COMPILE.C", "$(COMPILE.cc)",
|
||||
"COMPILE.cpp", "$(COMPILE.cc)",
|
||||
"LINK.cc", "$(CXX) $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) $(TARGET_ARCH)",
|
||||
"LINK.C", "$(LINK.cc)",
|
||||
"LINK.cpp", "$(LINK.cc)",
|
||||
"YACC.y", "$(YACC) $(YFLAGS)",
|
||||
"LEX.l", "$(LEX) $(LFLAGS) -t",
|
||||
"COMPILE.f", "$(FC) $(FFLAGS) $(TARGET_ARCH) -c",
|
||||
@@ -310,6 +426,17 @@ static char *default_variables[] =
|
||||
"SCCS_OUTPUT_OPTION", "-G$@",
|
||||
#endif
|
||||
|
||||
#ifdef _AMIGA
|
||||
".LIBPATTERNS", "%.lib",
|
||||
#else
|
||||
#ifdef __MSDOS__
|
||||
".LIBPATTERNS", "lib%.a $(DJDIR)/lib/lib%.a",
|
||||
#else
|
||||
".LIBPATTERNS", "lib%.so lib%.a",
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif /* !VMS */
|
||||
0, 0
|
||||
};
|
||||
|
||||
@@ -352,7 +479,7 @@ install_default_suffix_rules ()
|
||||
if (f->cmds == 0)
|
||||
{
|
||||
f->cmds = (struct commands *) xmalloc (sizeof (struct commands));
|
||||
f->cmds->filename = 0;
|
||||
f->cmds->fileinfo.filenm = 0;
|
||||
f->cmds->commands = s[1];
|
||||
f->cmds->command_lines = 0;
|
||||
}
|
||||
@@ -382,6 +509,9 @@ define_default_variables ()
|
||||
{
|
||||
register char **s;
|
||||
|
||||
if (no_builtin_variables_flag)
|
||||
return;
|
||||
|
||||
for (s = default_variables; *s != 0; s += 2)
|
||||
(void) define_variable (s[0], strlen (s[0]), s[1], o_default, 1);
|
||||
}
|
||||
|
||||
40
dep.h
40
dep.h
@@ -1,5 +1,5 @@
|
||||
/* Definitions of dependency data structures for GNU Make.
|
||||
Copyright (C) 1988, 1989, 1991, 1992, 1993 Free Software Foundation, Inc.
|
||||
Copyright (C) 1988, 1989, 1991, 1992, 1993, 1996 Free Software Foundation, Inc.
|
||||
This file is part of GNU Make.
|
||||
|
||||
GNU Make is free software; you can redistribute it and/or modify
|
||||
@@ -14,7 +14,18 @@ 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. */
|
||||
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
/* Flag bits for the second argument to `read_makefile'.
|
||||
These flags are saved in the `changed' field of each
|
||||
`struct dep' in the chain returned by `read_all_makefiles'. */
|
||||
|
||||
#define RM_NO_DEFAULT_GOAL (1 << 0) /* Do not set default goal. */
|
||||
#define RM_INCLUDED (1 << 1) /* Search makefile search path. */
|
||||
#define RM_DONTCARE (1 << 2) /* No error if it doesn't exist. */
|
||||
#define RM_NO_TILDE (1 << 3) /* Don't expand ~ in file name. */
|
||||
#define RM_NOFLAG 0
|
||||
|
||||
/* Structure representing one dependency of a file.
|
||||
Each struct file's `deps' points to a chain of these,
|
||||
@@ -40,11 +51,16 @@ struct nameseq
|
||||
};
|
||||
|
||||
|
||||
extern struct nameseq *multi_glob (), *parse_file_seq ();
|
||||
extern char *tilde_expand ();
|
||||
extern struct nameseq *multi_glob PARAMS ((struct nameseq *chain, unsigned int size));
|
||||
#ifdef VMS
|
||||
extern struct nameseq *parse_file_seq ();
|
||||
#else
|
||||
extern struct nameseq *parse_file_seq PARAMS ((char **stringp, int stopchar, unsigned int size, int strip));
|
||||
#endif
|
||||
extern char *tilde_expand PARAMS ((char *name));
|
||||
|
||||
#ifndef NO_ARCHIVES
|
||||
extern struct nameseq *ar_glob ();
|
||||
extern struct nameseq *ar_glob PARAMS ((char *arname, char *member_pattern, unsigned int size));
|
||||
#endif
|
||||
|
||||
#ifndef iAPX286
|
||||
@@ -54,13 +70,7 @@ extern struct nameseq *ar_glob ();
|
||||
extern char *dep_name ();
|
||||
#endif
|
||||
|
||||
extern struct dep *read_all_makefiles ();
|
||||
|
||||
/* Flag bits for the second argument to `read_makefile'.
|
||||
These flags are saved in the `changed' field of each
|
||||
`struct dep' in the chain returned by `read_all_makefiles'. */
|
||||
#define RM_NO_DEFAULT_GOAL (1 << 0) /* Do not set default goal. */
|
||||
#define RM_INCLUDED (1 << 1) /* Search makefile search path. */
|
||||
#define RM_DONTCARE (1 << 2) /* No error if it doesn't exist. */
|
||||
#define RM_NO_TILDE (1 << 3) /* Don't expand ~ in file name. */
|
||||
#define RM_NOFLAG 0
|
||||
extern struct dep *copy_dep_chain PARAMS ((struct dep *d));
|
||||
extern struct dep *read_all_makefiles PARAMS ((char **makefiles));
|
||||
extern int update_goal_chain PARAMS ((struct dep *goals, int makefiles));
|
||||
extern void uniquize_deps PARAMS ((struct dep *));
|
||||
|
||||
604
dir.c
604
dir.c
@@ -1,5 +1,5 @@
|
||||
/* Directory hashing for GNU Make.
|
||||
Copyright (C) 1988, 89, 91, 92, 93, 94, 95 Free Software Foundation, Inc.
|
||||
Copyright (C) 1988,89,91,92,93,94,95,96,97 Free Software Foundation, Inc.
|
||||
This file is part of GNU Make.
|
||||
|
||||
GNU Make is free software; you can redistribute it and/or modify
|
||||
@@ -14,30 +14,38 @@ 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. */
|
||||
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
#include "make.h"
|
||||
|
||||
#if defined (POSIX) || defined (HAVE_DIRENT_H) || defined (__GNU_LIBRARY__)
|
||||
#include <dirent.h>
|
||||
#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 HAVE_D_NAMLEN
|
||||
#ifdef HAVE_SYS_NDIR_H
|
||||
#include <sys/ndir.h>
|
||||
#endif /* HAVE_SYS_NDIR_H */
|
||||
#ifdef HAVE_SYS_DIR_H
|
||||
#include <sys/dir.h>
|
||||
#endif /* HAVE_SYS_DIR_H */
|
||||
#ifdef HAVE_NDIR_H
|
||||
#include <ndir.h>
|
||||
#endif /* HAVE_NDIR_H */
|
||||
#endif /* POSIX or HAVE_DIRENT_H or __GNU_LIBRARY__. */
|
||||
#ifdef HAVE_DIRENT_H
|
||||
# include <dirent.h>
|
||||
# define NAMLEN(dirent) strlen((dirent)->d_name)
|
||||
#else
|
||||
# define dirent direct
|
||||
# define NAMLEN(dirent) (dirent)->d_namlen
|
||||
# ifdef HAVE_SYS_NDIR_H
|
||||
# include <sys/ndir.h>
|
||||
# endif
|
||||
# ifdef HAVE_SYS_DIR_H
|
||||
# include <sys/dir.h>
|
||||
# endif
|
||||
# ifdef HAVE_NDIR_H
|
||||
# include <ndir.h>
|
||||
# endif
|
||||
# ifdef HAVE_VMSDIR_H
|
||||
# include "vmsdir.h"
|
||||
# endif /* HAVE_VMSDIR_H */
|
||||
#endif
|
||||
|
||||
#if defined (POSIX) && !defined (__GNU_LIBRARY__)
|
||||
/* In GNU systems, <dirent.h> defines this macro for us. */
|
||||
#ifdef _D_NAMLEN
|
||||
#undef NAMLEN
|
||||
#define NAMLEN(d) _D_NAMLEN(d)
|
||||
#endif
|
||||
|
||||
#if (defined (POSIX) || defined (WINDOWS32)) && !defined (__GNU_LIBRARY__)
|
||||
/* Posix does not require that the d_ino field be present, and some
|
||||
systems do not provide it. */
|
||||
#define REAL_DIR_ENTRY(dp) 1
|
||||
@@ -49,6 +57,12 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||
|
||||
#ifdef __MSDOS__
|
||||
#include <ctype.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
/* If it's MSDOS that doesn't have _USE_LFN, disable LFN support. */
|
||||
#ifndef _USE_LFN
|
||||
#define _USE_LFN 0
|
||||
#endif
|
||||
|
||||
static char *
|
||||
dosify (filename)
|
||||
@@ -58,9 +72,11 @@ dosify (filename)
|
||||
char *df;
|
||||
int i;
|
||||
|
||||
if (filename == 0)
|
||||
return 0;
|
||||
if (filename == 0 || _USE_LFN)
|
||||
return filename;
|
||||
|
||||
/* FIXME: what about filenames which violate
|
||||
8+3 constraints, like "config.h.in", or ".emacs"? */
|
||||
if (strpbrk (filename, "\"*+,;<=>?[\\]|") != 0)
|
||||
return filename;
|
||||
|
||||
@@ -88,7 +104,105 @@ dosify (filename)
|
||||
*df = 0;
|
||||
return dos_filename;
|
||||
}
|
||||
#endif /* __MSDOS__ */
|
||||
|
||||
#ifdef WINDOWS32
|
||||
#include "pathstuff.h"
|
||||
#endif
|
||||
|
||||
#ifdef _AMIGA
|
||||
#include <ctype.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_CASE_INSENSITIVE_FS
|
||||
static char *
|
||||
downcase (filename)
|
||||
char *filename;
|
||||
{
|
||||
#ifdef _AMIGA
|
||||
static char new_filename[136];
|
||||
#else
|
||||
static char new_filename[PATH_MAX];
|
||||
#endif
|
||||
char *df;
|
||||
int i;
|
||||
|
||||
if (filename == 0)
|
||||
return 0;
|
||||
|
||||
df = new_filename;
|
||||
|
||||
/* First, transform the name part. */
|
||||
for (i = 0; *filename != '\0'; ++i)
|
||||
{
|
||||
*df++ = tolower (*filename);
|
||||
++filename;
|
||||
}
|
||||
|
||||
*df = 0;
|
||||
|
||||
return new_filename;
|
||||
}
|
||||
#endif /* HAVE_CASE_INSENSITIVE_FS */
|
||||
|
||||
#ifdef VMS
|
||||
|
||||
static int
|
||||
vms_hash (name)
|
||||
char *name;
|
||||
{
|
||||
int h = 0;
|
||||
int g;
|
||||
|
||||
while (*name)
|
||||
{
|
||||
h = (h << 4) + *name++;
|
||||
g = h & 0xf0000000;
|
||||
if (g)
|
||||
{
|
||||
h = h ^ (g >> 24);
|
||||
h = h ^ g;
|
||||
}
|
||||
}
|
||||
return h;
|
||||
}
|
||||
|
||||
/* fake stat entry for a directory */
|
||||
static int
|
||||
vmsstat_dir (name, st)
|
||||
char *name;
|
||||
struct stat *st;
|
||||
{
|
||||
char *s;
|
||||
int h;
|
||||
DIR *dir;
|
||||
|
||||
dir = opendir (name);
|
||||
if (dir == 0)
|
||||
return -1;
|
||||
closedir (dir);
|
||||
s = strchr (name, ':'); /* find device */
|
||||
if (s)
|
||||
{
|
||||
*s++ = 0;
|
||||
st->st_dev = (char *)vms_hash (name);
|
||||
h = vms_hash (s);
|
||||
*(s-1) = ':';
|
||||
}
|
||||
else
|
||||
{
|
||||
st->st_dev = 0;
|
||||
s = name;
|
||||
h = vms_hash (s);
|
||||
}
|
||||
|
||||
st->st_ino[0] = h & 0xff;
|
||||
st->st_ino[1] = h & 0xff00;
|
||||
st->st_ino[2] = h >> 16;
|
||||
|
||||
return 0;
|
||||
}
|
||||
#endif /* VMS */
|
||||
|
||||
/* Hash table of directories. */
|
||||
|
||||
@@ -100,8 +214,29 @@ struct directory_contents
|
||||
{
|
||||
struct directory_contents *next;
|
||||
|
||||
int dev, ino; /* Device and inode numbers of this dir. */
|
||||
|
||||
dev_t dev; /* Device and inode numbers of this dir. */
|
||||
#ifdef WINDOWS32
|
||||
/*
|
||||
* Inode means nothing on WINDOWS32. Even file key information is
|
||||
* unreliable because it is random per file open and undefined
|
||||
* for remote filesystems. The most unique attribute I can
|
||||
* come up with is the fully qualified name of the directory. Beware
|
||||
* though, this is also unreliable. I'm open to suggestion on a better
|
||||
* way to emulate inode.
|
||||
*/
|
||||
char *path_key;
|
||||
int mtime; /* controls check for stale directory cache */
|
||||
int fs_flags; /* FS_FAT, FS_NTFS, ... */
|
||||
#define FS_FAT 0x1
|
||||
#define FS_NTFS 0x2
|
||||
#define FS_UNKNOWN 0x4
|
||||
#else
|
||||
#ifdef VMS
|
||||
ino_t ino[3];
|
||||
#else
|
||||
ino_t ino;
|
||||
#endif
|
||||
#endif /* WINDOWS32 */
|
||||
struct dirfile **files; /* Files in this directory. */
|
||||
DIR *dirstream; /* Stream reading this directory. */
|
||||
};
|
||||
@@ -145,7 +280,8 @@ struct dirfile
|
||||
#define DIRFILE_BUCKETS 107
|
||||
#endif
|
||||
|
||||
static int dir_contents_file_exists_p ();
|
||||
static int dir_contents_file_exists_p PARAMS ((struct directory_contents *dir, char *filename));
|
||||
static struct directory *find_directory PARAMS ((char *name));
|
||||
|
||||
/* Find the directory named NAME and return its `struct directory'. */
|
||||
|
||||
@@ -156,13 +292,27 @@ find_directory (name)
|
||||
register unsigned int hash = 0;
|
||||
register char *p;
|
||||
register struct directory *dir;
|
||||
#ifdef WINDOWS32
|
||||
char* w32_path;
|
||||
char fs_label[BUFSIZ];
|
||||
char fs_type[BUFSIZ];
|
||||
long fs_serno;
|
||||
long fs_flags;
|
||||
long fs_len;
|
||||
#endif
|
||||
#ifdef VMS
|
||||
if ((*name == '.') && (*(name+1) == 0))
|
||||
name = "[]";
|
||||
else
|
||||
name = vmsify (name,1);
|
||||
#endif
|
||||
|
||||
for (p = name; *p != '\0'; ++p)
|
||||
HASH (hash, *p);
|
||||
HASHI (hash, *p);
|
||||
hash %= DIRECTORY_BUCKETS;
|
||||
|
||||
for (dir = directories[hash]; dir != 0; dir = dir->next)
|
||||
if (streq (dir->name, name))
|
||||
if (strieq (dir->name, name))
|
||||
break;
|
||||
|
||||
if (dir == 0)
|
||||
@@ -179,21 +329,57 @@ find_directory (name)
|
||||
/* The directory is not in the name hash table.
|
||||
Find its device and inode numbers, and look it up by them. */
|
||||
|
||||
#ifdef VMS
|
||||
if (vmsstat_dir (name, &st) < 0)
|
||||
#else
|
||||
|
||||
#ifdef WINDOWS32
|
||||
/* Remove any trailing '\'. Windows32 stat fails even on valid
|
||||
directories if they end in '\'. */
|
||||
if (p[-1] == '\\')
|
||||
p[-1] = '\0';
|
||||
#endif
|
||||
if (stat (name, &st) < 0)
|
||||
#endif
|
||||
{
|
||||
/* Couldn't stat the directory. Mark this by
|
||||
setting the `contents' member to a nil pointer. */
|
||||
dir->contents = 0;
|
||||
dir->contents = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Search the contents hash table; device and inode are the key. */
|
||||
|
||||
struct directory_contents *dc;
|
||||
|
||||
#ifdef WINDOWS32
|
||||
w32_path = w32ify(name, 1);
|
||||
hash = ((unsigned int) st.st_dev << 16) | (unsigned int) st.st_ctime;
|
||||
#else
|
||||
#ifdef VMS
|
||||
hash = ((unsigned int) st.st_dev << 16)
|
||||
| ((unsigned int) st.st_ino[0]
|
||||
+ (unsigned int) st.st_ino[1]
|
||||
+ (unsigned int) st.st_ino[2]);
|
||||
#else
|
||||
hash = ((unsigned int) st.st_dev << 16) | (unsigned int) st.st_ino;
|
||||
#endif
|
||||
#endif
|
||||
hash %= DIRECTORY_BUCKETS;
|
||||
|
||||
for (dc = directories_contents[hash]; dc != 0; dc = dc->next)
|
||||
if (dc->dev == st.st_dev && dc->ino == st.st_ino)
|
||||
#ifdef WINDOWS32
|
||||
if (strieq(dc->path_key, w32_path))
|
||||
#else
|
||||
if (dc->dev == st.st_dev
|
||||
#ifdef VMS
|
||||
&& dc->ino[0] == st.st_ino[0]
|
||||
&& dc->ino[1] == st.st_ino[1]
|
||||
&& dc->ino[2] == st.st_ino[2])
|
||||
#else
|
||||
&& dc->ino == st.st_ino)
|
||||
#endif
|
||||
#endif /* WINDOWS32 */
|
||||
break;
|
||||
|
||||
if (dc == 0)
|
||||
@@ -205,15 +391,46 @@ find_directory (name)
|
||||
|
||||
/* Enter it in the contents hash table. */
|
||||
dc->dev = st.st_dev;
|
||||
#ifdef WINDOWS32
|
||||
dc->path_key = xstrdup(w32_path);
|
||||
dc->mtime = st.st_mtime;
|
||||
|
||||
/*
|
||||
* NTFS is the only WINDOWS32 filesystem that bumps mtime
|
||||
* on a directory when files are added/deleted from
|
||||
* a directory.
|
||||
*/
|
||||
w32_path[3] = '\0';
|
||||
if (GetVolumeInformation(w32_path,
|
||||
fs_label, sizeof (fs_label),
|
||||
&fs_serno, &fs_len,
|
||||
&fs_flags, fs_type, sizeof (fs_type)) == FALSE)
|
||||
dc->fs_flags = FS_UNKNOWN;
|
||||
else if (!strcmp(fs_type, "FAT"))
|
||||
dc->fs_flags = FS_FAT;
|
||||
else if (!strcmp(fs_type, "NTFS"))
|
||||
dc->fs_flags = FS_NTFS;
|
||||
else
|
||||
dc->fs_flags = FS_UNKNOWN;
|
||||
#else
|
||||
#ifdef VMS
|
||||
dc->ino[0] = st.st_ino[0];
|
||||
dc->ino[1] = st.st_ino[1];
|
||||
dc->ino[2] = st.st_ino[2];
|
||||
#else
|
||||
dc->ino = st.st_ino;
|
||||
#endif
|
||||
#endif /* WINDOWS32 */
|
||||
dc->next = directories_contents[hash];
|
||||
directories_contents[hash] = dc;
|
||||
|
||||
dc->dirstream = opendir (name);
|
||||
if (dc->dirstream == 0)
|
||||
{
|
||||
/* Couldn't open the directory. Mark this by
|
||||
setting the `files' member to a nil pointer. */
|
||||
dc->files = 0;
|
||||
dc->files = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Allocate an array of buckets for files and zero it. */
|
||||
@@ -251,21 +468,36 @@ dir_contents_file_exists_p (dir, filename)
|
||||
register char *p;
|
||||
register struct dirfile *df;
|
||||
register struct dirent *d;
|
||||
#ifdef WINDOWS32
|
||||
struct stat st;
|
||||
int rehash = 0;
|
||||
#endif
|
||||
|
||||
if (dir == 0 || dir->files == 0)
|
||||
{
|
||||
/* The directory could not be stat'd or opened. */
|
||||
return 0;
|
||||
|
||||
return 0;
|
||||
}
|
||||
#ifdef __MSDOS__
|
||||
filename = dosify (filename);
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_CASE_INSENSITIVE_FS
|
||||
filename = downcase (filename);
|
||||
#endif
|
||||
|
||||
#ifdef VMS
|
||||
filename = vmsify (filename,0);
|
||||
#endif
|
||||
|
||||
hash = 0;
|
||||
if (filename != 0)
|
||||
{
|
||||
if (*filename == '\0')
|
||||
{
|
||||
/* Checking if the directory exists. */
|
||||
return 1;
|
||||
return 1;
|
||||
}
|
||||
|
||||
for (p = filename; *p != '\0'; ++p)
|
||||
HASH (hash, *p);
|
||||
@@ -274,16 +506,45 @@ dir_contents_file_exists_p (dir, filename)
|
||||
/* Search the list of hashed files. */
|
||||
|
||||
for (df = dir->files[hash]; df != 0; df = df->next)
|
||||
if (streq (df->name, filename))
|
||||
return !df->impossible;
|
||||
{
|
||||
if (strieq (df->name, filename))
|
||||
{
|
||||
return !df->impossible;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* The file was not found in the hashed list.
|
||||
Try to read the directory further. */
|
||||
|
||||
if (dir->dirstream == 0)
|
||||
{
|
||||
#ifdef WINDOWS32
|
||||
/*
|
||||
* Check to see if directory has changed since last read. FAT
|
||||
* filesystems force a rehash always as mtime does not change
|
||||
* on directories (ugh!).
|
||||
*/
|
||||
if (dir->path_key &&
|
||||
(dir->fs_flags & FS_FAT ||
|
||||
(stat(dir->path_key, &st) == 0 &&
|
||||
st.st_mtime > dir->mtime))) {
|
||||
|
||||
/* reset date stamp to show most recent re-process */
|
||||
dir->mtime = st.st_mtime;
|
||||
|
||||
/* make sure directory can still be opened */
|
||||
dir->dirstream = opendir(dir->path_key);
|
||||
|
||||
if (dir->dirstream)
|
||||
rehash = 1;
|
||||
else
|
||||
return 0; /* couldn't re-read - fail */
|
||||
} else
|
||||
#endif
|
||||
/* The directory has been all read in. */
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
while ((d = readdir (dir->dirstream)) != 0)
|
||||
{
|
||||
@@ -295,28 +556,43 @@ dir_contents_file_exists_p (dir, filename)
|
||||
if (!REAL_DIR_ENTRY (d))
|
||||
continue;
|
||||
|
||||
#ifdef HAVE_D_NAMLEN
|
||||
len = d->d_namlen;
|
||||
while (d->d_name[len - 1] == '\0')
|
||||
--len;
|
||||
#else
|
||||
len = strlen (d->d_name);
|
||||
#endif
|
||||
|
||||
len = NAMLEN (d);
|
||||
for (i = 0; i < len; ++i)
|
||||
HASH (newhash, d->d_name[i]);
|
||||
HASHI (newhash, d->d_name[i]);
|
||||
newhash %= DIRFILE_BUCKETS;
|
||||
#ifdef WINDOWS32
|
||||
/*
|
||||
* If re-reading a directory, check that this file isn't already
|
||||
* in the cache.
|
||||
*/
|
||||
if (rehash) {
|
||||
for (df = dir->files[newhash]; df != 0; df = df->next)
|
||||
if (streq(df->name, d->d_name))
|
||||
break;
|
||||
} else
|
||||
df = 0;
|
||||
|
||||
/*
|
||||
* If re-reading a directory, don't cache files that have
|
||||
* already been discovered.
|
||||
*/
|
||||
if (!df) {
|
||||
#endif
|
||||
|
||||
df = (struct dirfile *) xmalloc (sizeof (struct dirfile));
|
||||
df->next = dir->files[newhash];
|
||||
dir->files[newhash] = df;
|
||||
df->name = savestring (d->d_name, len);
|
||||
df->impossible = 0;
|
||||
|
||||
#ifdef WINDOWS32
|
||||
}
|
||||
#endif
|
||||
/* Check if the name matches the one we're searching for. */
|
||||
if (filename != 0
|
||||
&& newhash == hash && streq (d->d_name, filename))
|
||||
return 1;
|
||||
&& newhash == hash && strieq (d->d_name, filename))
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
/* If the directory has been completely read in,
|
||||
@@ -327,7 +603,6 @@ dir_contents_file_exists_p (dir, filename)
|
||||
closedir (dir->dirstream);
|
||||
dir->dirstream = 0;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -352,20 +627,55 @@ file_exists_p (name)
|
||||
{
|
||||
char *dirend;
|
||||
char *dirname;
|
||||
char *slash;
|
||||
|
||||
#ifndef NO_ARCHIVES
|
||||
if (ar_name (name))
|
||||
return ar_member_date (name) != (time_t) -1;
|
||||
#endif
|
||||
|
||||
#ifdef VMS
|
||||
dirend = rindex (name, ']');
|
||||
dirend++;
|
||||
if (dirend == (char *)1)
|
||||
return dir_file_exists_p ("[]", name);
|
||||
#else /* !VMS */
|
||||
dirend = rindex (name, '/');
|
||||
#if defined (WINDOWS32) || defined (__MSDOS__)
|
||||
/* Forward and backslashes might be mixed. We need the rightmost one. */
|
||||
{
|
||||
char *bslash = rindex(name, '\\');
|
||||
if (!dirend || bslash > dirend)
|
||||
dirend = bslash;
|
||||
/* The case of "d:file". */
|
||||
if (!dirend && name[0] && name[1] == ':')
|
||||
dirend = name + 1;
|
||||
}
|
||||
#endif /* WINDOWS32 || __MSDOS__ */
|
||||
if (dirend == 0)
|
||||
#ifndef _AMIGA
|
||||
return dir_file_exists_p (".", name);
|
||||
#else /* !VMS && !AMIGA */
|
||||
return dir_file_exists_p ("", name);
|
||||
#endif /* AMIGA */
|
||||
#endif /* VMS */
|
||||
|
||||
dirname = (char *) alloca (dirend - name + 1);
|
||||
bcopy (name, dirname, dirend - name);
|
||||
dirname[dirend - name] = '\0';
|
||||
return dir_file_exists_p (dirname, dirend + 1);
|
||||
slash = dirend;
|
||||
if (dirend == name)
|
||||
dirname = "/";
|
||||
else
|
||||
{
|
||||
#if defined (WINDOWS32) || defined (__MSDOS__)
|
||||
/* d:/ and d: are *very* different... */
|
||||
if (dirend < name + 3 && name[1] == ':' &&
|
||||
(*dirend == '/' || *dirend == '\\' || *dirend == ':'))
|
||||
dirend++;
|
||||
#endif
|
||||
dirname = (char *) alloca (dirend - name + 1);
|
||||
bcopy (name, dirname, dirend - name);
|
||||
dirname[dirend - name] = '\0';
|
||||
}
|
||||
return dir_file_exists_p (dirname, slash + 1);
|
||||
}
|
||||
|
||||
/* Mark FILENAME as `impossible' for `file_impossible_p'.
|
||||
@@ -382,20 +692,55 @@ file_impossible (filename)
|
||||
register struct directory *dir;
|
||||
register struct dirfile *new;
|
||||
|
||||
#ifdef VMS
|
||||
dirend = rindex (p, ']');
|
||||
dirend++;
|
||||
if (dirend == (char *)1)
|
||||
dir = find_directory ("[]");
|
||||
#else
|
||||
dirend = rindex (p, '/');
|
||||
#if defined (WINDOWS32) || defined (__MSDOS__)
|
||||
/* Forward and backslashes might be mixed. We need the rightmost one. */
|
||||
{
|
||||
char *bslash = rindex(p, '\\');
|
||||
if (!dirend || bslash > dirend)
|
||||
dirend = bslash;
|
||||
/* The case of "d:file". */
|
||||
if (!dirend && p[0] && p[1] == ':')
|
||||
dirend = p + 1;
|
||||
}
|
||||
#endif /* WINDOWS32 or __MSDOS__ */
|
||||
if (dirend == 0)
|
||||
#ifdef _AMIGA
|
||||
dir = find_directory ("");
|
||||
#else /* !VMS && !AMIGA */
|
||||
dir = find_directory (".");
|
||||
#endif /* AMIGA */
|
||||
#endif /* VMS */
|
||||
else
|
||||
{
|
||||
char *dirname = (char *) alloca (dirend - p + 1);
|
||||
bcopy (p, dirname, dirend - p);
|
||||
dirname[dirend - p] = '\0';
|
||||
char *dirname;
|
||||
char *slash = dirend;
|
||||
if (dirend == p)
|
||||
dirname = "/";
|
||||
else
|
||||
{
|
||||
#if defined (WINDOWS32) || defined (__MSDOS__)
|
||||
/* d:/ and d: are *very* different... */
|
||||
if (dirend < p + 3 && p[1] == ':' &&
|
||||
(*dirend == '/' || *dirend == '\\' || *dirend == ':'))
|
||||
dirend++;
|
||||
#endif
|
||||
dirname = (char *) alloca (dirend - p + 1);
|
||||
bcopy (p, dirname, dirend - p);
|
||||
dirname[dirend - p] = '\0';
|
||||
}
|
||||
dir = find_directory (dirname);
|
||||
filename = p = dirend + 1;
|
||||
filename = p = slash + 1;
|
||||
}
|
||||
|
||||
for (hash = 0; *p != '\0'; ++p)
|
||||
HASH (hash, *p);
|
||||
HASHI (hash, *p);
|
||||
hash %= DIRFILE_BUCKETS;
|
||||
|
||||
if (dir->contents == 0)
|
||||
@@ -404,7 +749,18 @@ file_impossible (filename)
|
||||
structure for it, but leave it out of the contents hash table. */
|
||||
dir->contents = (struct directory_contents *)
|
||||
xmalloc (sizeof (struct directory_contents));
|
||||
#ifdef WINDOWS32
|
||||
dir->contents->path_key = NULL;
|
||||
dir->contents->mtime = 0;
|
||||
#else /* WINDOWS32 */
|
||||
#ifdef VMS
|
||||
dir->contents->dev = 0;
|
||||
dir->contents->ino[0] = dir->contents->ino[1] =
|
||||
dir->contents->ino[2] = 0;
|
||||
#else
|
||||
dir->contents->dev = dir->contents->ino = 0;
|
||||
#endif
|
||||
#endif /* WINDOWS32 */
|
||||
dir->contents->files = 0;
|
||||
dir->contents->dirstream = 0;
|
||||
}
|
||||
@@ -423,7 +779,7 @@ file_impossible (filename)
|
||||
new = (struct dirfile *) xmalloc (sizeof (struct dirfile));
|
||||
new->next = dir->contents->files[hash];
|
||||
dir->contents->files[hash] = new;
|
||||
new->name = savestring (filename, strlen (filename));
|
||||
new->name = xstrdup (filename);
|
||||
new->impossible = 1;
|
||||
}
|
||||
|
||||
@@ -439,16 +795,50 @@ file_impossible_p (filename)
|
||||
register struct directory_contents *dir;
|
||||
register struct dirfile *next;
|
||||
|
||||
dirend = rindex (filename, '/');
|
||||
#ifdef VMS
|
||||
dirend = rindex (filename, ']');
|
||||
if (dirend == 0)
|
||||
dir = find_directory ("[]")->contents;
|
||||
#else
|
||||
dirend = rindex (filename, '/');
|
||||
#if defined (WINDOWS32) || defined (__MSDOS__)
|
||||
/* Forward and backslashes might be mixed. We need the rightmost one. */
|
||||
{
|
||||
char *bslash = rindex(filename, '\\');
|
||||
if (!dirend || bslash > dirend)
|
||||
dirend = bslash;
|
||||
/* The case of "d:file". */
|
||||
if (!dirend && filename[0] && filename[1] == ':')
|
||||
dirend = filename + 1;
|
||||
}
|
||||
#endif /* WINDOWS32 || __MSDOS__ */
|
||||
if (dirend == 0)
|
||||
#ifdef _AMIGA
|
||||
dir = find_directory ("")->contents;
|
||||
#else /* !VMS && !AMIGA */
|
||||
dir = find_directory (".")->contents;
|
||||
#endif /* AMIGA */
|
||||
#endif /* VMS */
|
||||
else
|
||||
{
|
||||
char *dirname = (char *) alloca (dirend - filename + 1);
|
||||
bcopy (p, dirname, dirend - p);
|
||||
dirname[dirend - p] = '\0';
|
||||
char *dirname;
|
||||
char *slash = dirend;
|
||||
if (dirend == filename)
|
||||
dirname = "/";
|
||||
else
|
||||
{
|
||||
#if defined (WINDOWS32) || defined (__MSDOS__)
|
||||
/* d:/ and d: are *very* different... */
|
||||
if (dirend < filename + 3 && filename[1] == ':' &&
|
||||
(*dirend == '/' || *dirend == '\\' || *dirend == ':'))
|
||||
dirend++;
|
||||
#endif
|
||||
dirname = (char *) alloca (dirend - filename + 1);
|
||||
bcopy (p, dirname, dirend - p);
|
||||
dirname[dirend - p] = '\0';
|
||||
}
|
||||
dir = find_directory (dirname)->contents;
|
||||
p = filename = dirend + 1;
|
||||
p = filename = slash + 1;
|
||||
}
|
||||
|
||||
if (dir == 0 || dir->files == 0)
|
||||
@@ -458,13 +848,19 @@ file_impossible_p (filename)
|
||||
#ifdef __MSDOS__
|
||||
p = filename = dosify (p);
|
||||
#endif
|
||||
#ifdef HAVE_CASE_INSENSITIVE_FS
|
||||
p = filename = downcase (p);
|
||||
#endif
|
||||
#ifdef VMS
|
||||
p = filename = vmsify (p, 1);
|
||||
#endif
|
||||
|
||||
for (hash = 0; *p != '\0'; ++p)
|
||||
HASH (hash, *p);
|
||||
hash %= DIRFILE_BUCKETS;
|
||||
|
||||
for (next = dir->files[hash]; next != 0; next = next->next)
|
||||
if (streq (filename, next->name))
|
||||
if (strieq (filename, next->name))
|
||||
return next->impossible;
|
||||
|
||||
return 0;
|
||||
@@ -488,7 +884,7 @@ print_dir_data_base ()
|
||||
register unsigned int i, dirs, files, impossible;
|
||||
register struct directory *dir;
|
||||
|
||||
puts ("\n# Directories\n");
|
||||
puts (_("\n# Directories\n"));
|
||||
|
||||
dirs = files = impossible = 0;
|
||||
for (i = 0; i < DIRECTORY_BUCKETS; ++i)
|
||||
@@ -496,10 +892,23 @@ print_dir_data_base ()
|
||||
{
|
||||
++dirs;
|
||||
if (dir->contents == 0)
|
||||
printf ("# %s: could not be stat'd.\n", dir->name);
|
||||
printf (_("# %s: could not be stat'd.\n"), dir->name);
|
||||
else if (dir->contents->files == 0)
|
||||
printf ("# %s (device %d, inode %d): could not be opened.\n",
|
||||
dir->name, dir->contents->dev, dir->contents->ino);
|
||||
#ifdef WINDOWS32
|
||||
printf (_("# %s (key %s, mtime %d): could not be opened.\n"),
|
||||
dir->name, dir->contents->path_key,dir->contents->mtime);
|
||||
#else /* WINDOWS32 */
|
||||
#ifdef VMS
|
||||
printf (_("# %s (device %d, inode [%d,%d,%d]): could not be opened.\n"),
|
||||
dir->name, dir->contents->dev,
|
||||
dir->contents->ino[0], dir->contents->ino[1],
|
||||
dir->contents->ino[2]);
|
||||
#else
|
||||
printf (_("# %s (device %ld, inode %ld): could not be opened.\n"),
|
||||
dir->name, (long int) dir->contents->dev,
|
||||
(long int) dir->contents->ino);
|
||||
#endif
|
||||
#endif /* WINDOWS32 */
|
||||
else
|
||||
{
|
||||
register unsigned int f = 0, im = 0;
|
||||
@@ -511,22 +920,35 @@ print_dir_data_base ()
|
||||
++im;
|
||||
else
|
||||
++f;
|
||||
printf ("# %s (device %d, inode %d): ",
|
||||
dir->name, dir->contents->dev, dir->contents->ino);
|
||||
#ifdef WINDOWS32
|
||||
printf (_("# %s (key %s, mtime %d): "),
|
||||
dir->name, dir->contents->path_key, dir->contents->mtime);
|
||||
#else /* WINDOWS32 */
|
||||
#ifdef VMS
|
||||
printf (_("# %s (device %d, inode [%d,%d,%d]): "),
|
||||
dir->name, dir->contents->dev,
|
||||
dir->contents->ino[0], dir->contents->ino[1],
|
||||
dir->contents->ino[2]);
|
||||
#else
|
||||
printf (_("# %s (device %ld, inode %ld): "),
|
||||
dir->name,
|
||||
(long)dir->contents->dev, (long)dir->contents->ino);
|
||||
#endif
|
||||
#endif /* WINDOWS32 */
|
||||
if (f == 0)
|
||||
fputs ("No", stdout);
|
||||
fputs (_("No"), stdout);
|
||||
else
|
||||
printf ("%u", f);
|
||||
fputs (" files, ", stdout);
|
||||
fputs (_(" files, "), stdout);
|
||||
if (im == 0)
|
||||
fputs ("no", stdout);
|
||||
fputs (_("no"), stdout);
|
||||
else
|
||||
printf ("%u", im);
|
||||
fputs (" impossibilities", stdout);
|
||||
fputs (_(" impossibilities"), stdout);
|
||||
if (dir->contents->dirstream == 0)
|
||||
puts (".");
|
||||
else
|
||||
puts (" so far.");
|
||||
puts (_(" so far."));
|
||||
files += f;
|
||||
impossible += im;
|
||||
}
|
||||
@@ -534,15 +956,15 @@ print_dir_data_base ()
|
||||
|
||||
fputs ("\n# ", stdout);
|
||||
if (files == 0)
|
||||
fputs ("No", stdout);
|
||||
fputs (_("No"), stdout);
|
||||
else
|
||||
printf ("%u", files);
|
||||
fputs (" files, ", stdout);
|
||||
fputs (_(" files, "), stdout);
|
||||
if (impossible == 0)
|
||||
fputs ("no", stdout);
|
||||
fputs (_("no"), stdout);
|
||||
else
|
||||
printf ("%u", impossible);
|
||||
printf (" impossibilities in %u directories.\n", dirs);
|
||||
printf (_(" impossibilities in %u directories.\n"), dirs);
|
||||
}
|
||||
|
||||
/* Hooks for globbing. */
|
||||
@@ -560,15 +982,15 @@ struct dirstream
|
||||
};
|
||||
|
||||
/* Forward declarations. */
|
||||
static __ptr_t open_dirstream __P ((const char *));
|
||||
static struct dirent *read_dirstream __P ((__ptr_t));
|
||||
static __ptr_t open_dirstream PARAMS ((const char *));
|
||||
static struct dirent *read_dirstream PARAMS ((__ptr_t));
|
||||
|
||||
static __ptr_t
|
||||
open_dirstream (directory)
|
||||
const char *directory;
|
||||
{
|
||||
struct dirstream *new;
|
||||
struct directory *dir = find_directory (directory);
|
||||
struct directory *dir = find_directory ((char *)directory);
|
||||
|
||||
if (dir->contents == 0 || dir->contents->files == 0)
|
||||
/* DIR->contents is nil if the directory could not be stat'd.
|
||||
@@ -619,7 +1041,7 @@ read_dirstream (stream)
|
||||
}
|
||||
d = (struct dirent *) buf;
|
||||
FAKE_DIR_ENTRY (d);
|
||||
#ifdef HAVE_D_NAMLEN
|
||||
#ifdef _DIRENT_HAVE_D_NAMLEN
|
||||
d->d_namlen = len - 1;
|
||||
#endif
|
||||
memcpy (d->d_name, df->name, len);
|
||||
@@ -634,16 +1056,26 @@ read_dirstream (stream)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void
|
||||
ansi_free(p)
|
||||
void *p;
|
||||
{
|
||||
if (p)
|
||||
free(p);
|
||||
}
|
||||
|
||||
void
|
||||
dir_setup_glob (gl)
|
||||
glob_t *gl;
|
||||
{
|
||||
#ifndef VMS
|
||||
extern int stat ();
|
||||
#endif
|
||||
|
||||
/* Bogus sunos4 compiler complains (!) about & before functions. */
|
||||
gl->gl_opendir = open_dirstream;
|
||||
gl->gl_readdir = read_dirstream;
|
||||
gl->gl_closedir = free;
|
||||
gl->gl_closedir = ansi_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. */
|
||||
|
||||
42
dosbuild.bat
Normal file
42
dosbuild.bat
Normal file
@@ -0,0 +1,42 @@
|
||||
@echo Building Make for MSDOS
|
||||
|
||||
@rem Echo ON so they will see what is going on.
|
||||
|
||||
@echo on
|
||||
|
||||
gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g commands.c -o commands.o
|
||||
|
||||
gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g job.c -o job.o
|
||||
|
||||
gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g dir.c -o dir.o
|
||||
|
||||
gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g file.c -o file.o
|
||||
|
||||
gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g misc.c -o misc.o
|
||||
|
||||
gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g main.c -o main.o
|
||||
|
||||
gcc -c -I. -I./glob -DHAVE_CONFIG_H -DINCLUDEDIR=\"c:/djgpp/include\" -O2 -g read.c -o read.o
|
||||
|
||||
gcc -c -I. -I./glob -DHAVE_CONFIG_H -DLIBDIR=\"c:/djgpp/lib\" -O2 -g remake.c -o remake.o
|
||||
|
||||
gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g rule.c -o rule.o
|
||||
|
||||
gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g implicit.c -o implicit.o
|
||||
|
||||
gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g default.c -o default.o
|
||||
|
||||
gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g variable.c -o variable.o
|
||||
|
||||
gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g expand.c -o expand.o
|
||||
|
||||
gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g function.c -o function.o
|
||||
|
||||
gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g vpath.c -o vpath.o
|
||||
|
||||
gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g version.c -o version.o
|
||||
|
||||
gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g ar.c -o ar.o
|
||||
|
||||
gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g arscan.c -o arscan.o
|
||||
|
||||
137
expand.c
137
expand.c
@@ -14,21 +14,32 @@ 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. */
|
||||
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
#include "make.h"
|
||||
#include "filedef.h"
|
||||
#include "job.h"
|
||||
#include "commands.h"
|
||||
#include "file.h"
|
||||
#include "variable.h"
|
||||
#include "rule.h"
|
||||
|
||||
/* The next two describe the variable output buffer.
|
||||
This buffer is used to hold the variable-expansion of a line of the
|
||||
makefile. It is made bigger with realloc whenever it is too small.
|
||||
variable_buffer_length is the size currently allocated.
|
||||
variable_buffer is the address of the buffer. */
|
||||
variable_buffer is the address of the buffer.
|
||||
|
||||
For efficiency, it's guaranteed that the buffer will always have
|
||||
VARIABLE_BUFFER_ZONE extra bytes allocated. This allows you to add a few
|
||||
extra chars without having to call a function. Note you should never use
|
||||
these bytes unless you're _sure_ you have room (you know when the buffer
|
||||
length was last checked. */
|
||||
|
||||
#define VARIABLE_BUFFER_ZONE 5
|
||||
|
||||
static unsigned int variable_buffer_length;
|
||||
static char *variable_buffer;
|
||||
char *variable_buffer;
|
||||
|
||||
/* Subroutine of variable_expand and friends:
|
||||
The text to add is LENGTH chars starting at STRING to the variable_buffer.
|
||||
@@ -44,7 +55,7 @@ variable_buffer_output (ptr, string, length)
|
||||
{
|
||||
register unsigned int newlen = length + (ptr - variable_buffer);
|
||||
|
||||
if (newlen > variable_buffer_length)
|
||||
if ((newlen + VARIABLE_BUFFER_ZONE) > variable_buffer_length)
|
||||
{
|
||||
unsigned int offset = ptr - variable_buffer;
|
||||
variable_buffer_length = (newlen + 100 > 2 * variable_buffer_length
|
||||
@@ -85,17 +96,10 @@ recursively_expand (v)
|
||||
char *value;
|
||||
|
||||
if (v->expanding)
|
||||
{
|
||||
/* Expanding V causes infinite recursion. Lose. */
|
||||
if (reading_filename == 0)
|
||||
fatal ("Recursive variable `%s' references itself (eventually)",
|
||||
v->name);
|
||||
else
|
||||
makefile_fatal
|
||||
(reading_filename, *reading_lineno_ptr,
|
||||
"Recursive variable `%s' references itself (eventually)",
|
||||
v->name);
|
||||
}
|
||||
/* Expanding V causes infinite recursion. Lose. */
|
||||
fatal (reading_file,
|
||||
_("Recursive variable `%s' references itself (eventually)"),
|
||||
v->name);
|
||||
|
||||
v->expanding = 1;
|
||||
value = allocated_variable_expand (v->value);
|
||||
@@ -115,14 +119,8 @@ warn_undefined (name, length)
|
||||
unsigned int length;
|
||||
{
|
||||
if (warn_undefined_variables_flag)
|
||||
{
|
||||
static const char warnmsg[] = "warning: undefined variable `%.*s'";
|
||||
if (reading_filename != 0)
|
||||
makefile_error (reading_filename, *reading_lineno_ptr,
|
||||
warnmsg, length, name);
|
||||
else
|
||||
error (warnmsg, length, name);
|
||||
}
|
||||
error (reading_file,
|
||||
_("warning: undefined variable `%.*s'"), (int)length, name);
|
||||
}
|
||||
|
||||
/* Expand a simple reference to variable NAME, which is LENGTH chars long. */
|
||||
@@ -152,20 +150,38 @@ reference_variable (o, name, length)
|
||||
return o;
|
||||
}
|
||||
|
||||
/* Scan LINE for variable references and expansion-function calls.
|
||||
Build in `variable_buffer' the result of expanding the references and calls.
|
||||
Return the address of the resulting string, which is null-terminated
|
||||
and is valid only until the next time this function is called. */
|
||||
/* Scan STRING for variable references and expansion-function calls. Only
|
||||
LENGTH bytes of STRING are actually scanned. If LENGTH is -1, scan until
|
||||
a null byte is found.
|
||||
|
||||
Write the results to LINE, which must point into `variable_buffer'. If
|
||||
LINE is NULL, start at the beginning of the buffer.
|
||||
Return a pointer to LINE, or to the beginning of the buffer if LINE is
|
||||
NULL. */
|
||||
|
||||
char *
|
||||
variable_expand (line)
|
||||
variable_expand_string (line, string, length)
|
||||
register char *line;
|
||||
char *string;
|
||||
long length;
|
||||
{
|
||||
register struct variable *v;
|
||||
register char *p, *o, *p1;
|
||||
char save_char = '\0';
|
||||
unsigned int line_offset;
|
||||
|
||||
p = line;
|
||||
o = initialize_variable_output ();
|
||||
if (!line)
|
||||
line = initialize_variable_output();
|
||||
|
||||
p = string;
|
||||
o = line;
|
||||
line_offset = line - variable_buffer;
|
||||
|
||||
if (length >= 0)
|
||||
{
|
||||
save_char = string[length];
|
||||
string[length] = '\0';
|
||||
}
|
||||
|
||||
while (1)
|
||||
{
|
||||
@@ -215,14 +231,8 @@ variable_expand (line)
|
||||
|
||||
end = index (beg, closeparen);
|
||||
if (end == 0)
|
||||
{
|
||||
/* Unterminated variable reference. */
|
||||
if (reading_filename != 0)
|
||||
makefile_fatal (reading_filename, *reading_lineno_ptr,
|
||||
"unterminated variable reference");
|
||||
else
|
||||
fatal ("unterminated variable reference");
|
||||
}
|
||||
/* Unterminated variable reference. */
|
||||
fatal (reading_file, _("unterminated variable reference"));
|
||||
p1 = lindex (beg, end, '$');
|
||||
if (p1 != 0)
|
||||
{
|
||||
@@ -315,7 +325,7 @@ variable_expand (line)
|
||||
replace_end - replace_beg);
|
||||
replace[replace_end - replace_beg] = '\0';
|
||||
}
|
||||
|
||||
|
||||
o = patsubst_expand (o, value, pattern, replace,
|
||||
percent, (char *) 0);
|
||||
}
|
||||
@@ -365,7 +375,7 @@ variable_expand (line)
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (*p == '\0')
|
||||
break;
|
||||
@@ -373,8 +383,23 @@ variable_expand (line)
|
||||
++p;
|
||||
}
|
||||
|
||||
(void) variable_buffer_output (o, "", 1);
|
||||
return initialize_variable_output ();
|
||||
if (save_char)
|
||||
string[length] = save_char;
|
||||
|
||||
(void)variable_buffer_output (o, "", 1);
|
||||
return (variable_buffer + line_offset);
|
||||
}
|
||||
|
||||
/* Scan LINE for variable references and expansion-function calls.
|
||||
Build in `variable_buffer' the result of expanding the references and calls.
|
||||
Return the address of the resulting string, which is null-terminated
|
||||
and is valid only until the next time this function is called. */
|
||||
|
||||
char *
|
||||
variable_expand (line)
|
||||
char *line;
|
||||
{
|
||||
return variable_expand_string(NULL, line, (long)-1);
|
||||
}
|
||||
|
||||
/* Expand an argument for an expansion function.
|
||||
@@ -404,25 +429,39 @@ expand_argument (str, end)
|
||||
/* Expand LINE for FILE. Error messages refer to the file and line where
|
||||
FILE's commands were found. Expansion uses FILE's variable set list. */
|
||||
|
||||
char *
|
||||
static char *
|
||||
variable_expand_for_file (line, file)
|
||||
char *line;
|
||||
register struct file *file;
|
||||
{
|
||||
char *result;
|
||||
struct variable_set_list *save;
|
||||
struct variable_set_list *save, *fnext;
|
||||
|
||||
if (file == 0)
|
||||
return variable_expand (line);
|
||||
|
||||
save = current_variable_set_list;
|
||||
current_variable_set_list = file->variables;
|
||||
reading_filename = file->cmds->filename;
|
||||
reading_lineno_ptr = &file->cmds->lineno;
|
||||
if (file->cmds && file->cmds->fileinfo.filenm)
|
||||
reading_file = &file->cmds->fileinfo;
|
||||
else
|
||||
reading_file = 0;
|
||||
fnext = file->variables->next;
|
||||
/* See if there's a pattern-specific variable struct for this target. */
|
||||
if (!file->pat_searched)
|
||||
{
|
||||
file->patvar = lookup_pattern_var(file->name);
|
||||
file->pat_searched = 1;
|
||||
}
|
||||
if (file->patvar != 0)
|
||||
{
|
||||
file->patvar->vars->next = fnext;
|
||||
file->variables->next = file->patvar->vars;
|
||||
}
|
||||
result = variable_expand (line);
|
||||
current_variable_set_list = save;
|
||||
reading_filename = 0;
|
||||
reading_lineno_ptr = 0;
|
||||
reading_file = 0;
|
||||
file->variables->next = fnext;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
338
file.c
338
file.c
@@ -1,5 +1,5 @@
|
||||
/* Target file hash table management for GNU Make.
|
||||
Copyright (C) 1988, 89, 90, 91, 92, 93, 94, 1995 Free Software Foundation, Inc.
|
||||
Copyright (C) 1988,89,90,91,92,93,94,95,96,97 Free Software Foundation, Inc.
|
||||
This file is part of GNU Make.
|
||||
|
||||
GNU Make is free software; you can redistribute it and/or modify
|
||||
@@ -14,14 +14,17 @@ 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. */
|
||||
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
#include <assert.h>
|
||||
|
||||
#include "make.h"
|
||||
#include "commands.h"
|
||||
#include "dep.h"
|
||||
#include "file.h"
|
||||
#include "filedef.h"
|
||||
#include "job.h"
|
||||
#include "commands.h"
|
||||
#include "variable.h"
|
||||
#include <assert.h>
|
||||
|
||||
|
||||
/* Hash table of files the makefile knows how to make. */
|
||||
@@ -35,6 +38,9 @@ static struct file *files[FILE_BUCKETS];
|
||||
|
||||
unsigned int num_intermediates = 0;
|
||||
|
||||
/* Current value for pruning the scan of the goal chain (toggle 0/1). */
|
||||
|
||||
unsigned int considered = 0;
|
||||
|
||||
/* Access the hash table of all file records.
|
||||
lookup_file given a name, return the struct file * for that name,
|
||||
@@ -48,6 +54,9 @@ lookup_file (name)
|
||||
register struct file *f;
|
||||
register char *n;
|
||||
register unsigned int hashval;
|
||||
#ifdef VMS
|
||||
register char *lname, *ln;
|
||||
#endif
|
||||
|
||||
if (*name == '\0')
|
||||
abort ();
|
||||
@@ -55,6 +64,16 @@ lookup_file (name)
|
||||
/* This is also done in parse_file_seq, so this is redundant
|
||||
for names read from makefiles. It is here for names passed
|
||||
on the command line. */
|
||||
#ifdef VMS
|
||||
lname = (char *)malloc(strlen(name) + 1);
|
||||
for (n=name, ln=lname; *n != '\0'; ++n, ++ln)
|
||||
*ln = isupper(*n) ? tolower(*n) : *n;
|
||||
*ln = '\0';
|
||||
name = lname;
|
||||
|
||||
while (name[0] == '[' && name[1] == ']' && name[2] != '\0')
|
||||
name += 2;
|
||||
#endif
|
||||
while (name[0] == '.' && name[1] == '/' && name[2] != '\0')
|
||||
{
|
||||
name += 2;
|
||||
@@ -65,16 +84,34 @@ lookup_file (name)
|
||||
|
||||
if (*name == '\0')
|
||||
/* It was all slashes after a dot. */
|
||||
#ifdef VMS
|
||||
name = "[]";
|
||||
#else
|
||||
#ifdef _AMIGA
|
||||
name = "";
|
||||
#else
|
||||
name = "./";
|
||||
#endif /* AMIGA */
|
||||
#endif /* VMS */
|
||||
|
||||
hashval = 0;
|
||||
for (n = name; *n != '\0'; ++n)
|
||||
HASH (hashval, *n);
|
||||
HASHI (hashval, *n);
|
||||
hashval %= FILE_BUCKETS;
|
||||
|
||||
for (f = files[hashval]; f != 0; f = f->next)
|
||||
if (streq (f->name, name))
|
||||
return f;
|
||||
{
|
||||
if (strieq (f->hname, name))
|
||||
{
|
||||
#ifdef VMS
|
||||
free (lname);
|
||||
#endif
|
||||
return f;
|
||||
}
|
||||
}
|
||||
#ifdef VMS
|
||||
free (lname);
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -85,25 +122,46 @@ enter_file (name)
|
||||
register struct file *f, *new;
|
||||
register char *n;
|
||||
register unsigned int hashval;
|
||||
#ifdef VMS
|
||||
char *lname, *ln;
|
||||
#endif
|
||||
|
||||
if (*name == '\0')
|
||||
abort ();
|
||||
|
||||
#ifdef VMS
|
||||
lname = (char *)malloc (strlen (name) + 1);
|
||||
for (n = name, ln = lname; *n != '\0'; ++n, ++ln)
|
||||
{
|
||||
if (isupper(*n))
|
||||
*ln = tolower(*n);
|
||||
else
|
||||
*ln = *n;
|
||||
}
|
||||
*ln = 0;
|
||||
name = lname;
|
||||
#endif
|
||||
|
||||
hashval = 0;
|
||||
for (n = name; *n != '\0'; ++n)
|
||||
HASH (hashval, *n);
|
||||
HASHI (hashval, *n);
|
||||
hashval %= FILE_BUCKETS;
|
||||
|
||||
for (f = files[hashval]; f != 0; f = f->next)
|
||||
if (streq (f->name, name))
|
||||
if (strieq (f->hname, name))
|
||||
break;
|
||||
|
||||
if (f != 0 && !f->double_colon)
|
||||
return f;
|
||||
{
|
||||
#ifdef VMS
|
||||
free(lname);
|
||||
#endif
|
||||
return f;
|
||||
}
|
||||
|
||||
new = (struct file *) xmalloc (sizeof (struct file));
|
||||
bzero ((char *) new, sizeof (struct file));
|
||||
new->name = name;
|
||||
new->name = new->hname = name;
|
||||
new->update_status = -1;
|
||||
|
||||
if (f == 0)
|
||||
@@ -124,16 +182,16 @@ enter_file (name)
|
||||
return new;
|
||||
}
|
||||
|
||||
/* Rename FILE to NAME. This is not as simple as resetting
|
||||
the `name' member, since it must be put in a new hash bucket,
|
||||
/* Rehash FILE to NAME. This is not as simple as resetting
|
||||
the `hname' member, since it must be put in a new hash bucket,
|
||||
and possibly merged with an existing file called NAME. */
|
||||
|
||||
void
|
||||
rename_file (file, name)
|
||||
rehash_file (file, name)
|
||||
register struct file *file;
|
||||
char *name;
|
||||
{
|
||||
char *oldname = file->name;
|
||||
char *oldname = file->hname;
|
||||
register unsigned int oldhash;
|
||||
register char *n;
|
||||
|
||||
@@ -144,11 +202,28 @@ rename_file (file, name)
|
||||
|
||||
oldhash = 0;
|
||||
for (n = oldname; *n != '\0'; ++n)
|
||||
HASH (oldhash, *n);
|
||||
HASHI (oldhash, *n);
|
||||
|
||||
file_hash_enter (file, name, oldhash, file->name);
|
||||
}
|
||||
|
||||
/* Rename FILE to NAME. This is not as simple as resetting
|
||||
the `name' member, since it must be put in a new hash bucket,
|
||||
and possibly merged with an existing file called NAME. */
|
||||
|
||||
void
|
||||
rename_file (file, name)
|
||||
register struct file *file;
|
||||
char *name;
|
||||
{
|
||||
rehash_file(file, name);
|
||||
while (file)
|
||||
{
|
||||
file->name = file->hname;
|
||||
file = file->prev;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
file_hash_enter (file, name, oldhash, oldname)
|
||||
register struct file *file;
|
||||
@@ -164,15 +239,18 @@ file_hash_enter (file, name, oldhash, oldname)
|
||||
|
||||
newhash = 0;
|
||||
for (n = name; *n != '\0'; ++n)
|
||||
HASH (newhash, *n);
|
||||
HASHI (newhash, *n);
|
||||
newbucket = newhash % FILE_BUCKETS;
|
||||
|
||||
/* Look for an existing file under the new name. */
|
||||
|
||||
for (oldfile = files[newbucket]; oldfile != 0; oldfile = oldfile->next)
|
||||
if (streq (oldfile->name, name))
|
||||
if (strieq (oldfile->hname, name))
|
||||
break;
|
||||
|
||||
/* If the old file is the same as the new file, something's wrong. */
|
||||
assert (oldfile != file);
|
||||
|
||||
if (oldhash != 0 && (newbucket != oldbucket || oldfile != 0))
|
||||
{
|
||||
/* Remove FILE from its hash bucket. */
|
||||
@@ -190,9 +268,9 @@ file_hash_enter (file, name, oldhash, oldname)
|
||||
|
||||
/* Give FILE its new name. */
|
||||
|
||||
file->name = name;
|
||||
file->hname = name;
|
||||
for (f = file->double_colon; f != 0; f = f->prev)
|
||||
f->name = name;
|
||||
f->hname = name;
|
||||
|
||||
if (oldfile == 0)
|
||||
{
|
||||
@@ -221,24 +299,24 @@ file_hash_enter (file, name, oldhash, oldname)
|
||||
/* We have two sets of commands. We will go with the
|
||||
one given in the rule explicitly mentioning this name,
|
||||
but give a message to let the user know what's going on. */
|
||||
if (oldfile->cmds->filename != 0)
|
||||
makefile_error (file->cmds->filename, file->cmds->lineno,
|
||||
"Commands were specified for \
|
||||
file `%s' at %s:%u,",
|
||||
oldname, oldfile->cmds->filename,
|
||||
oldfile->cmds->lineno);
|
||||
if (oldfile->cmds->fileinfo.filenm != 0)
|
||||
error (&file->cmds->fileinfo,
|
||||
_("Commands were specified for \
|
||||
file `%s' at %s:%lu,"),
|
||||
oldname, oldfile->cmds->fileinfo.filenm,
|
||||
oldfile->cmds->fileinfo.lineno);
|
||||
else
|
||||
makefile_error (file->cmds->filename, file->cmds->lineno,
|
||||
"Commands for file `%s' were found by \
|
||||
implicit rule search,",
|
||||
error (&file->cmds->fileinfo,
|
||||
_("Commands for file `%s' were found by \
|
||||
implicit rule search,"),
|
||||
oldname);
|
||||
makefile_error (file->cmds->filename, file->cmds->lineno,
|
||||
"but `%s' is now considered the same file \
|
||||
as `%s'.",
|
||||
error (&file->cmds->fileinfo,
|
||||
_("but `%s' is now considered the same file \
|
||||
as `%s'."),
|
||||
oldname, name);
|
||||
makefile_error (file->cmds->filename, file->cmds->lineno,
|
||||
"Commands for `%s' will be ignored \
|
||||
in favor of those for `%s'.",
|
||||
error (&file->cmds->fileinfo,
|
||||
_("Commands for `%s' will be ignored \
|
||||
in favor of those for `%s'."),
|
||||
name, oldname);
|
||||
}
|
||||
}
|
||||
@@ -257,17 +335,24 @@ in favor of those for `%s'.",
|
||||
|
||||
merge_variable_set_lists (&oldfile->variables, file->variables);
|
||||
|
||||
if (oldfile->double_colon && !file->double_colon)
|
||||
fatal ("can't rename single-colon `%s' to double-colon `%s'",
|
||||
oldname, name);
|
||||
if (!oldfile->double_colon && file->double_colon)
|
||||
fatal ("can't rename double-colon `%s' to single-colon `%s'",
|
||||
if (oldfile->double_colon && file->is_target && !file->double_colon)
|
||||
fatal (NILF, _("can't rename single-colon `%s' to double-colon `%s'"),
|
||||
oldname, name);
|
||||
if (!oldfile->double_colon && file->double_colon)
|
||||
{
|
||||
if (oldfile->is_target)
|
||||
fatal (NILF, _("can't rename double-colon `%s' to single-colon `%s'"),
|
||||
oldname, name);
|
||||
else
|
||||
oldfile->double_colon = file->double_colon;
|
||||
}
|
||||
|
||||
if (file->last_mtime > oldfile->last_mtime)
|
||||
/* %%% Kludge so -W wins on a file that gets vpathized. */
|
||||
oldfile->last_mtime = file->last_mtime;
|
||||
|
||||
oldfile->mtime_before_update = file->mtime_before_update;
|
||||
|
||||
#define MERGE(field) oldfile->field |= file->field
|
||||
MERGE (precious);
|
||||
MERGE (tried_implicit);
|
||||
@@ -276,6 +361,7 @@ in favor of those for `%s'.",
|
||||
MERGE (is_target);
|
||||
MERGE (cmd_target);
|
||||
MERGE (phony);
|
||||
MERGE (ignore_vpath);
|
||||
#undef MERGE
|
||||
|
||||
file->renamed = oldfile;
|
||||
@@ -294,7 +380,7 @@ remove_intermediates (sig)
|
||||
register int i;
|
||||
register struct file *f;
|
||||
char doneany;
|
||||
|
||||
|
||||
if (question_flag || touch_flag)
|
||||
return;
|
||||
if (sig && just_print_flag)
|
||||
@@ -303,15 +389,16 @@ remove_intermediates (sig)
|
||||
doneany = 0;
|
||||
for (i = 0; i < FILE_BUCKETS; ++i)
|
||||
for (f = files[i]; f != 0; f = f->next)
|
||||
if (f->intermediate && (f->dontcare || !f->precious))
|
||||
if (f->intermediate && (f->dontcare || !f->precious)
|
||||
&& !f->secondary)
|
||||
{
|
||||
int status;
|
||||
if (f->update_status == -1)
|
||||
/* If nothing would have created this file yet,
|
||||
don't print an "rm" command for it. */
|
||||
continue;
|
||||
else if (just_print_flag)
|
||||
status = 0;
|
||||
continue;
|
||||
else if (just_print_flag)
|
||||
status = 0;
|
||||
else
|
||||
{
|
||||
status = unlink (f->name);
|
||||
@@ -321,7 +408,7 @@ remove_intermediates (sig)
|
||||
if (!f->dontcare)
|
||||
{
|
||||
if (sig)
|
||||
error ("*** Deleting intermediate file `%s'", f->name);
|
||||
error (NILF, _("*** Deleting intermediate file `%s'"), f->name);
|
||||
else if (!silent_flag)
|
||||
{
|
||||
if (! doneany)
|
||||
@@ -349,7 +436,8 @@ remove_intermediates (sig)
|
||||
/* For each dependency of each file, make the `struct dep' point
|
||||
at the appropriate `struct file' (which may have to be created).
|
||||
|
||||
Also mark the files depended on by .PRECIOUS and .PHONY. */
|
||||
Also mark the files depended on by .PRECIOUS, .PHONY, .SILENT,
|
||||
and various other special targets. */
|
||||
|
||||
void
|
||||
snap_deps ()
|
||||
@@ -372,7 +460,7 @@ snap_deps ()
|
||||
free (d->name);
|
||||
d->name = 0;
|
||||
}
|
||||
|
||||
|
||||
for (f = lookup_file (".PRECIOUS"); f != 0; f = f->prev)
|
||||
for (d = f->deps; d != 0; d = d->next)
|
||||
for (f2 = d->file; f2 != 0; f2 = f2->prev)
|
||||
@@ -384,9 +472,45 @@ snap_deps ()
|
||||
{
|
||||
/* Mark this file as phony and nonexistent. */
|
||||
f2->phony = 1;
|
||||
f2->last_mtime = (time_t) -1;
|
||||
f2->last_mtime = (FILE_TIMESTAMP) -1;
|
||||
f2->mtime_before_update = (FILE_TIMESTAMP) -1;
|
||||
}
|
||||
|
||||
for (f = lookup_file (".INTERMEDIATE"); f != 0; f = f->prev)
|
||||
{
|
||||
/* .INTERMEDIATE with deps listed
|
||||
marks those deps as intermediate files. */
|
||||
for (d = f->deps; d != 0; d = d->next)
|
||||
for (f2 = d->file; f2 != 0; f2 = f2->prev)
|
||||
f2->intermediate = 1;
|
||||
/* .INTERMEDIATE with no deps does nothing.
|
||||
Marking all files as intermediates is useless
|
||||
since the goal targets would be deleted after they are built. */
|
||||
}
|
||||
|
||||
for (f = lookup_file (".SECONDARY"); f != 0; f = f->prev)
|
||||
{
|
||||
/* .SECONDARY with deps listed
|
||||
marks those deps as intermediate files
|
||||
in that they don't get rebuilt if not actually needed;
|
||||
but unlike real intermediate files,
|
||||
these are not deleted after make finishes. */
|
||||
if (f->deps)
|
||||
{
|
||||
for (d = f->deps; d != 0; d = d->next)
|
||||
for (f2 = d->file; f2 != 0; f2 = f2->prev)
|
||||
f2->intermediate = f2->secondary = 1;
|
||||
}
|
||||
/* .SECONDARY with no deps listed marks *all* files that way. */
|
||||
else
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < FILE_BUCKETS; i++)
|
||||
for (f2 = files[i]; f2; f2= f2->next)
|
||||
f2->intermediate = f2->secondary = 1;
|
||||
}
|
||||
}
|
||||
|
||||
f = lookup_file (".EXPORT_ALL_VARIABLES");
|
||||
if (f != 0 && f->is_target)
|
||||
export_all_variables = 1;
|
||||
@@ -433,6 +557,51 @@ set_command_state (file, state)
|
||||
d->file->command_state = state;
|
||||
}
|
||||
|
||||
/* Get and print file timestamps. */
|
||||
|
||||
FILE_TIMESTAMP
|
||||
file_timestamp_now ()
|
||||
{
|
||||
#if HAVE_CLOCK_GETTIME && defined CLOCK_REALTIME
|
||||
struct timespec timespec;
|
||||
if (clock_gettime (CLOCK_REALTIME, ×pec) == 0)
|
||||
return FILE_TIMESTAMP_FROM_S_AND_NS (timespec.tv_sec, timespec.tv_nsec);
|
||||
#endif
|
||||
return FILE_TIMESTAMP_FROM_S_AND_NS (time ((time_t *) 0), 0);
|
||||
}
|
||||
|
||||
void
|
||||
file_timestamp_sprintf (p, ts)
|
||||
char *p;
|
||||
FILE_TIMESTAMP ts;
|
||||
{
|
||||
time_t t = FILE_TIMESTAMP_S (ts);
|
||||
struct tm *tm = localtime (&t);
|
||||
|
||||
if (tm)
|
||||
sprintf (p, "%04d-%02d-%02d %02d:%02d:%02d",
|
||||
tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday,
|
||||
tm->tm_hour, tm->tm_min, tm->tm_sec);
|
||||
else if (t < 0)
|
||||
sprintf (p, "%ld", (long) t);
|
||||
else
|
||||
sprintf (p, "%lu", (unsigned long) t);
|
||||
p += strlen (p);
|
||||
|
||||
/* Append nanoseconds as a fraction, but remove trailing zeros.
|
||||
We don't know the actual timestamp resolution, since clock_getres
|
||||
applies only to local times, whereas this timestamp might come
|
||||
from a remote filesystem. So removing trailing zeros is the
|
||||
best guess that we can do. */
|
||||
sprintf (p, ".%09ld", (long) FILE_TIMESTAMP_NS (ts));
|
||||
p += strlen (p) - 1;
|
||||
while (*p == '0')
|
||||
p--;
|
||||
p += *p != '.';
|
||||
|
||||
*p = '\0';
|
||||
}
|
||||
|
||||
/* Print the data base of files. */
|
||||
|
||||
static void
|
||||
@@ -443,50 +612,53 @@ print_file (f)
|
||||
|
||||
putchar ('\n');
|
||||
if (!f->is_target)
|
||||
puts ("# Not a target:");
|
||||
puts (_("# Not a target:"));
|
||||
printf ("%s:%s", f->name, f->double_colon ? ":" : "");
|
||||
|
||||
|
||||
for (d = f->deps; d != 0; d = d->next)
|
||||
printf (" %s", dep_name (d));
|
||||
putchar ('\n');
|
||||
|
||||
|
||||
if (f->precious)
|
||||
puts ("# Precious file (dependency of .PRECIOUS).");
|
||||
puts (_("# Precious file (prerequisite of .PRECIOUS)."));
|
||||
if (f->phony)
|
||||
puts ("# Phony target (dependency of .PHONY).");
|
||||
puts (_("# Phony target (prerequisite of .PHONY)."));
|
||||
if (f->cmd_target)
|
||||
puts ("# Command-line target.");
|
||||
puts (_("# Command-line target."));
|
||||
if (f->dontcare)
|
||||
puts ("# A default or MAKEFILES makefile.");
|
||||
printf ("# Implicit rule search has%s been done.\n",
|
||||
f->tried_implicit ? "" : " not");
|
||||
puts (_("# A default or MAKEFILES makefile."));
|
||||
printf (_("# Implicit rule search has%s been done.\n"),
|
||||
f->tried_implicit ? "" : _(" not"));
|
||||
if (f->stem != 0)
|
||||
printf ("# Implicit/static pattern stem: `%s'\n", f->stem);
|
||||
printf (_("# Implicit/static pattern stem: `%s'\n"), f->stem);
|
||||
if (f->intermediate)
|
||||
puts ("# File is an intermediate dependency.");
|
||||
puts (_("# File is an intermediate prerequisite."));
|
||||
if (f->also_make != 0)
|
||||
{
|
||||
fputs ("# Also makes:", stdout);
|
||||
fputs (_("# Also makes:"), stdout);
|
||||
for (d = f->also_make; d != 0; d = d->next)
|
||||
printf (" %s", dep_name (d));
|
||||
putchar ('\n');
|
||||
}
|
||||
if (f->last_mtime == (time_t) 0)
|
||||
puts ("# Modification time never checked.");
|
||||
else if (f->last_mtime == (time_t) -1)
|
||||
puts ("# File does not exist.");
|
||||
if (f->last_mtime == 0)
|
||||
puts (_("# Modification time never checked."));
|
||||
else if (f->last_mtime == (FILE_TIMESTAMP) -1)
|
||||
puts (_("# File does not exist."));
|
||||
else
|
||||
printf ("# Last modified %.24s (%ld)\n",
|
||||
ctime (&f->last_mtime), (long int) f->last_mtime);
|
||||
printf ("# File has%s been updated.\n",
|
||||
f->updated ? "" : " not");
|
||||
{
|
||||
char buf[FILE_TIMESTAMP_PRINT_LEN_BOUND + 1];
|
||||
file_timestamp_sprintf (buf, f->last_mtime);
|
||||
printf (_("# Last modified %s\n"), buf);
|
||||
}
|
||||
printf (_("# File has%s been updated.\n"),
|
||||
f->updated ? "" : _(" not"));
|
||||
switch (f->command_state)
|
||||
{
|
||||
case cs_running:
|
||||
puts ("# Commands currently running (THIS IS A BUG).");
|
||||
puts (_("# Commands currently running (THIS IS A BUG)."));
|
||||
break;
|
||||
case cs_deps_running:
|
||||
puts ("# Dependencies commands running (THIS IS A BUG).");
|
||||
puts (_("# Dependencies commands running (THIS IS A BUG)."));
|
||||
break;
|
||||
case cs_not_started:
|
||||
case cs_finished:
|
||||
@@ -495,24 +667,24 @@ print_file (f)
|
||||
case -1:
|
||||
break;
|
||||
case 0:
|
||||
puts ("# Successfully updated.");
|
||||
puts (_("# Successfully updated."));
|
||||
break;
|
||||
case 1:
|
||||
assert (question_flag);
|
||||
puts ("# Needs to be updated (-q is set).");
|
||||
puts (_("# Needs to be updated (-q is set)."));
|
||||
break;
|
||||
case 2:
|
||||
puts ("# Failed to be updated.");
|
||||
puts (_("# Failed to be updated."));
|
||||
break;
|
||||
default:
|
||||
puts ("# Invalid value in `update_status' member!");
|
||||
puts (_("# Invalid value in `update_status' member!"));
|
||||
fflush (stdout);
|
||||
fflush (stderr);
|
||||
abort ();
|
||||
}
|
||||
break;
|
||||
default:
|
||||
puts ("# Invalid value in `command_state' member!");
|
||||
puts (_("# Invalid value in `command_state' member!"));
|
||||
fflush (stdout);
|
||||
fflush (stderr);
|
||||
abort ();
|
||||
@@ -531,7 +703,7 @@ print_file_data_base ()
|
||||
register unsigned int i, nfiles, per_bucket;
|
||||
register struct file *file;
|
||||
|
||||
puts ("\n# Files");
|
||||
puts (_("\n# Files"));
|
||||
|
||||
per_bucket = nfiles = 0;
|
||||
for (i = 0; i < FILE_BUCKETS; ++i)
|
||||
@@ -554,13 +726,15 @@ print_file_data_base ()
|
||||
}
|
||||
|
||||
if (nfiles == 0)
|
||||
puts ("\n# No files.");
|
||||
puts (_("\n# No files."));
|
||||
else
|
||||
{
|
||||
printf ("\n# %u files in %u hash buckets.\n", nfiles, FILE_BUCKETS);
|
||||
printf (_("\n# %u files in %u hash buckets.\n"), nfiles, FILE_BUCKETS);
|
||||
#ifndef NO_FLOAT
|
||||
printf ("# average %.1f files per bucket, max %u files in one bucket.\n",
|
||||
((double) nfiles) / ((double) FILE_BUCKETS) * 100.0, per_bucket);
|
||||
printf (_("# average %.3f files per bucket, max %u files in one bucket.\n"),
|
||||
((double) nfiles) / ((double) FILE_BUCKETS), per_bucket);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
/* EOF */
|
||||
|
||||
111
file.h
111
file.h
@@ -1,111 +0,0 @@
|
||||
/* Definition of target file data structures for GNU Make.
|
||||
Copyright (C) 1988, 89, 90, 91, 92, 93, 94 Free Software Foundation, Inc.
|
||||
This file is part of GNU Make.
|
||||
|
||||
GNU Make is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
|
||||
GNU Make is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GNU Make; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||
|
||||
/* Structure that represents the info on one file
|
||||
that the makefile says how to make.
|
||||
All of these are chained together through `next'. */
|
||||
|
||||
struct file
|
||||
{
|
||||
struct file *next;
|
||||
char *name;
|
||||
struct dep *deps;
|
||||
struct commands *cmds; /* Commands to execute for this target. */
|
||||
int command_flags; /* Flags OR'd in for cmds; see commands.h. */
|
||||
char *stem; /* Implicit stem, if an implicit
|
||||
rule has been used */
|
||||
struct dep *also_make; /* Targets that are made by making this. */
|
||||
time_t last_mtime; /* File's modtime, if already known. */
|
||||
struct file *prev; /* Previous entry for same file name;
|
||||
used when there are multiple double-colon
|
||||
entries for the same file. */
|
||||
|
||||
/* File that this file was renamed to. After any time that a
|
||||
file could be renamed, call `check_renamed' (below). */
|
||||
struct file *renamed;
|
||||
|
||||
/* List of variable sets used for this file. */
|
||||
struct variable_set_list *variables;
|
||||
|
||||
/* Immediate dependent that caused this target to be remade,
|
||||
or nil if there isn't one. */
|
||||
struct file *parent;
|
||||
|
||||
/* For a double-colon entry, this is the first double-colon entry for
|
||||
the same file. Otherwise this is null. */
|
||||
struct file *double_colon;
|
||||
|
||||
short int update_status; /* Status of the last attempt to update,
|
||||
or -1 if none has been made. */
|
||||
|
||||
enum /* State of the commands. */
|
||||
{ /* Note: It is important that cs_not_started be zero. */
|
||||
cs_not_started, /* Not yet started. */
|
||||
cs_deps_running, /* Dep commands running. */
|
||||
cs_running, /* Commands running. */
|
||||
cs_finished /* Commands finished. */
|
||||
} command_state ENUM_BITFIELD (2);
|
||||
|
||||
unsigned int precious:1; /* Non-0 means don't delete file on quit */
|
||||
unsigned int tried_implicit:1; /* Nonzero if have searched
|
||||
for implicit rule for making
|
||||
this file; don't search again. */
|
||||
unsigned int updating:1; /* Nonzero while updating deps of this file */
|
||||
unsigned int updated:1; /* Nonzero if this file has been remade. */
|
||||
unsigned int is_target:1; /* Nonzero if file is described as target. */
|
||||
unsigned int cmd_target:1; /* Nonzero if file was given on cmd line. */
|
||||
unsigned int phony:1; /* Nonzero if this is a phony file
|
||||
i.e., a dependency of .PHONY. */
|
||||
unsigned int intermediate:1;/* Nonzero if this is an intermediate file. */
|
||||
unsigned int dontcare:1; /* Nonzero if no complaint is to be made if
|
||||
this target cannot be remade. */
|
||||
};
|
||||
|
||||
/* Number of intermediate files entered. */
|
||||
|
||||
extern unsigned int num_intermediates;
|
||||
|
||||
extern struct file *default_goal_file, *suffix_file, *default_file;
|
||||
|
||||
|
||||
extern struct file *lookup_file (), *enter_file ();
|
||||
extern void remove_intermediates (), snap_deps ();
|
||||
extern void rename_file (), file_hash_enter ();
|
||||
extern void set_command_state ();
|
||||
|
||||
|
||||
extern time_t f_mtime ();
|
||||
#define file_mtime_1(f, v) \
|
||||
((f)->last_mtime != (time_t) 0 ? (f)->last_mtime : f_mtime ((f), v))
|
||||
#define file_mtime(f) file_mtime_1 ((f), 1)
|
||||
#define file_mtime_no_search(f) file_mtime_1 ((f), 0)
|
||||
|
||||
/* Modtime value to use for `infinitely new'. We used to get the current time
|
||||
from the system and use that whenever we wanted `new'. But that causes
|
||||
trouble when the machine running make and the machine holding a file have
|
||||
different ideas about what time it is; and can also lose for `force'
|
||||
targets, which need to be considered newer than anything that depends on
|
||||
them, even if said dependents' modtimes are in the future.
|
||||
|
||||
NOTE: This assumes 32-bit `time_t's, but I cannot think of a portable way
|
||||
to produce the largest representable integer of a given signed type. */
|
||||
#define NEW_MTIME ((time_t) 0x7fffffff)
|
||||
|
||||
|
||||
#define check_renamed(file) \
|
||||
while ((file)->renamed != 0) (file) = (file)->renamed /* No ; here. */
|
||||
195
filedef.h
Normal file
195
filedef.h
Normal file
@@ -0,0 +1,195 @@
|
||||
/* Definition of target file data structures for GNU Make.
|
||||
Copyright (C) 1988,89,90,91,92,93,94,97 Free Software Foundation, Inc.
|
||||
This file is part of GNU Make.
|
||||
|
||||
GNU Make is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
|
||||
GNU Make is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GNU Make; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
|
||||
/* Structure that represents the info on one file
|
||||
that the makefile says how to make.
|
||||
All of these are chained together through `next'. */
|
||||
|
||||
struct file
|
||||
{
|
||||
struct file *next;
|
||||
char *name;
|
||||
char *hname; /* Hashed filename */
|
||||
char *vpath; /* VPATH/vpath pathname */
|
||||
struct dep *deps;
|
||||
struct commands *cmds; /* Commands to execute for this target. */
|
||||
int command_flags; /* Flags OR'd in for cmds; see commands.h. */
|
||||
char *stem; /* Implicit stem, if an implicit
|
||||
rule has been used */
|
||||
struct dep *also_make; /* Targets that are made by making this. */
|
||||
FILE_TIMESTAMP last_mtime; /* File's modtime, if already known. */
|
||||
FILE_TIMESTAMP mtime_before_update; /* File's modtime before any updating
|
||||
has been performed. */
|
||||
struct file *prev; /* Previous entry for same file name;
|
||||
used when there are multiple double-colon
|
||||
entries for the same file. */
|
||||
|
||||
/* File that this file was renamed to. After any time that a
|
||||
file could be renamed, call `check_renamed' (below). */
|
||||
struct file *renamed;
|
||||
|
||||
/* List of variable sets used for this file. */
|
||||
struct variable_set_list *variables;
|
||||
|
||||
/* Immediate dependent that caused this target to be remade,
|
||||
or nil if there isn't one. */
|
||||
struct file *parent;
|
||||
|
||||
/* For a double-colon entry, this is the first double-colon entry for
|
||||
the same file. Otherwise this is null. */
|
||||
struct file *double_colon;
|
||||
|
||||
/* Pattern-specific variable reference for this target, or null if there
|
||||
isn't one. Also see the pat_searched flag, below. */
|
||||
struct pattern_var *patvar;
|
||||
|
||||
short int update_status; /* Status of the last attempt to update,
|
||||
or -1 if none has been made. */
|
||||
|
||||
enum /* State of the commands. */
|
||||
{ /* Note: It is important that cs_not_started be zero. */
|
||||
cs_not_started, /* Not yet started. */
|
||||
cs_deps_running, /* Dep commands running. */
|
||||
cs_running, /* Commands running. */
|
||||
cs_finished /* Commands finished. */
|
||||
} command_state ENUM_BITFIELD (2);
|
||||
|
||||
unsigned int precious:1; /* Non-0 means don't delete file on quit */
|
||||
unsigned int tried_implicit:1; /* Nonzero if have searched
|
||||
for implicit rule for making
|
||||
this file; don't search again. */
|
||||
unsigned int updating:1; /* Nonzero while updating deps of this file */
|
||||
unsigned int updated:1; /* Nonzero if this file has been remade. */
|
||||
unsigned int is_target:1; /* Nonzero if file is described as target. */
|
||||
unsigned int cmd_target:1; /* Nonzero if file was given on cmd line. */
|
||||
unsigned int phony:1; /* Nonzero if this is a phony file
|
||||
i.e., a dependency of .PHONY. */
|
||||
unsigned int intermediate:1;/* Nonzero if this is an intermediate file. */
|
||||
/* Nonzero, for an intermediate file,
|
||||
means remove_intermediates should not delete it. */
|
||||
unsigned int secondary:1;
|
||||
unsigned int dontcare:1; /* Nonzero if no complaint is to be made if
|
||||
this target cannot be remade. */
|
||||
unsigned int mfile_status:1;/* Nonzero if update_status was obtained
|
||||
while remaking a makefile. */
|
||||
unsigned int ignore_vpath:1;/* Nonzero if we threw out VPATH name. */
|
||||
unsigned int pat_searched:1;/* Nonzero if we already searched for
|
||||
pattern-specific variables. */
|
||||
unsigned int considered:1; /* equal to `considered' if file has been
|
||||
considered on current scan of goal chain */
|
||||
};
|
||||
|
||||
/* Number of intermediate files entered. */
|
||||
|
||||
extern unsigned int num_intermediates;
|
||||
|
||||
/* Current value for pruning the scan of the goal chain (toggle 0/1). */
|
||||
|
||||
extern unsigned int considered;
|
||||
|
||||
extern struct file *default_goal_file, *suffix_file, *default_file;
|
||||
|
||||
|
||||
extern struct file *lookup_file PARAMS ((char *name));
|
||||
extern struct file *enter_file PARAMS ((char *name));
|
||||
extern void remove_intermediates PARAMS ((int sig));
|
||||
extern void snap_deps PARAMS ((void));
|
||||
extern void rename_file PARAMS ((struct file *file, char *name));
|
||||
extern void rehash_file PARAMS ((struct file *file, char *name));
|
||||
extern void file_hash_enter PARAMS ((struct file *file, char *name,
|
||||
unsigned int oldhash, char *oldname));
|
||||
extern void set_command_state PARAMS ((struct file *file, int state));
|
||||
extern void notice_finished_file PARAMS ((struct file *file));
|
||||
|
||||
|
||||
#if ST_MTIM_NSEC
|
||||
# define FILE_TIMESTAMP_STAT_MODTIME(st) \
|
||||
FILE_TIMESTAMP_FROM_S_AND_NS ((st).st_mtim.tv_sec, \
|
||||
(st).st_mtim.ST_MTIM_NSEC)
|
||||
# define FILE_TIMESTAMPS_PER_S \
|
||||
MIN ((FILE_TIMESTAMP) 1000000000, \
|
||||
(INTEGER_TYPE_MAXIMUM (FILE_TIMESTAMP) \
|
||||
/ INTEGER_TYPE_MAXIMUM (time_t)))
|
||||
#else
|
||||
# define FILE_TIMESTAMP_STAT_MODTIME(st) ((st).st_mtime)
|
||||
# define FILE_TIMESTAMPS_PER_S 1
|
||||
#endif
|
||||
|
||||
#define FILE_TIMESTAMP_FROM_S_AND_NS(s, ns) \
|
||||
((s) * FILE_TIMESTAMPS_PER_S \
|
||||
+ (ns) * FILE_TIMESTAMPS_PER_S / 1000000000)
|
||||
#define FILE_TIMESTAMP_DIV(a, b) ((a)/(b) - ((a)%(b) < 0))
|
||||
#define FILE_TIMESTAMP_MOD(a, b) ((a)%(b) + ((a)%(b) < 0) * (b))
|
||||
#define FILE_TIMESTAMP_S(ts) FILE_TIMESTAMP_DIV ((ts), FILE_TIMESTAMPS_PER_S)
|
||||
#define FILE_TIMESTAMP_NS(ts) \
|
||||
(((FILE_TIMESTAMP_MOD ((ts), FILE_TIMESTAMPS_PER_S) * 1000000000) \
|
||||
+ (FILE_TIMESTAMPS_PER_S - 1)) \
|
||||
/ FILE_TIMESTAMPS_PER_S)
|
||||
|
||||
/* Upper bound on length of string "YYYY-MM-DD HH:MM:SS.NNNNNNNNN"
|
||||
representing a file timestamp. The upper bound is not necessarily 19,
|
||||
since the year might be less than -999 or greater than 9999.
|
||||
|
||||
Subtract one for the sign bit if in case file timestamps can be negative;
|
||||
subtract FLOOR_LOG2_SECONDS_PER_YEAR to yield an upper bound on how many
|
||||
file timestamp bits might affect the year;
|
||||
302 / 1000 is log10 (2) rounded up;
|
||||
add one for integer division truncation;
|
||||
add one more for a minus sign if file timestamps can be negative;
|
||||
add 4 to allow for any 4-digit epoch year (e.g. 1970);
|
||||
add 25 to allow for "-MM-DD HH:MM:SS.NNNNNNNNN". */
|
||||
#define FLOOR_LOG2_SECONDS_PER_YEAR 24
|
||||
#define FILE_TIMESTAMP_PRINT_LEN_BOUND \
|
||||
(((sizeof (FILE_TIMESTAMP) * CHAR_BIT - 1 - FLOOR_LOG2_SECONDS_PER_YEAR) \
|
||||
* 302 / 1000) \
|
||||
+ 1 + 1 + 4 + 25)
|
||||
|
||||
extern FILE_TIMESTAMP file_timestamp_now PARAMS ((void));
|
||||
extern void file_timestamp_sprintf PARAMS ((char *p, FILE_TIMESTAMP ts));
|
||||
|
||||
/* Return the mtime of file F (a struct file *), caching it.
|
||||
The value is -1 if the file does not exist. */
|
||||
#define file_mtime(f) file_mtime_1 ((f), 1)
|
||||
/* Return the mtime of file F (a struct file *), caching it.
|
||||
Don't search using vpath for the file--if it doesn't actually exist,
|
||||
we don't find it.
|
||||
The value is -1 if the file does not exist. */
|
||||
#define file_mtime_no_search(f) file_mtime_1 ((f), 0)
|
||||
extern FILE_TIMESTAMP f_mtime PARAMS ((struct file *file, int search));
|
||||
#define file_mtime_1(f, v) \
|
||||
((f)->last_mtime ? (f)->last_mtime : f_mtime ((f), v))
|
||||
|
||||
/* Modtime value to use for `infinitely new'. We used to get the current time
|
||||
from the system and use that whenever we wanted `new'. But that causes
|
||||
trouble when the machine running make and the machine holding a file have
|
||||
different ideas about what time it is; and can also lose for `force'
|
||||
targets, which need to be considered newer than anything that depends on
|
||||
them, even if said dependents' modtimes are in the future.
|
||||
|
||||
If FILE_TIMESTAMP is unsigned, its maximum value is the same as
|
||||
((FILE_TIMESTAMP) -1), so use one less than that, because -1 is
|
||||
used for non-existing files. */
|
||||
#define NEW_MTIME \
|
||||
(INTEGER_TYPE_SIGNED (FILE_TIMESTAMP) \
|
||||
? INTEGER_TYPE_MAXIMUM (FILE_TIMESTAMP) \
|
||||
: (INTEGER_TYPE_MAXIMUM (FILE_TIMESTAMP) - 1))
|
||||
|
||||
#define check_renamed(file) \
|
||||
while ((file)->renamed != 0) (file) = (file)->renamed /* No ; here. */
|
||||
2597
function.c
2597
function.c
File diff suppressed because it is too large
Load Diff
821
getloadavg.c
821
getloadavg.c
File diff suppressed because it is too large
Load Diff
133
getopt.h
Normal file
133
getopt.h
Normal file
@@ -0,0 +1,133 @@
|
||||
/* Declarations for getopt.
|
||||
Copyright (C) 1989,90,91,92,93,94,96,97 Free Software Foundation, Inc.
|
||||
|
||||
NOTE: The canonical source of this file is maintained with the GNU C Library.
|
||||
Bugs can be reported to bug-glibc@gnu.org.
|
||||
|
||||
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, 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
USA. */
|
||||
|
||||
#ifndef _GETOPT_H
|
||||
#define _GETOPT_H 1
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* For communication from `getopt' to the caller.
|
||||
When `getopt' finds an option that takes an argument,
|
||||
the argument value is returned here.
|
||||
Also, when `ordering' is RETURN_IN_ORDER,
|
||||
each non-option ARGV-element is returned here. */
|
||||
|
||||
extern char *optarg;
|
||||
|
||||
/* Index in ARGV of the next element to be scanned.
|
||||
This is used for communication to and from the caller
|
||||
and for communication between successive calls to `getopt'.
|
||||
|
||||
On entry to `getopt', zero means this is the first call; initialize.
|
||||
|
||||
When `getopt' returns -1, this is the index of the first of the
|
||||
non-option elements that the caller should itself scan.
|
||||
|
||||
Otherwise, `optind' communicates from one call to the next
|
||||
how much of ARGV has been scanned so far. */
|
||||
|
||||
extern int optind;
|
||||
|
||||
/* Callers store zero here to inhibit the error message `getopt' prints
|
||||
for unrecognized options. */
|
||||
|
||||
extern int opterr;
|
||||
|
||||
/* Set to an option character which was unrecognized. */
|
||||
|
||||
extern int optopt;
|
||||
|
||||
/* Describe the long-named options requested by the application.
|
||||
The LONG_OPTIONS argument to getopt_long or getopt_long_only is a vector
|
||||
of `struct option' terminated by an element containing a name which is
|
||||
zero.
|
||||
|
||||
The field `has_arg' is:
|
||||
no_argument (or 0) if the option does not take an argument,
|
||||
required_argument (or 1) if the option requires an argument,
|
||||
optional_argument (or 2) if the option takes an optional argument.
|
||||
|
||||
If the field `flag' is not NULL, it points to a variable that is set
|
||||
to the value given in the field `val' when the option is found, but
|
||||
left unchanged if the option is not found.
|
||||
|
||||
To have a long-named option do something other than set an `int' to
|
||||
a compiled-in constant, such as set a value from `optarg', set the
|
||||
option's `flag' field to zero and its `val' field to a nonzero
|
||||
value (the equivalent single-letter option character, if there is
|
||||
one). For long options that have a zero `flag' field, `getopt'
|
||||
returns the contents of the `val' field. */
|
||||
|
||||
struct option
|
||||
{
|
||||
#if defined (__STDC__) && __STDC__
|
||||
const char *name;
|
||||
#else
|
||||
char *name;
|
||||
#endif
|
||||
/* has_arg can't be an enum because some compilers complain about
|
||||
type mismatches in all the code that assumes it is an int. */
|
||||
int has_arg;
|
||||
int *flag;
|
||||
int val;
|
||||
};
|
||||
|
||||
/* Names for the values of the `has_arg' field of `struct option'. */
|
||||
|
||||
#define no_argument 0
|
||||
#define required_argument 1
|
||||
#define optional_argument 2
|
||||
|
||||
#if defined (__STDC__) && __STDC__
|
||||
#ifdef __GNU_LIBRARY__
|
||||
/* Many other libraries have conflicting prototypes for getopt, with
|
||||
differences in the consts, in stdlib.h. To avoid compilation
|
||||
errors, only prototype getopt for the GNU C library. */
|
||||
extern int getopt (int argc, char *const *argv, const char *shortopts);
|
||||
#else /* not __GNU_LIBRARY__ */
|
||||
extern int getopt ();
|
||||
#endif /* __GNU_LIBRARY__ */
|
||||
extern int getopt_long (int argc, char *const *argv, const char *shortopts,
|
||||
const struct option *longopts, int *longind);
|
||||
extern int getopt_long_only (int argc, char *const *argv,
|
||||
const char *shortopts,
|
||||
const struct option *longopts, int *longind);
|
||||
|
||||
/* Internal only. Users should not call this directly. */
|
||||
extern int _getopt_internal (int argc, char *const *argv,
|
||||
const char *shortopts,
|
||||
const struct option *longopts, int *longind,
|
||||
int long_only);
|
||||
#else /* not __STDC__ */
|
||||
extern int getopt ();
|
||||
extern int getopt_long ();
|
||||
extern int getopt_long_only ();
|
||||
|
||||
extern int _getopt_internal ();
|
||||
#endif /* __STDC__ */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* getopt.h */
|
||||
190
getopt1.c
Normal file
190
getopt1.c
Normal file
@@ -0,0 +1,190 @@
|
||||
/* getopt_long and getopt_long_only entry points for GNU getopt.
|
||||
Copyright (C) 1987,88,89,90,91,92,93,94,96,97,98
|
||||
Free Software Foundation, Inc.
|
||||
|
||||
NOTE: The canonical source of this file is maintained with the GNU C Library.
|
||||
Bugs can be reported to bug-glibc@prep.ai.mit.edu.
|
||||
|
||||
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, 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
USA. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#include "getopt.h"
|
||||
|
||||
#if !defined __STDC__ || !__STDC__
|
||||
/* This is a separate conditional since some stdc systems
|
||||
reject `defined (const)'. */
|
||||
#ifndef const
|
||||
#define const
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
/* Comment out all this code if we are using the GNU C Library, and are not
|
||||
actually compiling the library itself. This code is part of the GNU C
|
||||
Library, but also included in many other GNU distributions. Compiling
|
||||
and linking in this code is a waste when using the GNU C library
|
||||
(especially if it is a shared library). Rather than having every GNU
|
||||
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. */
|
||||
|
||||
#define GETOPT_INTERFACE_VERSION 2
|
||||
#if !defined _LIBC && defined __GLIBC__ && __GLIBC__ >= 2
|
||||
#include <gnu-versions.h>
|
||||
#if _GNU_GETOPT_INTERFACE_VERSION == GETOPT_INTERFACE_VERSION
|
||||
#define ELIDE_CODE
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef ELIDE_CODE
|
||||
|
||||
|
||||
/* This needs to come after some library #include
|
||||
to get __GNU_LIBRARY__ defined. */
|
||||
#ifdef __GNU_LIBRARY__
|
||||
#include <stdlib.h>
|
||||
#endif
|
||||
|
||||
#ifndef NULL
|
||||
#define NULL 0
|
||||
#endif
|
||||
|
||||
int
|
||||
getopt_long (argc, argv, options, long_options, opt_index)
|
||||
int argc;
|
||||
char *const *argv;
|
||||
const char *options;
|
||||
const struct option *long_options;
|
||||
int *opt_index;
|
||||
{
|
||||
return _getopt_internal (argc, argv, options, long_options, opt_index, 0);
|
||||
}
|
||||
|
||||
/* Like getopt_long, but '-' as well as '--' can indicate a long option.
|
||||
If an option that starts with '-' (not '--') doesn't match a long option,
|
||||
but does match a short option, it is parsed as a short option
|
||||
instead. */
|
||||
|
||||
int
|
||||
getopt_long_only (argc, argv, options, long_options, opt_index)
|
||||
int argc;
|
||||
char *const *argv;
|
||||
const char *options;
|
||||
const struct option *long_options;
|
||||
int *opt_index;
|
||||
{
|
||||
return _getopt_internal (argc, argv, options, long_options, opt_index, 1);
|
||||
}
|
||||
|
||||
|
||||
#endif /* Not ELIDE_CODE. */
|
||||
|
||||
#ifdef TEST
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
int
|
||||
main (argc, argv)
|
||||
int argc;
|
||||
char **argv;
|
||||
{
|
||||
int c;
|
||||
int digit_optind = 0;
|
||||
|
||||
while (1)
|
||||
{
|
||||
int this_option_optind = optind ? optind : 1;
|
||||
int option_index = 0;
|
||||
static struct option long_options[] =
|
||||
{
|
||||
{"add", 1, 0, 0},
|
||||
{"append", 0, 0, 0},
|
||||
{"delete", 1, 0, 0},
|
||||
{"verbose", 0, 0, 0},
|
||||
{"create", 0, 0, 0},
|
||||
{"file", 1, 0, 0},
|
||||
{0, 0, 0, 0}
|
||||
};
|
||||
|
||||
c = getopt_long (argc, argv, "abc:d:0123456789",
|
||||
long_options, &option_index);
|
||||
if (c == -1)
|
||||
break;
|
||||
|
||||
switch (c)
|
||||
{
|
||||
case 0:
|
||||
printf ("option %s", long_options[option_index].name);
|
||||
if (optarg)
|
||||
printf (" with arg %s", optarg);
|
||||
printf ("\n");
|
||||
break;
|
||||
|
||||
case '0':
|
||||
case '1':
|
||||
case '2':
|
||||
case '3':
|
||||
case '4':
|
||||
case '5':
|
||||
case '6':
|
||||
case '7':
|
||||
case '8':
|
||||
case '9':
|
||||
if (digit_optind != 0 && digit_optind != this_option_optind)
|
||||
printf ("digits occur in two different argv-elements.\n");
|
||||
digit_optind = this_option_optind;
|
||||
printf ("option %c\n", c);
|
||||
break;
|
||||
|
||||
case 'a':
|
||||
printf ("option a\n");
|
||||
break;
|
||||
|
||||
case 'b':
|
||||
printf ("option b\n");
|
||||
break;
|
||||
|
||||
case 'c':
|
||||
printf ("option c with value `%s'\n", optarg);
|
||||
break;
|
||||
|
||||
case 'd':
|
||||
printf ("option d with value `%s'\n", optarg);
|
||||
break;
|
||||
|
||||
case '?':
|
||||
break;
|
||||
|
||||
default:
|
||||
printf ("?? getopt returned character code 0%o ??\n", c);
|
||||
}
|
||||
}
|
||||
|
||||
if (optind < argc)
|
||||
{
|
||||
printf ("non-option ARGV-elements: ");
|
||||
while (optind < argc)
|
||||
printf ("%s ", argv[optind++]);
|
||||
printf ("\n");
|
||||
}
|
||||
|
||||
exit (0);
|
||||
}
|
||||
|
||||
#endif /* TEST */
|
||||
1
glob/.cvsignore
Normal file
1
glob/.cvsignore
Normal file
@@ -0,0 +1 @@
|
||||
.deps Makefile.in
|
||||
@@ -1,481 +0,0 @@
|
||||
GNU LIBRARY GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 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.
|
||||
|
||||
[This is the first released version of the library GPL. It is
|
||||
numbered 2 because it goes with version 2 of the ordinary GPL.]
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
Licenses are intended to guarantee your freedom to share and change
|
||||
free software--to make sure the software is free for all its users.
|
||||
|
||||
This license, the Library General Public License, applies to some
|
||||
specially designated Free Software Foundation software, and to any
|
||||
other libraries whose authors decide to use it. You can use it for
|
||||
your libraries, 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 library, or if you modify it.
|
||||
|
||||
For example, if you distribute copies of the library, whether gratis
|
||||
or for a fee, you must give the recipients all the rights that we gave
|
||||
you. You must make sure that they, too, receive or can get the source
|
||||
code. If you link a program with the library, you must provide
|
||||
complete object files to the recipients so that they can relink them
|
||||
with the library, after making changes to the library and recompiling
|
||||
it. And you must show them these terms so they know their rights.
|
||||
|
||||
Our method of protecting your rights has two steps: (1) copyright
|
||||
the library, and (2) offer you this license which gives you legal
|
||||
permission to copy, distribute and/or modify the library.
|
||||
|
||||
Also, for each distributor's protection, we want to make certain
|
||||
that everyone understands that there is no warranty for this free
|
||||
library. If the library is modified by someone else and passed on, we
|
||||
want its recipients to know that what they have is not the original
|
||||
version, 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 companies distributing free
|
||||
software will individually obtain patent licenses, thus in effect
|
||||
transforming the program into proprietary software. To prevent this,
|
||||
we have made it clear that any patent must be licensed for everyone's
|
||||
free use or not licensed at all.
|
||||
|
||||
Most GNU software, including some libraries, is covered by the ordinary
|
||||
GNU General Public License, which was designed for utility programs. This
|
||||
license, the GNU Library General Public License, applies to certain
|
||||
designated libraries. This license is quite different from the ordinary
|
||||
one; be sure to read it in full, and don't assume that anything in it is
|
||||
the same as in the ordinary license.
|
||||
|
||||
The reason we have a separate public license for some libraries is that
|
||||
they blur the distinction we usually make between modifying or adding to a
|
||||
program and simply using it. Linking a program with a library, without
|
||||
changing the library, is in some sense simply using the library, and is
|
||||
analogous to running a utility program or application program. However, in
|
||||
a textual and legal sense, the linked executable is a combined work, a
|
||||
derivative of the original library, and the ordinary General Public License
|
||||
treats it as such.
|
||||
|
||||
Because of this blurred distinction, using the ordinary General
|
||||
Public License for libraries did not effectively promote software
|
||||
sharing, because most developers did not use the libraries. We
|
||||
concluded that weaker conditions might promote sharing better.
|
||||
|
||||
However, unrestricted linking of non-free programs would deprive the
|
||||
users of those programs of all benefit from the free status of the
|
||||
libraries themselves. This Library General Public License is intended to
|
||||
permit developers of non-free programs to use free libraries, while
|
||||
preserving your freedom as a user of such programs to change the free
|
||||
libraries that are incorporated in them. (We have not seen how to achieve
|
||||
this as regards changes in header files, but we have achieved it as regards
|
||||
changes in the actual functions of the Library.) The hope is that this
|
||||
will lead to faster development of free libraries.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow. Pay close attention to the difference between a
|
||||
"work based on the library" and a "work that uses the library". The
|
||||
former contains code derived from the library, while the latter only
|
||||
works together with the library.
|
||||
|
||||
Note that it is possible for a library to be covered by the ordinary
|
||||
General Public License rather than by this special one.
|
||||
|
||||
GNU LIBRARY GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License Agreement applies to any software library which
|
||||
contains a notice placed by the copyright holder or other authorized
|
||||
party saying it may be distributed under the terms of this Library
|
||||
General Public License (also called "this License"). Each licensee is
|
||||
addressed as "you".
|
||||
|
||||
A "library" means a collection of software functions and/or data
|
||||
prepared so as to be conveniently linked with application programs
|
||||
(which use some of those functions and data) to form executables.
|
||||
|
||||
The "Library", below, refers to any such software library or work
|
||||
which has been distributed under these terms. A "work based on the
|
||||
Library" means either the Library or any derivative work under
|
||||
copyright law: that is to say, a work containing the Library or a
|
||||
portion of it, either verbatim or with modifications and/or translated
|
||||
straightforwardly into another language. (Hereinafter, translation is
|
||||
included without limitation in the term "modification".)
|
||||
|
||||
"Source code" for a work means the preferred form of the work for
|
||||
making modifications to it. For a library, complete source code means
|
||||
all the source code for all modules it contains, plus any associated
|
||||
interface definition files, plus the scripts used to control compilation
|
||||
and installation of the library.
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running a program using the Library is not restricted, and output from
|
||||
such a program is covered only if its contents constitute a work based
|
||||
on the Library (independent of the use of the Library in a tool for
|
||||
writing it). Whether that is true depends on what the Library does
|
||||
and what the program that uses the Library does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Library's
|
||||
complete source code as you receive it, in any medium, provided that
|
||||
you conspicuously and appropriately publish on each copy an
|
||||
appropriate copyright notice and disclaimer of warranty; keep intact
|
||||
all the notices that refer to this License and to the absence of any
|
||||
warranty; and distribute a copy of this License along with the
|
||||
Library.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy,
|
||||
and you may at your option offer warranty protection in exchange for a
|
||||
fee.
|
||||
|
||||
2. You may modify your copy or copies of the Library or any portion
|
||||
of it, thus forming a work based on the Library, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) The modified work must itself be a software library.
|
||||
|
||||
b) You must cause the files modified to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
c) You must cause the whole of the work to be licensed at no
|
||||
charge to all third parties under the terms of this License.
|
||||
|
||||
d) If a facility in the modified Library refers to a function or a
|
||||
table of data to be supplied by an application program that uses
|
||||
the facility, other than as an argument passed when the facility
|
||||
is invoked, then you must make a good faith effort to ensure that,
|
||||
in the event an application does not supply such function or
|
||||
table, the facility still operates, and performs whatever part of
|
||||
its purpose remains meaningful.
|
||||
|
||||
(For example, a function in a library to compute square roots has
|
||||
a purpose that is entirely well-defined independent of the
|
||||
application. Therefore, Subsection 2d requires that any
|
||||
application-supplied function or table used by this function must
|
||||
be optional: if the application does not supply it, the square
|
||||
root function must still compute square roots.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Library,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Library, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote
|
||||
it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Library.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Library
|
||||
with the Library (or with a work based on the Library) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may opt to apply the terms of the ordinary GNU General Public
|
||||
License instead of this License to a given copy of the Library. To do
|
||||
this, you must alter all the notices that refer to this License, so
|
||||
that they refer to the ordinary GNU General Public License, version 2,
|
||||
instead of to this License. (If a newer version than version 2 of the
|
||||
ordinary GNU General Public License has appeared, then you can specify
|
||||
that version instead if you wish.) Do not make any other change in
|
||||
these notices.
|
||||
|
||||
Once this change is made in a given copy, it is irreversible for
|
||||
that copy, so the ordinary GNU General Public License applies to all
|
||||
subsequent copies and derivative works made from that copy.
|
||||
|
||||
This option is useful when you wish to copy part of the code of
|
||||
the Library into a program that is not a library.
|
||||
|
||||
4. You may copy and distribute the Library (or a portion or
|
||||
derivative of it, under Section 2) in object code or executable form
|
||||
under the terms of Sections 1 and 2 above provided that you accompany
|
||||
it with the complete corresponding machine-readable source code, which
|
||||
must be distributed under the terms of Sections 1 and 2 above on a
|
||||
medium customarily used for software interchange.
|
||||
|
||||
If distribution of object code is made by offering access to copy
|
||||
from a designated place, then offering equivalent access to copy the
|
||||
source code from the same place satisfies the requirement to
|
||||
distribute the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
5. A program that contains no derivative of any portion of the
|
||||
Library, but is designed to work with the Library by being compiled or
|
||||
linked with it, is called a "work that uses the Library". Such a
|
||||
work, in isolation, is not a derivative work of the Library, and
|
||||
therefore falls outside the scope of this License.
|
||||
|
||||
However, linking a "work that uses the Library" with the Library
|
||||
creates an executable that is a derivative of the Library (because it
|
||||
contains portions of the Library), rather than a "work that uses the
|
||||
library". The executable is therefore covered by this License.
|
||||
Section 6 states terms for distribution of such executables.
|
||||
|
||||
When a "work that uses the Library" uses material from a header file
|
||||
that is part of the Library, the object code for the work may be a
|
||||
derivative work of the Library even though the source code is not.
|
||||
Whether this is true is especially significant if the work can be
|
||||
linked without the Library, or if the work is itself a library. The
|
||||
threshold for this to be true is not precisely defined by law.
|
||||
|
||||
If such an object file uses only numerical parameters, data
|
||||
structure layouts and accessors, and small macros and small inline
|
||||
functions (ten lines or less in length), then the use of the object
|
||||
file is unrestricted, regardless of whether it is legally a derivative
|
||||
work. (Executables containing this object code plus portions of the
|
||||
Library will still fall under Section 6.)
|
||||
|
||||
Otherwise, if the work is a derivative of the Library, you may
|
||||
distribute the object code for the work under the terms of Section 6.
|
||||
Any executables containing that work also fall under Section 6,
|
||||
whether or not they are linked directly with the Library itself.
|
||||
|
||||
6. As an exception to the Sections above, you may also compile or
|
||||
link a "work that uses the Library" with the Library to produce a
|
||||
work containing portions of the Library, and distribute that work
|
||||
under terms of your choice, provided that the terms permit
|
||||
modification of the work for the customer's own use and reverse
|
||||
engineering for debugging such modifications.
|
||||
|
||||
You must give prominent notice with each copy of the work that the
|
||||
Library is used in it and that the Library and its use are covered by
|
||||
this License. You must supply a copy of this License. If the work
|
||||
during execution displays copyright notices, you must include the
|
||||
copyright notice for the Library among them, as well as a reference
|
||||
directing the user to the copy of this License. Also, you must do one
|
||||
of these things:
|
||||
|
||||
a) Accompany the work with the complete corresponding
|
||||
machine-readable source code for the Library including whatever
|
||||
changes were used in the work (which must be distributed under
|
||||
Sections 1 and 2 above); and, if the work is an executable linked
|
||||
with the Library, with the complete machine-readable "work that
|
||||
uses the Library", as object code and/or source code, so that the
|
||||
user can modify the Library and then relink to produce a modified
|
||||
executable containing the modified Library. (It is understood
|
||||
that the user who changes the contents of definitions files in the
|
||||
Library will not necessarily be able to recompile the application
|
||||
to use the modified definitions.)
|
||||
|
||||
b) Accompany the work with a written offer, valid for at
|
||||
least three years, to give the same user the materials
|
||||
specified in Subsection 6a, above, for a charge no more
|
||||
than the cost of performing this distribution.
|
||||
|
||||
c) If distribution of the work is made by offering access to copy
|
||||
from a designated place, offer equivalent access to copy the above
|
||||
specified materials from the same place.
|
||||
|
||||
d) Verify that the user has already received a copy of these
|
||||
materials or that you have already sent this user a copy.
|
||||
|
||||
For an executable, the required form of the "work that uses the
|
||||
Library" must include any data and utility programs needed for
|
||||
reproducing the executable from it. However, as a special exception,
|
||||
the 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.
|
||||
|
||||
It may happen that this requirement contradicts the license
|
||||
restrictions of other proprietary libraries that do not normally
|
||||
accompany the operating system. Such a contradiction means you cannot
|
||||
use both them and the Library together in an executable that you
|
||||
distribute.
|
||||
|
||||
7. You may place library facilities that are a work based on the
|
||||
Library side-by-side in a single library together with other library
|
||||
facilities not covered by this License, and distribute such a combined
|
||||
library, provided that the separate distribution of the work based on
|
||||
the Library and of the other library facilities is otherwise
|
||||
permitted, and provided that you do these two things:
|
||||
|
||||
a) Accompany the combined library with a copy of the same work
|
||||
based on the Library, uncombined with any other library
|
||||
facilities. This must be distributed under the terms of the
|
||||
Sections above.
|
||||
|
||||
b) Give prominent notice with the combined library of the fact
|
||||
that part of it is a work based on the Library, and explaining
|
||||
where to find the accompanying uncombined form of the same work.
|
||||
|
||||
8. You may not copy, modify, sublicense, link with, or distribute
|
||||
the Library except as expressly provided under this License. Any
|
||||
attempt otherwise to copy, modify, sublicense, link with, or
|
||||
distribute the Library is void, and will automatically terminate your
|
||||
rights under this License. However, parties who have received copies,
|
||||
or rights, from you under this License will not have their licenses
|
||||
terminated so long as such parties remain in full compliance.
|
||||
|
||||
9. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Library or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Library (or any work based on the
|
||||
Library), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Library or works based on it.
|
||||
|
||||
10. Each time you redistribute the Library (or any work based on the
|
||||
Library), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute, link with or modify the Library
|
||||
subject to these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties to
|
||||
this License.
|
||||
|
||||
11. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Library at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Library by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Library.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under any
|
||||
particular circumstance, the balance of the section is intended to apply,
|
||||
and the section as a whole is intended to apply in other circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
12. If the distribution and/or use of the Library is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Library under this License may add
|
||||
an explicit geographical distribution limitation excluding those countries,
|
||||
so that distribution is permitted only in or among countries not thus
|
||||
excluded. In such case, this License incorporates the limitation as if
|
||||
written in the body of this License.
|
||||
|
||||
13. The Free Software Foundation may publish revised and/or new
|
||||
versions of the Library General Public License from time to time.
|
||||
Such new versions will be similar in spirit to the present version,
|
||||
but may differ in detail to address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Library
|
||||
specifies a version number of this License which applies to it and
|
||||
"any later version", you have the option of following the terms and
|
||||
conditions either of that version or of any later version published by
|
||||
the Free Software Foundation. If the Library does not specify a
|
||||
license version number, you may choose any version ever published by
|
||||
the Free Software Foundation.
|
||||
|
||||
14. If you wish to incorporate parts of the Library into other free
|
||||
programs whose distribution conditions are incompatible with these,
|
||||
write to the author to ask for permission. For software which is
|
||||
copyrighted by the Free Software Foundation, write to the Free
|
||||
Software Foundation; we sometimes make exceptions for this. Our
|
||||
decision will be guided by the two goals of preserving the free status
|
||||
of all derivatives of our free software and of promoting the sharing
|
||||
and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
|
||||
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
|
||||
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
|
||||
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
|
||||
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
|
||||
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
|
||||
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
|
||||
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
|
||||
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
|
||||
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
|
||||
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
|
||||
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
|
||||
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
|
||||
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
|
||||
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
|
||||
DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
Appendix: How to Apply These Terms to Your New Libraries
|
||||
|
||||
If you develop a new library, and you want it to be of the greatest
|
||||
possible use to the public, we recommend making it free software that
|
||||
everyone can redistribute and change. You can do so by permitting
|
||||
redistribution under these terms (or, alternatively, under the terms of the
|
||||
ordinary General Public License).
|
||||
|
||||
To apply these terms, attach the following notices to the library. It is
|
||||
safest to attach them to the start of each source file to most effectively
|
||||
convey the exclusion of warranty; and each file should have at least the
|
||||
"copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the library's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; 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.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the library, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the
|
||||
library `Frob' (a library for tweaking knobs) written by James Random Hacker.
|
||||
|
||||
<signature of Ty Coon>, 1 April 1990
|
||||
Ty Coon, President of Vice
|
||||
|
||||
That's all there is to it!
|
||||
137
glob/ChangeLog
137
glob/ChangeLog
@@ -1,93 +1,108 @@
|
||||
Thu Dec 14 02:28:22 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
|
||||
1999-07-21 Paul D. Smith <psmith@gnu.org>
|
||||
|
||||
* posix/glob.c (glob_in_dir): Cast result of opendir to __ptr_t,
|
||||
and cast STREAM to DIR * before passing to readdir and closedir.
|
||||
* glob.c, glob.h, fnmatch.c, fnmatch.h: Update to latest version
|
||||
from GLIBC.
|
||||
|
||||
Mon Dec 11 20:07:54 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
|
||||
* fnmatch.c (internal_fnmatch): Use K&R definition syntax, not ANSI.
|
||||
(__strchrnul): This won't exist outside GLIBC, so create one.
|
||||
|
||||
* posix/glob.c [! STDC_HEADERS]: Declare getenv.
|
||||
(glob): Avoid using function as value.
|
||||
* glob.c: Move getlogin{,_r} prototypes below glob.h to get __P()
|
||||
macro.
|
||||
|
||||
Fri Dec 8 13:04:51 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
|
||||
1998-08-05 Paul D. Smith <psmith@gnu.org>
|
||||
|
||||
* 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.
|
||||
* configure.in: Remove; configuration for glob is handled by the
|
||||
make configure.in.
|
||||
|
||||
Mon Sep 11 14:00:14 1995 Roland McGrath <roland@whiz-bang.gnu.ai.mit.edu>
|
||||
1998-07-29 Paul D. Smith <psmith@gnu.org>
|
||||
|
||||
* posix/glob.c (glob): Comment fix.
|
||||
* glob.c, fnmatch.c: New versions from the GLIBC folks (Ulrich
|
||||
Drepper). Fixes a bug reported by Eli Zaretski. Integrates
|
||||
DOS/Windows32 support.
|
||||
|
||||
Wed Aug 30 16:44:55 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
|
||||
1998-07-27 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
|
||||
|
||||
* posix/glob.c (glob): Use realloc to extend strings for GLOB_MARK
|
||||
slash.
|
||||
(glob_in_dir): Don't allocate extra byte here.
|
||||
* glob.c (glob): Cast away const on assignment of pattern to dirname.
|
||||
Cast the return type of __alloca() for traditional C compilers.
|
||||
|
||||
Mon Aug 7 14:04:36 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
|
||||
1998-07-23 Paul D. Smith <psmith@gnu.org>
|
||||
|
||||
* posix/glob.c (glob_in_dir): Allocate GLOB_MARK byte in case when
|
||||
(NFOUND == 0 && (FLAGS & GLOB_NOCHECK)).
|
||||
* glob.c, fnmatch.c: New versions of these files from the GLIBC
|
||||
folks (Ulrich Drepper). Had to re-integrate some DOS/Windows
|
||||
code.
|
||||
|
||||
Sat Apr 29 15:46:57 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
|
||||
1998-07-10 Paul D. Smith <psmith@gnu.org>
|
||||
|
||||
* posix/glob.c (S_ISDIR): Define if undefined.
|
||||
* glob.c (glob_in_dir): If no meta chars exist in PATTERN and
|
||||
GLOB_NOCHECK is present, don't look for the file--whether it's
|
||||
found or not, we'll always return it, so why bother searching?
|
||||
|
||||
Tue Apr 25 17:17:19 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
|
||||
Also, if we are searching and there are no meta chars, don't
|
||||
bother trying fnmatch() if the strcmp() fails.
|
||||
|
||||
* 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.
|
||||
1998-05-30 Eli Zaretskii <eliz@is.elta.co.il>
|
||||
|
||||
Wed Mar 8 13:38:13 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
|
||||
* glob.c (glob) [__MSDOS__, WINDOWS32]: Compute the directory and
|
||||
filename parts of the pattern correctly when it includes a drive
|
||||
spec. Disallow wildcards in the drive spec. Prevent recursion
|
||||
when dirname is of the form "d:/" or "d:".
|
||||
(prefix_array) [__MSDOS__, WINDOWS32]: Don't append a slash to
|
||||
"d:/" and "d:".
|
||||
|
||||
* posix/glob/configure.bat: Fixes from DJ.
|
||||
1998-05-13 Paul D. Smith <psmith@gnu.org>
|
||||
|
||||
Wed Feb 22 00:44:41 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
|
||||
* SMakefile, Makefile.ami, glob.c, glob.h, fnmatch.c: Updated from
|
||||
the latest glibc version.
|
||||
|
||||
* posix/glob/configure.in: Put AC_ISC_POSIX before AC_CONST.
|
||||
1998-04-17 Paul D. Smith <psmith@gnu.org>
|
||||
|
||||
Sun Feb 5 17:59:53 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
|
||||
* configure.in: Create a config.h file instead of setting things
|
||||
on the compile line. This is because when build.sh runs it merely
|
||||
passes -DHAVE_CONFIG_H to the glob files, just as it does to the
|
||||
make files.
|
||||
* config.h.in: Created by autoheader.
|
||||
|
||||
* malloc/malloc.c (__malloc_extra_blocks): New variable.
|
||||
(malloc): When getting more core, get __malloc_extra_blocks extra;
|
||||
put the new block at the end of the free list and let the next loop
|
||||
iteration use the initial portion of it.
|
||||
* malloc/free.c (_free_internal): Account for twice
|
||||
__malloc_extra_blocks in deciding if we have so much extra memory
|
||||
we should return it to the system.
|
||||
* malloc/malloc.h (__malloc_extra_blocks): Declare it.
|
||||
* posix/glob.c (prefix_array, glob_pattern_p): Remove gratuitous
|
||||
const in parameter decl.
|
||||
Tue Aug 12 10:52:34 1997 Paul D. Smith <psmith@baynetworks.com>
|
||||
|
||||
Fri Jan 27 17:53:49 1995 Jim Meyering (meyering@comco.com)
|
||||
* configure.in: Require autoconf 2.12.
|
||||
|
||||
* posix/fnmatch.c: Declare errno if it's not defined.
|
||||
That's simpler than testing #if !defined(__GNU_LIBRARY__)
|
||||
&& !defined(STDC_HEADERS).
|
||||
* glob: Updates from latest GNU libc glob code.
|
||||
|
||||
Thu Jan 26 00:02:01 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
|
||||
* glob.c,glob.h,fnmatch.h: Change all WIN32 references to WINDOWS32.
|
||||
|
||||
* io/ftw.c: Avoid `ret' as variable name.
|
||||
* posix/glob.c: Likewise.
|
||||
* glob.h: OSF4 defines macros in such a way that GLOB_ALTDIRFUNC
|
||||
is not defined. Added a test to the #if which defines it if
|
||||
_GNU_SOURCE is defined; that's set by both glob.c and GNU make.
|
||||
|
||||
Wed Jan 25 00:45:56 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
|
||||
* glob.c: SunOS4 w/ cc needs #include <stdio.h>, since assert.h
|
||||
requires stderr but doesn't include stdio.h :-/.
|
||||
(next_brace_sub): De-protoize function definition.
|
||||
(glob): Cast __alloca(); on SunOS4 it uses the default return type
|
||||
of int.
|
||||
(glob): Irix defines getlogin_r() to return a char*; move the
|
||||
extern for that into the _LIBC area since it isn't used except in
|
||||
LIBC anyway. Likewise, move extern getlogin() into the "else".
|
||||
|
||||
* posix/glob/configure.in: Put AC_AIX and AC_MINIX early, before
|
||||
any compile tests.
|
||||
Sat Jul 20 21:55:31 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
|
||||
|
||||
Mon Jan 16 15:49:07 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
|
||||
Win32 hacks from <Rob_Tulloh@tivoli.com>.
|
||||
* posix/glob.c [WIN32]: Don't include <pwd.h>; don't use d_ino;
|
||||
use void * for my_realloc; include <malloc.h> for alloca.
|
||||
(glob) [WIN32]: Use "c:/users/default" for ~ if no HOME variable.
|
||||
* posix/fnmatch.h [WIN32]: Use prototypes even if [!__STDC__].
|
||||
* posix/glob.h: Likewise.
|
||||
|
||||
* posix/glob/Makefile.in: Remove config.h and config.log.
|
||||
Fri Jul 19 16:56:41 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
|
||||
|
||||
Sun Jan 15 06:56:47 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
|
||||
* posix/glob.h [!_AMIGA && !VMS]: Check this instead of just [!_AMIGA]
|
||||
for `struct stat;' forward decl.
|
||||
|
||||
* posix/glob/configure.in: Add AC_CONST check.
|
||||
Sat Jun 22 10:44:09 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
|
||||
|
||||
* posix/glob.c: Include <alloca.h> only [HAVE_ALLOCA_H], not [sparc].
|
||||
|
||||
Fri Jun 21 00:27:51 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
|
||||
|
||||
* posix/fnmatch.c (fnmatch): Fix \*[*?]+ case to increment name ptr
|
||||
only for ?s, not for *s. Fix from Chet Ramey.
|
||||
|
||||
|
||||
10
glob/Makefile.am
Normal file
10
glob/Makefile.am
Normal file
@@ -0,0 +1,10 @@
|
||||
# -*-Makefile-*-, or close enough
|
||||
|
||||
AUTOMAKE_OPTIONS = 1.4 foreign
|
||||
|
||||
noinst_LIBRARIES = libglob.a
|
||||
|
||||
libglob_a_SOURCES = glob.c glob.h fnmatch.c fnmatch.h
|
||||
|
||||
EXTRA_DIST = COPYING.LIB Makefile.ami SCOPTIONS SMakefile \
|
||||
configure.bat
|
||||
@@ -1,6 +1,6 @@
|
||||
# Makefile for standalone distribution of libglob.a (fnmatch, glob).
|
||||
|
||||
# Copyright (C) 1991, 92, 93, 94, 95 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1991, 92, 93, 94, 95, 97, 98 Free Software Foundation, Inc.
|
||||
# This file is part of the GNU C Library.
|
||||
|
||||
# This library is free software; you can redistribute it and/or
|
||||
@@ -10,55 +10,58 @@
|
||||
|
||||
# This library is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
# Library General Public License for more details.
|
||||
|
||||
# You should have received a copy of the GNU Library General Public
|
||||
# License along with this library; see the file COPYING.LIB. If
|
||||
# not, write to the Free Software Foundation, Inc., 675 Mass Ave,
|
||||
# Cambridge, MA 02139, USA.
|
||||
# not, write to the Free Software Foundation, Inc.,
|
||||
# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
# Ultrix 2.2 make doesn't expand the value of VPATH.
|
||||
VPATH = @srcdir@
|
||||
VPATH = /glob/
|
||||
# This must repeat the value, because configure will remove `VPATH = .'.
|
||||
srcdir = @srcdir@
|
||||
srcdir = /glob/
|
||||
|
||||
CC = @CC@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CFLAGS = @CFLAGS@
|
||||
CC = sc
|
||||
RM = delete
|
||||
CPPFLAGS =
|
||||
CFLAGS =
|
||||
|
||||
# Information determined by configure.
|
||||
DEFS = @DEFS@
|
||||
DEFS = Define HAVE_HEADER_STDC Define HAVE_UNISTD_H Define HAVE_STRING_H \
|
||||
Define HAVE_DIRENT_H
|
||||
|
||||
# How to invoke ar.
|
||||
AR = @AR@
|
||||
ARFLAGS = rv
|
||||
AR = join
|
||||
ARFLAGS = as
|
||||
|
||||
# How to invoke ranlib.
|
||||
RANLIB = @RANLIB@
|
||||
RANLIB = ;
|
||||
|
||||
.PHONY: all
|
||||
all: libglob.a
|
||||
all: glob.lib
|
||||
|
||||
libglob.a: glob.o fnmatch.o
|
||||
glob.lib : glob.o fnmatch.o
|
||||
$(AR) $(ARFLAGS) $@ glob.o fnmatch.o
|
||||
$(RANLIB) $@
|
||||
|
||||
# For some reason, Unix make wants the dependencies on the source files.
|
||||
# Otherwise it refuses to use an implicit rule!
|
||||
# And, get this: it doesn't work to use $(srcdir)/foo.c!!
|
||||
glob.o: $(srcdir)/glob.h $(srcdir)/fnmatch.h glob.c
|
||||
fnmatch.o: $(srcdir)/fnmatch.h fnmatch.c
|
||||
# And, get this: it doesn't work to use $(srcdir)foo.c!!
|
||||
glob.o: $(srcdir)glob.h $(srcdir)fnmatch.h glob.c
|
||||
fnmatch.o: $(srcdir)fnmatch.h fnmatch.c
|
||||
|
||||
OUTPUT_OPTION =
|
||||
.c.o:
|
||||
$(CC) -I. -I$(srcdir) -c \
|
||||
$(CC) IDir "" \
|
||||
$(DEFS) $(CPPFLAGS) $(CFLAGS) $< $(OUTPUT_OPTION)
|
||||
|
||||
.PHONY: clean realclean glob-clean glob-realclean distclean
|
||||
clean glob-clean:
|
||||
-rm -f libglob.a *.o core
|
||||
-$(RM) glob.lib "#?.o" core
|
||||
distclean glob-realclean: clean
|
||||
-rm -f TAGS tags Makefile config.status config.h config.log
|
||||
-$(RM) TAGS tags Makefile config.status config.h config.log
|
||||
realcean: distclean
|
||||
|
||||
# For inside the C library.
|
||||
13
glob/SCOPTIONS
Normal file
13
glob/SCOPTIONS
Normal file
@@ -0,0 +1,13 @@
|
||||
ERRORREXX
|
||||
OPTIMIZE
|
||||
NOVERSION
|
||||
OPTIMIZERTIME
|
||||
OPTIMIZERALIAS
|
||||
DEFINE INCLUDEDIR="include:"
|
||||
DEFINE LIBDIR="lib:"
|
||||
DEFINE NO_ALLOCA
|
||||
DEFINE NO_FLOAT
|
||||
DEFINE NO_ARCHIVES
|
||||
IGNORE=161
|
||||
IGNORE=100
|
||||
STARTUP=cres
|
||||
69
glob/SMakefile
Normal file
69
glob/SMakefile
Normal file
@@ -0,0 +1,69 @@
|
||||
# Makefile for standalone distribution of libglob.a (fnmatch, glob).
|
||||
|
||||
# Copyright (C) 1991, 92, 93, 94, 95, 97, 98 Free Software Foundation, Inc.
|
||||
# This file is part of the GNU C Library.
|
||||
|
||||
# This library is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU Library General Public License
|
||||
# as published by the Free Software Foundation; either version 2 of
|
||||
# the License, or (at your option) any later version.
|
||||
|
||||
# This library is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
# Library General Public License for more details.
|
||||
|
||||
# You should have received a copy of the GNU Library General Public
|
||||
# License along with this library; see the file COPYING.LIB. If
|
||||
# not, write to the Free Software Foundation, Inc.,
|
||||
# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
# Ultrix 2.2 make doesn't expand the value of VPATH.
|
||||
VPATH = /glob/
|
||||
# This must repeat the value, because configure will remove `VPATH = .'.
|
||||
srcdir = /glob/
|
||||
|
||||
CC = sc
|
||||
CPPFLAGS =
|
||||
CFLAGS =
|
||||
MAKE = smake
|
||||
RM = delete
|
||||
|
||||
# Information determined by configure.
|
||||
DEFS = Define HAVE_HEADER_STDC Define HAVE_UNISTD_H Define HAVE_STRING_H \
|
||||
Define HAVE_DIRENT_H
|
||||
|
||||
# How to invoke ar.
|
||||
AR = join
|
||||
ARFLAGS = as
|
||||
|
||||
# How to invoke ranlib.
|
||||
RANLIB = ;
|
||||
|
||||
.PHONY: all
|
||||
all: glob.lib
|
||||
|
||||
glob.lib : glob.o fnmatch.o
|
||||
$(AR) $(ARFLAGS) $@ glob.o fnmatch.o
|
||||
$(RANLIB) $@
|
||||
|
||||
# For some reason, Unix make wants the dependencies on the source files.
|
||||
# Otherwise it refuses to use an implicit rule!
|
||||
# And, get this: it doesn't work to use $(srcdir)foo.c!!
|
||||
glob.o: $(srcdir)glob.h $(srcdir)fnmatch.h glob.c
|
||||
fnmatch.o: $(srcdir)fnmatch.h fnmatch.c
|
||||
|
||||
.c.o:
|
||||
$(CC) IDir "" \
|
||||
$(DEFS) $(CPPFLAGS) $(CFLAGS) $< $(OUTPUT_OPTION)
|
||||
|
||||
.PHONY: clean realclean glob-clean glob-realclean distclean
|
||||
clean glob-clean:
|
||||
-$(RM) -f glob.lib *.o core
|
||||
distclean glob-realclean: clean
|
||||
-$(RM) -f TAGS tags Makefile config.status config.h config.log
|
||||
realcean: distclean
|
||||
|
||||
# For inside the C library.
|
||||
glob.tar glob.tar.Z:
|
||||
$(MAKE) -C .. $@
|
||||
1547
glob/configure
vendored
1547
glob/configure
vendored
File diff suppressed because it is too large
Load Diff
@@ -1,5 +1,5 @@
|
||||
@echo off
|
||||
echo Configuring glob for GO32
|
||||
echo Configuring glob for DJGPP
|
||||
rem This batch file assumes a unix-type "sed" program
|
||||
|
||||
echo # Makefile generated by "configure.bat"> Makefile
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
dnl Process this file with autoconf to produce a configure script.
|
||||
AC_INIT(fnmatch.c) dnl A distinctive file to look for in srcdir.
|
||||
AC_PREREQ(2.1) dnl Minimum Autoconf version required.
|
||||
AC_PROG_CC
|
||||
AC_CHECK_PROG(AR, ar, ar, ar)
|
||||
AC_PROG_RANLIB
|
||||
AC_PROG_CPP dnl Later checks need this.
|
||||
dnl These two want to come early.
|
||||
AC_AIX
|
||||
AC_MINIX
|
||||
AC_ISC_POSIX
|
||||
AC_CONST
|
||||
AC_HEADER_STDC
|
||||
AC_CHECK_HEADERS(memory.h unistd.h string.h)
|
||||
AC_HEADER_DIRENT
|
||||
AC_FUNC_CLOSEDIR_VOID
|
||||
AC_FUNC_ALLOCA
|
||||
AC_FUNC_STRCOLL
|
||||
AC_OUTPUT(Makefile)
|
||||
425
glob/fnmatch.c
425
glob/fnmatch.c
@@ -1,28 +1,51 @@
|
||||
/* Copyright (C) 1991, 1992, 1993 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1991, 92, 93, 96, 97, 98, 99 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; see the file COPYING.LIB. If
|
||||
not, write to the Free Software Foundation, Inc., 675 Mass Ave,
|
||||
Cambridge, MA 02139, USA. */
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; see the file COPYING.LIB. If not,
|
||||
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#if HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
/* Enable GNU extensions in fnmatch.h. */
|
||||
#ifndef _GNU_SOURCE
|
||||
# define _GNU_SOURCE 1
|
||||
#endif
|
||||
|
||||
#include <errno.h>
|
||||
#include <fnmatch.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#if HAVE_STRING_H || defined _LIBC
|
||||
# include <string.h>
|
||||
#else
|
||||
# include <strings.h>
|
||||
#endif
|
||||
|
||||
#if defined STDC_HEADERS || defined _LIBC
|
||||
# include <stdlib.h>
|
||||
#endif
|
||||
|
||||
/* For platform which support the ISO C amendement 1 functionality we
|
||||
support user defined character classes. */
|
||||
#if defined _LIBC || (defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H)
|
||||
/* Solaris 2.5 has a bug: <wchar.h> must be included before <wctype.h>. */
|
||||
# include <wchar.h>
|
||||
# include <wctype.h>
|
||||
#endif
|
||||
|
||||
/* Comment out all this code if we are using the GNU C Library, and are not
|
||||
actually compiling the library itself. This code is part of the GNU C
|
||||
@@ -32,26 +55,114 @@ 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__)
|
||||
#if defined _LIBC || !defined __GNU_LIBRARY__
|
||||
|
||||
|
||||
#ifndef errno
|
||||
extern int errno;
|
||||
# if defined STDC_HEADERS || !defined isascii
|
||||
# define ISASCII(c) 1
|
||||
# else
|
||||
# define ISASCII(c) isascii(c)
|
||||
# endif
|
||||
|
||||
#ifdef isblank
|
||||
# define ISBLANK(c) (ISASCII (c) && isblank (c))
|
||||
#else
|
||||
# define ISBLANK(c) ((c) == ' ' || (c) == '\t')
|
||||
#endif
|
||||
#ifdef isgraph
|
||||
# define ISGRAPH(c) (ISASCII (c) && isgraph (c))
|
||||
#else
|
||||
# define ISGRAPH(c) (ISASCII (c) && isprint (c) && !isspace (c))
|
||||
#endif
|
||||
|
||||
#define ISPRINT(c) (ISASCII (c) && isprint (c))
|
||||
#define ISDIGIT(c) (ISASCII (c) && isdigit (c))
|
||||
#define ISALNUM(c) (ISASCII (c) && isalnum (c))
|
||||
#define ISALPHA(c) (ISASCII (c) && isalpha (c))
|
||||
#define ISCNTRL(c) (ISASCII (c) && iscntrl (c))
|
||||
#define ISLOWER(c) (ISASCII (c) && islower (c))
|
||||
#define ISPUNCT(c) (ISASCII (c) && ispunct (c))
|
||||
#define ISSPACE(c) (ISASCII (c) && isspace (c))
|
||||
#define ISUPPER(c) (ISASCII (c) && isupper (c))
|
||||
#define ISXDIGIT(c) (ISASCII (c) && isxdigit (c))
|
||||
|
||||
# define STREQ(s1, s2) ((strcmp (s1, s2) == 0))
|
||||
|
||||
# if defined _LIBC || (defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H)
|
||||
/* The GNU C library provides support for user-defined character classes
|
||||
and the functions from ISO C amendement 1. */
|
||||
# ifdef CHARCLASS_NAME_MAX
|
||||
# define CHAR_CLASS_MAX_LENGTH CHARCLASS_NAME_MAX
|
||||
# else
|
||||
/* This shouldn't happen but some implementation might still have this
|
||||
problem. Use a reasonable default value. */
|
||||
# define CHAR_CLASS_MAX_LENGTH 256
|
||||
# endif
|
||||
|
||||
# ifdef _LIBC
|
||||
# define IS_CHAR_CLASS(string) __wctype (string)
|
||||
# else
|
||||
# define IS_CHAR_CLASS(string) wctype (string)
|
||||
# endif
|
||||
# else
|
||||
# define CHAR_CLASS_MAX_LENGTH 6 /* Namely, `xdigit'. */
|
||||
|
||||
# define IS_CHAR_CLASS(string) \
|
||||
(STREQ (string, "alpha") || STREQ (string, "upper") \
|
||||
|| STREQ (string, "lower") || STREQ (string, "digit") \
|
||||
|| STREQ (string, "alnum") || STREQ (string, "xdigit") \
|
||||
|| STREQ (string, "space") || STREQ (string, "print") \
|
||||
|| STREQ (string, "punct") || STREQ (string, "graph") \
|
||||
|| STREQ (string, "cntrl") || STREQ (string, "blank"))
|
||||
# endif
|
||||
|
||||
/* Avoid depending on library functions or files
|
||||
whose names are inconsistent. */
|
||||
|
||||
# if !defined _LIBC && !defined getenv
|
||||
extern char *getenv ();
|
||||
# endif
|
||||
|
||||
# ifndef errno
|
||||
extern int errno;
|
||||
# endif
|
||||
|
||||
/* This function doesn't exist on most systems. */
|
||||
|
||||
# if !defined HAVE___STRCHRNUL && !defined _LIBC
|
||||
static char *
|
||||
__strchrnul (s, c)
|
||||
register const char *s;
|
||||
int c;
|
||||
{
|
||||
c = (unsigned char)c;
|
||||
while (*s && *s != c)
|
||||
++s;
|
||||
return (char *)s;
|
||||
}
|
||||
# endif
|
||||
|
||||
/* Match STRING against the filename pattern PATTERN, returning zero if
|
||||
it matches, nonzero if not. */
|
||||
int
|
||||
fnmatch (pattern, string, flags)
|
||||
static int
|
||||
#ifdef _LIBC
|
||||
internal_function
|
||||
#endif
|
||||
internal_fnmatch (pattern, string, no_leading_period, flags)
|
||||
const char *pattern;
|
||||
const char *string;
|
||||
int no_leading_period;
|
||||
int flags;
|
||||
{
|
||||
register const char *p = pattern, *n = string;
|
||||
register char c;
|
||||
register unsigned char c;
|
||||
|
||||
/* Note that this evalutes C many times. */
|
||||
#define FOLD(c) ((flags & FNM_CASEFOLD) && isupper (c) ? tolower (c) : (c))
|
||||
/* Note that this evaluates C many times. */
|
||||
# ifdef _LIBC
|
||||
# define FOLD(c) ((flags & FNM_CASEFOLD) ? tolower (c) : (c))
|
||||
# else
|
||||
# define FOLD(c) ((flags & FNM_CASEFOLD) && ISUPPER (c) ? tolower (c) : (c))
|
||||
# endif
|
||||
|
||||
while ((c = *p++) != '\0')
|
||||
{
|
||||
@@ -62,10 +173,11 @@ fnmatch (pattern, string, flags)
|
||||
case '?':
|
||||
if (*n == '\0')
|
||||
return FNM_NOMATCH;
|
||||
else if ((flags & FNM_FILE_NAME) && *n == '/')
|
||||
else if (*n == '/' && (flags & FNM_FILE_NAME))
|
||||
return FNM_NOMATCH;
|
||||
else if ((flags & FNM_PERIOD) && *n == '.' &&
|
||||
(n == string || ((flags & FNM_FILE_NAME) && n[-1] == '/')))
|
||||
else if (*n == '.' && no_leading_period
|
||||
&& (n == string
|
||||
|| (n[-1] == '/' && (flags & FNM_FILE_NAME))))
|
||||
return FNM_NOMATCH;
|
||||
break;
|
||||
|
||||
@@ -73,95 +185,239 @@ fnmatch (pattern, string, flags)
|
||||
if (!(flags & FNM_NOESCAPE))
|
||||
{
|
||||
c = *p++;
|
||||
if (c == '\0')
|
||||
/* Trailing \ loses. */
|
||||
return FNM_NOMATCH;
|
||||
c = FOLD (c);
|
||||
}
|
||||
if (FOLD (*n) != c)
|
||||
if (FOLD ((unsigned char) *n) != c)
|
||||
return FNM_NOMATCH;
|
||||
break;
|
||||
|
||||
case '*':
|
||||
if ((flags & FNM_PERIOD) && *n == '.' &&
|
||||
(n == string || ((flags & FNM_FILE_NAME) && n[-1] == '/')))
|
||||
if (*n == '.' && no_leading_period
|
||||
&& (n == string
|
||||
|| (n[-1] == '/' && (flags & FNM_FILE_NAME))))
|
||||
return FNM_NOMATCH;
|
||||
|
||||
for (c = *p++; c == '?' || c == '*'; c = *p++, ++n)
|
||||
if (((flags & FNM_FILE_NAME) && *n == '/') ||
|
||||
(c == '?' && *n == '\0'))
|
||||
return FNM_NOMATCH;
|
||||
for (c = *p++; c == '?' || c == '*'; c = *p++)
|
||||
{
|
||||
if (*n == '/' && (flags & FNM_FILE_NAME))
|
||||
/* A slash does not match a wildcard under FNM_FILE_NAME. */
|
||||
return FNM_NOMATCH;
|
||||
else if (c == '?')
|
||||
{
|
||||
/* A ? needs to match one character. */
|
||||
if (*n == '\0')
|
||||
/* There isn't another character; no match. */
|
||||
return FNM_NOMATCH;
|
||||
else
|
||||
/* One character of the string is consumed in matching
|
||||
this ? wildcard, so *??? won't match if there are
|
||||
less than three characters. */
|
||||
++n;
|
||||
}
|
||||
}
|
||||
|
||||
if (c == '\0')
|
||||
return 0;
|
||||
/* The wildcard(s) is/are the last element of the pattern.
|
||||
If the name is a file name and contains another slash
|
||||
this does mean it cannot match. */
|
||||
return ((flags & FNM_FILE_NAME) && strchr (n, '/') != NULL
|
||||
? FNM_NOMATCH : 0);
|
||||
else
|
||||
{
|
||||
const char *endp;
|
||||
|
||||
{
|
||||
char c1 = (!(flags & FNM_NOESCAPE) && c == '\\') ? *p : c;
|
||||
c1 = FOLD (c1);
|
||||
for (--p; *n != '\0'; ++n)
|
||||
if ((c == '[' || FOLD (*n) == c1) &&
|
||||
fnmatch (p, n, flags & ~FNM_PERIOD) == 0)
|
||||
return 0;
|
||||
return FNM_NOMATCH;
|
||||
}
|
||||
endp = __strchrnul (n, (flags & FNM_FILE_NAME) ? '/' : '\0');
|
||||
|
||||
if (c == '[')
|
||||
{
|
||||
int flags2 = ((flags & FNM_FILE_NAME)
|
||||
? flags : (flags & ~FNM_PERIOD));
|
||||
|
||||
for (--p; n < endp; ++n)
|
||||
if (internal_fnmatch (p, n,
|
||||
(no_leading_period
|
||||
&& (n == string
|
||||
|| (n[-1] == '/'
|
||||
&& (flags
|
||||
& FNM_FILE_NAME)))),
|
||||
flags2)
|
||||
== 0)
|
||||
return 0;
|
||||
}
|
||||
else if (c == '/' && (flags & FNM_FILE_NAME))
|
||||
{
|
||||
while (*n != '\0' && *n != '/')
|
||||
++n;
|
||||
if (*n == '/'
|
||||
&& (internal_fnmatch (p, n + 1, flags & FNM_PERIOD,
|
||||
flags) == 0))
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
int flags2 = ((flags & FNM_FILE_NAME)
|
||||
? flags : (flags & ~FNM_PERIOD));
|
||||
|
||||
if (c == '\\' && !(flags & FNM_NOESCAPE))
|
||||
c = *p;
|
||||
c = FOLD (c);
|
||||
for (--p; n < endp; ++n)
|
||||
if (FOLD ((unsigned char) *n) == c
|
||||
&& (internal_fnmatch (p, n,
|
||||
(no_leading_period
|
||||
&& (n == string
|
||||
|| (n[-1] == '/'
|
||||
&& (flags
|
||||
& FNM_FILE_NAME)))),
|
||||
flags2) == 0))
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
/* If we come here no match is possible with the wildcard. */
|
||||
return FNM_NOMATCH;
|
||||
|
||||
case '[':
|
||||
{
|
||||
/* Nonzero if the sense of the character class is inverted. */
|
||||
static int posixly_correct;
|
||||
register int not;
|
||||
char cold;
|
||||
|
||||
if (posixly_correct == 0)
|
||||
posixly_correct = getenv ("POSIXLY_CORRECT") != NULL ? 1 : -1;
|
||||
|
||||
if (*n == '\0')
|
||||
return FNM_NOMATCH;
|
||||
|
||||
if ((flags & FNM_PERIOD) && *n == '.' &&
|
||||
(n == string || ((flags & FNM_FILE_NAME) && n[-1] == '/')))
|
||||
if (*n == '.' && no_leading_period && (n == string
|
||||
|| (n[-1] == '/'
|
||||
&& (flags
|
||||
& FNM_FILE_NAME))))
|
||||
return FNM_NOMATCH;
|
||||
|
||||
not = (*p == '!' || *p == '^');
|
||||
if (*n == '/' && (flags & FNM_FILE_NAME))
|
||||
/* `/' cannot be matched. */
|
||||
return FNM_NOMATCH;
|
||||
|
||||
not = (*p == '!' || (posixly_correct < 0 && *p == '^'));
|
||||
if (not)
|
||||
++p;
|
||||
|
||||
c = *p++;
|
||||
for (;;)
|
||||
{
|
||||
register char cstart = c, cend = c;
|
||||
unsigned char fn = FOLD ((unsigned char) *n);
|
||||
|
||||
if (!(flags & FNM_NOESCAPE) && c == '\\')
|
||||
cstart = cend = *p++;
|
||||
{
|
||||
if (*p == '\0')
|
||||
return FNM_NOMATCH;
|
||||
c = FOLD ((unsigned char) *p);
|
||||
++p;
|
||||
|
||||
cstart = cend = FOLD (cstart);
|
||||
if (c == fn)
|
||||
goto matched;
|
||||
}
|
||||
else if (c == '[' && *p == ':')
|
||||
{
|
||||
/* Leave room for the null. */
|
||||
char str[CHAR_CLASS_MAX_LENGTH + 1];
|
||||
size_t c1 = 0;
|
||||
# if defined _LIBC || (defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H)
|
||||
wctype_t wt;
|
||||
# endif
|
||||
const char *startp = p;
|
||||
|
||||
if (c == '\0')
|
||||
for (;;)
|
||||
{
|
||||
if (c1 == CHAR_CLASS_MAX_LENGTH)
|
||||
/* The name is too long and therefore the pattern
|
||||
is ill-formed. */
|
||||
return FNM_NOMATCH;
|
||||
|
||||
c = *++p;
|
||||
if (c == ':' && p[1] == ']')
|
||||
{
|
||||
p += 2;
|
||||
break;
|
||||
}
|
||||
if (c < 'a' || c >= 'z')
|
||||
{
|
||||
/* This cannot possibly be a character class name.
|
||||
Match it as a normal range. */
|
||||
p = startp;
|
||||
c = '[';
|
||||
goto normal_bracket;
|
||||
}
|
||||
str[c1++] = c;
|
||||
}
|
||||
str[c1] = '\0';
|
||||
|
||||
# if defined _LIBC || (defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H)
|
||||
wt = IS_CHAR_CLASS (str);
|
||||
if (wt == 0)
|
||||
/* Invalid character class name. */
|
||||
return FNM_NOMATCH;
|
||||
|
||||
if (__iswctype (__btowc ((unsigned char) *n), wt))
|
||||
goto matched;
|
||||
# else
|
||||
if ((STREQ (str, "alnum") && ISALNUM ((unsigned char) *n))
|
||||
|| (STREQ (str, "alpha") && ISALPHA ((unsigned char) *n))
|
||||
|| (STREQ (str, "blank") && ISBLANK ((unsigned char) *n))
|
||||
|| (STREQ (str, "cntrl") && ISCNTRL ((unsigned char) *n))
|
||||
|| (STREQ (str, "digit") && ISDIGIT ((unsigned char) *n))
|
||||
|| (STREQ (str, "graph") && ISGRAPH ((unsigned char) *n))
|
||||
|| (STREQ (str, "lower") && ISLOWER ((unsigned char) *n))
|
||||
|| (STREQ (str, "print") && ISPRINT ((unsigned char) *n))
|
||||
|| (STREQ (str, "punct") && ISPUNCT ((unsigned char) *n))
|
||||
|| (STREQ (str, "space") && ISSPACE ((unsigned char) *n))
|
||||
|| (STREQ (str, "upper") && ISUPPER ((unsigned char) *n))
|
||||
|| (STREQ (str, "xdigit") && ISXDIGIT ((unsigned char) *n)))
|
||||
goto matched;
|
||||
# endif
|
||||
}
|
||||
else if (c == '\0')
|
||||
/* [ (unterminated) loses. */
|
||||
return FNM_NOMATCH;
|
||||
|
||||
c = *p++;
|
||||
c = FOLD (c);
|
||||
|
||||
if ((flags & FNM_FILE_NAME) && c == '/')
|
||||
/* [/] can never match. */
|
||||
return FNM_NOMATCH;
|
||||
|
||||
if (c == '-' && *p != ']')
|
||||
else
|
||||
{
|
||||
cend = *p++;
|
||||
if (!(flags & FNM_NOESCAPE) && cend == '\\')
|
||||
cend = *p++;
|
||||
if (cend == '\0')
|
||||
return FNM_NOMATCH;
|
||||
cend = FOLD (cend);
|
||||
normal_bracket:
|
||||
if (FOLD (c) == fn)
|
||||
goto matched;
|
||||
|
||||
cold = c;
|
||||
c = *p++;
|
||||
}
|
||||
|
||||
if (FOLD (*n) >= cstart && FOLD (*n) <= cend)
|
||||
goto matched;
|
||||
if (c == '-' && *p != ']')
|
||||
{
|
||||
/* It is a range. */
|
||||
unsigned char cend = *p++;
|
||||
if (!(flags & FNM_NOESCAPE) && cend == '\\')
|
||||
cend = *p++;
|
||||
if (cend == '\0')
|
||||
return FNM_NOMATCH;
|
||||
|
||||
if (cold <= fn && fn <= FOLD (cend))
|
||||
goto matched;
|
||||
|
||||
c = *p++;
|
||||
}
|
||||
}
|
||||
|
||||
if (c == ']')
|
||||
break;
|
||||
}
|
||||
|
||||
if (!not)
|
||||
return FNM_NOMATCH;
|
||||
break;
|
||||
|
||||
matched:;
|
||||
matched:
|
||||
/* Skip the rest of the [...] that already matched. */
|
||||
while (c != ']')
|
||||
{
|
||||
@@ -171,8 +427,21 @@ fnmatch (pattern, string, flags)
|
||||
|
||||
c = *p++;
|
||||
if (!(flags & FNM_NOESCAPE) && c == '\\')
|
||||
/* XXX 1003.2d11 is unclear if this is right. */
|
||||
++p;
|
||||
{
|
||||
if (*p == '\0')
|
||||
return FNM_NOMATCH;
|
||||
/* XXX 1003.2d11 is unclear if this is right. */
|
||||
++p;
|
||||
}
|
||||
else if (c == '[' && *p == ':')
|
||||
{
|
||||
do
|
||||
if (*++p == '\0')
|
||||
return FNM_NOMATCH;
|
||||
while (*p != ':' || p[1] == ']');
|
||||
p += 2;
|
||||
c = *p;
|
||||
}
|
||||
}
|
||||
if (not)
|
||||
return FNM_NOMATCH;
|
||||
@@ -180,7 +449,7 @@ fnmatch (pattern, string, flags)
|
||||
break;
|
||||
|
||||
default:
|
||||
if (c != FOLD (*n))
|
||||
if (c != FOLD ((unsigned char) *n))
|
||||
return FNM_NOMATCH;
|
||||
}
|
||||
|
||||
@@ -195,6 +464,18 @@ fnmatch (pattern, string, flags)
|
||||
return 0;
|
||||
|
||||
return FNM_NOMATCH;
|
||||
|
||||
# undef FOLD
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
fnmatch (pattern, string, flags)
|
||||
const char *pattern;
|
||||
const char *string;
|
||||
int flags;
|
||||
{
|
||||
return internal_fnmatch (pattern, string, flags & FNM_PERIOD, flags);
|
||||
}
|
||||
|
||||
#endif /* _LIBC or not __GNU_LIBRARY__. */
|
||||
|
||||
@@ -1,39 +1,48 @@
|
||||
/* Copyright (C) 1991, 1992, 1993 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1991, 92, 93, 96, 97, 98, 99 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; see the file COPYING.LIB. If
|
||||
not, write to the Free Software Foundation, Inc., 675 Mass Ave,
|
||||
Cambridge, MA 02139, USA. */
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with the GNU C Library; see the file COPYING.LIB. If not,
|
||||
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
#ifndef _FNMATCH_H
|
||||
|
||||
#define _FNMATCH_H 1
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#if defined (__cplusplus) || (defined (__STDC__) && __STDC__)
|
||||
#undef __P
|
||||
#define __P(protos) protos
|
||||
#if defined __cplusplus || (defined __STDC__ && __STDC__) || defined WINDOWS32
|
||||
# if !defined __GLIBC__ || !defined __P
|
||||
# undef __P
|
||||
# define __P(protos) protos
|
||||
# endif
|
||||
#else /* Not C++ or ANSI C. */
|
||||
#undef __P
|
||||
#define __P(protos) ()
|
||||
# undef __P
|
||||
# define __P(protos) ()
|
||||
/* We can get away without defining `const' here only because in this file
|
||||
it is used only inside the prototype for `fnmatch', which is elided in
|
||||
non-ANSI C where `const' is problematical. */
|
||||
#endif /* C++ or ANSI C. */
|
||||
|
||||
#ifndef const
|
||||
# if (defined __STDC__ && __STDC__) || defined __cplusplus
|
||||
# define __const const
|
||||
# else
|
||||
# define __const
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* We #undef these before defining them because some losing systems
|
||||
(HP-UX A.08.07 for example) define these in <unistd.h>. */
|
||||
@@ -46,18 +55,26 @@ extern "C" {
|
||||
#define FNM_NOESCAPE (1 << 1) /* Backslashes don't quote special chars. */
|
||||
#define FNM_PERIOD (1 << 2) /* Leading `.' is matched only explicitly. */
|
||||
|
||||
#if !defined (_POSIX_C_SOURCE) || _POSIX_C_SOURCE < 2 || defined (_GNU_SOURCE)
|
||||
#define FNM_FILE_NAME FNM_PATHNAME /* Preferred GNU name. */
|
||||
#define FNM_LEADING_DIR (1 << 3) /* Ignore `/...' after a match. */
|
||||
#define FNM_CASEFOLD (1 << 4) /* Compare without regard to case. */
|
||||
#if !defined _POSIX_C_SOURCE || _POSIX_C_SOURCE < 2 || defined _GNU_SOURCE
|
||||
# define FNM_FILE_NAME FNM_PATHNAME /* Preferred GNU name. */
|
||||
# define FNM_LEADING_DIR (1 << 3) /* Ignore `/...' after a match. */
|
||||
# define FNM_CASEFOLD (1 << 4) /* Compare without regard to case. */
|
||||
#endif
|
||||
|
||||
/* Value returned by `fnmatch' if STRING does not match PATTERN. */
|
||||
#define FNM_NOMATCH 1
|
||||
|
||||
/* Match STRING against the filename pattern PATTERN,
|
||||
/* This value is returned if the implementation does not support
|
||||
`fnmatch'. Since this is not the case here it will never be
|
||||
returned but the conformance test suites still require the symbol
|
||||
to be defined. */
|
||||
#ifdef _XOPEN_SOURCE
|
||||
# define FNM_NOSYS (-1)
|
||||
#endif
|
||||
|
||||
/* Match NAME against the filename pattern PATTERN,
|
||||
returning zero if it matches, FNM_NOMATCH if not. */
|
||||
extern int fnmatch __P ((const char *__pattern, const char *__string,
|
||||
extern int fnmatch __P ((__const char *__pattern, __const char *__name,
|
||||
int __flags));
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
1249
glob/glob.c
1249
glob/glob.c
File diff suppressed because it is too large
Load Diff
179
glob/glob.h
179
glob/glob.h
@@ -1,42 +1,65 @@
|
||||
/* Copyright (C) 1991, 1992, 1995 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1991, 92, 95, 96, 97, 98 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
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; see the file COPYING.LIB. If
|
||||
not, write to the Free Software Foundation, Inc., 675 Mass Ave,
|
||||
Cambridge, MA 02139, USA. */
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with the GNU C Library; see the file COPYING.LIB. If not,
|
||||
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
#ifndef _GLOB_H
|
||||
|
||||
#define _GLOB_H 1
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#undef __ptr_t
|
||||
#if defined (__cplusplus) || (defined (__STDC__) && __STDC__)
|
||||
#undef __P
|
||||
#define __P(protos) protos
|
||||
#define __ptr_t void *
|
||||
#if defined __cplusplus || (defined __STDC__ && __STDC__) || defined WINDOWS32
|
||||
# if !defined __GLIBC__ || !defined __P
|
||||
# undef __P
|
||||
# undef __PMT
|
||||
# define __P(protos) protos
|
||||
# define __PMT(protos) protos
|
||||
# if !defined __GNUC__ || __GNUC__ < 2
|
||||
# undef __const
|
||||
# define __const const
|
||||
# endif
|
||||
# endif
|
||||
# define __ptr_t void *
|
||||
#else /* Not C++ or ANSI C. */
|
||||
#undef __P
|
||||
#define __P(protos) ()
|
||||
#undef const
|
||||
#define const
|
||||
#define __ptr_t char *
|
||||
# undef __P
|
||||
# undef __PMT
|
||||
# define __P(protos) ()
|
||||
# define __PMT(protos) ()
|
||||
# undef __const
|
||||
# define __const
|
||||
# define __ptr_t char *
|
||||
#endif /* C++ or ANSI C. */
|
||||
|
||||
/* We need `size_t' for the following definitions. */
|
||||
#ifndef __size_t
|
||||
# if defined __GNUC__ && __GNUC__ >= 2
|
||||
typedef __SIZE_TYPE__ __size_t;
|
||||
# else
|
||||
/* This is a guess. */
|
||||
typedef unsigned long int __size_t;
|
||||
# endif
|
||||
#else
|
||||
/* The GNU CC stddef.h version defines __size_t as empty. We need a real
|
||||
definition. */
|
||||
# undef __size_t
|
||||
# define __size_t size_t
|
||||
#endif
|
||||
|
||||
/* Bits set in the FLAGS argument to `glob'. */
|
||||
#define GLOB_ERR (1 << 0)/* Return on read errors. */
|
||||
#define GLOB_MARK (1 << 1)/* Append a slash to each name. */
|
||||
@@ -46,42 +69,77 @@ extern "C"
|
||||
#define GLOB_APPEND (1 << 5)/* Append to results of a previous call. */
|
||||
#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| \
|
||||
|
||||
#if (!defined _POSIX_C_SOURCE || _POSIX_C_SOURCE < 2 || defined _BSD_SOURCE \
|
||||
|| defined _GNU_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. */
|
||||
# define GLOB_ONLYDIR (1 << 13)/* Match only directories. */
|
||||
# define GLOB_TILDE_CHECK (1 << 14)/* Like GLOB_TILDE but return an error
|
||||
if the user name is not available. */
|
||||
# define __GLOB_FLAGS (GLOB_ERR|GLOB_MARK|GLOB_NOSORT|GLOB_DOOFFS| \
|
||||
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. */
|
||||
GLOB_NOMAGIC|GLOB_TILDE|GLOB_ONLYDIR|GLOB_TILDE_CHECK)
|
||||
#else
|
||||
# define __GLOB_FLAGS (GLOB_ERR|GLOB_MARK|GLOB_NOSORT|GLOB_DOOFFS| \
|
||||
GLOB_NOESCAPE|GLOB_NOCHECK|GLOB_APPEND| \
|
||||
GLOB_PERIOD)
|
||||
#endif
|
||||
|
||||
/* Error returns from `glob'. */
|
||||
#define GLOB_NOSPACE 1 /* Ran out of memory. */
|
||||
#define GLOB_ABEND 2 /* Read error. */
|
||||
#define GLOB_ABORTED 2 /* Read error. */
|
||||
#define GLOB_NOMATCH 3 /* No matches found. */
|
||||
#define GLOB_NOSYS 4 /* Not implemented. */
|
||||
#ifdef _GNU_SOURCE
|
||||
/* Previous versions of this file defined GLOB_ABEND instead of
|
||||
GLOB_ABORTED. Provide a compatibility definition here. */
|
||||
# define GLOB_ABEND GLOB_ABORTED
|
||||
#endif
|
||||
|
||||
/* Structure describing a globbing run. */
|
||||
#if !defined _AMIGA && !defined VMS /* Buggy compiler. */
|
||||
struct stat;
|
||||
#endif
|
||||
typedef struct
|
||||
{
|
||||
int gl_pathc; /* Count of paths matched by the pattern. */
|
||||
__size_t 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'. */
|
||||
__size_t 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 *));
|
||||
void (*gl_closedir) __PMT ((void *));
|
||||
struct dirent *(*gl_readdir) __PMT ((void *));
|
||||
__ptr_t (*gl_opendir) __PMT ((__const char *));
|
||||
int (*gl_lstat) __PMT ((__const char *, struct stat *));
|
||||
int (*gl_stat) __PMT ((__const char *, struct stat *));
|
||||
} glob_t;
|
||||
|
||||
#ifdef _LARGEFILE64_SOURCE
|
||||
struct stat64;
|
||||
typedef struct
|
||||
{
|
||||
__size_t gl_pathc;
|
||||
char **gl_pathv;
|
||||
__size_t gl_offs;
|
||||
int gl_flags;
|
||||
|
||||
/* If the GLOB_ALTDIRFUNC flag is set, the following functions
|
||||
are used instead of the normal file access functions. */
|
||||
void (*gl_closedir) __PMT ((void *));
|
||||
struct dirent64 *(*gl_readdir) __PMT ((void *));
|
||||
__ptr_t (*gl_opendir) __PMT ((__const char *));
|
||||
int (*gl_lstat) __PMT ((__const char *, struct stat64 *));
|
||||
int (*gl_stat) __PMT ((__const char *, struct stat64 *));
|
||||
} glob64_t;
|
||||
#endif
|
||||
|
||||
/* Do glob searching for PATTERN, placing results in PGLOB.
|
||||
The bits defined above may be set in FLAGS.
|
||||
If a directory cannot be opened or read and ERRFUNC is not nil,
|
||||
@@ -90,19 +148,42 @@ typedef struct
|
||||
`glob' returns GLOB_ABEND; if it returns zero, the error is ignored.
|
||||
If memory cannot be allocated for PGLOB, GLOB_NOSPACE is returned.
|
||||
Otherwise, `glob' returns zero. */
|
||||
extern int glob __P ((const char *__pattern, int __flags,
|
||||
int (*__errfunc) __P ((const char *, int)),
|
||||
#if _FILE_OFFSET_BITS != 64
|
||||
extern int glob __P ((__const char *__pattern, int __flags,
|
||||
int (*__errfunc) (__const char *, int),
|
||||
glob_t *__pglob));
|
||||
|
||||
/* Free storage allocated in PGLOB by a previous `glob' call. */
|
||||
extern void globfree __P ((glob_t *__pglob));
|
||||
#else
|
||||
# if __GNUC__ >= 2
|
||||
extern int glob __P ((__const char *__pattern, int __flags,
|
||||
int (*__errfunc) (__const char *, int),
|
||||
glob_t *__pglob)) __asm__ ("glob64");
|
||||
|
||||
extern void globfree __P ((glob_t *__pglob)) __asm__ ("globfree64");
|
||||
# else
|
||||
# define glob glob64
|
||||
# define globfree globfree64
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef _LARGEFILE64_SOURCE
|
||||
extern int glob64 __P ((__const char *__pattern, int __flags,
|
||||
int (*__errfunc) (__const char *, int),
|
||||
glob64_t *__pglob));
|
||||
|
||||
extern void globfree64 __P ((glob64_t *__pglob));
|
||||
#endif
|
||||
|
||||
|
||||
#if !defined (_POSIX_C_SOURCE) || _POSIX_C_SOURCE < 2 || defined (_GNU_SOURCE)
|
||||
/* If they are not NULL, `glob' uses these functions to read directories. */
|
||||
extern __ptr_t (*__glob_opendir_hook) __P ((const char *__directory));
|
||||
extern const char *(*__glob_readdir_hook) __P ((__ptr_t __stream));
|
||||
extern void (*__glob_closedir_hook) __P ((__ptr_t __stream));
|
||||
#ifdef _GNU_SOURCE
|
||||
/* Return nonzero if PATTERN contains any metacharacters.
|
||||
Metacharacters can be quoted with backslashes if QUOTE is nonzero.
|
||||
|
||||
This function is not part of the interface specified by POSIX.2
|
||||
but several programs want to use it. */
|
||||
extern int glob_pattern_p __P ((__const char *__pattern, int __quote));
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
@@ -349,9 +349,9 @@ 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.
|
||||
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.,
|
||||
59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
||||
@end smallexample
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
96
implicit.c
96
implicit.c
@@ -1,5 +1,5 @@
|
||||
/* Implicit rule searching 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,97 Free Software Foundation, Inc.
|
||||
This file is part of GNU Make.
|
||||
|
||||
GNU Make is free software; you can redistribute it and/or modify
|
||||
@@ -14,14 +14,16 @@ 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. */
|
||||
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
#include "make.h"
|
||||
#include "rule.h"
|
||||
#include "dep.h"
|
||||
#include "file.h"
|
||||
#include "filedef.h"
|
||||
|
||||
static int pattern_search ();
|
||||
static int pattern_search PARAMS ((struct file *file, int archive, unsigned int depth,
|
||||
unsigned int recursions));
|
||||
|
||||
/* For a FILE which has no commands specified, try to figure out some
|
||||
from the implicit pattern rules.
|
||||
@@ -34,7 +36,7 @@ try_implicit_rule (file, depth)
|
||||
struct file *file;
|
||||
unsigned int depth;
|
||||
{
|
||||
DEBUGPR ("Looking for an implicit rule for `%s'.\n");
|
||||
DEBUGPR (_("Looking for an implicit rule for `%s'.\n"));
|
||||
|
||||
/* The order of these searches was previously reversed. My logic now is
|
||||
that since the non-archive search uses more information in the target
|
||||
@@ -49,7 +51,7 @@ try_implicit_rule (file, depth)
|
||||
archive member name to search for implicit rules. */
|
||||
if (ar_name (file->name))
|
||||
{
|
||||
DEBUGPR ("Looking for archive-member implicit rule for `%s'.\n");
|
||||
DEBUGPR (_("Looking for archive-member implicit rule for `%s'.\n"));
|
||||
if (pattern_search (file, 1, depth, 0))
|
||||
return 1;
|
||||
}
|
||||
@@ -110,14 +112,14 @@ pattern_search (file, archive, depth, recursions)
|
||||
/* This buffer records all the dependencies actually found for a rule. */
|
||||
char **found_files = (char **) alloca (max_pattern_deps * sizeof (char *));
|
||||
/* Number of dep names now in FOUND_FILES. */
|
||||
unsigned int deps_found;
|
||||
unsigned int deps_found = 0;
|
||||
|
||||
/* Names of possible dependencies are constructed in this buffer. */
|
||||
register char *depname = (char *) alloca (namelen + max_pattern_dep_length);
|
||||
|
||||
/* The start and length of the stem of FILENAME for the current rule. */
|
||||
register char *stem;
|
||||
register unsigned int stemlen;
|
||||
register char *stem = 0;
|
||||
register unsigned int stemlen = 0;
|
||||
|
||||
/* Buffer in which we store all the rules that are possibly applicable. */
|
||||
struct rule **tryrules
|
||||
@@ -147,11 +149,11 @@ pattern_search (file, archive, depth, recursions)
|
||||
that is not just `%'. */
|
||||
int specific_rule_matched = 0;
|
||||
|
||||
register unsigned int i;
|
||||
register unsigned int i = 0; /* uninit checks OK */
|
||||
register struct rule *rule;
|
||||
register struct dep *dep;
|
||||
|
||||
char *p;
|
||||
char *p, *vp;
|
||||
|
||||
#ifndef NO_ARCHIVES
|
||||
if (archive || ar_name (filename))
|
||||
@@ -162,7 +164,22 @@ pattern_search (file, archive, depth, recursions)
|
||||
/* Set LASTSLASH to point at the last slash in FILENAME
|
||||
but not counting any slash at the end. (foo/bar/ counts as
|
||||
bar/ in directory foo/, not empty in directory foo/bar/.) */
|
||||
#ifdef VMS
|
||||
lastslash = rindex (filename, ']');
|
||||
#else
|
||||
lastslash = rindex (filename, '/');
|
||||
#ifdef __MSDOS__
|
||||
/* Handle backslashes (possibly mixed with forward slashes)
|
||||
and the case of "d:file". */
|
||||
{
|
||||
char *bslash = rindex (filename, '\\');
|
||||
if (lastslash == 0 || bslash > lastslash)
|
||||
lastslash = bslash;
|
||||
if (lastslash == 0 && filename[0] && filename[1] == ':')
|
||||
lastslash = filename + 1;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
if (lastslash != 0 && lastslash[1] == '\0')
|
||||
lastslash = 0;
|
||||
}
|
||||
@@ -182,7 +199,7 @@ pattern_search (file, archive, depth, recursions)
|
||||
don't use it here. */
|
||||
if (rule->in_use)
|
||||
{
|
||||
DEBUGP2 ("Avoiding implicit rule recursion.%s%s\n", "", "");
|
||||
DEBUGP2 (_("Avoiding implicit rule recursion.%s%s\n"), "", "");
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -210,7 +227,11 @@ pattern_search (file, archive, depth, recursions)
|
||||
/* Set CHECK_LASTSLASH if FILENAME contains a directory
|
||||
prefix and the target pattern does not contain a slash. */
|
||||
|
||||
#ifdef VMS
|
||||
check_lastslash = lastslash != 0 && index (target, ']') == 0;
|
||||
#else
|
||||
check_lastslash = lastslash != 0 && index (target, '/') == 0;
|
||||
#endif
|
||||
if (check_lastslash)
|
||||
{
|
||||
/* In that case, don't include the
|
||||
@@ -226,11 +247,11 @@ pattern_search (file, archive, depth, recursions)
|
||||
if (check_lastslash)
|
||||
{
|
||||
if (stem > (lastslash + 1)
|
||||
&& strncmp (target, lastslash + 1, stem - lastslash - 1))
|
||||
&& !strneq (target, lastslash + 1, stem - lastslash - 1))
|
||||
continue;
|
||||
}
|
||||
else if (stem > filename
|
||||
&& strncmp (target, filename, stem - filename))
|
||||
&& !strneq (target, filename, stem - filename))
|
||||
continue;
|
||||
|
||||
/* Check that the rule pattern matches the text after the stem.
|
||||
@@ -314,7 +335,7 @@ pattern_search (file, archive, depth, recursions)
|
||||
stemlen -= (lastslash - filename) + 1;
|
||||
}
|
||||
|
||||
DEBUGP2 ("Trying pattern rule with stem `%.*s'.\n",
|
||||
DEBUGP2 (_("Trying pattern rule with stem `%.*s'.\n"),
|
||||
(int) stemlen, stem);
|
||||
|
||||
/* Try each dependency; see if it "exists". */
|
||||
@@ -322,6 +343,8 @@ pattern_search (file, archive, depth, recursions)
|
||||
deps_found = 0;
|
||||
for (dep = rule->deps; dep != 0; dep = dep->next)
|
||||
{
|
||||
struct file *fp;
|
||||
|
||||
/* If the dependency name has a %, substitute the stem. */
|
||||
p = index (dep_name (dep), '%');
|
||||
if (p != 0)
|
||||
@@ -353,16 +376,16 @@ pattern_search (file, archive, depth, recursions)
|
||||
"impossible", then the rule fails and don't
|
||||
bother trying it on the second pass either
|
||||
since we know that will fail too. */
|
||||
DEBUGP2 ("Rejecting impossible %s dependency `%s'.\n",
|
||||
p == depname ? "implicit" : "rule", p);
|
||||
DEBUGP2 (_("Rejecting impossible %s prerequisite `%s'.\n"),
|
||||
p == depname ? _("implicit") : _("rule"), p);
|
||||
tryrules[i] = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
intermediate_files[deps_found] = 0;
|
||||
|
||||
DEBUGP2 ("Trying %s dependency `%s'.\n",
|
||||
p == depname ? "implicit" : "rule", p);
|
||||
DEBUGP2 (_("Trying %s prerequisite `%s'.\n"),
|
||||
p == depname ? _("implicit") : _("rule"), p);
|
||||
|
||||
/* The DEP->changed flag says that this dependency resides in a
|
||||
nonexistent directory. So we normally can skip looking for
|
||||
@@ -370,19 +393,25 @@ pattern_search (file, archive, depth, recursions)
|
||||
dependency file we are actually looking for is in a different
|
||||
directory (the one gotten by prepending FILENAME's directory),
|
||||
so it might actually exist. */
|
||||
/* If we find a file but the intermediate flag is set, then it
|
||||
was put here by a .INTERMEDIATE: rule so ignore it. */
|
||||
|
||||
if ((!dep->changed || check_lastslash)
|
||||
&& (lookup_file (p) != 0 || file_exists_p (p)))
|
||||
&& (((fp = lookup_file (p)) != 0 && !fp->intermediate)
|
||||
|| file_exists_p (p)))
|
||||
{
|
||||
found_files[deps_found++] = savestring (p, strlen (p));
|
||||
found_files[deps_found++] = xstrdup (p);
|
||||
continue;
|
||||
}
|
||||
/* This code, given FILENAME = "lib/foo.o", dependency name
|
||||
"lib/foo.c", and VPATH=src, searches for "src/lib/foo.c". */
|
||||
if (vpath_search (&p, (time_t *) 0))
|
||||
vp = p;
|
||||
if (vpath_search (&vp, (FILE_TIMESTAMP *) 0))
|
||||
{
|
||||
DEBUGP2 ("Found dependency as `%s'.%s\n", p, "");
|
||||
found_files[deps_found++] = p;
|
||||
DEBUGP2 (_("Found prerequisite `%s' as VPATH `%s'\n"),
|
||||
p, vp);
|
||||
strcpy (vp, p);
|
||||
found_files[deps_found++] = vp;
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -396,15 +425,15 @@ pattern_search (file, archive, depth, recursions)
|
||||
intermediate_file
|
||||
= (struct file *) alloca (sizeof (struct file));
|
||||
|
||||
DEBUGP2 ("Looking for a rule with %s file `%s'.\n",
|
||||
"intermediate", p);
|
||||
DEBUGP2 (_("Looking for a rule with %s file `%s'.\n"),
|
||||
_("intermediate"), p);
|
||||
|
||||
bzero ((char *) intermediate_file, sizeof (struct file));
|
||||
intermediate_file->name = p;
|
||||
if (pattern_search (intermediate_file, 0, depth + 1,
|
||||
recursions + 1))
|
||||
{
|
||||
p = savestring (p, strlen (p));
|
||||
p = xstrdup (p);
|
||||
intermediate_patterns[deps_found]
|
||||
= intermediate_file->name;
|
||||
intermediate_file->name = p;
|
||||
@@ -413,7 +442,7 @@ pattern_search (file, archive, depth, recursions)
|
||||
/* Allocate an extra copy to go in FOUND_FILES,
|
||||
because every elt of FOUND_FILES is consumed
|
||||
or freed later. */
|
||||
found_files[deps_found] = savestring (p, strlen (p));
|
||||
found_files[deps_found] = xstrdup (p);
|
||||
++deps_found;
|
||||
continue;
|
||||
}
|
||||
@@ -496,6 +525,7 @@ pattern_search (file, archive, depth, recursions)
|
||||
f->deps = imf->deps;
|
||||
f->cmds = imf->cmds;
|
||||
f->stem = imf->stem;
|
||||
f->also_make = imf->also_make;
|
||||
imf = lookup_file (intermediate_patterns[deps_found]);
|
||||
if (imf != 0 && imf->precious)
|
||||
f->precious = 1;
|
||||
@@ -504,6 +534,9 @@ pattern_search (file, archive, depth, recursions)
|
||||
for (dep = f->deps; dep != 0; dep = dep->next)
|
||||
{
|
||||
dep->file = enter_file (dep->name);
|
||||
/* enter_file uses dep->name _if_ we created a new file. */
|
||||
if (dep->name != dep->file->name)
|
||||
free (dep->name);
|
||||
dep->name = 0;
|
||||
dep->file->tried_implicit |= dep->changed;
|
||||
}
|
||||
@@ -545,7 +578,7 @@ pattern_search (file, archive, depth, recursions)
|
||||
dep->next = file->deps;
|
||||
file->deps = dep;
|
||||
}
|
||||
|
||||
|
||||
if (!checked_lastslash[foundrule])
|
||||
/* Always allocate new storage, since STEM might be
|
||||
on the stack for an intermediate file. */
|
||||
@@ -563,10 +596,9 @@ pattern_search (file, archive, depth, recursions)
|
||||
|
||||
file->cmds = rule->cmds;
|
||||
|
||||
/* Put the targets other than the one that
|
||||
matched into FILE's `also_make' member. */
|
||||
/* If this rule builds other targets, too, put the others into FILE's
|
||||
`also_make' member. */
|
||||
|
||||
/* If there was only one target, there is nothing to do. */
|
||||
if (rule->targets[1] != 0)
|
||||
for (i = 0; rule->targets[i] != 0; ++i)
|
||||
if (i != matches[foundrule])
|
||||
|
||||
38
job.h
38
job.h
@@ -1,5 +1,5 @@
|
||||
/* Definitions for managing subprocesses in GNU Make.
|
||||
Copyright (C) 1992, 1993 Free Software Foundation, Inc.
|
||||
Copyright (C) 1992, 1993, 1996, 1999 Free Software Foundation, Inc.
|
||||
This file is part of GNU Make.
|
||||
|
||||
GNU Make is free software; you can redistribute it and/or modify
|
||||
@@ -14,7 +14,11 @@ 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. */
|
||||
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
#ifndef SEEN_JOB_H
|
||||
#define SEEN_JOB_H
|
||||
|
||||
/* Structure describing a running or dead child process. */
|
||||
|
||||
@@ -31,6 +35,11 @@ struct child
|
||||
char *command_ptr; /* Ptr into command_lines[command_line]. */
|
||||
|
||||
pid_t pid; /* Child process's ID number. */
|
||||
#ifdef VMS
|
||||
int efn; /* Completion event flag number */
|
||||
int cstatus; /* Completion status */
|
||||
#endif
|
||||
char *sh_batch_file; /* Script file for shell commands */
|
||||
unsigned int remote:1; /* Nonzero if executing remotely. */
|
||||
|
||||
unsigned int noerror:1; /* Nonzero if commands contained a `-'. */
|
||||
@@ -41,18 +50,27 @@ struct child
|
||||
|
||||
extern struct child *children;
|
||||
|
||||
extern void new_job ();
|
||||
extern void reap_children ();
|
||||
extern void start_waiting_jobs ();
|
||||
extern void new_job PARAMS ((struct file *file));
|
||||
extern void reap_children PARAMS ((int block, int err));
|
||||
extern void start_waiting_jobs PARAMS ((void));
|
||||
|
||||
extern char **construct_command_argv ();
|
||||
extern void child_execute_job ();
|
||||
extern void exec_command ();
|
||||
extern char **construct_command_argv PARAMS ((char *line, char **restp, struct file *file, char** batch_file));
|
||||
#ifdef VMS
|
||||
extern int child_execute_job PARAMS ((char *argv, struct child *child));
|
||||
#else
|
||||
extern void child_execute_job PARAMS ((int stdin_fd, int stdout_fd, char **argv, char **envp));
|
||||
#endif
|
||||
#ifdef _AMIGA
|
||||
extern void exec_command PARAMS ((char **argv));
|
||||
#else
|
||||
extern void exec_command PARAMS ((char **argv, char **envp));
|
||||
#endif
|
||||
|
||||
extern unsigned int job_slots_used;
|
||||
|
||||
extern void block_sigs PARAMS ((void));
|
||||
#ifdef POSIX
|
||||
extern void unblock_sigs ();
|
||||
extern void unblock_sigs PARAMS ((void));
|
||||
#else
|
||||
#ifdef HAVE_SIGSETMASK
|
||||
extern int fatal_signal_mask;
|
||||
@@ -61,3 +79,5 @@ extern int fatal_signal_mask;
|
||||
#define unblock_sigs()
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif /* SEEN_JOB_H */
|
||||
|
||||
90
maintMakefile
Normal file
90
maintMakefile
Normal file
@@ -0,0 +1,90 @@
|
||||
# Maintainer-only makefile segment. This contains things that are relevant
|
||||
# only if you have the full copy of the GNU make sources from the CVS
|
||||
# tree, not a dist copy.
|
||||
#
|
||||
|
||||
# Find the glob source files... this might be dangerous, but we're maintainers!
|
||||
#
|
||||
globsrc := $(wildcard glob/*.c)
|
||||
globhdr := $(wildcard glob/*.h)
|
||||
|
||||
TEMPLATES = README README.DOS config.ami configh.dos config.h.W32 config.h-vms
|
||||
MTEMPLATES = Makefile.DOS SMakefile
|
||||
|
||||
# We need this to ensure that README and build.sh.in are created on time to
|
||||
# avoid errors by automake.
|
||||
#
|
||||
#Makefile.in: README build.sh.in
|
||||
|
||||
# General rule for turning a .template into a regular file.
|
||||
#
|
||||
$(TEMPLATES) : % : %.template Makefile
|
||||
rm -f $@
|
||||
sed -e 's@%VERSION%@$(VERSION)@g' \
|
||||
-e 's@%PACKAGE%@$(PACKAGE)@g' \
|
||||
$< > $@
|
||||
chmod a-w $@
|
||||
|
||||
# Construct Makefiles by adding on dependencies, etc.
|
||||
#
|
||||
$(MTEMPLATES) : % : %.template .dep_segment Makefile
|
||||
rm -f $@
|
||||
sed -e 's@%VERSION%@$(VERSION)@g' \
|
||||
-e 's@%PROGRAMS%@$(bin_PROGRAMS)@g' \
|
||||
-e 's@%SOURCES%@$(filter-out remote-%,$(make_SOURCES)) remote-$$(REMOTE).c@g' \
|
||||
-e 's@%OBJECTS%@$(filter-out remote-%,$(make_OBJECTS)) remote-$$(REMOTE).o@g' \
|
||||
-e 's@%GLOB_SOURCES%@$(globsrc) $(globhdr)@g' \
|
||||
-e 's@%GLOB_OBJECTS%@$(globsrc:glob/%.c=%.o)@g' \
|
||||
$< > $@
|
||||
echo >>$@; echo '# --------------- DEPENDENCIES' >>$@; echo '#' >>$@; \
|
||||
cat $(word 2,$^) >>$@
|
||||
chmod a-w $@
|
||||
|
||||
NMakefile: NMakefile.template .dep_segment Makefile
|
||||
rm -f $@
|
||||
cp $< $@
|
||||
echo >>$@; echo '# --------------- DEPENDENCIES' >>$@; echo '#' >>$@; \
|
||||
sed 's/^\([^ ]*\)\.o:/$$(OUTDIR)\/\1.obj:/' $(word 2,$^) >>$@
|
||||
chmod a-w $@
|
||||
|
||||
# Construct build.sh.in
|
||||
#
|
||||
build.sh.in: build.template Makefile
|
||||
rm -f $@
|
||||
sed -e 's@%objs%@$(filter-out remote-%, $(make_OBJECTS)@g' \
|
||||
-e 's@%globobjs%@$(patsubst %.c,%.o,$(globsrc)))@g' \
|
||||
$< > $@
|
||||
chmod a-w+x $@
|
||||
|
||||
# Use automake to build a dependency list file, for "foreign" makefiles like
|
||||
# Makefile.DOS.
|
||||
#
|
||||
.dep_segment: Makefile.am maintMakefile $(DEP_FILES)
|
||||
$(AUTOMAKE) --generate-deps --build-dir=. --srcdir-name=.
|
||||
|
||||
# We clean everything here. The GNU standards for makefile conventions say
|
||||
# you shouldn't remove configure, etc., but this makefile is only available
|
||||
# in a full development distribution, so they'll only be removed then.
|
||||
#
|
||||
# And _I_ want them to be removed ;)
|
||||
#
|
||||
maintFILES = configure aclocal.m4 config.h.in Makefile.in stamp-h.in
|
||||
|
||||
MAINTAINERCLEANFILES = $(maintFILES) $(TEMPLATES) $(MTEMPLATES) NMakefile \
|
||||
missing build.sh.in .dep_segment
|
||||
|
||||
# Put the alpha distribution files up for anonymous FTP.
|
||||
#
|
||||
ALPHA := ~ftp/gnu
|
||||
TARFILE := $(distdir).tar.gz
|
||||
|
||||
.PHONY: alpha
|
||||
alpha: $(ALPHA) $(TARFILE)
|
||||
@rm -f $(ALPHA)/$(TARFILE)
|
||||
cp -p $(TARFILE) $(ALPHA)
|
||||
|
||||
# This is needed because normal builds with GCC don't compile alloca.c, so
|
||||
# alloca.P doesn't get built :-/.
|
||||
#
|
||||
.deps/alloca.P: alloca.c
|
||||
$(COMPILE) -M -o $@ $<
|
||||
894
make-stds.texi
894
make-stds.texi
File diff suppressed because it is too large
Load Diff
37
make.1
37
make.1
@@ -5,17 +5,16 @@ make \- GNU make utility to maintain groups of programs
|
||||
.B "make "
|
||||
[
|
||||
.B \-f
|
||||
makefile ] [ option ] ...
|
||||
.I makefile
|
||||
] [ option ] ...
|
||||
target ...
|
||||
.SH WARNING
|
||||
This man paage is an extract of the documentation of
|
||||
This man page is an extract of the documentation of
|
||||
.I GNU make .
|
||||
It is updated only occasionally, because the GNU project does not use nroff.
|
||||
For complete, current documentation, refer to the Info file
|
||||
.B make
|
||||
or the DVI file
|
||||
.B make.dvi
|
||||
which are made from the Texinfo source file
|
||||
.B make.info
|
||||
which is made from the Texinfo source file
|
||||
.BR make.texinfo .
|
||||
.SH DESCRIPTION
|
||||
.LP
|
||||
@@ -24,7 +23,7 @@ The purpose of the
|
||||
utility is to determine automatically which
|
||||
pieces of a large program need to be recompiled, and issue the commands to
|
||||
recompile them.
|
||||
This manual describes the GNU implementation of
|
||||
The manual describes the GNU implementation of
|
||||
.IR make ,
|
||||
which was written by Richard Stallman and Roland McGrath.
|
||||
Our examples show C programs, since they are most common, but you can use
|
||||
@@ -110,7 +109,7 @@ or if the target does not exist.
|
||||
.B \-b
|
||||
.TP 0.5i
|
||||
.B \-m
|
||||
These options are ignored for compatibility with other versions of
|
||||
These options are ignored for compatibility with other versions of
|
||||
.IR make .
|
||||
.TP 0.5i
|
||||
.BI "\-C " dir
|
||||
@@ -157,7 +156,7 @@ If several
|
||||
.B \-I
|
||||
options are used to specify several directories, the directories are
|
||||
searched in the order specified.
|
||||
Unlike the arguments to other flags of
|
||||
Unlike the arguments to other flags of
|
||||
.IR make ,
|
||||
directories given with
|
||||
.B \-I
|
||||
@@ -236,11 +235,11 @@ Silent operation; do not print the commands as they are executed.
|
||||
Cancel the effect of the
|
||||
.B \-k
|
||||
option.
|
||||
This is never necessary except in a recursive
|
||||
This is never necessary except in a recursive
|
||||
.I make
|
||||
where
|
||||
.B \-k
|
||||
might be inherited from the top-level
|
||||
might be inherited from the top-level
|
||||
.I make
|
||||
via MAKEFLAGS or if you set
|
||||
.B \-k
|
||||
@@ -254,15 +253,10 @@ future invocations of
|
||||
.IR make .
|
||||
.TP 0.5i
|
||||
.B \-v
|
||||
Print the version of the
|
||||
Print the version of the
|
||||
.I make
|
||||
program plus a copyright, a list of authors and a notice that there
|
||||
is no warranty.
|
||||
After this information is printed, processing continues normally.
|
||||
To get this information without doing anything else, use
|
||||
.B make
|
||||
.B \-v
|
||||
.BI \-f /dev/null.
|
||||
.TP 0.5i
|
||||
.B \-w
|
||||
Print a message containing the working directory
|
||||
@@ -285,15 +279,10 @@ it is almost the same as running a
|
||||
.I touch
|
||||
command on the given file before running
|
||||
.IR make ,
|
||||
except that the modification time is changed only in the imagination of
|
||||
except that the modification time is changed only in the imagination of
|
||||
.IR make .
|
||||
.SH "SEE ALSO"
|
||||
.PD 0
|
||||
.TP 2.0i
|
||||
/usr/local/doc/gnumake.dvi
|
||||
.I
|
||||
The GNU Make Manual
|
||||
.PD
|
||||
.I "The GNU Make Manual"
|
||||
.SH BUGS
|
||||
See the chapter `Problems and Bugs' in
|
||||
.I "The GNU Make Manual" .
|
||||
|
||||
590
make.h
590
make.h
@@ -1,5 +1,5 @@
|
||||
/* Miscellaneous global declarations and portability cruft for GNU Make.
|
||||
Copyright (C) 1988, 89, 90, 91, 92, 93, 94, 95 Free Software Foundation, Inc.
|
||||
Copyright (C) 1988,89,90,91,92,93,94,95,96,97,99 Free Software Foundation, Inc.
|
||||
This file is part of GNU Make.
|
||||
|
||||
GNU Make is free software; you can redistribute it and/or modify
|
||||
@@ -14,7 +14,8 @@ 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. */
|
||||
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
/* AIX requires this to be the first thing in the file. */
|
||||
#if defined (_AIX) && !defined (__GNUC__)
|
||||
@@ -25,16 +26,39 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||
using -I. -I$srcdir will use ./config.h rather than $srcdir/config.h
|
||||
(which it would do because make.h was found in $srcdir). */
|
||||
#include <config.h>
|
||||
#undef HAVE_CONFIG_H
|
||||
#define HAVE_CONFIG_H
|
||||
#undef HAVE_CONFIG_H
|
||||
#define HAVE_CONFIG_H 1
|
||||
|
||||
#ifdef CRAY
|
||||
|
||||
/* Use prototypes if available. */
|
||||
#if defined (__cplusplus) || (defined (__STDC__) && __STDC__)
|
||||
# undef PARAMS
|
||||
# define PARAMS(protos) protos
|
||||
#else /* Not C++ or ANSI C. */
|
||||
# undef PARAMS
|
||||
# define PARAMS(protos) ()
|
||||
#endif /* C++ or ANSI C. */
|
||||
|
||||
|
||||
/* For now, set gettext macro to a no-op. */
|
||||
#undef _
|
||||
#undef N_
|
||||
#define _(s) s
|
||||
#define N_(s) s
|
||||
|
||||
|
||||
#ifdef CRAY
|
||||
/* This must happen before #include <signal.h> so
|
||||
that the declaration therein is changed. */
|
||||
#define signal bsdsignal
|
||||
# define signal bsdsignal
|
||||
#endif
|
||||
|
||||
#define _GNU_SOURCE
|
||||
/* If we're compiling for the dmalloc debugger, turn off string inlining. */
|
||||
#if defined(HAVE_DMALLOC_H) && defined(__GNUC__)
|
||||
# define __NO_STRING_INLINES
|
||||
#endif
|
||||
|
||||
#define _GNU_SOURCE 1
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <signal.h>
|
||||
@@ -44,297 +68,434 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||
/* SCO 3.2 "devsys 4.2" has a prototype for `ftime' in <time.h> that bombs
|
||||
unless <sys/timeb.h> has been included first. Does every system have a
|
||||
<sys/timeb.h>? If any does not, configure should check for it. */
|
||||
#include <sys/timeb.h>
|
||||
# include <sys/timeb.h>
|
||||
#endif
|
||||
#include <time.h>
|
||||
#include <errno.h>
|
||||
|
||||
#ifndef errno
|
||||
#ifndef errno
|
||||
extern int errno;
|
||||
#endif
|
||||
|
||||
#ifndef isblank
|
||||
#define isblank(c) ((c) == ' ' || (c) == '\t')
|
||||
/* A shortcut for EINTR checking. Note you should never negate this! That
|
||||
very likely doesn't mean what you want if EINTR is not available. */
|
||||
#ifdef EINTR
|
||||
# define EINTR_SET (errno == EINTR)
|
||||
#else
|
||||
# define EINTR_SET (0)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#ifndef isblank
|
||||
# define isblank(c) ((c) == ' ' || (c) == '\t')
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_UNISTD_H
|
||||
# include <unistd.h>
|
||||
/* Ultrix's unistd.h always defines _POSIX_VERSION, but you only get
|
||||
POSIX.1 behavior with `cc -YPOSIX', which predefines POSIX itself! */
|
||||
#if defined (_POSIX_VERSION) && !defined (ultrix)
|
||||
#define POSIX
|
||||
#endif
|
||||
# if defined (_POSIX_VERSION) && !defined (ultrix) && !defined (VMS)
|
||||
# define POSIX 1
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* Some systems define _POSIX_VERSION but are not really POSIX.1. */
|
||||
#if (defined (butterfly) || defined (__arm) || \
|
||||
(defined (__mips) && defined (_SYSTYPE_SVR3)) || \
|
||||
(defined (sequent) && defined (i386)))
|
||||
#undef POSIX
|
||||
#if (defined (butterfly) || defined (__arm) || (defined (__mips) && defined (_SYSTYPE_SVR3)) || (defined (sequent) && defined (i386)))
|
||||
# undef POSIX
|
||||
#endif
|
||||
|
||||
#if !defined (POSIX) && defined (_AIX) && defined (_POSIX_SOURCE)
|
||||
#define POSIX
|
||||
# define POSIX 1
|
||||
#endif
|
||||
|
||||
#if !defined (HAVE_SYS_SIGLIST) && defined (HAVE__SYS_SIGLIST)
|
||||
#define sys_siglist _sys_siglist
|
||||
#define HAVE_SYS_SIGLIST /* Now we have it. */
|
||||
|
||||
/* It was declared in <signal.h>, with who knows what type.
|
||||
Don't declare it again and risk conflicting. */
|
||||
#define SYS_SIGLIST_DECLARED
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_SYS_SIGLIST
|
||||
#ifndef SYS_SIGLIST_DECLARED
|
||||
#if defined (HAVE_SYS_SIGLIST) && !defined (SYS_SIGLIST_DECLARED)
|
||||
extern char *sys_siglist[];
|
||||
#endif
|
||||
#else
|
||||
#include "signame.h"
|
||||
|
||||
#if !defined (HAVE_SYS_SIGLIST) || !defined (HAVE_STRSIGNAL)
|
||||
# include "signame.h"
|
||||
#endif
|
||||
|
||||
/* Some systems do not define NSIG in <signal.h>. */
|
||||
#ifndef NSIG
|
||||
#ifdef _NSIG
|
||||
#define NSIG _NSIG
|
||||
#else
|
||||
#define NSIG 32
|
||||
#endif
|
||||
#ifndef NSIG
|
||||
# ifdef _NSIG
|
||||
# define NSIG _NSIG
|
||||
# else
|
||||
# define NSIG 32
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef RETSIGTYPE
|
||||
#define RETSIGTYPE void
|
||||
#ifndef RETSIGTYPE
|
||||
# define RETSIGTYPE void
|
||||
#endif
|
||||
|
||||
#ifndef sigmask
|
||||
#define sigmask(sig) (1 << ((sig) - 1))
|
||||
#ifndef sigmask
|
||||
# define sigmask(sig) (1 << ((sig) - 1))
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_LIMITS_H
|
||||
#include <limits.h>
|
||||
#ifdef HAVE_LIMITS_H
|
||||
# include <limits.h>
|
||||
#endif
|
||||
#ifdef HAVE_SYS_PARAM_H
|
||||
#include <sys/param.h>
|
||||
#ifdef HAVE_SYS_PARAM_H
|
||||
# include <sys/param.h>
|
||||
#endif
|
||||
|
||||
#ifndef PATH_MAX
|
||||
#ifndef POSIX
|
||||
#define PATH_MAX MAXPATHLEN
|
||||
#endif /* Not POSIX. */
|
||||
#endif /* No PATH_MAX. */
|
||||
#ifndef PATH_MAX
|
||||
# ifndef POSIX
|
||||
# define PATH_MAX MAXPATHLEN
|
||||
# endif
|
||||
#endif
|
||||
#ifndef MAXPATHLEN
|
||||
#define MAXPATHLEN 1024
|
||||
#endif /* No MAXPATHLEN. */
|
||||
# define MAXPATHLEN 1024
|
||||
#endif
|
||||
|
||||
#ifdef PATH_MAX
|
||||
#define GET_PATH_MAX PATH_MAX
|
||||
#define PATH_VAR(var) char var[PATH_MAX]
|
||||
#ifdef PATH_MAX
|
||||
# define GET_PATH_MAX PATH_MAX
|
||||
# define PATH_VAR(var) char var[PATH_MAX]
|
||||
#else
|
||||
#define NEED_GET_PATH_MAX
|
||||
extern unsigned int get_path_max ();
|
||||
#define GET_PATH_MAX (get_path_max ())
|
||||
#define PATH_VAR(var) char *var = (char *) alloca (GET_PATH_MAX)
|
||||
# define NEED_GET_PATH_MAX 1
|
||||
# define GET_PATH_MAX (get_path_max ())
|
||||
# define PATH_VAR(var) char *var = (char *) alloca (GET_PATH_MAX)
|
||||
extern unsigned int get_path_max PARAMS ((void));
|
||||
#endif
|
||||
|
||||
#ifdef STAT_MACROS_BROKEN
|
||||
#ifdef S_ISREG
|
||||
#undef S_ISREG
|
||||
#endif
|
||||
#ifdef S_ISDIR
|
||||
#undef S_ISDIR
|
||||
#endif
|
||||
#endif /* STAT_MACROS_BROKEN. */
|
||||
|
||||
#ifndef S_ISREG
|
||||
#define S_ISREG(mode) (((mode) & S_IFMT) == S_IFREG)
|
||||
#endif
|
||||
#ifndef S_ISDIR
|
||||
#define S_ISDIR(mode) (((mode) & S_IFMT) == S_IFDIR)
|
||||
#ifndef CHAR_BIT
|
||||
# define CHAR_BIT 8
|
||||
#endif
|
||||
|
||||
/* Nonzero if the integer type T is signed. */
|
||||
#define INTEGER_TYPE_SIGNED(t) ((t) -1 < 0)
|
||||
|
||||
#if (defined (STDC_HEADERS) || defined (__GNU_LIBRARY__))
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#define ANSI_STRING
|
||||
#else /* No standard headers. */
|
||||
/* The minimum and maximum values for the integer type T.
|
||||
Use ~ (t) 0, not -1, for portability to 1's complement hosts. */
|
||||
#define INTEGER_TYPE_MINIMUM(t) \
|
||||
(! INTEGER_TYPE_SIGNED (t) ? (t) 0 : ~ (t) 0 << (sizeof (t) * CHAR_BIT - 1))
|
||||
#define INTEGER_TYPE_MAXIMUM(t) (~ (t) 0 - INTEGER_TYPE_MINIMUM (t))
|
||||
|
||||
#ifdef HAVE_STRING_H
|
||||
#include <string.h>
|
||||
#define ANSI_STRING
|
||||
#ifdef STAT_MACROS_BROKEN
|
||||
# ifdef S_ISREG
|
||||
# undef S_ISREG
|
||||
# endif
|
||||
# ifdef S_ISDIR
|
||||
# undef S_ISDIR
|
||||
# endif
|
||||
#endif /* STAT_MACROS_BROKEN. */
|
||||
|
||||
#ifndef S_ISREG
|
||||
# define S_ISREG(mode) (((mode) & S_IFMT) == S_IFREG)
|
||||
#endif
|
||||
#ifndef S_ISDIR
|
||||
# define S_ISDIR(mode) (((mode) & S_IFMT) == S_IFDIR)
|
||||
#endif
|
||||
|
||||
#ifdef VMS
|
||||
# include <stdio.h>
|
||||
# include <types.h>
|
||||
# include <unixlib.h>
|
||||
# include <unixio.h>
|
||||
# include <errno.h>
|
||||
# include <perror.h>
|
||||
#endif
|
||||
|
||||
#ifndef __attribute__
|
||||
/* This feature is available in gcc versions 2.5 and later. */
|
||||
# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) || __STRICT_ANSI__
|
||||
# define __attribute__(x)
|
||||
# endif
|
||||
/* The __-protected variants of `format' and `printf' attributes
|
||||
are accepted by gcc versions 2.6.4 (effectively 2.7) and later. */
|
||||
# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7)
|
||||
# define __format__ format
|
||||
# define __printf__ printf
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if defined (STDC_HEADERS) || defined (__GNU_LIBRARY__)
|
||||
# include <stdlib.h>
|
||||
# include <string.h>
|
||||
# define ANSI_STRING 1
|
||||
#else /* No standard headers. */
|
||||
# ifdef HAVE_STRING_H
|
||||
# include <string.h>
|
||||
# define ANSI_STRING 1
|
||||
# else
|
||||
# include <strings.h>
|
||||
# endif
|
||||
# ifdef HAVE_MEMORY_H
|
||||
# include <memory.h>
|
||||
# endif
|
||||
# ifdef HAVE_STDLIB_H
|
||||
# include <stdlib.h>
|
||||
# else
|
||||
extern char *malloc PARAMS ((int));
|
||||
extern char *realloc PARAMS ((char *, int));
|
||||
extern void free PARAMS ((char *));
|
||||
|
||||
extern void abort PARAMS ((void)) __attribute__ ((noreturn));
|
||||
extern void exit PARAMS ((int)) __attribute__ ((noreturn));
|
||||
# endif /* HAVE_STDLIB_H. */
|
||||
|
||||
#endif /* Standard headers. */
|
||||
|
||||
#if ST_MTIM_NSEC
|
||||
# if HAVE_INTTYPES_H
|
||||
# include <inttypes.h>
|
||||
# endif
|
||||
# define FILE_TIMESTAMP uintmax_t
|
||||
#else
|
||||
#include <strings.h>
|
||||
#endif
|
||||
#ifdef HAVE_MEMORY_H
|
||||
#include <memory.h>
|
||||
# define FILE_TIMESTAMP time_t
|
||||
#endif
|
||||
|
||||
extern char *malloc (), *realloc ();
|
||||
extern void free ();
|
||||
#ifdef ANSI_STRING
|
||||
|
||||
extern void abort (), exit ();
|
||||
# ifndef index
|
||||
# define index(s, c) strchr((s), (c))
|
||||
# endif
|
||||
# ifndef rindex
|
||||
# define rindex(s, c) strrchr((s), (c))
|
||||
# endif
|
||||
|
||||
#endif /* Standard headers. */
|
||||
# ifndef bcmp
|
||||
# define bcmp(s1, s2, n) memcmp ((s1), (s2), (n))
|
||||
# endif
|
||||
# ifndef bzero
|
||||
# define bzero(s, n) memset ((s), 0, (n))
|
||||
# endif
|
||||
# if defined(HAVE_MEMMOVE) && !defined(bcopy)
|
||||
# define bcopy(s, d, n) memmove ((d), (s), (n))
|
||||
# endif
|
||||
|
||||
#ifdef ANSI_STRING
|
||||
#else /* Not ANSI_STRING. */
|
||||
|
||||
#ifndef index
|
||||
#define index(s, c) strchr((s), (c))
|
||||
#endif
|
||||
#ifndef rindex
|
||||
#define rindex(s, c) strrchr((s), (c))
|
||||
# ifndef bcmp
|
||||
extern int bcmp PARAMS ((const char *, const char *, int));
|
||||
# endif
|
||||
# ifndef bzero
|
||||
extern void bzero PARAMS ((char *, int));
|
||||
#endif
|
||||
# ifndef bcopy
|
||||
extern void bcopy PARAMS ((const char *b1, char *b2, int));
|
||||
# endif
|
||||
|
||||
#ifndef bcmp
|
||||
#define bcmp(s1, s2, n) memcmp ((s1), (s2), (n))
|
||||
#endif
|
||||
#ifndef bzero
|
||||
#define bzero(s, n) memset ((s), 0, (n))
|
||||
#endif
|
||||
#ifndef bcopy
|
||||
#define bcopy(s, d, n) memcpy ((d), (s), (n))
|
||||
#endif
|
||||
|
||||
#else /* Not ANSI_STRING. */
|
||||
|
||||
#ifndef bcmp
|
||||
extern int bcmp ();
|
||||
#endif
|
||||
#ifndef bzero
|
||||
extern void bzero ();
|
||||
#endif
|
||||
#ifndef bcopy
|
||||
extern void bcopy ();
|
||||
#endif
|
||||
|
||||
#endif /* ANSI_STRING. */
|
||||
#undef ANSI_STRING
|
||||
#endif /* ANSI_STRING. */
|
||||
#undef ANSI_STRING
|
||||
|
||||
/* SCO Xenix has a buggy macro definition in <string.h>. */
|
||||
#undef strerror
|
||||
#undef strerror
|
||||
|
||||
#ifndef ANSI_STRING
|
||||
extern char *strerror ();
|
||||
#if !defined(ANSI_STRING) && !defined(__DECC)
|
||||
extern char *strerror PARAMS ((int errnum));
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef __GNUC__
|
||||
#undef alloca
|
||||
#define alloca(n) __builtin_alloca (n)
|
||||
#else /* Not GCC. */
|
||||
#ifdef HAVE_ALLOCA_H
|
||||
#include <alloca.h>
|
||||
#else /* Not HAVE_ALLOCA_H. */
|
||||
#ifndef _AIX
|
||||
#ifdef __GNUC__
|
||||
# undef alloca
|
||||
# define alloca(n) __builtin_alloca (n)
|
||||
#else /* Not GCC. */
|
||||
# ifdef HAVE_ALLOCA_H
|
||||
# include <alloca.h>
|
||||
# else /* Not HAVE_ALLOCA_H. */
|
||||
# ifndef _AIX
|
||||
extern char *alloca ();
|
||||
#endif /* Not AIX. */
|
||||
#endif /* HAVE_ALLOCA_H. */
|
||||
#endif /* GCC. */
|
||||
# endif /* Not AIX. */
|
||||
# endif /* HAVE_ALLOCA_H. */
|
||||
#endif /* GCC. */
|
||||
|
||||
#ifndef iAPX286
|
||||
#define streq(a, b) \
|
||||
((a) == (b) || \
|
||||
(*(a) == *(b) && (*(a) == '\0' || !strcmp ((a) + 1, (b) + 1))))
|
||||
/* ISDIGIT offers the following features:
|
||||
- Its arg may be any int or unsigned int; it need not be an unsigned char.
|
||||
- It's guaranteed to evaluate its argument exactly once.
|
||||
NOTE! Make relies on this behavior, don't change it!
|
||||
- It's typically faster.
|
||||
Posix 1003.2-1992 section 2.5.2.1 page 50 lines 1556-1558 says that
|
||||
only '0' through '9' are digits. Prefer ISDIGIT to isdigit() unless
|
||||
it's important to use the locale's definition of `digit' even when the
|
||||
host does not conform to Posix. */
|
||||
#define ISDIGIT(c) ((unsigned) (c) - '0' <= 9)
|
||||
|
||||
#ifndef iAPX286
|
||||
# define streq(a, b) \
|
||||
((a) == (b) || \
|
||||
(*(a) == *(b) && (*(a) == '\0' || !strcmp ((a) + 1, (b) + 1))))
|
||||
# ifdef HAVE_CASE_INSENSITIVE_FS
|
||||
/* This is only used on Windows/DOS platforms, so we assume strcmpi(). */
|
||||
# define strieq(a, b) \
|
||||
((a) == (b) || \
|
||||
(tolower(*(a)) == tolower(*(b)) && (*(a) == '\0' || !strcmpi ((a) + 1, (b) + 1))))
|
||||
# else
|
||||
# define strieq(a, b) streq(a, b)
|
||||
# endif
|
||||
#else
|
||||
/* Buggy compiler can't handle this. */
|
||||
#define streq(a, b) (strcmp ((a), (b)) == 0)
|
||||
# define streq(a, b) (strcmp ((a), (b)) == 0)
|
||||
# define strieq(a, b) (strcmp ((a), (b)) == 0)
|
||||
#endif
|
||||
#define strneq(a, b, l) (strncmp ((a), (b), (l)) == 0)
|
||||
|
||||
/* Add to VAR the hashing value of C, one character in a name. */
|
||||
#define HASH(var, c) \
|
||||
#define HASH(var, c) \
|
||||
((var += (c)), (var = ((var) << 7) + ((var) >> 20)))
|
||||
#ifdef HAVE_CASE_INSENSITIVE_FS /* Fold filenames */
|
||||
# define HASHI(var, c) \
|
||||
((var += tolower((c))), (var = ((var) << 7) + ((var) >> 20)))
|
||||
#else
|
||||
# define HASHI(var, c) HASH(var,c)
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__) || defined(ENUM_BITFIELDS)
|
||||
#define ENUM_BITFIELD(bits) :bits
|
||||
# define ENUM_BITFIELD(bits) :bits
|
||||
#else
|
||||
#define ENUM_BITFIELD(bits)
|
||||
# define ENUM_BITFIELD(bits)
|
||||
#endif
|
||||
|
||||
#ifdef __MSDOS__
|
||||
#define PATH_SEPARATOR_CHAR ';'
|
||||
#if defined(__MSDOS__) || defined(WINDOWS32)
|
||||
# define PATH_SEPARATOR_CHAR ';'
|
||||
#else
|
||||
#define PATH_SEPARATOR_CHAR ':'
|
||||
# if defined(VMS)
|
||||
# define PATH_SEPARATOR_CHAR ','
|
||||
# else
|
||||
# define PATH_SEPARATOR_CHAR ':'
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef WINDOWS32
|
||||
# include <fcntl.h>
|
||||
# include <malloc.h>
|
||||
# define pipe(p) _pipe(p, 512, O_BINARY)
|
||||
# define kill(pid,sig) w32_kill(pid,sig)
|
||||
|
||||
extern void sync_Path_environment(void);
|
||||
extern int kill(int pid, int sig);
|
||||
extern int safe_stat(char *file, struct stat *sb);
|
||||
extern char *end_of_token_w32(char *s, char stopchar);
|
||||
extern int find_and_set_default_shell(char *token);
|
||||
|
||||
/* indicates whether or not we have Bourne shell */
|
||||
extern int no_default_sh_exe;
|
||||
|
||||
/* is default_shell unixy? */
|
||||
extern int unixy_shell;
|
||||
#endif /* WINDOWS32 */
|
||||
|
||||
struct floc
|
||||
{
|
||||
char *filenm;
|
||||
unsigned long lineno;
|
||||
};
|
||||
#define NILF ((struct floc *)0)
|
||||
|
||||
|
||||
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 ();
|
||||
extern char *xmalloc (), *xrealloc ();
|
||||
extern char *find_next_token (), *next_token (), *end_of_token ();
|
||||
extern void collapse_continuations (), remove_comments ();
|
||||
extern char *sindex (), *lindex ();
|
||||
extern int alpha_compare ();
|
||||
extern void print_spaces ();
|
||||
extern struct dep *copy_dep_chain ();
|
||||
extern char *find_char_unquote (), *find_percent ();
|
||||
|
||||
#ifndef NO_ARCHIVES
|
||||
extern int ar_name ();
|
||||
extern void ar_parse_name ();
|
||||
extern int ar_touch ();
|
||||
extern time_t ar_member_date ();
|
||||
/* Fancy processing for variadic functions in both ANSI and pre-ANSI
|
||||
compilers. */
|
||||
#if defined __STDC__ && __STDC__
|
||||
extern void message (int prefix, const char *fmt, ...)
|
||||
__attribute__ ((__format__ (__printf__, 2, 3)));
|
||||
extern void error (const struct floc *flocp, const char *fmt, ...)
|
||||
__attribute__ ((__format__ (__printf__, 2, 3)));
|
||||
extern void fatal (const struct floc *flocp, const char *fmt, ...)
|
||||
__attribute__ ((noreturn, __format__ (__printf__, 2, 3)));
|
||||
#else
|
||||
extern void message ();
|
||||
extern void error ();
|
||||
extern void fatal ();
|
||||
#endif
|
||||
|
||||
extern void dir_load ();
|
||||
extern int dir_file_exists_p (), file_exists_p (), file_impossible_p ();
|
||||
extern void file_impossible ();
|
||||
extern char *dir_name ();
|
||||
extern void die PARAMS ((int)) __attribute__ ((noreturn));
|
||||
extern void log_working_directory PARAMS ((int));
|
||||
extern void pfatal_with_name PARAMS ((char *)) __attribute__ ((noreturn));
|
||||
extern void perror_with_name PARAMS ((char *, char *));
|
||||
extern char *savestring PARAMS ((const char *, unsigned int));
|
||||
extern char *concat PARAMS ((char *, char *, char *));
|
||||
extern char *xmalloc PARAMS ((unsigned int));
|
||||
extern char *xrealloc PARAMS ((char *, unsigned int));
|
||||
extern char *xstrdup PARAMS ((const char *));
|
||||
extern char *find_next_token PARAMS ((char **, unsigned int *));
|
||||
extern char *next_token PARAMS ((char *));
|
||||
extern char *end_of_token PARAMS ((char *));
|
||||
extern void collapse_continuations PARAMS ((char *));
|
||||
extern void remove_comments PARAMS((char *));
|
||||
extern char *sindex PARAMS ((const char *, unsigned int, \
|
||||
const char *, unsigned int));
|
||||
extern char *lindex PARAMS ((const char *, const char *, int));
|
||||
extern int alpha_compare PARAMS ((const void *, const void *));
|
||||
extern void print_spaces PARAMS ((unsigned int));
|
||||
extern char *find_char_unquote PARAMS ((char *, char *, int));
|
||||
extern char *find_percent PARAMS ((char *));
|
||||
|
||||
extern void define_default_variables ();
|
||||
extern void set_default_suffixes (), install_default_suffix_rules ();
|
||||
extern void install_default_implicit_rules (), count_implicit_rule_limits ();
|
||||
extern void convert_to_pattern (), create_pattern_rule ();
|
||||
#ifndef NO_ARCHIVES
|
||||
extern int ar_name PARAMS ((char *));
|
||||
extern void ar_parse_name PARAMS ((char *, char **, char **));
|
||||
extern int ar_touch PARAMS ((char *));
|
||||
extern time_t ar_member_date PARAMS ((char *));
|
||||
#endif
|
||||
|
||||
extern void build_vpath_lists (), construct_vpath_list ();
|
||||
extern int vpath_search ();
|
||||
extern int dir_file_exists_p PARAMS ((char *, char *));
|
||||
extern int file_exists_p PARAMS ((char *));
|
||||
extern int file_impossible_p PARAMS ((char *));
|
||||
extern void file_impossible PARAMS ((char *));
|
||||
extern char *dir_name PARAMS ((char *));
|
||||
|
||||
extern void construct_include_path ();
|
||||
extern void uniquize_deps ();
|
||||
extern void define_default_variables PARAMS ((void));
|
||||
extern void set_default_suffixes PARAMS ((void));
|
||||
extern void install_default_suffix_rules PARAMS ((void));
|
||||
extern void install_default_implicit_rules PARAMS ((void));
|
||||
|
||||
extern int update_goal_chain ();
|
||||
extern void notice_finished_file ();
|
||||
extern void build_vpath_lists PARAMS ((void));
|
||||
extern void construct_vpath_list PARAMS ((char *pattern, char *dirpath));
|
||||
extern int vpath_search PARAMS ((char **file, FILE_TIMESTAMP *mtime_ptr));
|
||||
extern int gpath_search PARAMS ((char *file, int len));
|
||||
|
||||
extern void user_access (), make_access (), child_access ();
|
||||
extern void construct_include_path PARAMS ((char **arg_dirs));
|
||||
|
||||
extern void user_access PARAMS ((void));
|
||||
extern void make_access PARAMS ((void));
|
||||
extern void child_access PARAMS ((void));
|
||||
|
||||
#ifdef HAVE_VFORK_H
|
||||
#include <vfork.h>
|
||||
#ifdef HAVE_VFORK_H
|
||||
# include <vfork.h>
|
||||
#endif
|
||||
|
||||
/* We omit these declarations on non-POSIX systems which define _POSIX_VERSION,
|
||||
because such systems often declare the in header files anyway. */
|
||||
because such systems often declare them in header files anyway. */
|
||||
|
||||
#if !defined (__GNU_LIBRARY__) && !defined (POSIX) && !defined (_POSIX_VERSION)
|
||||
#if !defined (__GNU_LIBRARY__) && !defined (POSIX) && !defined (_POSIX_VERSION) && !defined(WINDOWS32)
|
||||
|
||||
extern long int atol ();
|
||||
# ifndef VMS
|
||||
extern long int lseek ();
|
||||
# endif
|
||||
|
||||
#endif /* Not GNU C library or POSIX. */
|
||||
#endif /* Not GNU C library or POSIX. */
|
||||
|
||||
#ifdef HAVE_GETCWD
|
||||
#ifdef HAVE_GETCWD
|
||||
extern char *getcwd ();
|
||||
# ifdef VMS
|
||||
extern char *getwd PARAMS ((char *));
|
||||
# endif
|
||||
#else
|
||||
extern char *getwd ();
|
||||
#define getcwd(buf, len) getwd (buf)
|
||||
# define getcwd(buf, len) getwd (buf)
|
||||
#endif
|
||||
|
||||
extern const struct floc *reading_file;
|
||||
|
||||
extern char **environ;
|
||||
|
||||
extern char *reading_filename;
|
||||
extern unsigned int *reading_lineno_ptr;
|
||||
|
||||
extern int just_print_flag, silent_flag, ignore_errors_flag, keep_going_flag;
|
||||
extern int debug_flag, print_data_base_flag, question_flag, touch_flag;
|
||||
extern int env_overrides, no_builtin_rules_flag, print_version_flag;
|
||||
extern int print_directory_flag, warn_undefined_variables_flag;
|
||||
extern int posix_pedantic;
|
||||
extern int env_overrides, no_builtin_rules_flag, no_builtin_variables_flag;
|
||||
extern int print_version_flag, print_directory_flag;
|
||||
extern int warn_undefined_variables_flag, posix_pedantic;
|
||||
extern int clock_skew_detected;
|
||||
|
||||
/* can we run commands via 'sh -c xxx' or must we use batch files? */
|
||||
extern int batch_mode_shell;
|
||||
|
||||
extern unsigned int job_slots;
|
||||
extern int job_fds[2];
|
||||
extern int job_rfd;
|
||||
#ifndef NO_FLOAT
|
||||
extern double max_load_average;
|
||||
#else
|
||||
extern int max_load_average;
|
||||
#endif
|
||||
|
||||
extern char *program;
|
||||
extern char *starting_directory;
|
||||
@@ -346,6 +507,41 @@ extern unsigned int commands_started;
|
||||
extern int handling_fatal_signal;
|
||||
|
||||
|
||||
#ifndef MIN
|
||||
#define MIN(_a,_b) ((_a)<(_b)?(_a):(_b))
|
||||
#endif
|
||||
#ifndef MAX
|
||||
#define MAX(_a,_b) ((_a)>(_b)?(_a):(_b))
|
||||
#endif
|
||||
|
||||
#define DEBUGPR(msg) \
|
||||
do if (debug_flag) { print_spaces (depth); printf (msg, file->name); \
|
||||
fflush (stdout); } while (0)
|
||||
fflush (stdout); } while (0)
|
||||
|
||||
#ifdef VMS
|
||||
# ifndef EXIT_FAILURE
|
||||
# define EXIT_FAILURE 3
|
||||
# endif
|
||||
# ifndef EXIT_SUCCESS
|
||||
# define EXIT_SUCCESS 1
|
||||
# endif
|
||||
# ifndef EXIT_TROUBLE
|
||||
# define EXIT_TROUBLE 2
|
||||
# endif
|
||||
#else
|
||||
# ifndef EXIT_FAILURE
|
||||
# define EXIT_FAILURE 2
|
||||
# endif
|
||||
# ifndef EXIT_SUCCESS
|
||||
# define EXIT_SUCCESS 0
|
||||
# endif
|
||||
# ifndef EXIT_TROUBLE
|
||||
# define EXIT_TROUBLE 1
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* Set up heap debugging library dmalloc. */
|
||||
|
||||
#ifdef HAVE_DMALLOC_H
|
||||
#include <dmalloc.h>
|
||||
#endif
|
||||
|
||||
5
make.lnk
Normal file
5
make.lnk
Normal file
@@ -0,0 +1,5 @@
|
||||
FROM LIB:cres.o "commands.o"+"job.o"+"dir.o"+"file.o"+"misc.o"+"main.o"+"read.o"+"remake.o"+"rule.o"+"implicit.o"+"default.o"+"variable.o"+"expand.o"+"function.o"+"vpath.o"+"version.o"+"ar.o"+"arscan.o"+"signame.o"+"remote-stub.o"+"getopt.o"+"getopt1.o"+"alloca.o"+"amiga.o"
|
||||
TO "make.new"
|
||||
LIB glob/glob.lib LIB:sc.lib LIB:amiga.lib
|
||||
QUIET
|
||||
|
||||
2083
make.texinfo
2083
make.texinfo
File diff suppressed because it is too large
Load Diff
71
makefile.com
Normal file
71
makefile.com
Normal file
@@ -0,0 +1,71 @@
|
||||
$!
|
||||
$! Makefile.com - builds GNU Make for VMS
|
||||
$!
|
||||
$! P1 is non-empty if you want to link with the VAXCRTL library instead
|
||||
$! of the shareable executable
|
||||
$! P2 = DEBUG will build an image with debug information
|
||||
$!
|
||||
$! In case of problems with the install you might contact me at
|
||||
$! zinser@decus.decus.de (preferred) or martin_zinser@exchange.de
|
||||
$!
|
||||
$! Look for the compiler used
|
||||
$!
|
||||
$ lval = ""
|
||||
$ if f$search("SYS$SYSTEM:DECC$COMPILER.EXE").eqs.""
|
||||
$ then
|
||||
$ if f$trnlnm("SYS").eqs."" then def/nolog sys sys$library:
|
||||
$ ccopt = ""
|
||||
$ else
|
||||
$ ccopt = "/decc/prefix=all"
|
||||
$ if f$trnlnm("SYS").eqs.""
|
||||
$ then
|
||||
$ if f$trnlnm("DECC$LIBRARY_INCLUDE").nes.""
|
||||
$ then
|
||||
$ define sys decc$library_include:
|
||||
$ else
|
||||
$ if f$search("SYS$COMMON:[DECC$LIB.REFERENCE]DECC$RTLDEF.DIR").nes."" -
|
||||
then lval = "SYS$COMMON:[DECC$LIB.REFERENCE.DECC$RTLDEF],"
|
||||
$ if f$search("SYS$COMMON:[DECC$LIB.REFERENCE]SYS$STARLET_C.DIR").nes."" -
|
||||
then lval = lval+"SYS$COMMON:[DECC$LIB.REFERENCE.SYS$STARLET_C],"
|
||||
$ lval=lval+"SYS$LIBRARY:"
|
||||
$ define sys 'lval
|
||||
$ endif
|
||||
$ endif
|
||||
$ endif
|
||||
$!
|
||||
$! Should we build a debug image
|
||||
$!
|
||||
$ if (p2.eqs."DEBUG")
|
||||
$ then
|
||||
$ ccopt = ccopt + "/noopt/debug"
|
||||
$ lopt = "/debug"
|
||||
$ else
|
||||
$ lopt = ""
|
||||
$ endif
|
||||
$ filelist = "alloca ar arscan commands default dir expand file function implicit job main misc read remake remote-stub rule signame variable version vmsfunctions vmsify vpath [.glob]glob [.glob]fnmatch getopt1 getopt"
|
||||
$ copy config.h-vms config.h
|
||||
$ n=0
|
||||
$ open/write optf make.opt
|
||||
$ loop:
|
||||
$ cfile = f$elem(n," ",filelist)
|
||||
$ if cfile .eqs. " " then goto linkit
|
||||
$ write sys$output "Compiling ''cfile'..."
|
||||
$ call compileit 'cfile' 'p1'
|
||||
$ n = n + 1
|
||||
$ goto loop
|
||||
$ linkit:
|
||||
$ close optf
|
||||
$ if p1 .nes. "" then goto link_using_library
|
||||
$ link/exe=make make.opt/opt'lopt
|
||||
$ exit
|
||||
$ link_using_library:
|
||||
$ link/exe=make make.opt/opt,sys$library:vaxcrtl/lib'lopt
|
||||
$!
|
||||
$ compileit : subroutine
|
||||
$ ploc = f$locate("]",p1)
|
||||
$ filnam = p1
|
||||
$ if ploc .lt. f$length(p1) then filnam=f$extract(ploc+1,100,p1)
|
||||
$ write optf "''filnam'"
|
||||
$ cc'ccopt'/include=([],[.glob])/define=("allocated_variable_expand_for_file=alloc_var_expand_for_file","unlink=remove","HAVE_CONFIG_H","VMS") 'p1'
|
||||
$ exit
|
||||
$ endsubroutine : compileit
|
||||
122
makefile.vms
Normal file
122
makefile.vms
Normal file
@@ -0,0 +1,122 @@
|
||||
# Copyright (C) 1988, 1989, 1996, 1997 Free Software Foundation, Inc.
|
||||
# This file is part of GNU Make.
|
||||
#
|
||||
# VMS extensions from GNU Make 3.60 imported by
|
||||
# Klaus Kämpf (kkaempf@progis.de) of proGIS Software, Aachen, Germany
|
||||
#
|
||||
# GNU Make is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# GNU Make is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with GNU Make; see the file COPYING. If not, write to
|
||||
# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
# Boston, MA 02111-1307, USA.
|
||||
|
||||
CC = cc/warn
|
||||
CP = copy
|
||||
|
||||
%.obj: %.c
|
||||
$(CC) $(CFLAGS)/obj=$@ $<
|
||||
#
|
||||
# Makefile for GNU Make
|
||||
#
|
||||
|
||||
CFLAGS = $(defines) /debug/noopt/include=([],[.glob])
|
||||
#LDFLAGS = /deb
|
||||
LDFLAGS =
|
||||
|
||||
defines = /define=("unlink=remove","HAVE_CONFIG_H","VMS","allocated_variable_expand_for_file=alloc_var_expand_for_file")
|
||||
|
||||
LOAD_AVG = /define="NO_LDAV"
|
||||
|
||||
# If you don't want archive support, comment these out.
|
||||
ARCHIVES = ,ar.obj,arscan.obj
|
||||
ARCHIVES_SRC = ar.c arscan.c
|
||||
|
||||
# If your system needs extra libraries loaded in, define them here.
|
||||
# System V probably need -lPW for alloca.
|
||||
# if on vax, uncomment the following line
|
||||
#LOADLIBES = ,c.opt/opt
|
||||
LOADLIBES =,sys$$library:vaxcrtl.olb/lib
|
||||
|
||||
# If your system doesn't have alloca, or the one provided is bad,
|
||||
# get it from the Emacs distribution and define these.
|
||||
ALLOCA = ,alloca.obj
|
||||
ALLOCASRC = alloca.c
|
||||
|
||||
# If there are remote execution facilities defined,
|
||||
# enable them with switches here (see remote-*.c).
|
||||
REMOTE =
|
||||
|
||||
# Any extra object files your system needs.
|
||||
extras = ,signame.obj,remote-stub.obj,vmsfunctions.obj,vmsify.obj
|
||||
#,directory.obj
|
||||
# as an alternative:
|
||||
glob = ,[.glob]glob.obj,[.glob]fnmatch.obj
|
||||
getopt = ,getopt.obj,getopt1.obj
|
||||
# Directory to install `make' in.
|
||||
bindir = []
|
||||
# Directory to install the man page in.
|
||||
mandir = []
|
||||
# Number to put on the man page filename.
|
||||
manext = 1
|
||||
|
||||
objs = commands.obj,job.obj,dir.obj,file.obj,misc.obj,\
|
||||
main.obj,read.obj,remake.obj,rule.obj,implicit.obj,\
|
||||
default.obj,variable.obj,expand.obj,function.obj,\
|
||||
vpath.obj,version.obj$(ARCHIVES)$(ALLOCA)$(extras)$(getopt)$(glob)
|
||||
srcs = commands.c job.c dir.c file.c misc.c \
|
||||
main.c read.c remake.c rule.c implicit.c \
|
||||
default.c variable.c expand.c function.c \
|
||||
vpath.c version.c vmsfunctions.c vmsify.c $(ARCHIVES_SRC) $(ALLOCASRC) \
|
||||
commands.h dep.h filedef.h job.h make.h rule.h variable.h
|
||||
|
||||
|
||||
.PHONY: all doc
|
||||
all: config.h make.exe
|
||||
|
||||
doc: make.info make.dvi
|
||||
|
||||
|
||||
make.exe: $(objs)
|
||||
$(LD)$(LDFLAGS)/exe=$@ $^$(LOADLIBES)
|
||||
|
||||
.PHONY: clean realclean
|
||||
clean:
|
||||
-$(RM) make.exe;,*.obj;*
|
||||
|
||||
# Automatically generated dependencies.
|
||||
commands.obj: commands.c make.h dep.h commands.h filedef.h variable.h job.h
|
||||
job.obj: job.c make.h commands.h job.h filedef.h variable.h
|
||||
dir.obj: dir.c make.h
|
||||
file.obj: file.c make.h commands.h dep.h filedef.h variable.h
|
||||
misc.obj: misc.c make.h dep.h
|
||||
main.obj: main.c make.h commands.h dep.h filedef.h variable.h job.h
|
||||
read.obj: read.c make.h commands.h dep.h filedef.h variable.h
|
||||
remake.obj: remake.c make.h commands.h job.h dep.h filedef.h
|
||||
rule.obj: rule.c make.h commands.h dep.h filedef.h variable.h rule.h
|
||||
implicit.obj: implicit.c make.h rule.h dep.h filedef.h
|
||||
default.obj: default.c make.h rule.h dep.h filedef.h commands.h variable.h
|
||||
variable.obj: variable.c make.h commands.h variable.h dep.h filedef.h
|
||||
expand.obj: expand.c make.h commands.h filedef.h variable.h
|
||||
function.obj: function.c make.h variable.h dep.h commands.h job.h
|
||||
vpath.obj: vpath.c make.h filedef.h variable.h
|
||||
version.obj: version.c
|
||||
arscan.obj: arscan.c
|
||||
ar.obj: ar.c make.h filedef.h
|
||||
signame.obj: signame.c
|
||||
remote-stub.obj: remote-stub.c
|
||||
[.glob]glob.obj: [.glob]glob.c
|
||||
[.glob]fnmatch.obj: [.glob]fnmatch.c
|
||||
getopt.obj: getopt.c
|
||||
getopt1.obj: getopt1.c
|
||||
|
||||
config.h: config.h-vms
|
||||
$(CP) $< $@
|
||||
282
misc.c
282
misc.c
@@ -1,5 +1,5 @@
|
||||
/* Miscellaneous generic support functions for GNU Make.
|
||||
Copyright (C) 1988, 89, 90, 91, 92, 93, 94, 1995 Free Software Foundation, Inc.
|
||||
Copyright (C) 1988,89,90,91,92,93,94,95,97 Free Software Foundation, Inc.
|
||||
This file is part of GNU Make.
|
||||
|
||||
GNU Make is free software; you can redistribute it and/or modify
|
||||
@@ -14,23 +14,59 @@ 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. */
|
||||
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
#include "make.h"
|
||||
#include "dep.h"
|
||||
|
||||
|
||||
/* Variadic functions. We go through contortions to allow proper function
|
||||
prototypes for both ANSI and pre-ANSI C compilers, and also for those
|
||||
which support stdarg.h vs. varargs.h, and finally those which have
|
||||
vfprintf(), etc. and those who have _doprnt... or nothing.
|
||||
|
||||
This fancy stuff all came from GNU fileutils, except for the VA_PRINTF and
|
||||
VA_END macros used here since we have multiple print functions. */
|
||||
|
||||
#if HAVE_VPRINTF || HAVE_DOPRNT
|
||||
# define HAVE_STDVARARGS 1
|
||||
# if __STDC__
|
||||
# include <stdarg.h>
|
||||
# define VA_START(args, lastarg) va_start(args, lastarg)
|
||||
# else
|
||||
# include <varargs.h>
|
||||
# define VA_START(args, lastarg) va_start(args)
|
||||
# endif
|
||||
# if HAVE_VPRINTF
|
||||
# define VA_PRINTF(fp, lastarg, args) vfprintf((fp), (lastarg), (args))
|
||||
# else
|
||||
# define VA_PRINTF(fp, lastarg, args) _doprnt((lastarg), (args), (fp))
|
||||
# endif
|
||||
# define VA_END(args) va_end(args)
|
||||
#else
|
||||
/* # undef HAVE_STDVARARGS */
|
||||
# define va_alist a1, a2, a3, a4, a5, a6, a7, a8
|
||||
# define va_dcl char *a1, *a2, *a3, *a4, *a5, *a6, *a7, *a8;
|
||||
# define VA_START(args, lastarg)
|
||||
# define VA_END(args)
|
||||
#endif
|
||||
|
||||
|
||||
/* Compare strings *S1 and *S2.
|
||||
Return negative if the first is less, positive if it is greater,
|
||||
zero if they are equal. */
|
||||
|
||||
int
|
||||
alpha_compare (s1, s2)
|
||||
char **s1, **s2;
|
||||
alpha_compare (v1, v2)
|
||||
const void *v1, *v2;
|
||||
{
|
||||
if (**s1 != **s2)
|
||||
return **s1 - **s2;
|
||||
return strcmp (*s1, *s2);
|
||||
const char *s1 = *((char **)v1);
|
||||
const char *s2 = *((char **)v2);
|
||||
|
||||
if (*s1 != *s2)
|
||||
return *s1 - *s2;
|
||||
return strcmp (s1, s2);
|
||||
}
|
||||
|
||||
/* Discard each backslash-newline combination from LINE.
|
||||
@@ -173,13 +209,22 @@ concat (s1, s2, s3)
|
||||
/* Print a message on stdout. */
|
||||
|
||||
void
|
||||
message (prefix, s1, s2, s3, s4, s5, s6)
|
||||
#if __STDC__ && HAVE_STDVARARGS
|
||||
message (int prefix, const char *fmt, ...)
|
||||
#else
|
||||
message (prefix, fmt, va_alist)
|
||||
int prefix;
|
||||
char *s1, *s2, *s3, *s4, *s5, *s6;
|
||||
const char *fmt;
|
||||
va_dcl
|
||||
#endif
|
||||
{
|
||||
#if HAVE_STDVARARGS
|
||||
va_list args;
|
||||
#endif
|
||||
|
||||
log_working_directory (1);
|
||||
|
||||
if (s1 != 0)
|
||||
if (fmt != 0)
|
||||
{
|
||||
if (prefix)
|
||||
{
|
||||
@@ -188,76 +233,78 @@ message (prefix, s1, s2, s3, s4, s5, s6)
|
||||
else
|
||||
printf ("%s[%u]: ", program, makelevel);
|
||||
}
|
||||
printf (s1, s2, s3, s4, s5, s6);
|
||||
VA_START (args, fmt);
|
||||
VA_PRINTF (stdout, fmt, args);
|
||||
VA_END (args);
|
||||
putchar ('\n');
|
||||
}
|
||||
|
||||
fflush (stdout);
|
||||
}
|
||||
|
||||
/* Print an error message and exit. */
|
||||
|
||||
/* VARARGS1 */
|
||||
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
|
||||
fprintf (stderr, "%s[%u]: *** ", program, makelevel);
|
||||
fprintf (stderr, s1, s2, s3, s4, s5, s6);
|
||||
fputs (". Stop.\n", stderr);
|
||||
|
||||
die (2);
|
||||
}
|
||||
|
||||
/* Print error message. `s1' is printf control string, `s2' is arg for it. */
|
||||
|
||||
/* VARARGS1 */
|
||||
/* Print an error message. */
|
||||
|
||||
void
|
||||
error (s1, s2, s3, s4, s5, s6)
|
||||
char *s1, *s2, *s3, *s4, *s5, *s6;
|
||||
#if __STDC__ && HAVE_STDVARARGS
|
||||
error (const struct floc *flocp, const char *fmt, ...)
|
||||
#else
|
||||
error (flocp, fmt, va_alist)
|
||||
const struct floc *flocp;
|
||||
const char *fmt;
|
||||
va_dcl
|
||||
#endif
|
||||
{
|
||||
#if HAVE_STDVARARGS
|
||||
va_list args;
|
||||
#endif
|
||||
|
||||
log_working_directory (1);
|
||||
|
||||
if (makelevel == 0)
|
||||
if (flocp && flocp->filenm)
|
||||
fprintf (stderr, "%s:%lu: ", flocp->filenm, flocp->lineno);
|
||||
else if (makelevel == 0)
|
||||
fprintf (stderr, "%s: ", program);
|
||||
else
|
||||
fprintf (stderr, "%s[%u]: ", program, makelevel);
|
||||
fprintf (stderr, s1, s2, s3, s4, s5, s6);
|
||||
|
||||
VA_START(args, fmt);
|
||||
VA_PRINTF (stderr, fmt, args);
|
||||
VA_END (args);
|
||||
|
||||
putc ('\n', stderr);
|
||||
fflush (stderr);
|
||||
}
|
||||
|
||||
void
|
||||
makefile_error (file, lineno, s1, s2, s3, s4, s5, s6)
|
||||
char *file;
|
||||
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);
|
||||
fflush (stderr);
|
||||
}
|
||||
/* Print an error message and exit. */
|
||||
|
||||
void
|
||||
makefile_fatal (file, lineno, s1, s2, s3, s4, s5, s6)
|
||||
char *file;
|
||||
unsigned int lineno;
|
||||
char *s1, *s2, *s3, *s4, *s5, *s6;
|
||||
#if __STDC__ && HAVE_STDVARARGS
|
||||
fatal (const struct floc *flocp, const char *fmt, ...)
|
||||
#else
|
||||
fatal (flocp, fmt, va_alist)
|
||||
const struct floc *flocp;
|
||||
const char *fmt;
|
||||
va_dcl
|
||||
#endif
|
||||
{
|
||||
#if HAVE_STDVARARGS
|
||||
va_list args;
|
||||
#endif
|
||||
|
||||
log_working_directory (1);
|
||||
|
||||
fprintf (stderr, "%s:%u: *** ", file, lineno);
|
||||
fprintf (stderr, s1, s2, s3, s4, s5, s6);
|
||||
fputs (". Stop.\n", stderr);
|
||||
if (flocp && flocp->filenm)
|
||||
fprintf (stderr, "%s:%lu: *** ", flocp->filenm, flocp->lineno);
|
||||
else if (makelevel == 0)
|
||||
fprintf (stderr, "%s: *** ", program);
|
||||
else
|
||||
fprintf (stderr, "%s[%u]: *** ", program, makelevel);
|
||||
|
||||
VA_START(args, fmt);
|
||||
VA_PRINTF (stderr, fmt, args);
|
||||
VA_END (args);
|
||||
|
||||
fputs (_(". Stop.\n"), stderr);
|
||||
|
||||
die (2);
|
||||
}
|
||||
@@ -271,13 +318,15 @@ strerror (errnum)
|
||||
int errnum;
|
||||
{
|
||||
extern int errno, sys_nerr;
|
||||
#ifndef __DECC
|
||||
extern char *sys_errlist[];
|
||||
#endif
|
||||
static char buf[] = "Unknown error 12345678901234567890";
|
||||
|
||||
if (errno < sys_nerr)
|
||||
return sys_errlist[errnum];
|
||||
|
||||
sprintf (buf, "Unknown error %d", errnum);
|
||||
sprintf (buf, _("Unknown error %d"), errnum);
|
||||
return buf;
|
||||
}
|
||||
#endif
|
||||
@@ -288,7 +337,7 @@ void
|
||||
perror_with_name (str, name)
|
||||
char *str, *name;
|
||||
{
|
||||
error ("%s%s: %s", str, name, strerror (errno));
|
||||
error (NILF, "%s%s: %s", str, name, strerror (errno));
|
||||
}
|
||||
|
||||
/* Print an error message from errno and exit. */
|
||||
@@ -297,15 +346,19 @@ void
|
||||
pfatal_with_name (name)
|
||||
char *name;
|
||||
{
|
||||
fatal ("%s: %s", name, strerror (errno));
|
||||
fatal (NILF, "%s: %s", name, strerror (errno));
|
||||
|
||||
/* NOTREACHED */
|
||||
}
|
||||
|
||||
/* Like malloc but get fatal error if memory is exhausted. */
|
||||
/* Don't bother if we're using dmalloc; it provides these for us. */
|
||||
|
||||
#ifndef HAVE_DMALLOC_H
|
||||
|
||||
#undef xmalloc
|
||||
#undef xrealloc
|
||||
#undef xstrdup
|
||||
|
||||
char *
|
||||
xmalloc (size)
|
||||
@@ -313,7 +366,7 @@ xmalloc (size)
|
||||
{
|
||||
char *result = (char *) malloc (size);
|
||||
if (result == 0)
|
||||
fatal ("virtual memory exhausted");
|
||||
fatal (NILF, _("virtual memory exhausted"));
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -323,15 +376,43 @@ xrealloc (ptr, size)
|
||||
char *ptr;
|
||||
unsigned int size;
|
||||
{
|
||||
char *result = (char *) realloc (ptr, size);
|
||||
char *result;
|
||||
|
||||
/* Some older implementations of realloc() don't conform to ANSI. */
|
||||
result = ptr ? realloc (ptr, size) : malloc (size);
|
||||
if (result == 0)
|
||||
fatal ("virtual memory exhausted");
|
||||
fatal (NILF, _("virtual memory exhausted"));
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
char *
|
||||
xstrdup (ptr)
|
||||
const char *ptr;
|
||||
{
|
||||
char *result;
|
||||
|
||||
#ifdef HAVE_STRDUP
|
||||
result = strdup (ptr);
|
||||
#else
|
||||
result = (char *) malloc (strlen (ptr) + 1);
|
||||
#endif
|
||||
|
||||
if (result == 0)
|
||||
fatal (NILF, _("virtual memory exhausted"));
|
||||
|
||||
#ifdef HAVE_STRDUP
|
||||
return result;
|
||||
#else
|
||||
return strcpy(result, ptr);
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif /* HAVE_DMALLOC_H */
|
||||
|
||||
char *
|
||||
savestring (str, length)
|
||||
char *str;
|
||||
const char *str;
|
||||
unsigned int length;
|
||||
{
|
||||
register char *out = (char *) xmalloc (length + 1);
|
||||
@@ -347,21 +428,28 @@ savestring (str, length)
|
||||
|
||||
char *
|
||||
sindex (big, blen, small, slen)
|
||||
char *big;
|
||||
const char *big;
|
||||
unsigned int blen;
|
||||
char *small;
|
||||
const char *small;
|
||||
unsigned int slen;
|
||||
{
|
||||
register unsigned int b;
|
||||
|
||||
if (blen < 1)
|
||||
if (!blen)
|
||||
blen = strlen (big);
|
||||
if (slen < 1)
|
||||
if (!slen)
|
||||
slen = strlen (small);
|
||||
|
||||
for (b = 0; b < blen; ++b)
|
||||
if (big[b] == *small && !strncmp (&big[b + 1], small + 1, slen - 1))
|
||||
return (&big[b]);
|
||||
if (slen && blen >= slen)
|
||||
{
|
||||
register unsigned int b;
|
||||
|
||||
/* Quit when there's not enough room left for the small string. */
|
||||
--slen;
|
||||
blen -= slen;
|
||||
|
||||
for (b = 0; b < blen; ++b, ++big)
|
||||
if (*big == *small && strneq (big + 1, small + 1, slen))
|
||||
return (char *)big;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -374,12 +462,12 @@ sindex (big, blen, small, slen)
|
||||
|
||||
char *
|
||||
lindex (s, limit, c)
|
||||
register char *s, *limit;
|
||||
register const char *s, *limit;
|
||||
int c;
|
||||
{
|
||||
while (s < limit)
|
||||
if (*s++ == c)
|
||||
return s - 1;
|
||||
return (char *)(s - 1);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -395,6 +483,37 @@ end_of_token (s)
|
||||
return s;
|
||||
}
|
||||
|
||||
#ifdef WINDOWS32
|
||||
/*
|
||||
* Same as end_of_token, but take into account a stop character
|
||||
*/
|
||||
char *
|
||||
end_of_token_w32 (s, stopchar)
|
||||
char *s;
|
||||
char stopchar;
|
||||
{
|
||||
register char *p = s;
|
||||
register int backslash = 0;
|
||||
|
||||
while (*p != '\0' && *p != stopchar && (backslash || !isblank (*p)))
|
||||
{
|
||||
if (*p++ == '\\')
|
||||
{
|
||||
backslash = !backslash;
|
||||
while (*p == '\\')
|
||||
{
|
||||
backslash = !backslash;
|
||||
++p;
|
||||
}
|
||||
}
|
||||
else
|
||||
backslash = 0;
|
||||
}
|
||||
|
||||
return p;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Return the address of the first nonwhitespace or null in the string S. */
|
||||
|
||||
char *
|
||||
@@ -437,14 +556,14 @@ copy_dep_chain (d)
|
||||
{
|
||||
register struct dep *c;
|
||||
struct dep *firstnew = 0;
|
||||
struct dep *lastnew;
|
||||
struct dep *lastnew = 0;
|
||||
|
||||
while (d != 0)
|
||||
{
|
||||
c = (struct dep *) xmalloc (sizeof (struct dep));
|
||||
bcopy ((char *) d, (char *) c, sizeof (struct dep));
|
||||
if (c->name != 0)
|
||||
c->name = savestring (c->name, strlen (c->name));
|
||||
c->name = xstrdup (c->name);
|
||||
c->next = 0;
|
||||
if (firstnew == 0)
|
||||
firstnew = lastnew = c;
|
||||
@@ -531,8 +650,9 @@ log_access (flavor)
|
||||
but we write this one to stderr because it might be
|
||||
run in a child fork whose stdout is piped. */
|
||||
|
||||
fprintf (stderr, "%s access: user %d (real %d), group %d (real %d)\n",
|
||||
flavor, geteuid (), getuid (), getegid (), getgid ());
|
||||
fprintf (stderr, _("%s access: user %lu (real %lu), group %lu (real %lu)\n"),
|
||||
flavor, (unsigned long) geteuid (), (unsigned long) getuid (),
|
||||
(unsigned long) getegid (), (unsigned long) getgid ());
|
||||
fflush (stderr);
|
||||
}
|
||||
|
||||
@@ -540,6 +660,7 @@ log_access (flavor)
|
||||
static void
|
||||
init_access ()
|
||||
{
|
||||
#ifndef VMS
|
||||
user_uid = getuid ();
|
||||
user_gid = getgid ();
|
||||
|
||||
@@ -550,9 +671,10 @@ init_access ()
|
||||
if (user_uid == -1 || user_gid == -1 || make_uid == -1 || make_gid == -1)
|
||||
pfatal_with_name ("get{e}[gu]id");
|
||||
|
||||
log_access ("Initialized");
|
||||
log_access (_("Initialized"));
|
||||
|
||||
current_access = make;
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif /* GETLOADAVG_PRIVILEGED */
|
||||
|
||||
64
readme.vms
Normal file
64
readme.vms
Normal file
@@ -0,0 +1,64 @@
|
||||
This is the VMS port of GNU Make.
|
||||
|
||||
It is based on the VMS port of GNU Make 3.60 by Mike Moretti.
|
||||
|
||||
This port was done by Klaus Kämpf <kkaempf@progis.de> of
|
||||
proGIS Software, Aachen, Germany.
|
||||
|
||||
To build Make, simply type @makefile. This should compile all the
|
||||
necessary files and link Make. There is also a file called
|
||||
makefile.vms. If you already have GNU Make built you can just use
|
||||
Make with this makefile to rebuild.
|
||||
|
||||
Here are some notes about GNU Make for VMS:
|
||||
|
||||
The variable $^ separates files with commas instead of spaces (It's the
|
||||
natural thing to do for VMS).
|
||||
|
||||
See defaults.c for VMS default suffixes and my definitions for default
|
||||
rules and variables.
|
||||
|
||||
The shell function is not implemented yet.
|
||||
|
||||
Load average routines haven't been implemented for VMS yet.
|
||||
|
||||
The default include directory for including other makefiles is
|
||||
SYS$SYSROOT:[SYSLIB] (I don't remember why I didn't just use
|
||||
SYS$LIBRARY: instead; maybe it wouldn't work that way).
|
||||
|
||||
The default makefiles make looks for are: makefile.vms, gnumakefile, makefile.,
|
||||
and gnumakefile. .
|
||||
|
||||
The stat() function and handling of time stamps in VMS is broken, so I
|
||||
replaced it with a hack in vmsfunctions.c. I will provide a full rewrite
|
||||
somewhere in the future. Be warned, the time resolution inside make is
|
||||
less than what vms provides. This might be a problem on the faster Alphas.
|
||||
|
||||
You can use a : in a filename only if you preceed it with a backslash ('\').
|
||||
E.g.- hobbes\:[bogas.files]
|
||||
|
||||
Make ignores success, informational, or warning errors (-S-, -I-, or -W-).
|
||||
But it will stop on -E- and -F- errors. (unless you do something to override
|
||||
this in your makefile, or whatever).
|
||||
|
||||
Remote stuff isn't implemented yet.
|
||||
|
||||
Multiple line DCL commands, such as "if" statements, must be put inside
|
||||
command files. You can run a command file by using \@.
|
||||
|
||||
|
||||
Change history:
|
||||
|
||||
3.76.x
|
||||
======
|
||||
Added VMS help version (make.hlp) of the Unix man page. To integrate
|
||||
that with an existing Help library use a command like the following
|
||||
$lib/ins/help sys$help:helplib.hlb make.hlp
|
||||
3.74.3
|
||||
======
|
||||
Lots of default settings are adapted for VMS. See default.c.
|
||||
|
||||
Long command lines are now converted to command files.
|
||||
|
||||
Comma (',') as a separator is now allowed. See makefile.vms for an example.
|
||||
|
||||
@@ -18,18 +18,19 @@ 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. */
|
||||
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
#include "make.h"
|
||||
#include "job.h"
|
||||
#include "filedef.h"
|
||||
#include "commands.h"
|
||||
#include "job.h"
|
||||
#include <sys/time.h>
|
||||
#include <netdb.h>
|
||||
|
||||
#define __STRICT_BSD__ /* Don't make conflicting declarations. */
|
||||
#include "customs.h"
|
||||
|
||||
|
||||
char *remote_description = "Customs";
|
||||
|
||||
/* File name of the Customs `export' client command.
|
||||
@@ -42,25 +43,47 @@ static ExportPermit permit;
|
||||
/* Normalized path name of the current directory. */
|
||||
static char *normalized_cwd;
|
||||
|
||||
/* Call once at startup even if no commands are run. */
|
||||
|
||||
void
|
||||
remote_setup ()
|
||||
{
|
||||
}
|
||||
|
||||
/* Called before exit. */
|
||||
|
||||
void
|
||||
remote_cleanup ()
|
||||
{
|
||||
}
|
||||
|
||||
/* Return nonzero if the next job should be done remotely. */
|
||||
|
||||
int
|
||||
start_remote_job_p ()
|
||||
start_remote_job_p (first_p)
|
||||
int first_p;
|
||||
{
|
||||
static int inited = 0;
|
||||
int status;
|
||||
|
||||
/* Allow the user to turn off job exportation
|
||||
(useful while he is debugging Customs, for example). */
|
||||
if (getenv ("GNU_MAKE_NO_CUSTOMS") != 0)
|
||||
return 0;
|
||||
int njobs;
|
||||
|
||||
if (!inited)
|
||||
{
|
||||
/* Allow the user to turn off job exportation (useful while he is
|
||||
debugging Customs, for example). */
|
||||
if (getenv ("GNU_MAKE_NO_CUSTOMS") != 0)
|
||||
{
|
||||
inited = -1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* For secure Customs, make is installed setuid root and
|
||||
Customs requires a privileged source port be used. */
|
||||
make_access ();
|
||||
|
||||
if (debug_flag)
|
||||
Rpc_Debug(1);
|
||||
|
||||
/* Ping the daemon once to see if it is there. */
|
||||
inited = Customs_Ping () == RPC_SUCCESS ? 1 : -1;
|
||||
|
||||
@@ -87,6 +110,15 @@ start_remote_job_p ()
|
||||
if (inited < 0)
|
||||
return 0;
|
||||
|
||||
njobs = job_slots_used;
|
||||
if (!first_p)
|
||||
njobs -= 1; /* correction for being called from reap_children() */
|
||||
|
||||
/* the first job should run locally, or, if the -l flag is given, we use
|
||||
that as clue as to how many local jobs should be scheduled locally */
|
||||
if (max_load_average < 0 && njobs == 0 || njobs < max_load_average)
|
||||
return 0;
|
||||
|
||||
status = Customs_Host (EXPORT_SAME, &permit);
|
||||
if (status != RPC_SUCCESS)
|
||||
{
|
||||
@@ -113,8 +145,8 @@ start_remote_job (argv, envp, stdin_fd, is_remote, id_ptr, used_stdin)
|
||||
int *id_ptr;
|
||||
int *used_stdin;
|
||||
{
|
||||
extern int vfork (), execve ();
|
||||
char waybill[MAX_DATA_SIZE], msg[128];
|
||||
struct hostent *host;
|
||||
struct timeval timeout;
|
||||
struct sockaddr_in sin;
|
||||
int len;
|
||||
@@ -126,7 +158,7 @@ start_remote_job (argv, envp, stdin_fd, is_remote, id_ptr, used_stdin)
|
||||
retsock = Rpc_UdpCreate (True, 0);
|
||||
if (retsock < 0)
|
||||
{
|
||||
error ("exporting: Couldn't create return socket.");
|
||||
error (NILF, "exporting: Couldn't create return socket.");
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -150,8 +182,8 @@ start_remote_job (argv, envp, stdin_fd, is_remote, id_ptr, used_stdin)
|
||||
/* Modify the waybill as if the remote child had done `child_access ()'. */
|
||||
{
|
||||
WayBill *wb = (WayBill *) waybill;
|
||||
wb->euid = wb->ruid;
|
||||
wb->rgid = wb->rgid;
|
||||
wb->ruid = wb->euid;
|
||||
wb->rgid = wb->egid;
|
||||
}
|
||||
|
||||
/* Send the request to the server, timing out in 20 seconds. */
|
||||
@@ -164,26 +196,31 @@ start_remote_job (argv, envp, stdin_fd, is_remote, id_ptr, used_stdin)
|
||||
len, (Rpc_Opaque) waybill,
|
||||
sizeof(msg), (Rpc_Opaque) msg,
|
||||
1, &timeout);
|
||||
|
||||
host = gethostbyaddr((char *)&permit.addr, sizeof(permit.addr), AF_INET);
|
||||
|
||||
if (status != RPC_SUCCESS)
|
||||
{
|
||||
(void) close (retsock);
|
||||
(void) close (sock);
|
||||
error ("exporting: %s", Rpc_ErrorMessage (status));
|
||||
error (NILF, "exporting to %s: %s",
|
||||
host ? host->h_name : inet_ntoa (permit.addr),
|
||||
Rpc_ErrorMessage (status));
|
||||
return 1;
|
||||
}
|
||||
else if (msg[0] != 'O' || msg[1] != 'k' || msg[2] != '\0')
|
||||
{
|
||||
(void) close (retsock);
|
||||
(void) close (sock);
|
||||
error ("CUSTOMS_IMPORT: %s", msg);
|
||||
error (NILF, "exporting to %s: %s",
|
||||
host ? host->h_name : inet_ntoa (permit.addr),
|
||||
msg);
|
||||
return 1;
|
||||
}
|
||||
else if (debug_flag)
|
||||
else
|
||||
{
|
||||
struct hostent *host = gethostbyaddr (&permit.addr, sizeof (permit.addr),
|
||||
AF_INET);
|
||||
printf ("Job exported to %s ID %u\n",
|
||||
host == 0 ? inet_ntoa (permit.addr) : host->h_name,
|
||||
error (NILF, "*** exported to %s (id %u)",
|
||||
host ? host->h_name : inet_ntoa (permit.addr),
|
||||
permit.id);
|
||||
}
|
||||
|
||||
@@ -225,6 +262,7 @@ start_remote_job (argv, envp, stdin_fd, is_remote, id_ptr, used_stdin)
|
||||
(void) close (sock);
|
||||
*is_remote = 0;
|
||||
*id_ptr = pid;
|
||||
*used_stdin = 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Template for the remote job exportation interface to GNU Make.
|
||||
Copyright (C) 1988, 1989, 1992, 1993 Free Software Foundation, Inc.
|
||||
Copyright (C) 1988, 1989, 1992, 1993, 1996 Free Software Foundation, Inc.
|
||||
This file is part of GNU Make.
|
||||
|
||||
GNU Make is free software; you can redistribute it and/or modify
|
||||
@@ -14,19 +14,36 @@ 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. */
|
||||
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
#include "make.h"
|
||||
#include "filedef.h"
|
||||
#include "job.h"
|
||||
#include "commands.h"
|
||||
|
||||
|
||||
char *remote_description = 0;
|
||||
|
||||
/* Call once at startup even if no commands are run. */
|
||||
|
||||
void
|
||||
remote_setup ()
|
||||
{
|
||||
}
|
||||
|
||||
/* Called before exit. */
|
||||
|
||||
void
|
||||
remote_cleanup ()
|
||||
{
|
||||
}
|
||||
|
||||
/* Return nonzero if the next job should be done remotely. */
|
||||
|
||||
int
|
||||
start_remote_job_p ()
|
||||
start_remote_job_p (first_p)
|
||||
int first_p;
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
217
rule.c
217
rule.c
@@ -1,5 +1,5 @@
|
||||
/* Pattern and suffix rule internals for GNU Make.
|
||||
Copyright (C) 1988, 1989, 1990, 1991, 1992, 1993 Free Software Foundation, Inc.
|
||||
Copyright (C) 1988,89,90,91,92,93, 1998 Free Software Foundation, Inc.
|
||||
This file is part of GNU Make.
|
||||
|
||||
GNU Make is free software; you can redistribute it and/or modify
|
||||
@@ -14,16 +14,18 @@ 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. */
|
||||
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
#include "make.h"
|
||||
#include "commands.h"
|
||||
#include "dep.h"
|
||||
#include "file.h"
|
||||
#include "filedef.h"
|
||||
#include "job.h"
|
||||
#include "commands.h"
|
||||
#include "variable.h"
|
||||
#include "rule.h"
|
||||
|
||||
static void freerule ();
|
||||
static void freerule PARAMS ((struct rule *rule, struct rule *lastrule));
|
||||
|
||||
/* Chain of all pattern rules. */
|
||||
|
||||
@@ -49,6 +51,14 @@ unsigned int max_pattern_deps;
|
||||
|
||||
unsigned int max_pattern_dep_length;
|
||||
|
||||
/* Chain of all pattern-specific variables. */
|
||||
|
||||
static struct pattern_var *pattern_vars;
|
||||
|
||||
/* Pointer to last struct in the chain, so we can add onto the end. */
|
||||
|
||||
static struct pattern_var *last_pattern_var;
|
||||
|
||||
/* Pointer to structure for the file .SUFFIXES
|
||||
whose dependencies are the suffixes to be searched. */
|
||||
|
||||
@@ -85,7 +95,7 @@ count_implicit_rule_limits ()
|
||||
unsigned int ntargets;
|
||||
|
||||
++num_pattern_rules;
|
||||
|
||||
|
||||
ntargets = 0;
|
||||
while (rule->targets[ntargets] != 0)
|
||||
++ntargets;
|
||||
@@ -96,9 +106,13 @@ count_implicit_rule_limits ()
|
||||
for (dep = rule->deps; dep != 0; dep = dep->next)
|
||||
{
|
||||
unsigned int len = strlen (dep->name);
|
||||
char *p = rindex (dep->name, '/');
|
||||
char *p2 = p != 0 ? index (dep->name, '%') : 0;
|
||||
|
||||
#ifdef VMS
|
||||
char *p = rindex (dep->name, ']');
|
||||
#else
|
||||
char *p = rindex (dep->name, '/');
|
||||
#endif
|
||||
char *p2 = p != 0 ? index (dep->name, '%') : 0;
|
||||
ndeps++;
|
||||
|
||||
if (len > max_pattern_dep_length)
|
||||
@@ -125,7 +139,11 @@ count_implicit_rule_limits ()
|
||||
nonexistent subdirectory. */
|
||||
|
||||
dep->changed = !dir_file_exists_p (name, "");
|
||||
#ifdef VMS
|
||||
if (dep->changed && *name == ']')
|
||||
#else
|
||||
if (dep->changed && *name == '/')
|
||||
#endif
|
||||
{
|
||||
/* The name is absolute and the directory does not exist.
|
||||
This rule can never possibly match, since this dependency
|
||||
@@ -148,7 +166,7 @@ count_implicit_rule_limits ()
|
||||
end_main_loop:
|
||||
rule = next;
|
||||
}
|
||||
|
||||
|
||||
if (name != 0)
|
||||
free (name);
|
||||
}
|
||||
@@ -173,7 +191,11 @@ convert_suffix_rule (target, source, cmds)
|
||||
/* Special case: TARGET being nil means we are defining a
|
||||
`.X.a' suffix rule; the target pattern is always `(%.o)'. */
|
||||
{
|
||||
#ifdef VMS
|
||||
targname = savestring ("(%.obj)", 7);
|
||||
#else
|
||||
targname = savestring ("(%.o)", 5);
|
||||
#endif
|
||||
targpercent = targname + 1;
|
||||
}
|
||||
else
|
||||
@@ -312,27 +334,29 @@ new_pattern_rule (rule, override)
|
||||
if (!streq (dep_name (d), dep_name (d2)))
|
||||
break;
|
||||
if (d == 0 && d2 == 0)
|
||||
/* All the dependencies matched. */
|
||||
if (override)
|
||||
{
|
||||
/* Remove the old rule. */
|
||||
freerule (r, lastrule);
|
||||
/* Install the new one. */
|
||||
if (pattern_rules == 0)
|
||||
pattern_rules = rule;
|
||||
else
|
||||
last_pattern_rule->next = rule;
|
||||
last_pattern_rule = rule;
|
||||
|
||||
/* We got one. Stop looking. */
|
||||
goto matched;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* The old rule stays intact. Destroy the new one. */
|
||||
freerule (rule, (struct rule *) 0);
|
||||
return 0;
|
||||
}
|
||||
{
|
||||
/* All the dependencies matched. */
|
||||
if (override)
|
||||
{
|
||||
/* Remove the old rule. */
|
||||
freerule (r, lastrule);
|
||||
/* Install the new one. */
|
||||
if (pattern_rules == 0)
|
||||
pattern_rules = rule;
|
||||
else
|
||||
last_pattern_rule->next = rule;
|
||||
last_pattern_rule = rule;
|
||||
|
||||
/* We got one. Stop looking. */
|
||||
goto matched;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* The old rule stays intact. Destroy the new one. */
|
||||
freerule (rule, (struct rule *) 0);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -395,11 +419,11 @@ install_pattern_rule (p, terminal)
|
||||
{
|
||||
r->terminal = terminal;
|
||||
r->cmds = (struct commands *) xmalloc (sizeof (struct commands));
|
||||
r->cmds->filename = 0;
|
||||
r->cmds->lineno = 0;
|
||||
r->cmds->fileinfo.filenm = 0;
|
||||
r->cmds->fileinfo.lineno = 0;
|
||||
/* These will all be string literals, but we malloc space for them
|
||||
anyway because somebody might want to free them later. */
|
||||
r->cmds->commands = savestring (p->commands, strlen (p->commands));
|
||||
r->cmds->commands = xstrdup (p->commands);
|
||||
r->cmds->command_lines = 0;
|
||||
}
|
||||
}
|
||||
@@ -415,10 +439,23 @@ freerule (rule, lastrule)
|
||||
{
|
||||
struct rule *next = rule->next;
|
||||
register unsigned int i;
|
||||
register struct dep *dep;
|
||||
|
||||
for (i = 0; rule->targets[i] != 0; ++i)
|
||||
free (rule->targets[i]);
|
||||
|
||||
dep = rule->deps;
|
||||
while (dep)
|
||||
{
|
||||
struct dep *t;
|
||||
|
||||
t = dep->next;
|
||||
/* We might leak dep->name here, but I'm not sure how to fix this: I
|
||||
think that pointer might be shared (e.g., in the file hash?) */
|
||||
free ((char *) dep);
|
||||
dep = t;
|
||||
}
|
||||
|
||||
free ((char *) rule->targets);
|
||||
free ((char *) rule->suffixes);
|
||||
free ((char *) rule->lens);
|
||||
@@ -506,6 +543,78 @@ create_pattern_rule (targets, target_percents,
|
||||
r->terminal = terminal;
|
||||
}
|
||||
|
||||
/* Create a new pattern-specific variable struct. */
|
||||
|
||||
struct pattern_var *
|
||||
create_pattern_var (target, suffix)
|
||||
char *target, *suffix;
|
||||
{
|
||||
register struct pattern_var *p = 0;
|
||||
unsigned int len = strlen(target);
|
||||
|
||||
/* Look to see if this pattern already exists in the list. */
|
||||
for (p = pattern_vars; p != NULL; p = p->next)
|
||||
if (p->len == len && !strcmp(p->target, target))
|
||||
break;
|
||||
|
||||
if (p == 0)
|
||||
{
|
||||
p = (struct pattern_var *) xmalloc (sizeof (struct pattern_var));
|
||||
if (last_pattern_var != 0)
|
||||
last_pattern_var->next = p;
|
||||
else
|
||||
pattern_vars = p;
|
||||
last_pattern_var = p;
|
||||
p->next = 0;
|
||||
p->target = target;
|
||||
p->len = len;
|
||||
p->suffix = suffix + 1;
|
||||
p->vars = create_new_variable_set();
|
||||
}
|
||||
|
||||
return p;
|
||||
}
|
||||
|
||||
/* Look up a target in the pattern-specific variable list. */
|
||||
|
||||
struct pattern_var *
|
||||
lookup_pattern_var (target)
|
||||
char *target;
|
||||
{
|
||||
struct pattern_var *p;
|
||||
unsigned int targlen = strlen(target);
|
||||
|
||||
for (p = pattern_vars; p != 0; p = p->next)
|
||||
{
|
||||
char *stem;
|
||||
unsigned int stemlen;
|
||||
|
||||
if (p->len > targlen)
|
||||
/* It can't possibly match. */
|
||||
continue;
|
||||
|
||||
/* From the lengths of the filename and the pattern parts,
|
||||
find the stem: the part of the filename that matches the %. */
|
||||
stem = target + (p->suffix - p->target - 1);
|
||||
stemlen = targlen - p->len + 1;
|
||||
|
||||
/* Compare the text in the pattern before the stem, if any. */
|
||||
if (stem > target && !strneq (p->target, target, stem - target))
|
||||
continue;
|
||||
|
||||
/* Compare the text in the pattern after the stem, if any.
|
||||
We could test simply use streq, but this way we compare the
|
||||
first two characters immediately. This saves time in the very
|
||||
common case where the first character matches because it is a
|
||||
period. */
|
||||
if (*p->suffix == stem[stemlen]
|
||||
&& (*p->suffix == '\0'|| streq (&p->suffix[1], &stem[stemlen+1])))
|
||||
break;
|
||||
}
|
||||
|
||||
return p;
|
||||
}
|
||||
|
||||
/* Print the data base of rules. */
|
||||
|
||||
static void /* Useful to call from gdb. */
|
||||
@@ -555,17 +664,49 @@ print_rule_data_base ()
|
||||
}
|
||||
|
||||
if (rules == 0)
|
||||
puts ("\n# No implicit rules.");
|
||||
puts (_("\n# No implicit rules."));
|
||||
else
|
||||
{
|
||||
printf ("\n# %u implicit rules, %u", rules, terminal);
|
||||
printf (_("\n# %u implicit rules, %u"), rules, terminal);
|
||||
#ifndef NO_FLOAT
|
||||
printf (" (%.1f%%)", (double) terminal / (double) rules * 100.0);
|
||||
#else
|
||||
{
|
||||
int f = (terminal * 1000 + 5) / rules;
|
||||
printf (" (%d.%d%%)", f/10, f%10);
|
||||
}
|
||||
#endif
|
||||
puts (" terminal.");
|
||||
puts (_(" terminal."));
|
||||
}
|
||||
|
||||
if (num_pattern_rules != rules)
|
||||
fatal ("BUG: num_pattern_rules wrong! %u != %u",
|
||||
num_pattern_rules, rules);
|
||||
{
|
||||
/* This can happen if a fatal error was detected while reading the
|
||||
makefiles and thus count_implicit_rule_limits wasn't called yet. */
|
||||
if (num_pattern_rules != 0)
|
||||
fatal (NILF, _("BUG: num_pattern_rules wrong! %u != %u"),
|
||||
num_pattern_rules, rules);
|
||||
}
|
||||
|
||||
puts (_("\n# Pattern-specific variable values"));
|
||||
|
||||
{
|
||||
struct pattern_var *p;
|
||||
|
||||
rules = 0;
|
||||
for (p = pattern_vars; p != 0; p = p->next)
|
||||
{
|
||||
++rules;
|
||||
|
||||
printf ("\n%s :\n", p->target);
|
||||
print_variable_set (p->vars->set, "# ");
|
||||
}
|
||||
|
||||
if (rules == 0)
|
||||
puts (_("\n# No pattern-specific variable values."));
|
||||
else
|
||||
{
|
||||
printf (_("\n# %u pattern-specific variable values"), rules);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
25
rule.h
25
rule.h
@@ -14,7 +14,8 @@ 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. */
|
||||
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
/* Structure used for pattern rules. */
|
||||
|
||||
@@ -30,6 +31,15 @@ struct rule
|
||||
char in_use; /* If in use by a parent pattern_search. */
|
||||
};
|
||||
|
||||
struct pattern_var
|
||||
{
|
||||
struct pattern_var *next;
|
||||
char *target;
|
||||
unsigned int len;
|
||||
char *suffix;
|
||||
struct variable_set_list *vars;
|
||||
};
|
||||
|
||||
/* For calling install_pattern_rule. */
|
||||
struct pspec
|
||||
{
|
||||
@@ -49,5 +59,14 @@ extern struct file *suffix_file;
|
||||
extern unsigned int maxsuffix;
|
||||
|
||||
|
||||
extern void install_pattern_rule ();
|
||||
int new_pattern_rule ();
|
||||
extern void install_pattern_rule PARAMS ((struct pspec *p, int terminal));
|
||||
extern int new_pattern_rule PARAMS ((struct rule *rule, int override));
|
||||
extern struct pattern_var *create_pattern_var PARAMS ((char *target, char *suffix));
|
||||
extern struct pattern_var *lookup_pattern_var PARAMS ((char *target));
|
||||
extern void count_implicit_rule_limits PARAMS ((void));
|
||||
extern void convert_to_pattern PARAMS ((void));
|
||||
extern void create_pattern_rule PARAMS ((char **targets,
|
||||
char **target_percents, int terminal,
|
||||
struct dep *deps,
|
||||
struct commands *commands,
|
||||
int override));
|
||||
|
||||
145
signame.c
145
signame.c
@@ -1,28 +1,32 @@
|
||||
/* Convert between signal names and numbers.
|
||||
Copyright (C) 1990, 1992, 1993, 1995 Free Software Foundation, Inc.
|
||||
Copyright (C) 1990, 1992, 1993, 1995, 1996 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
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, or (at your option)
|
||||
any later version.
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This 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.
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU 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. */
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with the GNU C Library; see the file COPYING.LIB. If not,
|
||||
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
#include "make.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <sys/types.h> /* Some systems need this for <signal.h>. */
|
||||
#include <signal.h>
|
||||
|
||||
#ifdef HAVE_STRING_H
|
||||
#include <string.h>
|
||||
#endif
|
||||
|
||||
/* Some systems declare `sys_siglist in <unistd.h>; if
|
||||
configure defined SYS_SIGLIST_DECLARED, it may expect
|
||||
to find the declaration there. */
|
||||
@@ -50,7 +54,7 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||
/* There is too much variation in Sys V signal numbers and names, so
|
||||
we must initialize them at runtime. */
|
||||
|
||||
static const char undoc[] = "unknown signal";
|
||||
static const char *undoc;
|
||||
|
||||
const char *sys_siglist[NSIG];
|
||||
|
||||
@@ -64,12 +68,14 @@ extern char *sys_siglist[];
|
||||
|
||||
/* Table of abbreviations for signals. Note: A given number can
|
||||
appear more than once with different abbreviations. */
|
||||
#define SIG_TABLE_SIZE (NSIG*2)
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int number;
|
||||
const char *abbrev;
|
||||
} num_abbrev;
|
||||
static num_abbrev sig_table[NSIG*2];
|
||||
static num_abbrev sig_table[SIG_TABLE_SIZE];
|
||||
/* Number of elements of sig_table used. */
|
||||
static int sig_table_nelts = 0;
|
||||
|
||||
@@ -82,10 +88,18 @@ init_sig (number, abbrev, name)
|
||||
const char *name;
|
||||
{
|
||||
#ifndef HAVE_SYS_SIGLIST
|
||||
sys_siglist[number] = name;
|
||||
/* If this value is ever greater than NSIG it seems like it'd be a bug in
|
||||
the system headers, but... better safe than sorry. We know, for
|
||||
example, that this isn't always true on VMS. */
|
||||
|
||||
if (number >= 0 && number < NSIG)
|
||||
sys_siglist[number] = name;
|
||||
#endif
|
||||
sig_table[sig_table_nelts].number = number;
|
||||
sig_table[sig_table_nelts++].abbrev = abbrev;
|
||||
if (sig_table_nelts < SIG_TABLE_SIZE)
|
||||
{
|
||||
sig_table[sig_table_nelts].number = number;
|
||||
sig_table[sig_table_nelts++].abbrev = abbrev;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
@@ -93,6 +107,10 @@ signame_init ()
|
||||
{
|
||||
#ifndef HAVE_SYS_SIGLIST
|
||||
int i;
|
||||
char *u = _("unknown signal");
|
||||
|
||||
undoc = xstrdup(u);
|
||||
|
||||
/* Initialize signal names. */
|
||||
for (i = 0; i < NSIG; i++)
|
||||
sys_siglist[i] = undoc;
|
||||
@@ -100,132 +118,135 @@ signame_init ()
|
||||
|
||||
/* Initialize signal names. */
|
||||
#if defined (SIGHUP)
|
||||
init_sig (SIGHUP, "HUP", "Hangup");
|
||||
init_sig (SIGHUP, "HUP", _("Hangup"));
|
||||
#endif
|
||||
#if defined (SIGINT)
|
||||
init_sig (SIGINT, "INT", "Interrupt");
|
||||
init_sig (SIGINT, "INT", _("Interrupt"));
|
||||
#endif
|
||||
#if defined (SIGQUIT)
|
||||
init_sig (SIGQUIT, "QUIT", "Quit");
|
||||
init_sig (SIGQUIT, "QUIT", _("Quit"));
|
||||
#endif
|
||||
#if defined (SIGILL)
|
||||
init_sig (SIGILL, "ILL", "Illegal Instruction");
|
||||
init_sig (SIGILL, "ILL", _("Illegal Instruction"));
|
||||
#endif
|
||||
#if defined (SIGTRAP)
|
||||
init_sig (SIGTRAP, "TRAP", "Trace/breakpoint trap");
|
||||
init_sig (SIGTRAP, "TRAP", _("Trace/breakpoint trap"));
|
||||
#endif
|
||||
/* If SIGIOT == SIGABRT, we want to print it as SIGABRT because
|
||||
SIGABRT is in ANSI and POSIX.1 and SIGIOT isn't. */
|
||||
#if defined (SIGABRT)
|
||||
init_sig (SIGABRT, "ABRT", "Aborted");
|
||||
init_sig (SIGABRT, "ABRT", _("Aborted"));
|
||||
#endif
|
||||
#if defined (SIGIOT)
|
||||
init_sig (SIGIOT, "IOT", "IOT trap");
|
||||
init_sig (SIGIOT, "IOT", _("IOT trap"));
|
||||
#endif
|
||||
#if defined (SIGEMT)
|
||||
init_sig (SIGEMT, "EMT", "EMT trap");
|
||||
init_sig (SIGEMT, "EMT", _("EMT trap"));
|
||||
#endif
|
||||
#if defined (SIGFPE)
|
||||
init_sig (SIGFPE, "FPE", "Floating point exception");
|
||||
init_sig (SIGFPE, "FPE", _("Floating point exception"));
|
||||
#endif
|
||||
#if defined (SIGKILL)
|
||||
init_sig (SIGKILL, "KILL", "Killed");
|
||||
init_sig (SIGKILL, "KILL", _("Killed"));
|
||||
#endif
|
||||
#if defined (SIGBUS)
|
||||
init_sig (SIGBUS, "BUS", "Bus error");
|
||||
init_sig (SIGBUS, "BUS", _("Bus error"));
|
||||
#endif
|
||||
#if defined (SIGSEGV)
|
||||
init_sig (SIGSEGV, "SEGV", "Segmentation fault");
|
||||
init_sig (SIGSEGV, "SEGV", _("Segmentation fault"));
|
||||
#endif
|
||||
#if defined (SIGSYS)
|
||||
init_sig (SIGSYS, "SYS", "Bad system call");
|
||||
init_sig (SIGSYS, "SYS", _("Bad system call"));
|
||||
#endif
|
||||
#if defined (SIGPIPE)
|
||||
init_sig (SIGPIPE, "PIPE", "Broken pipe");
|
||||
init_sig (SIGPIPE, "PIPE", _("Broken pipe"));
|
||||
#endif
|
||||
#if defined (SIGALRM)
|
||||
init_sig (SIGALRM, "ALRM", "Alarm clock");
|
||||
init_sig (SIGALRM, "ALRM", _("Alarm clock"));
|
||||
#endif
|
||||
#if defined (SIGTERM)
|
||||
init_sig (SIGTERM, "TERM", "Terminated");
|
||||
init_sig (SIGTERM, "TERM", _("Terminated"));
|
||||
#endif
|
||||
#if defined (SIGUSR1)
|
||||
init_sig (SIGUSR1, "USR1", "User defined signal 1");
|
||||
init_sig (SIGUSR1, "USR1", _("User defined signal 1"));
|
||||
#endif
|
||||
#if defined (SIGUSR2)
|
||||
init_sig (SIGUSR2, "USR2", "User defined signal 2");
|
||||
init_sig (SIGUSR2, "USR2", _("User defined signal 2"));
|
||||
#endif
|
||||
/* If SIGCLD == SIGCHLD, we want to print it as SIGCHLD because that
|
||||
is what is in POSIX.1. */
|
||||
#if defined (SIGCHLD)
|
||||
init_sig (SIGCHLD, "CHLD", "Child exited");
|
||||
init_sig (SIGCHLD, "CHLD", _("Child exited"));
|
||||
#endif
|
||||
#if defined (SIGCLD)
|
||||
init_sig (SIGCLD, "CLD", "Child exited");
|
||||
init_sig (SIGCLD, "CLD", _("Child exited"));
|
||||
#endif
|
||||
#if defined (SIGPWR)
|
||||
init_sig (SIGPWR, "PWR", "Power failure");
|
||||
init_sig (SIGPWR, "PWR", _("Power failure"));
|
||||
#endif
|
||||
#if defined (SIGTSTP)
|
||||
init_sig (SIGTSTP, "TSTP", "Stopped");
|
||||
init_sig (SIGTSTP, "TSTP", _("Stopped"));
|
||||
#endif
|
||||
#if defined (SIGTTIN)
|
||||
init_sig (SIGTTIN, "TTIN", "Stopped (tty input)");
|
||||
init_sig (SIGTTIN, "TTIN", _("Stopped (tty input)"));
|
||||
#endif
|
||||
#if defined (SIGTTOU)
|
||||
init_sig (SIGTTOU, "TTOU", "Stopped (tty output)");
|
||||
init_sig (SIGTTOU, "TTOU", _("Stopped (tty output)"));
|
||||
#endif
|
||||
#if defined (SIGSTOP)
|
||||
init_sig (SIGSTOP, "STOP", "Stopped (signal)");
|
||||
init_sig (SIGSTOP, "STOP", _("Stopped (signal)"));
|
||||
#endif
|
||||
#if defined (SIGXCPU)
|
||||
init_sig (SIGXCPU, "XCPU", "CPU time limit exceeded");
|
||||
init_sig (SIGXCPU, "XCPU", _("CPU time limit exceeded"));
|
||||
#endif
|
||||
#if defined (SIGXFSZ)
|
||||
init_sig (SIGXFSZ, "XFSZ", "File size limit exceeded");
|
||||
init_sig (SIGXFSZ, "XFSZ", _("File size limit exceeded"));
|
||||
#endif
|
||||
#if defined (SIGVTALRM)
|
||||
init_sig (SIGVTALRM, "VTALRM", "Virtual timer expired");
|
||||
init_sig (SIGVTALRM, "VTALRM", _("Virtual timer expired"));
|
||||
#endif
|
||||
#if defined (SIGPROF)
|
||||
init_sig (SIGPROF, "PROF", "Profiling timer expired");
|
||||
init_sig (SIGPROF, "PROF", _("Profiling timer expired"));
|
||||
#endif
|
||||
#if defined (SIGWINCH)
|
||||
/* "Window size changed" might be more accurate, but even if that
|
||||
is all that it means now, perhaps in the future it will be
|
||||
extended to cover other kinds of window changes. */
|
||||
init_sig (SIGWINCH, "WINCH", "Window changed");
|
||||
init_sig (SIGWINCH, "WINCH", _("Window changed"));
|
||||
#endif
|
||||
#if defined (SIGCONT)
|
||||
init_sig (SIGCONT, "CONT", "Continued");
|
||||
init_sig (SIGCONT, "CONT", _("Continued"));
|
||||
#endif
|
||||
#if defined (SIGURG)
|
||||
init_sig (SIGURG, "URG", "Urgent I/O condition");
|
||||
init_sig (SIGURG, "URG", _("Urgent I/O condition"));
|
||||
#endif
|
||||
#if defined (SIGIO)
|
||||
/* "I/O pending" has also been suggested. A disadvantage is
|
||||
that signal only happens when the process has
|
||||
asked for it, not everytime I/O is pending. Another disadvantage
|
||||
is the confusion from giving it a different name than under Unix. */
|
||||
init_sig (SIGIO, "IO", "I/O possible");
|
||||
init_sig (SIGIO, "IO", _("I/O possible"));
|
||||
#endif
|
||||
#if defined (SIGWIND)
|
||||
init_sig (SIGWIND, "WIND", "SIGWIND");
|
||||
init_sig (SIGWIND, "WIND", _("SIGWIND"));
|
||||
#endif
|
||||
#if defined (SIGPHONE)
|
||||
init_sig (SIGPHONE, "PHONE", "SIGPHONE");
|
||||
init_sig (SIGPHONE, "PHONE", _("SIGPHONE"));
|
||||
#endif
|
||||
#if defined (SIGPOLL)
|
||||
init_sig (SIGPOLL, "POLL", "I/O possible");
|
||||
init_sig (SIGPOLL, "POLL", _("I/O possible"));
|
||||
#endif
|
||||
#if defined (SIGLOST)
|
||||
init_sig (SIGLOST, "LOST", "Resource lost");
|
||||
init_sig (SIGLOST, "LOST", _("Resource lost"));
|
||||
#endif
|
||||
#if defined (SIGDANGER)
|
||||
init_sig (SIGDANGER, "DANGER", "Danger signal");
|
||||
init_sig (SIGDANGER, "DANGER", _("Danger signal"));
|
||||
#endif
|
||||
#if defined (SIGINFO)
|
||||
init_sig (SIGINFO, "INFO", "Information request");
|
||||
init_sig (SIGINFO, "INFO", _("Information request"));
|
||||
#endif
|
||||
#if defined (SIGNOFP)
|
||||
init_sig (SIGNOFP, "NOFP", _("Floating point co-processor not available"));
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -239,7 +260,7 @@ sig_abbrev (number)
|
||||
|
||||
if (sig_table_nelts == 0)
|
||||
signame_init ();
|
||||
|
||||
|
||||
for (i = 0; i < sig_table_nelts; i++)
|
||||
if (sig_table[i].number == number)
|
||||
return (char *)sig_table[i].abbrev;
|
||||
@@ -293,10 +314,10 @@ strsignal (signal)
|
||||
int signal;
|
||||
{
|
||||
static char buf[] = "Signal 12345678901234567890";
|
||||
|
||||
|
||||
if (signal > 0 || signal < NSIG)
|
||||
return (char *) sys_siglist[signal];
|
||||
|
||||
|
||||
sprintf (buf, "Signal %d", signal);
|
||||
return buf;
|
||||
}
|
||||
|
||||
26
signame.h
26
signame.h
@@ -1,19 +1,21 @@
|
||||
/* Convert between signal names and numbers.
|
||||
Copyright (C) 1990, 1992, 1993, 1995 Free Software Foundation, Inc.
|
||||
Copyright (C) 1990, 1992, 1993, 1995, 1997 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
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, or (at your option)
|
||||
any later version.
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This 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.
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU 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. */
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with the GNU C Library; see the file COPYING.LIB. If not,
|
||||
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
#if defined (__STDC__) && __STDC__
|
||||
|
||||
|
||||
6
subproc.bat
Normal file
6
subproc.bat
Normal file
@@ -0,0 +1,6 @@
|
||||
cd w32\subproc
|
||||
set MAKE=%2
|
||||
set MAKEFILE=%1
|
||||
if x%2 == x set MAKE=nmake
|
||||
%MAKE% /f %MAKEFILE%
|
||||
cd ..\..
|
||||
5896
texinfo.tex
Normal file
5896
texinfo.tex
Normal file
File diff suppressed because it is too large
Load Diff
424
variable.c
424
variable.c
@@ -1,5 +1,5 @@
|
||||
/* Internals of variables for GNU Make.
|
||||
Copyright (C) 1988, 89, 90, 91, 92, 93, 94 Free Software Foundation, Inc.
|
||||
Copyright (C) 1988,89,90,91,92,93,94,96,97 Free Software Foundation, Inc.
|
||||
This file is part of GNU Make.
|
||||
|
||||
GNU Make is free software; you can redistribute it and/or modify
|
||||
@@ -14,13 +14,18 @@ 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. */
|
||||
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
#include "make.h"
|
||||
#include "dep.h"
|
||||
#include "filedef.h"
|
||||
#include "job.h"
|
||||
#include "commands.h"
|
||||
#include "variable.h"
|
||||
#include "dep.h"
|
||||
#include "file.h"
|
||||
#ifdef WINDOWS32
|
||||
#include "pathstuff.h"
|
||||
#endif
|
||||
|
||||
/* Hash table of all global variable definitions. */
|
||||
|
||||
@@ -39,6 +44,9 @@ static struct variable_set global_variable_set
|
||||
static struct variable_set_list global_setlist
|
||||
= { 0, &global_variable_set };
|
||||
struct variable_set_list *current_variable_set_list = &global_setlist;
|
||||
|
||||
static struct variable *lookup_variable_in_set PARAMS ((char *name,
|
||||
unsigned int length, struct variable_set *set));
|
||||
|
||||
/* Implement variables. */
|
||||
|
||||
@@ -49,7 +57,7 @@ struct variable_set_list *current_variable_set_list = &global_setlist;
|
||||
If RECURSIVE is nonzero a flag is set in the variable saying
|
||||
that it should be recursively re-expanded. */
|
||||
|
||||
static struct variable *
|
||||
struct variable *
|
||||
define_variable_in_set (name, length, value, origin, recursive, set)
|
||||
char *name;
|
||||
unsigned int length;
|
||||
@@ -69,7 +77,7 @@ define_variable_in_set (name, length, value, origin, recursive, set)
|
||||
|
||||
for (v = set->table[hashval]; v != 0; v = v->next)
|
||||
if (*v->name == *name
|
||||
&& !strncmp (v->name + 1, name + 1, length - 1)
|
||||
&& strneq (v->name + 1, name + 1, length - 1)
|
||||
&& v->name[length] == '\0')
|
||||
break;
|
||||
|
||||
@@ -90,7 +98,7 @@ define_variable_in_set (name, length, value, origin, recursive, set)
|
||||
{
|
||||
if (v->value != 0)
|
||||
free (v->value);
|
||||
v->value = savestring (value, strlen (value));
|
||||
v->value = xstrdup (value);
|
||||
v->origin = origin;
|
||||
v->recursive = recursive;
|
||||
}
|
||||
@@ -101,10 +109,11 @@ define_variable_in_set (name, length, value, origin, recursive, set)
|
||||
|
||||
v = (struct variable *) xmalloc (sizeof (struct variable));
|
||||
v->name = savestring (name, length);
|
||||
v->value = savestring (value, strlen (value));
|
||||
v->value = xstrdup (value);
|
||||
v->origin = origin;
|
||||
v->recursive = recursive;
|
||||
v->expanding = 0;
|
||||
v->per_target = 0;
|
||||
v->export = v_default;
|
||||
v->next = set->table[hashval];
|
||||
set->table[hashval] = v;
|
||||
@@ -167,7 +176,7 @@ lookup_variable (name, length)
|
||||
|
||||
for (v = set->table[hashval]; v != 0; v = v->next)
|
||||
if (*v->name == *name
|
||||
&& !strncmp (v->name + 1, name + 1, length - 1)
|
||||
&& strneq (v->name + 1, name + 1, length - 1)
|
||||
&& v->name[length] == 0)
|
||||
return v;
|
||||
}
|
||||
@@ -175,6 +184,34 @@ lookup_variable (name, length)
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Lookup a variable whose name is a string starting at NAME
|
||||
and with LENGTH chars in set SET. NAME need not be null-terminated.
|
||||
Returns address of the `struct variable' containing all info
|
||||
on the variable, or nil if no such variable is defined. */
|
||||
|
||||
static struct variable *
|
||||
lookup_variable_in_set (name, length, set)
|
||||
char *name;
|
||||
unsigned int length;
|
||||
struct variable_set *set;
|
||||
{
|
||||
register unsigned int i;
|
||||
register unsigned int hash = 0;
|
||||
register struct variable *v;
|
||||
|
||||
for (i = 0; i < length; ++i)
|
||||
HASH (hash, name[i]);
|
||||
hash %= set->buckets;
|
||||
|
||||
for (v = set->table[hash]; v != 0; v = v->next)
|
||||
if (*v->name == *name
|
||||
&& strneq (v->name + 1, name + 1, length - 1)
|
||||
&& v->name[length] == 0)
|
||||
return v;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Initialize FILE's variable set list. If FILE already has a variable set
|
||||
list, the topmost variable set is left intact, but the the rest of the
|
||||
chain is replaced with FILE->parent's setlist. */
|
||||
@@ -229,6 +266,8 @@ pop_variable_scope ()
|
||||
next = v->next;
|
||||
|
||||
free (v->name);
|
||||
if (v->value)
|
||||
free (v->value);
|
||||
free ((char *) v);
|
||||
}
|
||||
}
|
||||
@@ -236,10 +275,8 @@ pop_variable_scope ()
|
||||
free ((char *) set);
|
||||
}
|
||||
|
||||
/* Create a new variable set and push it on the current setlist. */
|
||||
|
||||
void
|
||||
push_new_variable_scope ()
|
||||
struct variable_set_list *
|
||||
create_new_variable_set ()
|
||||
{
|
||||
register struct variable_set_list *setlist;
|
||||
register struct variable_set *set;
|
||||
@@ -254,7 +291,16 @@ push_new_variable_scope ()
|
||||
xmalloc (sizeof (struct variable_set_list));
|
||||
setlist->set = set;
|
||||
setlist->next = current_variable_set_list;
|
||||
current_variable_set_list = setlist;
|
||||
|
||||
return setlist;
|
||||
}
|
||||
|
||||
/* Create a new variable set and push it on the current setlist. */
|
||||
|
||||
struct variable_set_list *
|
||||
push_new_variable_scope ()
|
||||
{
|
||||
return (current_variable_set_list = create_new_variable_set());
|
||||
}
|
||||
|
||||
/* Merge SET1 into SET0, freeing unused storage in SET1. */
|
||||
@@ -324,8 +370,6 @@ merge_variable_set_lists (setlist0, setlist1)
|
||||
|
||||
merge_variable_sets (list0->set, next->set);
|
||||
|
||||
free ((char *) next);
|
||||
|
||||
last0 = list0;
|
||||
list0 = list0->next;
|
||||
}
|
||||
@@ -345,7 +389,11 @@ merge_variable_set_lists (setlist0, setlist1)
|
||||
void
|
||||
define_automatic_variables ()
|
||||
{
|
||||
#ifdef WINDOWS32
|
||||
extern char* default_shell;
|
||||
#else
|
||||
extern char default_shell[];
|
||||
#endif
|
||||
register struct variable *v;
|
||||
char buf[200];
|
||||
|
||||
@@ -360,19 +408,47 @@ define_automatic_variables ()
|
||||
? "" : remote_description);
|
||||
(void) define_variable ("MAKE_VERSION", 12, buf, o_default, 0);
|
||||
|
||||
|
||||
#ifdef __MSDOS__
|
||||
/* Allow to specify a special shell just for Make,
|
||||
and use $COMSPEC as the default $SHELL when appropriate. */
|
||||
{
|
||||
static char shell_str[] = "SHELL";
|
||||
const int shlen = sizeof (shell_str) - 1;
|
||||
struct variable *mshp = lookup_variable ("MAKESHELL", 9);
|
||||
struct variable *comp = lookup_variable ("COMSPEC", 7);
|
||||
|
||||
/* Make $MAKESHELL override $SHELL even if -e is in effect. */
|
||||
if (mshp)
|
||||
(void) define_variable (shell_str, shlen,
|
||||
mshp->value, o_env_override, 0);
|
||||
else if (comp)
|
||||
{
|
||||
/* $COMSPEC shouldn't override $SHELL. */
|
||||
struct variable *shp = lookup_variable (shell_str, shlen);
|
||||
|
||||
if (!shp)
|
||||
(void) define_variable (shell_str, shlen, comp->value, o_env, 0);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
/* This won't override any definition, but it
|
||||
will provide one if there isn't one there. */
|
||||
v = define_variable ("SHELL", 5, default_shell, o_default, 0);
|
||||
v->export = v_export; /* Always export SHELL. */
|
||||
|
||||
/* On MSDOS we do use SHELL from environment, since
|
||||
it isn't a standard environment variable on MSDOS,
|
||||
so whoever sets it, does that on purpose. */
|
||||
#ifndef __MSDOS__
|
||||
/* Don't let SHELL come from the environment. */
|
||||
if (*v->value == '\0' || v->origin == o_env || v->origin == o_env_override)
|
||||
{
|
||||
free (v->value);
|
||||
v->origin = o_file;
|
||||
v->value = savestring (default_shell, strlen (default_shell));
|
||||
v->value = xstrdup (default_shell);
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Make sure MAKEFILES gets exported if it is set. */
|
||||
v = define_variable ("MAKEFILES", 9, "", o_default, 0);
|
||||
@@ -467,6 +543,19 @@ target_environment (file)
|
||||
added specially at the end. */
|
||||
continue;
|
||||
|
||||
/* If this is a per-target variable and it hasn't been touched
|
||||
already then look up the global version and take its export
|
||||
value. */
|
||||
if (v->per_target && v->export == v_default)
|
||||
{
|
||||
struct variable *gv;
|
||||
|
||||
gv = lookup_variable_in_set(v->name, strlen(v->name),
|
||||
&global_variable_set);
|
||||
if (gv)
|
||||
v->export = gv->export;
|
||||
}
|
||||
|
||||
switch (v->export)
|
||||
{
|
||||
case v_default:
|
||||
@@ -485,15 +574,16 @@ target_environment (file)
|
||||
for (++p; *p != '\0'; ++p)
|
||||
if (*p != '_' && (*p < 'a' || *p > 'z')
|
||||
&& (*p < 'A' || *p > 'Z') && (*p < '0' || *p > '9'))
|
||||
break;
|
||||
continue;
|
||||
if (*p != '\0')
|
||||
continue;
|
||||
|
||||
case v_export:
|
||||
break;
|
||||
|
||||
case v_noexport:
|
||||
continue;
|
||||
case v_export:
|
||||
break;
|
||||
|
||||
case v_noexport:
|
||||
continue;
|
||||
|
||||
case v_ifset:
|
||||
if (v->origin == o_default)
|
||||
@@ -501,9 +591,22 @@ target_environment (file)
|
||||
break;
|
||||
}
|
||||
|
||||
/* If this was from a different-sized hash table, then
|
||||
recalculate the bucket it goes in. */
|
||||
if (set->buckets != buckets)
|
||||
{
|
||||
register char *np;
|
||||
|
||||
j = 0;
|
||||
for (np = v->name; *np != '\0'; ++np)
|
||||
HASH (j, *np);
|
||||
j %= buckets;
|
||||
}
|
||||
|
||||
for (ov = table[j]; ov != 0; ov = ov->next)
|
||||
if (streq (v->name, ov->variable->name))
|
||||
break;
|
||||
|
||||
if (ov == 0)
|
||||
{
|
||||
register struct variable_bucket *entry;
|
||||
@@ -526,6 +629,7 @@ target_environment (file)
|
||||
for (b = table[i]; b != 0; b = b->next)
|
||||
{
|
||||
register struct variable *v = b->variable;
|
||||
|
||||
/* If V is recursively expanded and didn't come from the environment,
|
||||
expand its value. If it came from the environment, it should
|
||||
go back into the environment unchanged. */
|
||||
@@ -533,11 +637,25 @@ target_environment (file)
|
||||
&& v->origin != o_env && v->origin != o_env_override)
|
||||
{
|
||||
char *value = recursively_expand (v);
|
||||
#ifdef WINDOWS32
|
||||
if (strcmp(v->name, "Path") == 0 ||
|
||||
strcmp(v->name, "PATH") == 0)
|
||||
convert_Path_to_windows32(value, ';');
|
||||
#endif
|
||||
result[nvariables++] = concat (v->name, "=", value);
|
||||
free (value);
|
||||
}
|
||||
else
|
||||
#ifdef WINDOWS32
|
||||
{
|
||||
if (strcmp(v->name, "Path") == 0 ||
|
||||
strcmp(v->name, "PATH") == 0)
|
||||
convert_Path_to_windows32(v->value, ';');
|
||||
result[nvariables++] = concat (v->name, "=", v->value);
|
||||
}
|
||||
#else
|
||||
result[nvariables++] = concat (v->name, "=", v->value);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
result[nvariables] = (char *) xmalloc (100);
|
||||
@@ -554,19 +672,15 @@ target_environment (file)
|
||||
from a makefile, an override directive, the environment with
|
||||
or without the -e switch, or the command line.
|
||||
|
||||
A variable definition has the form "name = value" or "name := value".
|
||||
Any whitespace around the "=" or ":=" is removed. The first form
|
||||
defines a variable that is recursively re-evaluated. The second form
|
||||
defines a variable whose value is variable-expanded at the time of
|
||||
definition and then is evaluated only once at the time of expansion.
|
||||
See the comments for parse_variable_definition().
|
||||
|
||||
If a variable was defined, a pointer to its `struct variable' is returned.
|
||||
If not, NULL is returned. */
|
||||
If LINE was recognized as a variable definition, a pointer to its `struct
|
||||
variable' is returned. If LINE is not a variable definition, NULL is
|
||||
returned. */
|
||||
|
||||
struct variable *
|
||||
try_variable_definition (filename, lineno, line, origin)
|
||||
char *filename;
|
||||
unsigned int lineno;
|
||||
try_variable_definition (flocp, line, origin)
|
||||
const struct floc *flocp;
|
||||
char *line;
|
||||
enum variable_origin origin;
|
||||
{
|
||||
@@ -574,8 +688,9 @@ try_variable_definition (filename, lineno, line, origin)
|
||||
register char *p = line;
|
||||
register char *beg;
|
||||
register char *end;
|
||||
enum { bogus, simple, recursive, append } flavor = bogus;
|
||||
char *name, *expanded_name, *value;
|
||||
enum { f_bogus,
|
||||
f_simple, f_recursive, f_append, f_conditional } flavor = f_bogus;
|
||||
char *name, *expanded_name, *value, *alloc_value=NULL;
|
||||
struct variable *v;
|
||||
|
||||
while (1)
|
||||
@@ -586,14 +701,14 @@ try_variable_definition (filename, lineno, line, origin)
|
||||
if (c == '=')
|
||||
{
|
||||
end = p - 1;
|
||||
flavor = recursive;
|
||||
flavor = f_recursive;
|
||||
break;
|
||||
}
|
||||
else if (c == ':')
|
||||
if (*p == '=')
|
||||
{
|
||||
end = p++ - 1;
|
||||
flavor = simple;
|
||||
flavor = f_simple;
|
||||
break;
|
||||
}
|
||||
else
|
||||
@@ -602,9 +717,43 @@ try_variable_definition (filename, lineno, line, origin)
|
||||
else if (c == '+' && *p == '=')
|
||||
{
|
||||
end = p++ - 1;
|
||||
flavor = append;
|
||||
flavor = f_append;
|
||||
break;
|
||||
}
|
||||
else if (c == '?' && *p == '=')
|
||||
{
|
||||
end = p++ - 1;
|
||||
flavor = f_conditional;
|
||||
break;
|
||||
}
|
||||
else if (c == '$')
|
||||
{
|
||||
/* This might begin a variable expansion reference. Make sure we
|
||||
don't misrecognize chars inside the reference as =, := or +=. */
|
||||
char closeparen;
|
||||
int count;
|
||||
c = *p++;
|
||||
if (c == '(')
|
||||
closeparen = ')';
|
||||
else if (c == '{')
|
||||
closeparen = '}';
|
||||
else
|
||||
continue; /* Nope. */
|
||||
|
||||
/* P now points past the opening paren or brace.
|
||||
Count parens or braces until it is matched. */
|
||||
count = 0;
|
||||
for (; *p != '\0'; ++p)
|
||||
{
|
||||
if (*p == c)
|
||||
++count;
|
||||
else if (*p == closeparen && --count < 0)
|
||||
{
|
||||
++p;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
beg = next_token (line);
|
||||
@@ -619,31 +768,39 @@ try_variable_definition (filename, lineno, line, origin)
|
||||
expanded_name = allocated_variable_expand (name);
|
||||
|
||||
if (expanded_name[0] == '\0')
|
||||
{
|
||||
if (filename == 0)
|
||||
fatal ("empty variable name");
|
||||
else
|
||||
makefile_fatal (filename, lineno, "empty variable name");
|
||||
}
|
||||
fatal (flocp, _("empty variable name"));
|
||||
|
||||
/* Calculate the variable's new value in VALUE. */
|
||||
|
||||
switch (flavor)
|
||||
{
|
||||
case bogus:
|
||||
case f_bogus:
|
||||
/* Should not be possible. */
|
||||
abort ();
|
||||
return 0;
|
||||
case simple:
|
||||
/* A simple variable definition "var := value". Expand the value. */
|
||||
value = variable_expand (p);
|
||||
case f_simple:
|
||||
/* A simple variable definition "var := value". Expand the value.
|
||||
We have to allocate memory since otherwise it'll clobber the
|
||||
variable buffer, and we may still need that if we're looking at a
|
||||
target-specific variable. */
|
||||
value = alloc_value = allocated_variable_expand (p);
|
||||
break;
|
||||
case recursive:
|
||||
case f_conditional:
|
||||
/* A conditional variable definition "var ?= value".
|
||||
The value is set IFF the variable is not defined yet. */
|
||||
v = lookup_variable(expanded_name, strlen(expanded_name));
|
||||
if (v)
|
||||
{
|
||||
free(expanded_name);
|
||||
return v;
|
||||
}
|
||||
flavor = f_recursive;
|
||||
/* FALLTHROUGH */
|
||||
case f_recursive:
|
||||
/* A recursive variable definition "var = value".
|
||||
The value is used verbatim. */
|
||||
value = p;
|
||||
break;
|
||||
case append:
|
||||
case f_append:
|
||||
/* An appending variable definition "var += value".
|
||||
Extract the old value and append the new one. */
|
||||
v = lookup_variable (expanded_name, strlen (expanded_name));
|
||||
@@ -652,7 +809,7 @@ try_variable_definition (filename, lineno, line, origin)
|
||||
/* There was no old value.
|
||||
This becomes a normal recursive definition. */
|
||||
value = p;
|
||||
flavor = recursive;
|
||||
flavor = f_recursive;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -663,12 +820,14 @@ try_variable_definition (filename, lineno, line, origin)
|
||||
if (v->recursive)
|
||||
/* The previous definition of the variable was recursive.
|
||||
The new value comes from the unexpanded old and new values. */
|
||||
flavor = recursive;
|
||||
flavor = f_recursive;
|
||||
else
|
||||
/* The previous definition of the variable was simple.
|
||||
The new value comes from the old value, which was expanded
|
||||
when it was set; and from the expanded new value. */
|
||||
p = variable_expand (p);
|
||||
when it was set; and from the expanded new value. Allocate
|
||||
memory for the expansion as we may still need the rest of the
|
||||
buffer if we're looking at a target-specific variable. */
|
||||
p = alloc_value = allocated_variable_expand (p);
|
||||
|
||||
oldlen = strlen (v->value);
|
||||
newlen = strlen (p);
|
||||
@@ -679,9 +838,110 @@ try_variable_definition (filename, lineno, line, origin)
|
||||
}
|
||||
}
|
||||
|
||||
v = define_variable (expanded_name, strlen (expanded_name),
|
||||
value, origin, flavor == recursive);
|
||||
#ifdef __MSDOS__
|
||||
/* Many Unix Makefiles include a line saying "SHELL=/bin/sh", but
|
||||
non-Unix systems don't conform to this default configuration (in
|
||||
fact, most of them don't even have `/bin'). On the other hand,
|
||||
$SHELL in the environment, if set, points to the real pathname of
|
||||
the shell.
|
||||
Therefore, we generally won't let lines like "SHELL=/bin/sh" from
|
||||
the Makefile override $SHELL from the environment. But first, we
|
||||
look for the basename of the shell in the directory where SHELL=
|
||||
points, and along the $PATH; if it is found in any of these places,
|
||||
we define $SHELL to be the actual pathname of the shell. Thus, if
|
||||
you have bash.exe installed as d:/unix/bash.exe, and d:/unix is on
|
||||
your $PATH, then SHELL=/usr/local/bin/bash will have the effect of
|
||||
defining SHELL to be "d:/unix/bash.exe". */
|
||||
if ((origin == o_file || origin == o_override)
|
||||
&& strcmp (expanded_name, "SHELL") == 0)
|
||||
{
|
||||
char shellpath[PATH_MAX];
|
||||
extern char * __dosexec_find_on_path (const char *, char *[], char *);
|
||||
|
||||
/* See if we can find "/bin/sh.exe", "/bin/sh.com", etc. */
|
||||
if (__dosexec_find_on_path (value, (char **)0, shellpath))
|
||||
{
|
||||
char *p;
|
||||
|
||||
for (p = shellpath; *p; p++)
|
||||
{
|
||||
if (*p == '\\')
|
||||
*p = '/';
|
||||
}
|
||||
v = define_variable (expanded_name, strlen (expanded_name),
|
||||
shellpath, origin, flavor == f_recursive);
|
||||
}
|
||||
else
|
||||
{
|
||||
char *shellbase, *bslash;
|
||||
struct variable *pathv = lookup_variable ("PATH", 4);
|
||||
char *path_string;
|
||||
char *fake_env[2];
|
||||
size_t pathlen = 0;
|
||||
|
||||
shellbase = rindex (value, '/');
|
||||
bslash = rindex (value, '\\');
|
||||
if (!shellbase || bslash > shellbase)
|
||||
shellbase = bslash;
|
||||
if (!shellbase && value[1] == ':')
|
||||
shellbase = value + 1;
|
||||
if (shellbase)
|
||||
shellbase++;
|
||||
else
|
||||
shellbase = value;
|
||||
|
||||
/* Search for the basename of the shell (with standard
|
||||
executable extensions) along the $PATH. */
|
||||
if (pathv)
|
||||
pathlen = strlen (pathv->value);
|
||||
path_string = (char *)xmalloc (5 + pathlen + 2 + 1);
|
||||
/* On MSDOS, current directory is considered as part of $PATH. */
|
||||
sprintf (path_string, "PATH=.;%s", pathv ? pathv->value : "");
|
||||
fake_env[0] = path_string;
|
||||
fake_env[1] = (char *)0;
|
||||
if (__dosexec_find_on_path (shellbase, fake_env, shellpath))
|
||||
{
|
||||
char *p;
|
||||
|
||||
for (p = shellpath; *p; p++)
|
||||
{
|
||||
if (*p == '\\')
|
||||
*p = '/';
|
||||
}
|
||||
v = define_variable (expanded_name, strlen (expanded_name),
|
||||
shellpath, origin, flavor == f_recursive);
|
||||
}
|
||||
else
|
||||
v = lookup_variable (expanded_name, strlen (expanded_name));
|
||||
|
||||
free (path_string);
|
||||
}
|
||||
}
|
||||
else
|
||||
#endif /* __MSDOS__ */
|
||||
#ifdef WINDOWS32
|
||||
if ((origin == o_file || origin == o_override)
|
||||
&& strcmp (expanded_name, "SHELL") == 0) {
|
||||
extern char* default_shell;
|
||||
|
||||
/*
|
||||
* Call shell locator function. If it returns TRUE, then
|
||||
* set no_default_sh_exe to indicate sh was found and
|
||||
* set new value for SHELL variable.
|
||||
*/
|
||||
if (find_and_set_default_shell(value)) {
|
||||
v = define_variable (expanded_name, strlen (expanded_name),
|
||||
default_shell, origin, flavor == f_recursive);
|
||||
no_default_sh_exe = 0;
|
||||
}
|
||||
} else
|
||||
#endif
|
||||
|
||||
v = define_variable (expanded_name, strlen (expanded_name),
|
||||
value, origin, flavor == f_recursive);
|
||||
|
||||
if (alloc_value)
|
||||
free (alloc_value);
|
||||
free (expanded_name);
|
||||
|
||||
return v;
|
||||
@@ -694,7 +954,7 @@ print_variable (v, prefix)
|
||||
register struct variable *v;
|
||||
char *prefix;
|
||||
{
|
||||
char *origin;
|
||||
const char *origin;
|
||||
|
||||
switch (v->origin)
|
||||
{
|
||||
@@ -722,7 +982,6 @@ print_variable (v, prefix)
|
||||
case o_invalid:
|
||||
default:
|
||||
abort ();
|
||||
break;
|
||||
}
|
||||
printf ("# %s\n", origin);
|
||||
|
||||
@@ -760,7 +1019,7 @@ print_variable (v, prefix)
|
||||
/* Print all the variables in SET. PREFIX is printed before
|
||||
the actual variable definitions (everything else is comments). */
|
||||
|
||||
static void
|
||||
void
|
||||
print_variable_set (set, prefix)
|
||||
register struct variable_set *set;
|
||||
char *prefix;
|
||||
@@ -785,16 +1044,24 @@ print_variable_set (set, prefix)
|
||||
}
|
||||
|
||||
if (nvariables == 0)
|
||||
puts ("# No variables.");
|
||||
puts (_("# No variables."));
|
||||
else
|
||||
{
|
||||
printf ("# %u variables in %u hash buckets.\n",
|
||||
printf (_("# %u variables in %u hash buckets.\n"),
|
||||
nvariables, set->buckets);
|
||||
#ifndef NO_FLOAT
|
||||
printf ("# average of %.1f variables per bucket, \
|
||||
max %u in one bucket.\n",
|
||||
printf (_("# average of %.1f variables per bucket, \
|
||||
max %u in one bucket.\n"),
|
||||
(double) nvariables / (double) set->buckets,
|
||||
per_bucket);
|
||||
#else
|
||||
{
|
||||
int f = (nvariables * 1000 + 5) / set->buckets;
|
||||
printf (_("# average of %d.%d variables per bucket, \
|
||||
max %u in one bucket.\n"),
|
||||
f/10, f%10,
|
||||
per_bucket);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@@ -805,7 +1072,7 @@ max %u in one bucket.\n",
|
||||
void
|
||||
print_variable_data_base ()
|
||||
{
|
||||
puts ("\n# Variables\n");
|
||||
puts (_("\n# Variables\n"));
|
||||
|
||||
print_variable_set (&global_variable_set, "");
|
||||
}
|
||||
@@ -820,3 +1087,30 @@ print_file_variables (file)
|
||||
if (file->variables != 0)
|
||||
print_variable_set (file->variables->set, "# ");
|
||||
}
|
||||
|
||||
#ifdef WINDOWS32
|
||||
void
|
||||
sync_Path_environment(void)
|
||||
{
|
||||
char* path = allocated_variable_expand("$(Path)");
|
||||
static char* environ_path = NULL;
|
||||
|
||||
if (!path)
|
||||
return;
|
||||
|
||||
/*
|
||||
* If done this before, don't leak memory unnecessarily.
|
||||
* Free the previous entry before allocating new one.
|
||||
*/
|
||||
if (environ_path)
|
||||
free(environ_path);
|
||||
|
||||
/*
|
||||
* Create something WINDOWS32 world can grok
|
||||
*/
|
||||
convert_Path_to_windows32(path, ';');
|
||||
environ_path = concat("Path", "=", path);
|
||||
putenv(environ_path);
|
||||
free(path);
|
||||
}
|
||||
#endif
|
||||
|
||||
61
variable.h
61
variable.h
@@ -14,7 +14,8 @@ 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. */
|
||||
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
/* Codes in a variable definition saying where the definition came from.
|
||||
Increasing numeric values signify less-overridable definitions. */
|
||||
@@ -43,7 +44,8 @@ struct variable
|
||||
origin ENUM_BITFIELD (3); /* Variable origin. */
|
||||
unsigned int recursive:1; /* Gets recursively re-evaluated. */
|
||||
unsigned int expanding:1; /* Nonzero if currently being expanded. */
|
||||
enum
|
||||
unsigned int per_target:1; /* Nonzero if a target-specific variable. */
|
||||
enum variable_export
|
||||
{
|
||||
v_export, /* Export this variable. */
|
||||
v_noexport, /* Don't export this variable. */
|
||||
@@ -68,33 +70,48 @@ struct variable_set_list
|
||||
struct variable_set *set; /* Variable set. */
|
||||
};
|
||||
|
||||
extern char *variable_buffer;
|
||||
extern struct variable_set_list *current_variable_set_list;
|
||||
|
||||
|
||||
extern void push_new_variable_scope (), pop_variable_scope ();
|
||||
|
||||
extern int handle_function ();
|
||||
|
||||
extern char *variable_buffer_output ();
|
||||
extern char *variable_expand (), *variable_expand_for_file ();
|
||||
extern char *allocated_variable_expand_for_file ();
|
||||
/* expand.c */
|
||||
extern char *variable_buffer_output PARAMS ((char *ptr, char *string, unsigned int length));
|
||||
extern char *variable_expand PARAMS ((char *line));
|
||||
extern char *allocated_variable_expand_for_file PARAMS ((char *line, struct file *file));
|
||||
#define allocated_variable_expand(line) \
|
||||
allocated_variable_expand_for_file (line, (struct file *) 0)
|
||||
extern char *expand_argument ();
|
||||
extern char *expand_argument PARAMS ((char *str, char *end));
|
||||
extern char *variable_expand_string PARAMS ((char *line, char *string,
|
||||
long length));
|
||||
|
||||
extern void define_automatic_variables ();
|
||||
extern void initialize_file_variables ();
|
||||
extern void print_file_variables ();
|
||||
/* function.c */
|
||||
extern int handle_function PARAMS ((char **op, char **stringp));
|
||||
extern int pattern_matches PARAMS ((char *pattern, char *percent, char *str));
|
||||
extern char *subst_expand PARAMS ((char *o, char *text, char *subst, char *replace,
|
||||
unsigned int slen, unsigned int rlen, int by_word, int suffix_only));
|
||||
extern char *patsubst_expand PARAMS ((char *o, char *text, char *pattern, char *replace,
|
||||
char *pattern_percent, char *replace_percent));
|
||||
|
||||
extern void merge_variable_set_lists ();
|
||||
/* expand.c */
|
||||
extern char *recursively_expand PARAMS ((struct variable *v));
|
||||
|
||||
extern struct variable *try_variable_definition ();
|
||||
/* variable.c */
|
||||
extern struct variable_set_list *create_new_variable_set PARAMS ((void));
|
||||
extern struct variable_set_list *push_new_variable_scope PARAMS ((void));
|
||||
extern void pop_variable_scope PARAMS ((void));
|
||||
extern void define_automatic_variables PARAMS ((void));
|
||||
extern void initialize_file_variables PARAMS ((struct file *file));
|
||||
extern void print_file_variables PARAMS ((struct file *file));
|
||||
extern void print_variable_set PARAMS ((struct variable_set *set, char *prefix));
|
||||
extern void merge_variable_set_lists PARAMS ((struct variable_set_list **setlist0, struct variable_set_list *setlist1));
|
||||
extern struct variable *try_variable_definition PARAMS ((const struct floc *flocp, char *line, enum variable_origin origin));
|
||||
|
||||
extern struct variable *lookup_variable (), *define_variable ();
|
||||
extern struct variable *define_variable_for_file ();
|
||||
extern struct variable *lookup_variable PARAMS ((char *name, unsigned int length));
|
||||
extern struct variable *define_variable PARAMS ((char *name, unsigned int length, char *value,
|
||||
enum variable_origin origin, int recursive));
|
||||
extern struct variable *define_variable_in_set PARAMS ((char *name, unsigned int length,
|
||||
char *value, enum variable_origin origin, int recursive, struct variable_set *set));
|
||||
extern struct variable *define_variable_for_file PARAMS ((char *name, unsigned int length,
|
||||
char *value, enum variable_origin origin, int recursive, struct file *file));
|
||||
extern char **target_environment PARAMS ((struct file *file));
|
||||
|
||||
extern int pattern_matches ();
|
||||
extern char *subst_expand (), *patsubst_expand (), *recursively_expand ();
|
||||
|
||||
extern char **target_environment ();
|
||||
extern int export_all_variables;
|
||||
|
||||
@@ -1,4 +1,9 @@
|
||||
char *version_string = "3.74.2";
|
||||
/* We use <config.h> instead of "config.h" so that a compilation
|
||||
using -I. -I$srcdir will use ./config.h rather than $srcdir/config.h
|
||||
(which it would do because make.h was found in $srcdir). */
|
||||
#include <config.h>
|
||||
|
||||
char *version_string = VERSION;
|
||||
|
||||
/*
|
||||
Local variables:
|
||||
|
||||
42
vmsdir.h
Normal file
42
vmsdir.h
Normal file
@@ -0,0 +1,42 @@
|
||||
/* dirent.h for vms */
|
||||
|
||||
#include <rms.h>
|
||||
|
||||
#define MAXNAMLEN 255
|
||||
|
||||
#ifndef __DECC
|
||||
typedef unsigned long u_long;
|
||||
typedef unsigned short u_short;
|
||||
#endif
|
||||
|
||||
struct direct {
|
||||
off_t d_off;
|
||||
u_long d_fileno;
|
||||
u_short d_reclen;
|
||||
u_short d_namlen;
|
||||
char d_name[MAXNAMLEN + 1];
|
||||
};
|
||||
|
||||
#undef DIRSIZ
|
||||
#define DIRSIZ(dp) \
|
||||
(((sizeof (struct direct) - (MAXNAMLEN+1) + ((dp)->d_namlen+1)) + 3) & ~3)
|
||||
|
||||
#define d_ino d_fileno /* compatability */
|
||||
|
||||
|
||||
/*
|
||||
* Definitions for library routines operating on directories.
|
||||
*/
|
||||
|
||||
typedef struct FAB DIR;
|
||||
|
||||
#ifndef NULL
|
||||
#define NULL 0
|
||||
#endif
|
||||
extern DIR *opendir PARAMS (());
|
||||
extern struct direct *readdir PARAMS ((DIR *dfd));
|
||||
#define rewinddir(dirp) seekdir((dirp), (long)0)
|
||||
extern int closedir PARAMS ((DIR *dfd));
|
||||
extern char *vmsify PARAMS ((char *name, int type));
|
||||
|
||||
/* EOF */
|
||||
279
vmsfunctions.c
Normal file
279
vmsfunctions.c
Normal file
@@ -0,0 +1,279 @@
|
||||
/* vmsfunctions.c */
|
||||
|
||||
#define KDEBUG 0
|
||||
|
||||
#include <stdio.h>
|
||||
#include <ctype.h>
|
||||
#include "make.h"
|
||||
#ifdef __DECC
|
||||
#include <starlet.h>
|
||||
#endif
|
||||
#include <descrip.h>
|
||||
#include <rms.h>
|
||||
#include <iodef.h>
|
||||
#include <atrdef.h>
|
||||
#include <fibdef.h>
|
||||
#include "vmsdir.h"
|
||||
|
||||
#if __VMS_VER < 70000000
|
||||
|
||||
DIR *
|
||||
opendir (dspec)
|
||||
char *dspec;
|
||||
{
|
||||
static struct FAB *dfab;
|
||||
struct NAM *dnam;
|
||||
char *searchspec;
|
||||
|
||||
dfab = (struct FAB *) xmalloc (sizeof (struct FAB));
|
||||
if (! dfab)
|
||||
{
|
||||
printf ("Error mallocing for FAB\n");
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
dnam = (struct NAM *) xmalloc (sizeof (struct NAM));
|
||||
if (! dnam)
|
||||
{
|
||||
printf ("Error mallocing for NAM\n");
|
||||
free (dfab);
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
searchspec = (char *) xmalloc (MAXNAMLEN + 1);
|
||||
if (! searchspec)
|
||||
{
|
||||
printf ("Error mallocing for searchspec\n");
|
||||
free (dfab);
|
||||
free (dnam);
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
sprintf (searchspec, "%s*.*;", dspec);
|
||||
|
||||
*dfab = cc$rms_fab;
|
||||
dfab->fab$l_fna = searchspec;
|
||||
dfab->fab$b_fns = strlen (searchspec);
|
||||
dfab->fab$l_nam = dnam;
|
||||
|
||||
*dnam = cc$rms_nam;
|
||||
dnam->nam$l_esa = searchspec;
|
||||
dnam->nam$b_ess = MAXNAMLEN;
|
||||
|
||||
if (! (sys$parse (dfab) & 1))
|
||||
{
|
||||
free (dfab);
|
||||
free (dnam);
|
||||
free (searchspec);
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
return (dfab);
|
||||
}
|
||||
|
||||
#define uppercasify(str) \
|
||||
do \
|
||||
{ \
|
||||
char *tmp; \
|
||||
for (tmp = (str); *tmp != '\0'; tmp++) \
|
||||
if (islower (*tmp)) \
|
||||
*tmp = toupper (*tmp); \
|
||||
} \
|
||||
while (0)
|
||||
|
||||
struct direct *
|
||||
readdir (dfd)
|
||||
DIR * dfd;
|
||||
{
|
||||
static struct direct *dentry;
|
||||
static char resultspec[MAXNAMLEN + 1];
|
||||
int i;
|
||||
|
||||
dentry = (struct direct *) xmalloc (sizeof (struct direct));
|
||||
if (! dentry)
|
||||
{
|
||||
printf ("Error mallocing for direct\n");
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
dfd->fab$l_nam->nam$l_rsa = resultspec;
|
||||
dfd->fab$l_nam->nam$b_rss = MAXNAMLEN;
|
||||
|
||||
if (debug_flag)
|
||||
printf (".");
|
||||
|
||||
if (!((i = sys$search (dfd)) & 1))
|
||||
{
|
||||
if (debug_flag)
|
||||
printf ("sys$search failed with %d\n", i);
|
||||
free (dentry);
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
dentry->d_off = 0;
|
||||
if (dfd->fab$l_nam->nam$w_fid == 0)
|
||||
dentry->d_fileno = 1;
|
||||
else
|
||||
dentry->d_fileno = dfd->fab$l_nam->nam$w_fid[0]
|
||||
+ dfd->fab$l_nam->nam$w_fid[1] << 16;
|
||||
dentry->d_reclen = sizeof (struct direct);
|
||||
#if 0
|
||||
if (!strcmp(dfd->fab$l_nam->nam$l_type, ".DIR"))
|
||||
dentry->d_namlen = dfd->fab$l_nam->nam$b_name;
|
||||
else
|
||||
#endif
|
||||
dentry->d_namlen = dfd->fab$l_nam->nam$b_name + dfd->fab$l_nam->nam$b_type;
|
||||
strncpy (dentry->d_name, dfd->fab$l_nam->nam$l_name, dentry->d_namlen);
|
||||
dentry->d_name[dentry->d_namlen] = '\0';
|
||||
uppercasify (dentry->d_name);
|
||||
#if 0
|
||||
uvUnFixRCSSeparator(dentry->d_name);
|
||||
#endif
|
||||
|
||||
return (dentry);
|
||||
}
|
||||
|
||||
closedir (dfd)
|
||||
DIR *dfd;
|
||||
{
|
||||
if (dfd)
|
||||
{
|
||||
if (dfd->fab$l_nam)
|
||||
free (dfd->fab$l_nam->nam$l_esa);
|
||||
free (dfd->fab$l_nam);
|
||||
free (dfd);
|
||||
}
|
||||
}
|
||||
#endif /* compiled for OpenVMS prior to V7.x */
|
||||
|
||||
char *
|
||||
getwd (cwd)
|
||||
char *cwd;
|
||||
{
|
||||
static char buf[512];
|
||||
|
||||
if (cwd)
|
||||
return (getcwd (cwd, 512));
|
||||
else
|
||||
return (getcwd (buf, 512));
|
||||
}
|
||||
|
||||
int
|
||||
vms_stat (name, buf)
|
||||
char *name;
|
||||
struct stat *buf;
|
||||
{
|
||||
int status;
|
||||
int i;
|
||||
|
||||
static struct FAB Fab;
|
||||
static struct NAM Nam;
|
||||
static struct fibdef Fib; /* short fib */
|
||||
static struct dsc$descriptor FibDesc =
|
||||
{ sizeof (Fib), DSC$K_DTYPE_Z, DSC$K_CLASS_S, (char *) &Fib };
|
||||
static struct dsc$descriptor_s DevDesc =
|
||||
{ 0, DSC$K_DTYPE_T, DSC$K_CLASS_S, &Nam.nam$t_dvi[1] };
|
||||
static char EName[NAM$C_MAXRSS];
|
||||
static char RName[NAM$C_MAXRSS];
|
||||
static struct dsc$descriptor_s FileName =
|
||||
{ 0, DSC$K_DTYPE_T, DSC$K_CLASS_S, 0 };
|
||||
static struct dsc$descriptor_s string =
|
||||
{ 0, DSC$K_DTYPE_T, DSC$K_CLASS_S, 0 };
|
||||
static unsigned long Rdate[2];
|
||||
static unsigned long Cdate[2];
|
||||
static struct atrdef Atr[] =
|
||||
{
|
||||
#if defined(VAX)
|
||||
/* Revision date */
|
||||
{ sizeof (Rdate), ATR$C_REVDATE, (unsigned int) &Rdate[0] },
|
||||
/* Creation date */
|
||||
{ sizeof (Cdate), ATR$C_CREDATE, (unsigned int) &Cdate[0] },
|
||||
#else
|
||||
/* Revision date */
|
||||
{ sizeof (Rdate), ATR$C_REVDATE, &Rdate[0] },
|
||||
/* Creation date */
|
||||
{ sizeof (Cdate), ATR$C_CREDATE, &Cdate[0]},
|
||||
#endif
|
||||
{ 0, 0, 0 }
|
||||
};
|
||||
static short int DevChan;
|
||||
static short int iosb[4];
|
||||
|
||||
name = vmsify (name, 0);
|
||||
|
||||
/* initialize RMS structures, we need a NAM to retrieve the FID */
|
||||
Fab = cc$rms_fab;
|
||||
Fab.fab$l_fna = name; /* name of file */
|
||||
Fab.fab$b_fns = strlen (name);
|
||||
Fab.fab$l_nam = &Nam; /* FAB has an associated NAM */
|
||||
|
||||
Nam = cc$rms_nam;
|
||||
Nam.nam$l_esa = EName; /* expanded filename */
|
||||
Nam.nam$b_ess = sizeof (EName);
|
||||
Nam.nam$l_rsa = RName; /* resultant filename */
|
||||
Nam.nam$b_rss = sizeof (RName);
|
||||
|
||||
/* do $PARSE and $SEARCH here */
|
||||
status = sys$parse (&Fab);
|
||||
if (!(status & 1))
|
||||
return -1;
|
||||
|
||||
DevDesc.dsc$w_length = Nam.nam$t_dvi[0];
|
||||
status = sys$assign (&DevDesc, &DevChan, 0, 0);
|
||||
if (!(status & 1))
|
||||
return -1;
|
||||
|
||||
FileName.dsc$a_pointer = Nam.nam$l_name;
|
||||
FileName.dsc$w_length = Nam.nam$b_name + Nam.nam$b_type + Nam.nam$b_ver;
|
||||
|
||||
/* Initialize the FIB */
|
||||
for (i = 0; i < 3; i++)
|
||||
{
|
||||
#if __DECC
|
||||
Fib.fib$w_fid[i] = Nam.nam$w_fid[i];
|
||||
Fib.fib$w_did[i] = Nam.nam$w_did[i];
|
||||
#else
|
||||
Fib.fib$r_fid_overlay.fib$w_fid[i] = Nam.nam$w_fid[i];
|
||||
Fib.fib$r_did_overlay.fib$w_did[i] = Nam.nam$w_did[i];
|
||||
#endif
|
||||
}
|
||||
|
||||
status = sys$qiow (0, DevChan, IO$_ACCESS, &iosb, 0, 0,
|
||||
&FibDesc, &FileName, 0, 0, &Atr, 0);
|
||||
sys$dassgn (DevChan);
|
||||
if (!(status & 1))
|
||||
return -1;
|
||||
status = iosb[0];
|
||||
if (!(status & 1))
|
||||
return -1;
|
||||
|
||||
status = stat (name, buf);
|
||||
if (status)
|
||||
return -1;
|
||||
|
||||
buf->st_mtime = ((Rdate[0] >> 24) & 0xff) + ((Rdate[1] << 8) & 0xffffff00);
|
||||
buf->st_ctime = ((Cdate[0] >> 24) & 0xff) + ((Cdate[1] << 8) & 0xffffff00);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
char *
|
||||
cvt_time (tval)
|
||||
unsigned long tval;
|
||||
{
|
||||
static long int date[2];
|
||||
static char str[27];
|
||||
static struct dsc$descriptor date_str =
|
||||
{ 26, DSC$K_DTYPE_T, DSC$K_CLASS_S, str };
|
||||
|
||||
date[0] = (tval & 0xff) << 24;
|
||||
date[1] = ((tval >> 8) & 0xffffff);
|
||||
|
||||
if ((date[0] == 0) && (date[1] == 0))
|
||||
return ("never");
|
||||
|
||||
sys$asctim (0, &date_str, date, 0);
|
||||
str[26] = '\0';
|
||||
|
||||
return (str);
|
||||
}
|
||||
952
vmsify.c
Normal file
952
vmsify.c
Normal file
@@ -0,0 +1,952 @@
|
||||
/*
|
||||
vmsify.c
|
||||
|
||||
Module for vms <-> unix file name conversion
|
||||
|
||||
Written by Klaus Kämpf (kkaempf@progis.de)
|
||||
of proGIS Software, Aachen, Germany
|
||||
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#if VMS
|
||||
#include <unixlib.h>
|
||||
#include <stdlib.h>
|
||||
#include <jpidef.h>
|
||||
#include <descrip.h>
|
||||
#include <uaidef.h>
|
||||
#include <ssdef.h>
|
||||
#include <starlet.h>
|
||||
#include <lib$routines.h>
|
||||
/* Initialize a string descriptor (struct dsc$descriptor_s) for an
|
||||
arbitrary string. ADDR is a pointer to the first character
|
||||
of the string, and LEN is the length of the string. */
|
||||
|
||||
#define INIT_DSC_S(dsc, addr, len) do { \
|
||||
(dsc).dsc$b_dtype = DSC$K_DTYPE_T; \
|
||||
(dsc).dsc$b_class = DSC$K_CLASS_S; \
|
||||
(dsc).dsc$w_length = (len); \
|
||||
(dsc).dsc$a_pointer = (addr); \
|
||||
} while (0)
|
||||
|
||||
/* Initialize a string descriptor (struct dsc$descriptor_s) for a
|
||||
NUL-terminated string. S is a pointer to the string; the length
|
||||
is determined by calling strlen(). */
|
||||
|
||||
#define INIT_DSC_CSTRING(dsc, s) INIT_DSC_S(dsc, s, strlen(s))
|
||||
#endif
|
||||
|
||||
/*
|
||||
copy 'from' to 'to' up to but not including 'upto'
|
||||
return 0 if eos on from
|
||||
return 1 if upto found
|
||||
|
||||
return 'to' at last char + 1
|
||||
return 'from' at match + 1 or eos if no match
|
||||
|
||||
if as_dir == 1, change all '.' to '_'
|
||||
else change all '.' but the last to '_'
|
||||
*/
|
||||
|
||||
static int
|
||||
copyto (char **to, char **from, char upto, int as_dir)
|
||||
{
|
||||
char *s;
|
||||
|
||||
s = strrchr (*from, '.');
|
||||
|
||||
while (**from)
|
||||
{
|
||||
if (**from == upto)
|
||||
{
|
||||
do
|
||||
{
|
||||
(*from)++;
|
||||
}
|
||||
while (**from == upto);
|
||||
return 1;
|
||||
}
|
||||
if (**from == '.')
|
||||
{
|
||||
if ((as_dir == 1)
|
||||
|| (*from != s))
|
||||
**to = '_';
|
||||
else
|
||||
**to = '.';
|
||||
}
|
||||
else
|
||||
{
|
||||
if (islower (**from))
|
||||
**to = toupper (**from);
|
||||
else
|
||||
**to = **from;
|
||||
}
|
||||
(*to)++;
|
||||
(*from)++;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
get translation of logical name
|
||||
|
||||
*/
|
||||
|
||||
static char *
|
||||
trnlog (char *name)
|
||||
{
|
||||
int stat;
|
||||
static char reslt[1024];
|
||||
$DESCRIPTOR (reslt_dsc, reslt);
|
||||
short resltlen;
|
||||
struct dsc$descriptor_s name_dsc;
|
||||
char *s;
|
||||
|
||||
INIT_DSC_CSTRING (name_dsc, name);
|
||||
|
||||
stat = lib$sys_trnlog (&name_dsc, &resltlen, &reslt_dsc);
|
||||
|
||||
if ((stat&1) == 0)
|
||||
{
|
||||
return "";
|
||||
}
|
||||
if (stat == SS$_NOTRAN)
|
||||
{
|
||||
return "";
|
||||
}
|
||||
reslt[resltlen] = '\0';
|
||||
|
||||
s = (char *)malloc (resltlen+1);
|
||||
if (s == 0)
|
||||
return "";
|
||||
strcpy (s, reslt);
|
||||
return s;
|
||||
}
|
||||
|
||||
enum namestate { N_START, N_DEVICE, N_OPEN, N_DOT, N_CLOSED, N_DONE };
|
||||
|
||||
/*
|
||||
convert unix style name to vms style
|
||||
type = 0 -> name is a full name (directory and filename part)
|
||||
type = 1 -> name is a directory
|
||||
type = 2 -> name is a filename without directory
|
||||
|
||||
The following conversions are applied
|
||||
(0) (1) (2)
|
||||
input full name dir name file name
|
||||
|
||||
1 ./ <cwd> [] <current directory>.dir
|
||||
2 ../ <home of cwd> <home of cwd> <home of cwd>.dir
|
||||
|
||||
3 // <dev of cwd>: <dev of cwd>:[000000] <dev of cwd>:000000.dir
|
||||
4 //a a: a: a:
|
||||
5 //a/ a: a: a:000000.dir
|
||||
|
||||
9 / [000000] [000000] 000000.dir
|
||||
10 /a [000000]a [a] [000000]a
|
||||
11 /a/ [a] [a] [000000]a.dir
|
||||
12 /a/b [a]b [a.b] [a]b
|
||||
13 /a/b/ [a.b] [a.b] [a]b.dir
|
||||
14 /a/b/c [a.b]c [a.b.c] [a.b]c
|
||||
15 /a/b/c/ [a.b.c] [a.b.c] [a.b]c.dir
|
||||
|
||||
16 a a [.a] a
|
||||
17 a/ [.a] [.a] a.dir
|
||||
18 a/b [.a]b [.a.b] [.a]b
|
||||
19 a/b/ [.a.b] [.a.b] [.a]b.dir
|
||||
20 a/b/c [.a.b]c [.a.b.c] [.a.b]c
|
||||
21 a/b/c/ [.a.b.c] [.a.b.c] [.a.b]c.dir
|
||||
|
||||
22 a.b.c a_b.c [.a_b_c] a_b_c.dir
|
||||
|
||||
23 [x][y]z [x.y]z [x.y]z [x.y]z
|
||||
24 [x][.y]z [x.y]z [x.y]z [x.y]z
|
||||
|
||||
25 filenames with '$' are left unchanged if they contain no '/'
|
||||
25 filenames with ':' are left unchanged
|
||||
26 filenames with a single pair of '[' ']' are left unchanged
|
||||
|
||||
the input string is not written to
|
||||
*/
|
||||
|
||||
char *
|
||||
vmsify (name, type)
|
||||
char *name;
|
||||
int type;
|
||||
{
|
||||
/* max 255 device
|
||||
max 39 directory
|
||||
max 39 filename
|
||||
max 39 filetype
|
||||
max 5 version
|
||||
*/
|
||||
#define MAXPATHLEN 512
|
||||
|
||||
enum namestate nstate;
|
||||
static char vmsname[MAXPATHLEN+1];
|
||||
char *fptr;
|
||||
char *vptr;
|
||||
char *s,*s1;
|
||||
int as_dir;
|
||||
int count;
|
||||
|
||||
if (name == 0)
|
||||
return 0;
|
||||
fptr = name;
|
||||
vptr = vmsname;
|
||||
nstate = N_START;
|
||||
|
||||
/* case 25a */
|
||||
|
||||
s = strpbrk (name, "$:");
|
||||
if (s != 0)
|
||||
{
|
||||
if (*s == '$')
|
||||
{
|
||||
if (strchr (name, '/') == 0)
|
||||
{
|
||||
return name;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return name;
|
||||
}
|
||||
}
|
||||
|
||||
/* case 26 */
|
||||
|
||||
s = strchr (name, '[');
|
||||
|
||||
if (s != 0)
|
||||
{
|
||||
s1 = strchr (s+1, '[');
|
||||
if (s1 == 0)
|
||||
{
|
||||
return name; /* single [, keep unchanged */
|
||||
}
|
||||
s1--;
|
||||
if (*s1 != ']')
|
||||
{
|
||||
return name; /* not ][, keep unchanged */
|
||||
}
|
||||
|
||||
/* we have ][ */
|
||||
|
||||
s = name;
|
||||
|
||||
/* s -> starting char
|
||||
s1 -> ending ']' */
|
||||
|
||||
do
|
||||
{
|
||||
strncpy (vptr, s, s1-s); /* copy up to but not including ']' */
|
||||
vptr += s1-s;
|
||||
if (*s1 == 0)
|
||||
break;
|
||||
s = s1 + 1; /* s -> char behind ']' */
|
||||
if (*s != '[') /* was '][' ? */
|
||||
break; /* no, last ] found, exit */
|
||||
s++;
|
||||
if (*s != '.')
|
||||
*vptr++ = '.';
|
||||
s1 = strchr (s, ']');
|
||||
if (s1 == 0) /* no closing ] */
|
||||
s1 = s + strlen (s);
|
||||
}
|
||||
while (1);
|
||||
|
||||
*vptr++ = ']';
|
||||
|
||||
fptr = s;
|
||||
|
||||
}
|
||||
|
||||
else /* no [ in name */
|
||||
|
||||
{
|
||||
|
||||
int state;
|
||||
int rooted = 1; /* flag if logical is rooted, else insert [000000] */
|
||||
|
||||
state = 0;
|
||||
|
||||
do
|
||||
{
|
||||
|
||||
switch (state)
|
||||
{
|
||||
case 0: /* start of loop */
|
||||
if (*fptr == '/')
|
||||
{
|
||||
fptr++;
|
||||
state = 1;
|
||||
}
|
||||
else if (*fptr == '.')
|
||||
{
|
||||
fptr++;
|
||||
state = 10;
|
||||
}
|
||||
else
|
||||
state = 2;
|
||||
break;
|
||||
|
||||
case 1: /* '/' at start */
|
||||
if (*fptr == '/')
|
||||
{
|
||||
fptr++;
|
||||
state = 3;
|
||||
}
|
||||
else
|
||||
state = 4;
|
||||
break;
|
||||
|
||||
case 2: /* no '/' at start */
|
||||
s = strchr (fptr, '/');
|
||||
if (s == 0) /* no '/' (16) */
|
||||
{
|
||||
if (type == 1)
|
||||
{
|
||||
strcpy (vptr, "[.");
|
||||
vptr += 2;
|
||||
}
|
||||
copyto (&vptr, &fptr, 0, (type==1));
|
||||
if (type == 1)
|
||||
*vptr++ = ']';
|
||||
state = -1;
|
||||
}
|
||||
else /* found '/' (17..21) */
|
||||
{
|
||||
if ((type == 2)
|
||||
&& (*(s+1) == 0)) /* 17(2) */
|
||||
{
|
||||
copyto (&vptr, &fptr, '/', 1);
|
||||
state = 7;
|
||||
}
|
||||
else
|
||||
{
|
||||
strcpy (vptr, "[.");
|
||||
vptr += 2;
|
||||
copyto (&vptr, &fptr, '/', 1);
|
||||
nstate = N_OPEN;
|
||||
state = 9;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case 3: /* '//' at start */
|
||||
while (*fptr == '/') /* collapse all '/' */
|
||||
fptr++;
|
||||
if (*fptr == 0) /* just // */
|
||||
{
|
||||
char cwdbuf[MAXPATHLEN+1];
|
||||
|
||||
s1 = getcwd(cwdbuf, MAXPATHLEN);
|
||||
if (s1 == 0)
|
||||
{
|
||||
return ""; /* FIXME, err getcwd */
|
||||
}
|
||||
s = strchr (s1, ':');
|
||||
if (s == 0)
|
||||
{
|
||||
return ""; /* FIXME, err no device */
|
||||
}
|
||||
strncpy (vptr, s1, s-s1+1);
|
||||
vptr += s-s1+1;
|
||||
state = -1;
|
||||
break;
|
||||
}
|
||||
|
||||
s = vptr;
|
||||
|
||||
if (copyto (&vptr, &fptr, '/', 1) == 0) /* copy device part */
|
||||
{
|
||||
*vptr++ = ':';
|
||||
state = -1;
|
||||
break;
|
||||
}
|
||||
*vptr = ':';
|
||||
nstate = N_DEVICE;
|
||||
if (*fptr == 0) /* just '//a/' */
|
||||
{
|
||||
strcpy (vptr+1, "[000000]");
|
||||
vptr += 9;
|
||||
state = -1;
|
||||
break;
|
||||
}
|
||||
*vptr = 0;
|
||||
/* check logical for [000000] insertion */
|
||||
s1 = trnlog (s);
|
||||
if (*s1 != 0)
|
||||
{ /* found translation */
|
||||
char *s2;
|
||||
for (;;) /* loop over all nested logicals */
|
||||
{
|
||||
s2 = s1 + strlen (s1) - 1;
|
||||
if (*s2 == ':') /* translation ends in ':' */
|
||||
{
|
||||
s2 = trnlog (s1);
|
||||
free (s1);
|
||||
if (*s2 == 0)
|
||||
{
|
||||
rooted = 0;
|
||||
break;
|
||||
}
|
||||
s1 = s2;
|
||||
continue; /* next iteration */
|
||||
}
|
||||
if (*s2 == ']') /* translation ends in ']' */
|
||||
{
|
||||
if (*(s2-1) == '.') /* ends in '.]' */
|
||||
{
|
||||
if (!strneq (fptr, "000000", 6))
|
||||
rooted = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
strcpy (vmsname, s1);
|
||||
s = strchr (vmsname, ']');
|
||||
*s = '.';
|
||||
nstate = N_DOT;
|
||||
vptr = s;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
free (s1);
|
||||
}
|
||||
else
|
||||
rooted = 0;
|
||||
|
||||
if (*vptr == 0)
|
||||
{
|
||||
nstate = N_DEVICE;
|
||||
*vptr++ = ':';
|
||||
}
|
||||
else
|
||||
vptr++;
|
||||
|
||||
if (rooted == 0)
|
||||
{
|
||||
strcpy (vptr, "[000000.");
|
||||
vptr += 8;
|
||||
s1 = vptr-1;
|
||||
nstate = N_DOT;
|
||||
}
|
||||
else
|
||||
s1 = 0;
|
||||
|
||||
/* s1-> '.' after 000000 or NULL */
|
||||
|
||||
s = strchr (fptr, '/');
|
||||
if (s == 0)
|
||||
{ /* no next '/' */
|
||||
if (*(vptr-1) == '.')
|
||||
*(vptr-1) = ']';
|
||||
else if (rooted == 0)
|
||||
*vptr++ = ']';
|
||||
copyto (&vptr, &fptr, 0, (type == 1));
|
||||
state = -1;
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
while (*(s+1) == '/') /* skip multiple '/' */
|
||||
s++;
|
||||
}
|
||||
|
||||
if ((rooted != 0)
|
||||
&& (*(vptr-1) != '.'))
|
||||
{
|
||||
*vptr++ = '[';
|
||||
nstate = N_DOT;
|
||||
}
|
||||
else
|
||||
if ((nstate == N_DOT)
|
||||
&& (s1 != 0)
|
||||
&& (*(s+1) == 0))
|
||||
{
|
||||
if (type == 2)
|
||||
{
|
||||
*s1 = ']';
|
||||
nstate = N_CLOSED;
|
||||
}
|
||||
}
|
||||
state = 9;
|
||||
break;
|
||||
|
||||
case 4: /* single '/' at start (9..15) */
|
||||
if (*fptr == 0)
|
||||
state = 5;
|
||||
else
|
||||
state = 6;
|
||||
break;
|
||||
|
||||
case 5: /* just '/' at start (9) */
|
||||
if (type != 2)
|
||||
{
|
||||
*vptr++ = '[';
|
||||
nstate = N_OPEN;
|
||||
}
|
||||
strcpy (vptr, "000000");
|
||||
vptr += 6;
|
||||
if (type == 2)
|
||||
state = 7;
|
||||
else
|
||||
state = 8;
|
||||
break;
|
||||
|
||||
case 6: /* chars following '/' at start 10..15 */
|
||||
*vptr++ = '[';
|
||||
nstate = N_OPEN;
|
||||
s = strchr (fptr, '/');
|
||||
if (s == 0) /* 10 */
|
||||
{
|
||||
if (type != 1)
|
||||
{
|
||||
strcpy (vptr, "000000]");
|
||||
vptr += 7;
|
||||
}
|
||||
copyto (&vptr, &fptr, 0, (type == 1));
|
||||
if (type == 1)
|
||||
{
|
||||
*vptr++ = ']';
|
||||
}
|
||||
state = -1;
|
||||
}
|
||||
else /* 11..15 */
|
||||
{
|
||||
if ( (type == 2)
|
||||
&& (*(s+1) == 0)) /* 11(2) */
|
||||
{
|
||||
strcpy (vptr, "000000]");
|
||||
nstate = N_CLOSED;
|
||||
vptr += 7;
|
||||
}
|
||||
copyto (&vptr, &fptr, '/', (*(vptr-1) != ']'));
|
||||
state = 9;
|
||||
}
|
||||
break;
|
||||
|
||||
case 7: /* add '.dir' and exit */
|
||||
if ((nstate == N_OPEN)
|
||||
|| (nstate == N_DOT))
|
||||
{
|
||||
s = vptr-1;
|
||||
while (s > vmsname)
|
||||
{
|
||||
if (*s == ']')
|
||||
{
|
||||
break;
|
||||
}
|
||||
if (*s == '.')
|
||||
{
|
||||
*s = ']';
|
||||
break;
|
||||
}
|
||||
s--;
|
||||
}
|
||||
}
|
||||
strcpy (vptr, ".dir");
|
||||
vptr += 4;
|
||||
state = -1;
|
||||
break;
|
||||
|
||||
case 8: /* add ']' and exit */
|
||||
*vptr++ = ']';
|
||||
state = -1;
|
||||
break;
|
||||
|
||||
case 9: /* 17..21, fptr -> 1st '/' + 1 */
|
||||
if (*fptr == 0)
|
||||
{
|
||||
if (type == 2)
|
||||
{
|
||||
state = 7;
|
||||
}
|
||||
else
|
||||
state = 8;
|
||||
break;
|
||||
}
|
||||
s = strchr (fptr, '/');
|
||||
if (s == 0)
|
||||
{
|
||||
if (type != 1)
|
||||
{
|
||||
if (nstate == N_OPEN)
|
||||
{
|
||||
*vptr++ = ']';
|
||||
nstate = N_CLOSED;
|
||||
}
|
||||
as_dir = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (nstate == N_OPEN)
|
||||
{
|
||||
*vptr++ = '.';
|
||||
nstate = N_DOT;
|
||||
}
|
||||
as_dir = 1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
while (*(s+1) == '/')
|
||||
s++;
|
||||
if ( (type == 2)
|
||||
&& (*(s+1) == 0)) /* 19(2), 21(2)*/
|
||||
{
|
||||
if (nstate != N_CLOSED)
|
||||
{
|
||||
*vptr++ = ']';
|
||||
nstate = N_CLOSED;
|
||||
}
|
||||
as_dir = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (nstate == N_OPEN)
|
||||
{
|
||||
*vptr++ = '.';
|
||||
nstate = N_DOT;
|
||||
}
|
||||
as_dir = 1;
|
||||
}
|
||||
}
|
||||
if ( (*fptr == '.') /* check for '..' or '../' */
|
||||
&& (*(fptr+1) == '.')
|
||||
&& ((*(fptr+2) == '/')
|
||||
|| (*(fptr+2) == 0)) )
|
||||
{
|
||||
fptr += 2;
|
||||
if (*fptr == '/')
|
||||
{
|
||||
do
|
||||
{
|
||||
fptr++;
|
||||
}
|
||||
while (*fptr == '/');
|
||||
}
|
||||
else if (*fptr == 0)
|
||||
type = 1;
|
||||
vptr--; /* vptr -> '.' or ']' */
|
||||
s1 = vptr;
|
||||
for (;;)
|
||||
{
|
||||
s1--;
|
||||
if (*s1 == '.') /* one back */
|
||||
{
|
||||
vptr = s1;
|
||||
nstate = N_OPEN;
|
||||
break;
|
||||
}
|
||||
if (*s1 == '[') /* top level reached */
|
||||
{
|
||||
if (*fptr == 0)
|
||||
{
|
||||
strcpy (s1, "[000000]");
|
||||
vptr = s1 + 8;
|
||||
nstate = N_CLOSED;
|
||||
s = 0;
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
vptr = s1+1;
|
||||
nstate = N_OPEN;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
copyto (&vptr, &fptr, '/', as_dir);
|
||||
if (nstate == N_DOT)
|
||||
nstate = N_OPEN;
|
||||
}
|
||||
if (s == 0)
|
||||
{ /* 18,20 */
|
||||
if (type == 1)
|
||||
*vptr++ = ']';
|
||||
state = -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (*(s+1) == 0)
|
||||
{
|
||||
if (type == 2) /* 19,21 */
|
||||
{
|
||||
state = 7;
|
||||
}
|
||||
else
|
||||
{
|
||||
*vptr++ = ']';
|
||||
state = -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case 10: /* 1,2 first is '.' */
|
||||
if (*fptr == '.')
|
||||
{
|
||||
fptr++;
|
||||
state = 11;
|
||||
}
|
||||
else
|
||||
state = 12;
|
||||
break;
|
||||
|
||||
case 11: /* 2, '..' at start */
|
||||
count = 1;
|
||||
if (*fptr != 0)
|
||||
{
|
||||
if (*fptr != '/') /* got ..xxx */
|
||||
{
|
||||
return name;
|
||||
}
|
||||
do /* got ../ */
|
||||
{
|
||||
fptr++;
|
||||
while (*fptr == '/') fptr++;
|
||||
if (*fptr != '.')
|
||||
break;
|
||||
if (*(fptr+1) != '.')
|
||||
break;
|
||||
fptr += 2;
|
||||
if ((*fptr == 0)
|
||||
|| (*fptr == '/'))
|
||||
count++;
|
||||
}
|
||||
while (*fptr == '/');
|
||||
}
|
||||
{ /* got '..' or '../' */
|
||||
nstate = N_OPEN;
|
||||
*vptr++ = '[';
|
||||
while (count--)
|
||||
*vptr++ = '-';
|
||||
|
||||
if (*fptr == 0) /* had '..' or '../' */
|
||||
{
|
||||
*vptr++ = ']';
|
||||
state = -1;
|
||||
}
|
||||
else /* had '../xxx' */
|
||||
{
|
||||
state = 9;
|
||||
}
|
||||
*vptr = 0;
|
||||
}
|
||||
break;
|
||||
|
||||
case 12: /* 1, '.' at start */
|
||||
if (*fptr != 0)
|
||||
{
|
||||
if (*fptr != '/')
|
||||
{
|
||||
return name;
|
||||
}
|
||||
fptr++;
|
||||
}
|
||||
|
||||
if (*fptr)
|
||||
{
|
||||
state = 9;
|
||||
|
||||
switch (type)
|
||||
{
|
||||
case 0:
|
||||
nstate = N_CLOSED;
|
||||
*vptr++ = '[';
|
||||
*vptr++ = ']';
|
||||
break;
|
||||
|
||||
case 1:
|
||||
nstate = N_OPEN;
|
||||
*vptr++ = '[';
|
||||
break;
|
||||
|
||||
case 2:
|
||||
nstate = N_CLOSED;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (type == 1)
|
||||
{
|
||||
*vptr++ = '[';
|
||||
*vptr++ = ']';
|
||||
state = -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
char cwdbuf[MAXPATHLEN+1];
|
||||
|
||||
s1 = getcwd(cwdbuf, MAXPATHLEN);
|
||||
if (s1 == 0)
|
||||
{
|
||||
return "foo"; /*FIXME, err getcwd */
|
||||
}
|
||||
strcpy (vptr, s1);
|
||||
vptr += strlen (vptr);
|
||||
|
||||
if (type == 2)
|
||||
{
|
||||
s = vptr;
|
||||
while (s > vmsname)
|
||||
{
|
||||
if (*s == '.')
|
||||
{
|
||||
*s = ']';
|
||||
vptr--;
|
||||
break;
|
||||
}
|
||||
|
||||
if (*s == '[')
|
||||
{
|
||||
int i;
|
||||
char *t = vptr - 2;
|
||||
while (t > s)
|
||||
{
|
||||
*(t+7) = *t;
|
||||
t--;
|
||||
}
|
||||
s++;
|
||||
for (i = 0; i < 6; i++)
|
||||
*s++ = '0';
|
||||
*s = ']';
|
||||
vptr += 6;
|
||||
break;
|
||||
}
|
||||
s--;
|
||||
}
|
||||
|
||||
strcpy (vptr, ".dir");
|
||||
vptr += 4;
|
||||
}
|
||||
|
||||
state = -1;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
while (state > 0);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
/* directory conversion done
|
||||
fptr -> filename part of input string
|
||||
vptr -> free space in vmsname
|
||||
*/
|
||||
|
||||
*vptr++ = 0;
|
||||
|
||||
return vmsname;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
convert from vms-style to unix-style
|
||||
|
||||
dev:[dir1.dir2] //dev/dir1/dir2/
|
||||
*/
|
||||
|
||||
char *
|
||||
unixify (char *name)
|
||||
{
|
||||
static char piece[512];
|
||||
char *s, *p;
|
||||
|
||||
if (strchr (name, '/') != 0) /* already in unix style */
|
||||
return name;
|
||||
|
||||
p = piece;
|
||||
*p = 0;
|
||||
|
||||
/* device part */
|
||||
|
||||
s = strchr (name, ':');
|
||||
|
||||
if (s != 0)
|
||||
{
|
||||
*s = 0;
|
||||
*p++ = '/';
|
||||
*p++ = '/';
|
||||
strcpy (p, name);
|
||||
p += strlen (p);
|
||||
*s = ':';
|
||||
}
|
||||
|
||||
/* directory part */
|
||||
|
||||
*p++ = '/';
|
||||
s = strchr (name, '[');
|
||||
|
||||
if (s != 0)
|
||||
{
|
||||
s++;
|
||||
switch (*s)
|
||||
{
|
||||
case ']': /* [] */
|
||||
strcat (p, "./");
|
||||
break;
|
||||
case '-': /* [- */
|
||||
strcat (p, "../");
|
||||
break;
|
||||
case '.':
|
||||
strcat (p, "./"); /* [. */
|
||||
break;
|
||||
default:
|
||||
s--;
|
||||
break;
|
||||
}
|
||||
s++;
|
||||
while (*s)
|
||||
{
|
||||
if (*s == '.')
|
||||
*p++ = '/';
|
||||
else
|
||||
*p++ = *s;
|
||||
s++;
|
||||
if (*s == ']')
|
||||
{
|
||||
s++;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (*s != 0) /* more after ']' ?? */
|
||||
{
|
||||
if (*(p-1) != '/')
|
||||
*p++ = '/';
|
||||
strcpy (p, s); /* copy it anyway */
|
||||
}
|
||||
}
|
||||
|
||||
else /* no '[' anywhere */
|
||||
|
||||
{
|
||||
*p++ = 0;
|
||||
}
|
||||
|
||||
/* force end with '/' */
|
||||
|
||||
if (*(p-1) != '/')
|
||||
*p++ = '/';
|
||||
*p = 0;
|
||||
|
||||
return piece;
|
||||
}
|
||||
|
||||
/* EOF */
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user