mirror of
https://github.com/mirror/make.git
synced 2026-08-31 19:58:10 +08:00
Compare commits
365 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ed493f6c91 | ||
|
|
7c3260bbdd | ||
|
|
38b19976f5 | ||
|
|
1dd52ab472 | ||
|
|
92789aa2e7 | ||
|
|
4e18732a1d | ||
|
|
11f9da227e | ||
|
|
b92340a1ea | ||
|
|
8064aee4f9 | ||
|
|
cf78e65fda | ||
|
|
04f0d8427f | ||
|
|
f8401ad28b | ||
|
|
e4b3bf7f97 | ||
|
|
d18a87d0a4 | ||
|
|
41c35f2ffe | ||
|
|
deb4a42c3e | ||
|
|
252c26bd20 | ||
|
|
6f8da5f4b8 | ||
|
|
c46b5a9e0e | ||
|
|
b4157d2ff4 | ||
|
|
f364e0d8d6 | ||
|
|
bb0c05a7f0 | ||
|
|
f987d181c4 | ||
|
|
cad3ddd165 | ||
|
|
54214176b1 | ||
|
|
c2f92c980f | ||
|
|
5b1ca277ca | ||
|
|
7c71df5695 | ||
|
|
a0956c1803 | ||
|
|
4ec74e568d | ||
|
|
d9fc1ac5d2 | ||
|
|
9f55e9fd13 | ||
|
|
7bb7bb4ba4 | ||
|
|
b79791533b | ||
|
|
9d24d41801 | ||
|
|
2d943d3d2e | ||
|
|
b16913a67e | ||
|
|
72ee43c473 | ||
|
|
e5e538fb7a | ||
|
|
c453f898a0 | ||
|
|
18c4b508ef | ||
|
|
383eb3a923 | ||
|
|
01b1d4f401 | ||
|
|
bf2d71498c | ||
|
|
3e20e376b7 | ||
|
|
7ddfc42ee3 | ||
|
|
ca92d83cde | ||
|
|
ae80eefe65 | ||
|
|
01142a53c9 | ||
|
|
dee6af912a | ||
|
|
7296991d6c | ||
|
|
d51ac70122 | ||
|
|
3cb84fe933 | ||
|
|
ad84ec2fdc | ||
|
|
26b9f30714 | ||
|
|
5ac80176a3 | ||
|
|
c801a7fb67 | ||
|
|
c2eddf9be2 | ||
|
|
f8852311cc | ||
|
|
a99378ebe4 | ||
|
|
6c87f3fb85 | ||
|
|
38116baee9 | ||
|
|
614033f8c6 | ||
|
|
f3640ecf4f | ||
|
|
c4e232e44f | ||
|
|
aa99e810a9 | ||
|
|
8f49029561 | ||
|
|
f7ed583675 | ||
|
|
cf7f7de7ae | ||
|
|
d4cb7ae6d4 | ||
|
|
387d349dc8 | ||
|
|
caad0e2181 | ||
|
|
990d6f9b9a | ||
|
|
134480787e | ||
|
|
a9a4919909 | ||
|
|
d12ff78cb2 | ||
|
|
fabb03eac4 | ||
|
|
618c53a225 | ||
|
|
88d126d6c4 | ||
|
|
f6ea899d83 | ||
|
|
ee861a4e9f | ||
|
|
ca4234c4b5 | ||
|
|
257b82ac1f | ||
|
|
aac4004444 | ||
|
|
86fc644dcc | ||
|
|
02b3a6ad46 | ||
|
|
77734be2af | ||
|
|
820210ab85 | ||
|
|
77706874a7 | ||
|
|
a9548aeb8f | ||
|
|
70ba0357a0 | ||
|
|
7d48401707 | ||
|
|
1fc13bf576 | ||
|
|
896908180e | ||
|
|
80e9a422e4 | ||
|
|
15a7e3830f | ||
|
|
26e359c71d | ||
|
|
4da2055a10 | ||
|
|
a2ba5ccbda | ||
|
|
5eff618c8c | ||
|
|
10e130b207 | ||
|
|
62da1c45e5 | ||
|
|
ab31f0b594 | ||
|
|
8f1b6bca46 | ||
|
|
6faa02247e | ||
|
|
c72e1ec446 | ||
|
|
91d87ccf32 | ||
|
|
7ad2593b2d | ||
|
|
09cce75c30 | ||
|
|
07eea3aa49 | ||
|
|
16e14b4114 | ||
|
|
77881d2281 | ||
|
|
2fe96e4a41 | ||
|
|
dd24a4c1cf | ||
|
|
f36c6c7347 | ||
|
|
87d24154af | ||
|
|
614557d04c | ||
|
|
047544785b | ||
|
|
73b08af181 | ||
|
|
5c1d9e54c7 | ||
|
|
2d7b5d6d80 | ||
|
|
5dc7358547 | ||
|
|
e33af0fb4a | ||
|
|
6f7e06ec4e | ||
|
|
3f3eecc115 | ||
|
|
b09e9af0b8 | ||
|
|
9992cb0b83 | ||
|
|
0cbee1b475 | ||
|
|
d63925d863 | ||
|
|
0793658c09 | ||
|
|
98da874c43 | ||
|
|
88d6c22a48 | ||
|
|
c3b39d0654 | ||
|
|
fe55d6e1e3 | ||
|
|
768f287a06 | ||
|
|
8dd302cda6 | ||
|
|
df75efb114 | ||
|
|
3ec497f8f8 | ||
|
|
84ed34ba5a | ||
|
|
08c964b4ac | ||
|
|
97e51c0285 | ||
|
|
59abb46bc9 | ||
|
|
6d6f12b0c3 | ||
|
|
621d3196fa | ||
|
|
e4b7ac21dc | ||
|
|
d444b87173 | ||
|
|
1c179f9636 | ||
|
|
5690084634 | ||
|
|
9fa63eb918 | ||
|
|
668eda0527 | ||
|
|
4e1be4a60c | ||
|
|
5b1e871d2d | ||
|
|
2da3bb46f2 | ||
|
|
b264d3d4f8 | ||
|
|
51c1c07e7a | ||
|
|
700af780af | ||
|
|
f14824878d | ||
|
|
8c2aa889bb | ||
|
|
bb21dd4d2d | ||
|
|
93fd0c0c9a | ||
|
|
cf56036c60 | ||
|
|
88ceff8b2f | ||
|
|
9755d4c09c | ||
|
|
634ef057ad | ||
|
|
949c0464a9 | ||
|
|
416664b1e7 | ||
|
|
667d70eac2 | ||
|
|
b9078e5bd3 | ||
|
|
0de7b74896 | ||
|
|
236589642e | ||
|
|
cb9ac2b0cc | ||
|
|
40a6751abf | ||
|
|
1bc35a7ae7 | ||
|
|
8cdaabbf8e | ||
|
|
2be8661433 | ||
|
|
8b3e678ace | ||
|
|
ec09ec775a | ||
|
|
bdaeca49e9 | ||
|
|
342a9bb54b | ||
|
|
6761122be0 | ||
|
|
1fd0bfaf1e | ||
|
|
8eb171e469 | ||
|
|
7154e316b7 | ||
|
|
f3e345c869 | ||
|
|
d34f46c1f3 | ||
|
|
f0ab709640 | ||
|
|
5f2d114c6d | ||
|
|
cbe0d2e47f | ||
|
|
f485881d4a | ||
|
|
15db387f18 | ||
|
|
aab51f7ef2 | ||
|
|
2b25eac587 | ||
|
|
e72c5e021f | ||
|
|
b6a779d262 | ||
|
|
26f4bb89bd | ||
|
|
320714ae85 | ||
|
|
6682fbc2cb | ||
|
|
f2b130bda8 | ||
|
|
8aba33a8bd | ||
|
|
d365bdfdbc | ||
|
|
f440c3ebe2 | ||
|
|
3efba8a145 | ||
|
|
e7b2f6818c | ||
|
|
c90db9276a | ||
|
|
7192d0ec4a | ||
|
|
9230bfb9ae | ||
|
|
55b993ae09 | ||
|
|
1d20aa7247 | ||
|
|
21f7ac8f47 | ||
|
|
aa376ad638 | ||
|
|
35b51df110 | ||
|
|
e62f4cf9a2 | ||
|
|
116767901f | ||
|
|
71eb0a8038 | ||
|
|
d9291d09b8 | ||
|
|
f3ad572099 | ||
|
|
cefe747e85 | ||
|
|
3ecf97d3af | ||
|
|
21d3865973 | ||
|
|
29d92d4091 | ||
|
|
f8f9d371ff | ||
|
|
f5af979357 | ||
|
|
76cb186732 | ||
|
|
6c06c547dc | ||
|
|
c5d4b7b2f2 | ||
|
|
9e4b3d3f4c | ||
|
|
5a96d5a066 | ||
|
|
4488592dda | ||
|
|
e7eb8b5962 | ||
|
|
0c2fc00544 | ||
|
|
214df0e92a | ||
|
|
b2e898d0bf | ||
|
|
abb1e8d10b | ||
|
|
cc6dc70b16 | ||
|
|
2638552859 | ||
|
|
de48d6a4f7 | ||
|
|
55f06bdc3f | ||
|
|
0d367bbe6e | ||
|
|
f4b8ddf260 | ||
|
|
e13fd5c83d | ||
|
|
7c4e6b0299 | ||
|
|
b9c4fc441b | ||
|
|
65b73ce434 | ||
|
|
2d73c9bf25 | ||
|
|
33468b3f31 | ||
|
|
1cffd0a203 | ||
|
|
b580949ae0 | ||
|
|
f2771aa614 | ||
|
|
5e829188d3 | ||
|
|
297cb5adb7 | ||
|
|
012918bf11 | ||
|
|
1ae90c030d | ||
|
|
0fb6f2d985 | ||
|
|
97a8d9b45a | ||
|
|
c5c02accb7 | ||
|
|
76a099997b | ||
|
|
c5319e75f5 | ||
|
|
510e5ce801 | ||
|
|
144f436c4b | ||
|
|
52056d7b2c | ||
|
|
c66ec5fa20 | ||
|
|
da6fc6aae2 | ||
|
|
d9aff6b817 | ||
|
|
e5f6dc54b9 | ||
|
|
88732a29f2 | ||
|
|
7b0a741857 | ||
|
|
74bd8b3aa5 | ||
|
|
9043b28250 | ||
|
|
fcc11d05a6 | ||
|
|
a8f4669b23 | ||
|
|
bd4829096c | ||
|
|
7044e0c93c | ||
|
|
94d9077691 | ||
|
|
c4cc2e9595 | ||
|
|
5e234e4048 | ||
|
|
950f3d305f | ||
|
|
58a37927e6 | ||
|
|
ec272f3a9c | ||
|
|
ef6aca5a38 | ||
|
|
b262ea5d8f | ||
|
|
cc20f90507 | ||
|
|
9e2fa24649 | ||
|
|
2dc0280d82 | ||
|
|
90959b8b70 | ||
|
|
19ae6fe72a | ||
|
|
0e020bbc24 | ||
|
|
c01222c018 | ||
|
|
957aa450a0 | ||
|
|
e49e11e069 | ||
|
|
f4f353bb54 | ||
|
|
a80b0096f5 | ||
|
|
62e8f029e9 | ||
|
|
db7658e042 | ||
|
|
fa7f95c66c | ||
|
|
df5f30a76a | ||
|
|
1770540217 | ||
|
|
c8a6263eb5 | ||
|
|
a015d1f822 | ||
|
|
c604e53a45 | ||
|
|
d79fe162c0 | ||
|
|
0c326a66c9 | ||
|
|
f79bde1a6d | ||
|
|
289108cc9b | ||
|
|
61c413d5ea | ||
|
|
d3a53d5d16 | ||
|
|
1306023a4f | ||
|
|
80b90b7866 | ||
|
|
8e024a2532 | ||
|
|
660a2eafe5 | ||
|
|
8277806db6 | ||
|
|
6ba5ea022a | ||
|
|
4533348826 | ||
|
|
68fbad6667 | ||
|
|
f430a65ccb | ||
|
|
c30da63fd2 | ||
|
|
3fb7312e9f | ||
|
|
dd6adfa454 | ||
|
|
3b5e47b2e2 | ||
|
|
4e277f6fbd | ||
|
|
ec946d7e21 | ||
|
|
16d06006a4 | ||
|
|
b774aebffa | ||
|
|
06de697268 | ||
|
|
fdfe0446b6 | ||
|
|
12b14f0484 | ||
|
|
4e12a5fa45 | ||
|
|
e56243fe57 | ||
|
|
7449abfe1b | ||
|
|
53b9770b40 | ||
|
|
766baeef0a | ||
|
|
ee204c78f2 | ||
|
|
e64674b718 | ||
|
|
564fb212a7 | ||
|
|
30cc10093b | ||
|
|
69c5a2128b | ||
|
|
577dd1ff6d | ||
|
|
86f2f8bcb5 | ||
|
|
c72205b28b | ||
|
|
057e33d6b5 | ||
|
|
e4499a1fb5 | ||
|
|
57b043c7fb | ||
|
|
f389aabde6 | ||
|
|
acbef3f612 | ||
|
|
3822f77c1d | ||
|
|
1cf3932a39 | ||
|
|
33bda40086 | ||
|
|
e666a6a021 | ||
|
|
5920d6d2b3 | ||
|
|
2e6468c811 | ||
|
|
393d2a2d4a | ||
|
|
bd7d03f8cd | ||
|
|
a4a173928f | ||
|
|
0e113897f7 | ||
|
|
b0eab8ecb9 | ||
|
|
f84821b249 | ||
|
|
99d1423059 | ||
|
|
7fbd58cd6b | ||
|
|
3ede0b96ac | ||
|
|
1d289b424a | ||
|
|
96285f875b | ||
|
|
bd4ce86785 | ||
|
|
e1c072aa7e | ||
|
|
af0074547d | ||
|
|
4a7a8278e8 | ||
|
|
00fa3ca3a5 |
1
.ccls
1
.ccls
@@ -13,6 +13,7 @@ clang
|
|||||||
-Wall
|
-Wall
|
||||||
-Wextra
|
-Wextra
|
||||||
-Werror
|
-Werror
|
||||||
|
-Wno-address
|
||||||
-Wwrite-strings
|
-Wwrite-strings
|
||||||
-Wshadow
|
-Wshadow
|
||||||
-Wdeclaration-after-statement
|
-Wdeclaration-after-statement
|
||||||
|
|||||||
@@ -1,18 +1,21 @@
|
|||||||
(
|
(
|
||||||
(nil . ((bug-reference-bug-regexp . "\\(\\)\\bSV[- ]\\([0-9]+\\)")
|
(nil . ((bug-reference-bug-regexp . "\\(\\)\\bSV[- ]\\([0-9]+\\)")
|
||||||
(bug-reference-url-format . "https://savannah.gnu.org/bugs/?%s")
|
(bug-reference-url-format . "https://savannah.gnu.org/bugs/?%s")
|
||||||
(ccls-initialization-options . (:index (:threads 6
|
(ccls-initialization-options
|
||||||
:initialBlacklist ("/make-[0-9]" "tests/work/" "/\\.deps" "/\\..*cache" "/\\.git"))))
|
. (:index (:threads 6
|
||||||
(lsp-file-watch-ignored . ("/\\.git$"
|
:initialBlacklist ["/make-[0-9]" "tests/work/" "/\\.deps"
|
||||||
"/\\..*cache$"
|
"/\\..*cache" "/\\.git"])))
|
||||||
;; autotools content
|
(lsp-file-watch-ignored-directories
|
||||||
"/\\.deps$"
|
. ("[/\\\\]\\.git$"
|
||||||
"/autom4te\\.cache$"
|
"[/\\\\]\\..*cache$"
|
||||||
"/build-aux$"
|
;; autotools content
|
||||||
;; make-specific content
|
"[/\\\\]\\.deps$"
|
||||||
"/doc/manual$"
|
"[/\\\\]autom4te\\.cache$"
|
||||||
"/tests/work$"
|
"[/\\\\]build-aux$"
|
||||||
"/make-[0-9]"))
|
;; make-specific content
|
||||||
|
"[/\\\\]doc[/\\\\]manual$"
|
||||||
|
"[/\\\\]tests[/\\\\]work$"
|
||||||
|
"[/\\\\]make-[0-9]"))
|
||||||
))
|
))
|
||||||
(c-mode . ((c-file-style . "gnu")))
|
(c-mode . ((c-file-style . "gnu")))
|
||||||
)
|
)
|
||||||
|
|||||||
22
.gitignore
vendored
22
.gitignore
vendored
@@ -11,8 +11,14 @@ GTAGS
|
|||||||
*~
|
*~
|
||||||
#*
|
#*
|
||||||
.#*
|
.#*
|
||||||
|
*.diff
|
||||||
|
*.patch
|
||||||
|
*.orig
|
||||||
|
*.rej
|
||||||
|
|
||||||
# Configure artifacts
|
# Configure artifacts
|
||||||
|
/lib/
|
||||||
|
/m4/
|
||||||
ABOUT-NLS
|
ABOUT-NLS
|
||||||
INSTALL
|
INSTALL
|
||||||
Makefile
|
Makefile
|
||||||
@@ -28,8 +34,10 @@ config.log
|
|||||||
config.status
|
config.status
|
||||||
configure
|
configure
|
||||||
/mk/Posix.mk
|
/mk/Posix.mk
|
||||||
stamp-h1
|
stamp-*
|
||||||
.dirstamp
|
.dirstamp
|
||||||
|
gnulib
|
||||||
|
convert.sed
|
||||||
|
|
||||||
# Build artifacts
|
# Build artifacts
|
||||||
.deps/
|
.deps/
|
||||||
@@ -52,19 +60,17 @@ WinRel/
|
|||||||
GccDebug/
|
GccDebug/
|
||||||
GccRel/
|
GccRel/
|
||||||
|
|
||||||
|
# Test artifacts
|
||||||
|
makeerror-*
|
||||||
|
test-suite.log
|
||||||
|
|
||||||
# Distribution artifacts
|
# Distribution artifacts
|
||||||
.dep_segment
|
.dep_segment
|
||||||
.check-git-HEAD
|
.check-git-HEAD
|
||||||
ChangeLog
|
ChangeLog
|
||||||
README
|
README
|
||||||
README.DOS
|
|
||||||
README.OS2
|
|
||||||
README.W32
|
|
||||||
build.cfg
|
build.cfg
|
||||||
config.ami
|
mkconfig.h
|
||||||
config.h-vms
|
|
||||||
config.h.W32
|
|
||||||
configh.dos
|
|
||||||
make-[0-9]*/
|
make-[0-9]*/
|
||||||
make-[0-9]*.tar.*
|
make-[0-9]*.tar.*
|
||||||
checkcfg.*.log
|
checkcfg.*.log
|
||||||
|
|||||||
61
AUTHORS
61
AUTHORS
@@ -1,15 +1,16 @@
|
|||||||
-----------------------------------
|
-----------------------------------
|
||||||
|
|
||||||
GNU make development up to version 3.75 by:
|
GNU Make development starting with GNU Make 3.76 by:
|
||||||
Roland McGrath <roland@gnu.org>
|
|
||||||
|
|
||||||
|
|
||||||
Development starting with GNU make 3.76 by:
|
|
||||||
Paul D. Smith <psmith@gnu.org>
|
Paul D. Smith <psmith@gnu.org>
|
||||||
|
|
||||||
Additional development starting with GNU make 3.81 by:
|
Additional development starting with GNU Make 4.3 by:
|
||||||
|
Dmitry Goncharov <dgoncharov@users.sf.net>
|
||||||
|
|
||||||
|
Additional development starting with GNU Make 3.81 by:
|
||||||
Boris Kolpackov <boris@kolpackov.net>
|
Boris Kolpackov <boris@kolpackov.net>
|
||||||
|
|
||||||
|
GNU Make development up to version 3.75 by:
|
||||||
|
Roland McGrath <roland@gnu.org>
|
||||||
|
|
||||||
GNU Make User's Manual
|
GNU Make User's Manual
|
||||||
Written by:
|
Written by:
|
||||||
@@ -22,7 +23,7 @@ GNU Make User's Manual
|
|||||||
Paul D. Smith <psmith@gnu.org>
|
Paul D. Smith <psmith@gnu.org>
|
||||||
|
|
||||||
-----------------------------------
|
-----------------------------------
|
||||||
GNU make porting efforts:
|
GNU Make porting efforts:
|
||||||
|
|
||||||
Port to VMS by:
|
Port to VMS by:
|
||||||
Klaus Kaempf <kkaempf@progis.de>
|
Klaus Kaempf <kkaempf@progis.de>
|
||||||
@@ -34,6 +35,9 @@ GNU make porting efforts:
|
|||||||
Port to Amiga by:
|
Port to Amiga by:
|
||||||
Aaron Digulla <digulla@fh-konstanz.de>
|
Aaron Digulla <digulla@fh-konstanz.de>
|
||||||
|
|
||||||
|
Port to MS-Windows (native/MinGW) maintained by:
|
||||||
|
Eli Zaretskii <eliz@gnu.org>
|
||||||
|
|
||||||
Port to MS-DOS (DJGPP), OS/2, and MS-Windows (native/MinGW) by:
|
Port to MS-DOS (DJGPP), OS/2, and MS-Windows (native/MinGW) by:
|
||||||
DJ Delorie <dj@delorie.com>
|
DJ Delorie <dj@delorie.com>
|
||||||
Rob Tulloh <rob_tulloh@tivoli.com>
|
Rob Tulloh <rob_tulloh@tivoli.com>
|
||||||
@@ -42,38 +46,67 @@ GNU make porting efforts:
|
|||||||
Andreas Beuning <andreas.buening@nexgo.de>
|
Andreas Beuning <andreas.buening@nexgo.de>
|
||||||
Earnie Boyd <earnie@uses.sf.net>
|
Earnie Boyd <earnie@uses.sf.net>
|
||||||
Troy Runkel <Troy.Runkel@mathworks.com>
|
Troy Runkel <Troy.Runkel@mathworks.com>
|
||||||
|
Juan M. Guerrero <juan.guerrero@gmx.de>
|
||||||
|
|
||||||
-----------------------------------
|
-----------------------------------
|
||||||
Other contributors:
|
Other contributors:
|
||||||
|
|
||||||
|
Luke Allardyce <lukeallardyce@gmail.com>
|
||||||
|
Aron Barath <baratharon@caesar.elte.hu>
|
||||||
|
David Boyce <dsb@boyski.com>
|
||||||
|
Kevin Buettner <kevinb@redhat.com>
|
||||||
Janet Carson <janet_carson@tivoli.com>
|
Janet Carson <janet_carson@tivoli.com>
|
||||||
Howard Chu <hyc@highlandsun.com>
|
Howard Chu <hyc@highlandsun.com>
|
||||||
Ludovic Courtès <ludo@gnu.org>
|
Ludovic Courtès <ludo@gnu.org>
|
||||||
|
Joe Crayne <oh.hello.joe@gmail.com>
|
||||||
|
Jeremy Devenport <jeremy.devenport@gmail.com>
|
||||||
|
Pete Dietl <petedietl@gmail.com>
|
||||||
|
Martin Dorey <martin.dorey@hds.com>
|
||||||
|
Christian Eggers <ceggers@arri.de>
|
||||||
Paul Eggert <eggert@twinsun.com>
|
Paul Eggert <eggert@twinsun.com>
|
||||||
|
Mike Frysinger <vapier@gentoo.org>
|
||||||
Ramon Garcia Fernandez <ramon.garcia.f@gmail.com>
|
Ramon Garcia Fernandez <ramon.garcia.f@gmail.com>
|
||||||
|
Noah Goldstein <goldstein.w.n@gmail.com>
|
||||||
|
Mike Haboustak <haboustak@gmail.com>
|
||||||
|
Frank Heckenbach <f.heckenbach@fh-soft.de>
|
||||||
Klaus Heinz <kamar@ease.rhein-main.de>
|
Klaus Heinz <kamar@ease.rhein-main.de>
|
||||||
|
Ben Hutchings <ben@decadent.org.uk>
|
||||||
|
Cao jin <caoj.fnst@cn.fujitsu.com>
|
||||||
Michael Joosten
|
Michael Joosten
|
||||||
|
Christian Jullien <eligis@orange.fr>
|
||||||
Jim Kelton <jim_kelton@tivoli.com>
|
Jim Kelton <jim_kelton@tivoli.com>
|
||||||
|
Kaz Kylheku <kaz@kylheku.com>
|
||||||
David Lubbren <uhay@rz.uni-karlsruhe.de>
|
David Lubbren <uhay@rz.uni-karlsruhe.de>
|
||||||
Tim Magill <tim.magill@telops.gte.com>
|
Tim Magill <tim.magill@telops.gte.com>
|
||||||
Markus Mauhart <qwe123@chello.at>
|
Markus Mauhart <qwe123@chello.at>
|
||||||
Greg McGary <greg@mcgary.org>
|
Greg McGary <greg@mcgary.org>
|
||||||
Thien-Thi Nguyen <ttn@gnuvola.org>
|
Thien-Thi Nguyen <ttn@gnuvola.org>
|
||||||
Thomas Riedl <thomas.riedl@siemens.com>
|
|
||||||
Han-Wen Nienhuys <hanwen@cs.uu.nl>
|
Han-Wen Nienhuys <hanwen@cs.uu.nl>
|
||||||
Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
|
Enrique Olaizola <enrique_olaizola16@hotmail.com>
|
||||||
|
Ola Olsson <ola1olsson@gmail.com>
|
||||||
|
Jens Rehsack <sno@netbsd.org>
|
||||||
|
Thomas Riedl <thomas.riedl@siemens.com>
|
||||||
|
Jaak Ristioja <jaak@ristioja.ee>
|
||||||
|
Christoph Schulz <develop@kristov.de>
|
||||||
|
Andreas Schwab <schwab@suse.de>
|
||||||
|
spagoveanu <spagoveanu@gmail.com>
|
||||||
Carl Staelin (Princeton University)
|
Carl Staelin (Princeton University)
|
||||||
Ian Stewartson (Data Logic Limited)
|
Ian Stewartson (Data Logic Limited)
|
||||||
|
Tobias Stoeckmann <tobias@stoeckmann.org>
|
||||||
|
Sergei Trofimovich <siarheit@google.com>
|
||||||
|
Marc Ullman <marc@mathworks.com>
|
||||||
|
Christof Warlich <cwarlich@gmx.de>
|
||||||
|
Florian Weimer <fweimer@redhat.com>
|
||||||
David A. Wheeler <dwheeler@dwheeler.com>
|
David A. Wheeler <dwheeler@dwheeler.com>
|
||||||
David Boyce <dsb@boyski.com>
|
Bernhard M. Wiedemann <bwiedemann@suse.de>
|
||||||
Frank Heckenbach <f.heckenbach@fh-soft.de>
|
Ben Wijen <ben@wijen.net>
|
||||||
Kaz Kylheku <kaz@kylheku.com>
|
Jouke Witteveen <j.witteveen@gmail.com>
|
||||||
|
|
||||||
With suggestions/comments/bug reports from a cast of ... well ...
|
With suggestions/comments/bug reports from a cast of ... well ...
|
||||||
hundreds, anyway :)
|
hundreds, anyway :)
|
||||||
|
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 1997-2019 Free Software Foundation, Inc.
|
Copyright (C) 1997-2022 Free Software Foundation, Inc.
|
||||||
This file is part of GNU Make.
|
This file is part of GNU Make.
|
||||||
|
|
||||||
GNU Make is free software; you can redistribute it and/or modify it under the
|
GNU Make is free software; you can redistribute it and/or modify it under the
|
||||||
@@ -86,4 +119,4 @@ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|||||||
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
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
|
You should have received a copy of the GNU General Public License along with
|
||||||
this program. If not, see <http://www.gnu.org/licenses/>.
|
this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
#
|
#
|
||||||
# make.exe -f Basic.mk
|
# make.exe -f Basic.mk
|
||||||
#
|
#
|
||||||
# Copyright (C) 2017-2019 Free Software Foundation, Inc.
|
# Copyright (C) 2017-2022 Free Software Foundation, Inc.
|
||||||
# This file is part of GNU Make.
|
# This file is part of GNU Make.
|
||||||
#
|
#
|
||||||
# GNU Make is free software; you can redistribute it and/or modify it under
|
# GNU Make is free software; you can redistribute it and/or modify it under
|
||||||
@@ -24,7 +24,7 @@
|
|||||||
# details.
|
# details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License along with
|
# You should have received a copy of the GNU General Public License along with
|
||||||
# this program. If not, see <http://www.gnu.org/licenses/>.
|
# this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
all:
|
all:
|
||||||
|
|
||||||
@@ -39,7 +39,6 @@ w32_SOURCES = %w32_SOURCES%
|
|||||||
vms_SOURCES = %vms_SOURCES%
|
vms_SOURCES = %vms_SOURCES%
|
||||||
amiga_SOURCES = %amiga_SOURCES%
|
amiga_SOURCES = %amiga_SOURCES%
|
||||||
|
|
||||||
posix_SOURCES = $(src)posixos.c
|
|
||||||
remote_SOURCES = $(src)remote-stub.c
|
remote_SOURCES = $(src)remote-stub.c
|
||||||
|
|
||||||
OUTDIR =
|
OUTDIR =
|
||||||
@@ -88,8 +87,9 @@ COMPILE.cmd = $(CC) $(extra_CFLAGS) $(CFLAGS) $(extra_CPPFLAGS) $(CPPFLAGS) $(TA
|
|||||||
# $(call LINK.cmd,<objectlist>)
|
# $(call LINK.cmd,<objectlist>)
|
||||||
LINK.cmd = $(LD) $(extra_LDFLAGS) $(LDFLAGS) $(TARGET_ARCH) $1 $(LDLIBS) $(LINK_OUTPUT)
|
LINK.cmd = $(LD) $(extra_LDFLAGS) $(LDFLAGS) $(TARGET_ARCH) $1 $(LDLIBS) $(LINK_OUTPUT)
|
||||||
|
|
||||||
# $(CHECK.cmd)
|
# $(CHECK.cmd) $(CHECK.args)
|
||||||
CHECK.cmd = cd $(SRCDIR)/tests && ./run_make_tests -make $(shell cd $(<D) && pwd)/$(<F)
|
CHECK.cmd = cd $(SRCDIR)/tests && ./run_make_tests -make $(shell cd $(<D) && pwd)/$(<F)
|
||||||
|
CHECK.args ?=
|
||||||
|
|
||||||
# $(call MKDIR.cmd,<dirlist>)
|
# $(call MKDIR.cmd,<dirlist>)
|
||||||
MKDIR.cmd = mkdir -p $1
|
MKDIR.cmd = mkdir -p $1
|
||||||
@@ -103,9 +103,7 @@ CP.cmd = cp $1 $2
|
|||||||
CLEANSPACE = $(call RM.cmd,$(OBJECTS) $(PROG) $(BUILT_SOURCES))
|
CLEANSPACE = $(call RM.cmd,$(OBJECTS) $(PROG) $(BUILT_SOURCES))
|
||||||
|
|
||||||
# Load overrides for the above variables.
|
# Load overrides for the above variables.
|
||||||
include $(firstword $(wildcard $(SRCDIR)/mk/$(lastword $(subst -, ,$(MAKE_HOST)).mk) $(OUTDIR)mk/Posix.mk $(SRCDIR)/mk/Posix.mk))
|
include $(firstword $(wildcard $(SRCDIR)/mk/$(lastword $(subst -, ,$(MAKE_HOST)).mk)))
|
||||||
|
|
||||||
VERSION = %VERSION%
|
|
||||||
|
|
||||||
VPATH = $(SRCDIR)
|
VPATH = $(SRCDIR)
|
||||||
|
|
||||||
@@ -123,7 +121,7 @@ $(OBJDIRS):
|
|||||||
$(call MKDIR.cmd,$@)
|
$(call MKDIR.cmd,$@)
|
||||||
|
|
||||||
check:
|
check:
|
||||||
$(CHECK.cmd)
|
$(CHECK.cmd) $(CHECK.args)
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
$(CLEANSPACE)
|
$(CLEANSPACE)
|
||||||
|
|||||||
8
COPYING
8
COPYING
@@ -1,7 +1,7 @@
|
|||||||
GNU GENERAL PUBLIC LICENSE
|
GNU GENERAL PUBLIC LICENSE
|
||||||
Version 3, 29 June 2007
|
Version 3, 29 June 2007
|
||||||
|
|
||||||
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
||||||
Everyone is permitted to copy and distribute verbatim copies
|
Everyone is permitted to copy and distribute verbatim copies
|
||||||
of this license document, but changing it is not allowed.
|
of this license document, but changing it is not allowed.
|
||||||
|
|
||||||
@@ -645,7 +645,7 @@ the "copyright" line and a pointer to where the full notice is found.
|
|||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
Also add information on how to contact you by electronic and paper mail.
|
Also add information on how to contact you by electronic and paper mail.
|
||||||
|
|
||||||
@@ -664,11 +664,11 @@ might be different; for a GUI interface, you would use an "about box".
|
|||||||
You should also get your employer (if you work as a programmer) or school,
|
You should also get your employer (if you work as a programmer) or school,
|
||||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||||
For more information on this, and how to apply and follow the GNU GPL, see
|
For more information on this, and how to apply and follow the GNU GPL, see
|
||||||
<http://www.gnu.org/licenses/>.
|
<https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
The GNU General Public License does not permit incorporating your program
|
The GNU General Public License does not permit incorporating your program
|
||||||
into proprietary programs. If your program is a subroutine library, you
|
into proprietary programs. If your program is a subroutine library, you
|
||||||
may consider it more useful to permit linking proprietary applications with
|
may consider it more useful to permit linking proprietary applications with
|
||||||
the library. If this is what you want to do, use the GNU Lesser General
|
the library. If this is what you want to do, use the GNU Lesser General
|
||||||
Public License instead of this License. But first, please read
|
Public License instead of this License. But first, please read
|
||||||
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
|
<https://www.gnu.org/philosophy/why-not-lgpl.html>.
|
||||||
|
|||||||
@@ -4994,4 +4994,4 @@ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|||||||
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
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
|
You should have received a copy of the GNU General Public License along with
|
||||||
this program. If not, see <http://www.gnu.org/licenses/>.
|
this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|||||||
@@ -1322,7 +1322,7 @@
|
|||||||
non-standard versions of free() don't like it.
|
non-standard versions of free() don't like it.
|
||||||
|
|
||||||
* configure.in (--enable-dmalloc): Install some support for using
|
* configure.in (--enable-dmalloc): Install some support for using
|
||||||
dmalloc (http://www.dmalloc.com/) with make. Use --enable-dmalloc
|
dmalloc (https://www.dmalloc.com/) with make. Use --enable-dmalloc
|
||||||
with configure to enable it.
|
with configure to enable it.
|
||||||
|
|
||||||
* function.c (function_table_entry): Whoops! The function.c
|
* function.c (function_table_entry): Whoops! The function.c
|
||||||
@@ -6632,7 +6632,7 @@ Fri Nov 1 19:34:28 1991 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
|
|||||||
|
|
||||||
See ChangeLog.1, available in the Git repository at:
|
See ChangeLog.1, available in the Git repository at:
|
||||||
|
|
||||||
http://git.savannah.gnu.org/cgit/make.git/tree/
|
https://git.savannah.gnu.org/cgit/make.git/tree/
|
||||||
|
|
||||||
for earlier changes.
|
for earlier changes.
|
||||||
|
|
||||||
@@ -6650,4 +6650,4 @@ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|||||||
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
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
|
You should have received a copy of the GNU General Public License along with
|
||||||
this program. If not, see <http://www.gnu.org/licenses/>.
|
this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|||||||
10
ChangeLog.3
10
ChangeLog.3
@@ -664,7 +664,7 @@
|
|||||||
characters in its name, pass NULL as the first argument to
|
characters in its name, pass NULL as the first argument to
|
||||||
CreateProcess. This avoids weird failures due to buggy quoting by
|
CreateProcess. This avoids weird failures due to buggy quoting by
|
||||||
CreateProcess. For the details, see the discussion starting at
|
CreateProcess. For the details, see the discussion starting at
|
||||||
http://lists.gnu.org/archive/html/make-w32/2013-04/msg00008.html.
|
https://lists.gnu.org/archive/html/make-w32/2013-04/msg00008.html.
|
||||||
|
|
||||||
* load.c (load_object, load_file): Accept an additional argument
|
* load.c (load_object, load_file): Accept an additional argument
|
||||||
DLP and return in it a pointer that can be used to unload the
|
DLP and return in it a pointer that can be used to unload the
|
||||||
@@ -706,7 +706,7 @@
|
|||||||
(construct_command_argv_internal): Don't treat a backslash as an
|
(construct_command_argv_internal): Don't treat a backslash as an
|
||||||
escape character before whitespace, if the shell is not a Posix
|
escape character before whitespace, if the shell is not a Posix
|
||||||
shell. For the description of the problem, see
|
shell. For the description of the problem, see
|
||||||
http://lists.gnu.org/archive/html/make-w32/2013-04/msg00014.html.
|
https://lists.gnu.org/archive/html/make-w32/2013-04/msg00014.html.
|
||||||
|
|
||||||
2013-05-01 Paul Smith <psmith@gnu.org>
|
2013-05-01 Paul Smith <psmith@gnu.org>
|
||||||
|
|
||||||
@@ -1392,7 +1392,7 @@
|
|||||||
2011-09-16 Paul Smith <psmith@gnu.org>
|
2011-09-16 Paul Smith <psmith@gnu.org>
|
||||||
|
|
||||||
* maintMakefile (do-po-update): Apparently we have to avoid
|
* maintMakefile (do-po-update): Apparently we have to avoid
|
||||||
certificate checks on the http://translationproject.org site now.
|
certificate checks on the https://translationproject.org site now.
|
||||||
|
|
||||||
2011-09-12 Paul Smith <psmith@gnu.org>
|
2011-09-12 Paul Smith <psmith@gnu.org>
|
||||||
|
|
||||||
@@ -5612,7 +5612,7 @@
|
|||||||
|
|
||||||
See ChangeLog.2, available in the Git repository at:
|
See ChangeLog.2, available in the Git repository at:
|
||||||
|
|
||||||
http://git.savannah.gnu.org/cgit/make.git/tree/
|
https://git.savannah.gnu.org/cgit/make.git/tree/
|
||||||
|
|
||||||
for earlier changes.
|
for earlier changes.
|
||||||
|
|
||||||
@@ -5630,4 +5630,4 @@ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|||||||
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
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
|
You should have received a copy of the GNU General Public License along with
|
||||||
this program. If not, see <http://www.gnu.org/licenses/>.
|
this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|||||||
78
Makefile.am
78
Makefile.am
@@ -1,6 +1,6 @@
|
|||||||
# This is a -*-Makefile-*-, or close enough
|
# This is a -*-Makefile-*-, or close enough
|
||||||
#
|
#
|
||||||
# Copyright (C) 1997-2019 Free Software Foundation, Inc.
|
# Copyright (C) 1997-2022 Free Software Foundation, Inc.
|
||||||
# This file is part of GNU Make.
|
# This file is part of GNU Make.
|
||||||
#
|
#
|
||||||
# GNU Make is free software; you can redistribute it and/or modify it under
|
# GNU Make is free software; you can redistribute it and/or modify it under
|
||||||
@@ -14,9 +14,9 @@
|
|||||||
# details.
|
# details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License along with
|
# You should have received a copy of the GNU General Public License along with
|
||||||
# this program. If not, see <http://www.gnu.org/licenses/>.
|
# this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
AUTOMAKE_OPTIONS = dist-bzip2 silent-rules std-options subdir-objects nostdinc
|
AUTOMAKE_OPTIONS = dist-lzip silent-rules std-options subdir-objects nostdinc
|
||||||
ACLOCAL_AMFLAGS = -I m4
|
ACLOCAL_AMFLAGS = -I m4
|
||||||
|
|
||||||
MAKE_HOST = @MAKE_HOST@
|
MAKE_HOST = @MAKE_HOST@
|
||||||
@@ -35,8 +35,9 @@ make_SRCS = src/ar.c src/arscan.c src/commands.c src/commands.h \
|
|||||||
src/hash.c src/hash.h src/implicit.c src/job.c src/job.h \
|
src/hash.c src/hash.h src/implicit.c src/job.c src/job.h \
|
||||||
src/load.c src/loadapi.c src/main.c src/makeint.h src/misc.c \
|
src/load.c src/loadapi.c src/main.c src/makeint.h src/misc.c \
|
||||||
src/os.h src/output.c src/output.h src/read.c src/remake.c \
|
src/os.h src/output.c src/output.h src/read.c src/remake.c \
|
||||||
src/rule.c src/rule.h src/signame.c src/strcache.c \
|
src/rule.c src/rule.h src/shuffle.h src/shuffle.c \
|
||||||
src/variable.c src/variable.h src/version.c src/vpath.c
|
src/signame.c src/strcache.c src/variable.c src/variable.h \
|
||||||
|
src/version.c src/vpath.c
|
||||||
|
|
||||||
w32_SRCS = src/w32/pathstuff.c src/w32/w32os.c src/w32/compat/dirent.c \
|
w32_SRCS = src/w32/pathstuff.c src/w32/w32os.c src/w32/compat/dirent.c \
|
||||||
src/w32/compat/posixfcn.c src/w32/include/dirent.h \
|
src/w32/compat/posixfcn.c src/w32/include/dirent.h \
|
||||||
@@ -59,16 +60,28 @@ loadavg_SRCS = lib/getloadavg.c
|
|||||||
make_SOURCES = $(make_SRCS)
|
make_SOURCES = $(make_SRCS)
|
||||||
EXTRA_make_SOURCES = $(amiga_SRCS) $(vms_SRCS)
|
EXTRA_make_SOURCES = $(amiga_SRCS) $(vms_SRCS)
|
||||||
|
|
||||||
make_LDADD = $(LIBOBJS) $(GUILE_LIBS) lib/libgnu.a $(GETLOADAVG_LIBS) \
|
if HAVE_GUILE
|
||||||
|
_GUILE_CFLAGS = $(GUILE_CFLAGS)
|
||||||
|
_GUILE_LIBS = $(GUILE_LIBS)
|
||||||
|
else
|
||||||
|
_GUILE_CFLAGS =
|
||||||
|
_GUILE_LIBS =
|
||||||
|
endif
|
||||||
|
|
||||||
|
make_LDADD = $(LIBOBJS) $(_GUILE_LIBS) lib/libgnu.a $(GETLOADAVG_LIBS) \
|
||||||
@LIBINTL@
|
@LIBINTL@
|
||||||
|
|
||||||
localedir = $(datadir)/locale
|
localedir = $(datadir)/locale
|
||||||
|
|
||||||
AM_CPPFLAGS = -Isrc -I$(top_srcdir)/src -Ilib -I$(top_srcdir)/lib \
|
AM_CPPFLAGS = -Isrc -I$(top_srcdir)/src -Ilib -I$(top_srcdir)/lib \
|
||||||
-DLIBDIR=\"$(libdir)\" -DINCLUDEDIR=\"$(includedir)\" \
|
-DLIBDIR=\"$(libdir)\" -DLOCALEDIR=\"$(localedir)\"
|
||||||
-DLOCALEDIR=\"$(localedir)\"
|
|
||||||
|
|
||||||
AM_CFLAGS = $(GUILE_CFLAGS)
|
# If prefix is not a standard location, look in prefix as well
|
||||||
|
if !KNOWN_PREFIX
|
||||||
|
AM_CPPFLAGS += -DINCLUDEDIR=\"$(includedir)\"
|
||||||
|
endif
|
||||||
|
|
||||||
|
AM_CFLAGS = $(_GUILE_CFLAGS)
|
||||||
|
|
||||||
if WINDOWSENV
|
if WINDOWSENV
|
||||||
make_SOURCES += $(w32_SRCS)
|
make_SOURCES += $(w32_SRCS)
|
||||||
@@ -94,11 +107,12 @@ m4_FILES = m4/gnulib-cache.m4
|
|||||||
test_FILES = tests/run_make_tests tests/run_make_tests.bat \
|
test_FILES = tests/run_make_tests tests/run_make_tests.bat \
|
||||||
tests/run_make_tests.pl tests/test_driver.pl \
|
tests/run_make_tests.pl tests/test_driver.pl \
|
||||||
tests/config-flags.pm.in tests/config_flags_pm.com \
|
tests/config-flags.pm.in tests/config_flags_pm.com \
|
||||||
tests/mkshadow tests/jhelp.pl tests/guile.supp tests/README
|
tests/config-flags.pm.W32 \
|
||||||
|
tests/mkshadow tests/thelp.pl tests/guile.supp tests/README
|
||||||
# test/scripts are added via dist-hook below.
|
# test/scripts are added via dist-hook below.
|
||||||
|
|
||||||
EXTRA_DIST = ChangeLog README build.sh build.cfg.in $(man_MANS) \
|
EXTRA_DIST = ChangeLog INSTALL README build.sh build.cfg.in $(man_MANS) \
|
||||||
README.customs README.OS2 \
|
src/mkconfig.h README.customs README.OS2 \
|
||||||
README.Amiga SCOPTIONS src/config.ami \
|
README.Amiga SCOPTIONS src/config.ami \
|
||||||
README.DOS builddos.bat src/configh.dos \
|
README.DOS builddos.bat src/configh.dos \
|
||||||
README.W32 build_w32.bat src/config.h.W32 \
|
README.W32 build_w32.bat src/config.h.W32 \
|
||||||
@@ -123,14 +137,14 @@ src/gmk-default.h: $(top_srcdir)/src/gmk-default.scm
|
|||||||
dist-hook:
|
dist-hook:
|
||||||
(cd $(top_srcdir); \
|
(cd $(top_srcdir); \
|
||||||
sub=`find tests/scripts -follow \( -name .git -o -name .deps -o -name work -o -name .gitignore -o -name \*.orig -o -name \*.rej -o -name \*~ -o -name \*.out -o -name Makefile \) -prune -o -type f -print`; \
|
sub=`find tests/scripts -follow \( -name .git -o -name .deps -o -name work -o -name .gitignore -o -name \*.orig -o -name \*.rej -o -name \*~ -o -name \*.out -o -name Makefile \) -prune -o -type f -print`; \
|
||||||
tar chf - $$sub) \
|
$(AMTAR) chf - $$sub) \
|
||||||
| (cd $(distdir); tar xfBp -)
|
| (cd $(distdir); $(AMTAR) xfBp -)
|
||||||
|
|
||||||
|
|
||||||
# --------------- Local CHECK Section
|
# --------------- Local CHECK Section
|
||||||
|
|
||||||
check-local: check-regression
|
check-local: check-regression
|
||||||
@banner=" Regression PASSED: GNU Make $(VERSION) ($(MAKE_HOST)) built with $(CC) "; \
|
@banner=" Regression PASSED: $(PACKAGE_STRING) ($(MAKE_HOST)) built with $(CC) "; \
|
||||||
dashes=`echo "$$banner" | sed s/./=/g`; \
|
dashes=`echo "$$banner" | sed s/./=/g`; \
|
||||||
echo; \
|
echo; \
|
||||||
echo "$$dashes"; \
|
echo "$$dashes"; \
|
||||||
@@ -148,7 +162,24 @@ MAKETESTFLAGS =
|
|||||||
|
|
||||||
.PHONY: check-regression
|
.PHONY: check-regression
|
||||||
|
|
||||||
|
GMK_OUTDIR = ..
|
||||||
|
|
||||||
|
testlog = test-suite.log
|
||||||
|
testresult = tests/.test-result
|
||||||
|
errorpre = makeerror-$(PACKAGE_VERSION)-$(host_triplet)
|
||||||
|
|
||||||
|
testfiles = $(testlog) $(testresult) $(errorfile)
|
||||||
|
MOSTLYCLEANFILES = $(testfiles)
|
||||||
|
|
||||||
|
errordetails = config.status config.log src/config.h $(testlog) tests/work
|
||||||
|
|
||||||
|
# Create a 4-letter random sequence
|
||||||
|
rand_value = c = "abcdefghijklmnopqrstuvwxyz0123456789"
|
||||||
|
rand_char = substr(c,int(rand()*36),1)
|
||||||
|
rand_string = $(AWK) 'BEGIN{srand(); $(rand_value); print $(rand_char) "" $(rand_char) "" $(rand_char) "" $(rand_char);}'
|
||||||
|
|
||||||
check-regression: tests/config-flags.pm
|
check-regression: tests/config-flags.pm
|
||||||
|
@rm -f $(testfiles)
|
||||||
@if test -f '$(top_srcdir)/tests/run_make_tests'; then \
|
@if test -f '$(top_srcdir)/tests/run_make_tests'; then \
|
||||||
ulimit -n 128; \
|
ulimit -n 128; \
|
||||||
if $(PERL) -v >/dev/null 2>&1; then \
|
if $(PERL) -v >/dev/null 2>&1; then \
|
||||||
@@ -156,17 +187,26 @@ check-regression: tests/config-flags.pm
|
|||||||
*) test -d tests || mkdir tests; \
|
*) test -d tests || mkdir tests; \
|
||||||
rm -f srctests; \
|
rm -f srctests; \
|
||||||
if ln -s '$(top_srcdir)/tests' srctests; then \
|
if ln -s '$(top_srcdir)/tests' srctests; then \
|
||||||
for f in run_make_tests run_make_tests.pl test_driver.pl scripts jhelp.pl; do \
|
for f in run_make_tests run_make_tests.pl test_driver.pl scripts thelp.pl; do \
|
||||||
rm -f tests/$$f; ln -s ../srctests/$$f tests; \
|
rm -f tests/$$f; ln -s ../srctests/$$f tests; \
|
||||||
done; fi ;; \
|
done; fi ;; \
|
||||||
esac; \
|
esac; \
|
||||||
echo "cd tests && $(PERL) ./run_make_tests.pl -srcdir $(abs_top_srcdir) -make ../make$(EXEEXT) $(MAKETESTFLAGS)"; \
|
echo "cd tests && $(PERL) $(PERLFLAGS) ./run_make_tests.pl -srcdir $(abs_top_srcdir) -make $(GMK_OUTDIR)/make$(EXEEXT) $(MAKETESTFLAGS)"; \
|
||||||
cd tests && $(PERL) ./run_make_tests.pl -srcdir '$(abs_top_srcdir)' -make '../make$(EXEEXT)' $(MAKETESTFLAGS); \
|
(cd tests && $(PERL) $(PERLFLAGS) ./run_make_tests.pl -srcdir '$(abs_top_srcdir)' -make '$(GMK_OUTDIR)/make$(EXEEXT)' $(MAKETESTFLAGS); echo $$? >.test-result) 2>&1 | tee $(testlog); \
|
||||||
|
er=$$(cat $(testresult)); if test "$$er" -ne 0; then \
|
||||||
|
dirnm="$(errorpre)-$$($(rand_string))"; fnm="$$dirnm.tar.gz"; \
|
||||||
|
rm -rf "$$dirnm"; mkdir "$$dirnm"; \
|
||||||
|
$(AMTAR) chf - $(errordetails) | (cd "$$dirnm"; $(AMTAR) xf -); \
|
||||||
|
$(AMTAR) chf - "$$dirnm" | eval GZIP= gzip $(GZIP_ENV) -c >"$$fnm"; \
|
||||||
|
echo "*** Testing FAILED! Details: $$fnm"; \
|
||||||
|
echo '*** Please report to <$(PACKAGE_BUGREPORT)>'; echo; \
|
||||||
|
exit $$er; \
|
||||||
|
fi; \
|
||||||
else \
|
else \
|
||||||
echo "Can't find a working Perl ($(PERL)); the test suite requires Perl."; \
|
echo "Can't find a working Perl ($(PERL)); the test suite requires Perl."; \
|
||||||
fi; \
|
fi; \
|
||||||
else \
|
else \
|
||||||
echo "Can't find the GNU Make test suite ($(top_srcdir)/tests)."; \
|
echo "Can't find the $(PACKAGE_NAME) test suite ($(top_srcdir)/tests)."; \
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
267
NEWS
267
NEWS
@@ -1,19 +1,211 @@
|
|||||||
GNU make NEWS -*-indented-text-*-
|
GNU Make NEWS -*-indented-text-*-
|
||||||
History of user-visible changes.
|
History of user-visible changes.
|
||||||
16 September 2019
|
31 October 2022
|
||||||
|
|
||||||
See the end of this file for copyrights and conditions.
|
See the end of this file for copyrights and conditions.
|
||||||
|
|
||||||
All user-visible changes are more fully described in the GNU make manual,
|
All user-visible changes are more fully described in the GNU Make manual,
|
||||||
which is contained in this distribution as the file doc/make.texi.
|
which is contained in this distribution as the file doc/make.texi.
|
||||||
See the README file and the GNU make manual for instructions for
|
See the README file and the GNU Make manual for instructions for
|
||||||
reporting bugs.
|
reporting bugs.
|
||||||
|
|
||||||
Version 4.2.91 (16 Sep 2019)
|
Version 4.4 (31 Oct 2022)
|
||||||
|
|
||||||
A complete list of bugs fixed in this version is available here:
|
A complete list of bugs fixed in this version is available here:
|
||||||
|
|
||||||
http://sv.gnu.org/bugs/index.php?group=make&report_id=111&fix_release_id=108&set=custom
|
https://sv.gnu.org/bugs/index.php?group=make&report_id=111&fix_release_id=109&set=custom
|
||||||
|
|
||||||
|
* WARNING: Deprecation!
|
||||||
|
The following systems are deprecated in this release:
|
||||||
|
- OS/2 (EMX)
|
||||||
|
- AmigaOS
|
||||||
|
- Xenix
|
||||||
|
- Cray
|
||||||
|
In the NEXT release of GNU Make, support for these systems will be removed.
|
||||||
|
If you want to see them continue to be supported, contact <bug-make@gnu.org>.
|
||||||
|
|
||||||
|
* WARNING: Future backward-incompatibility!
|
||||||
|
In the NEXT release of GNU Make, pattern rules will implement the same
|
||||||
|
behavior change for multiple targets as explicit grouped targets, below: if
|
||||||
|
any target of the rule is needed by the build, the recipe will be invoked if
|
||||||
|
any target of the rule is missing or out of date. During testing some
|
||||||
|
makefiles were found to contain pattern rules that do not build all targets;
|
||||||
|
this can cause issues so we are delaying this change for one release cycle
|
||||||
|
to allow these makefiles to be updated. GNU Make shows a warning if it
|
||||||
|
detects this situation: "pattern recipe did not update peer target".
|
||||||
|
|
||||||
|
* WARNING: Backward-incompatibility!
|
||||||
|
GNU Make now uses temporary files in more situations than previous releases.
|
||||||
|
If your build system sets TMPDIR (or TMP or TEMP on Windows) and deletes the
|
||||||
|
contents during the build, or uses restrictive permissions, this may cause
|
||||||
|
problems. You can choose an alternative temporary directory only for use by
|
||||||
|
GNU Make by setting the new MAKE_TMPDIR environment variable before invoking
|
||||||
|
make. Note that this value CANNOT be set inside the makefile, since make
|
||||||
|
needs to find its temporary directory before the makefiles are parsed.
|
||||||
|
|
||||||
|
* WARNING: Backward-incompatibility!
|
||||||
|
Previously each target in a explicit grouped target rule was considered
|
||||||
|
individually: if the targets needed by the build were not out of date the
|
||||||
|
recipe was not run even if other targets in the group were out of date. Now
|
||||||
|
if any of the grouped targets are needed by the build, then if any of the
|
||||||
|
grouped targets are out of date the recipe is run and all targets in the
|
||||||
|
group are considered updated.
|
||||||
|
|
||||||
|
* WARNING: Backward-incompatibility!
|
||||||
|
Previously if --no-print-directory was seen anywhere in the environment or
|
||||||
|
command line it would take precedence over any --print-directory. Now, the
|
||||||
|
last setting of directory printing options seen will be used, so a command
|
||||||
|
line such as "--no-print-directory -w" _will_ show directory entry/exits.
|
||||||
|
|
||||||
|
* WARNING: Backward-incompatibility!
|
||||||
|
Previously the order in which makefiles were remade was not explicitly
|
||||||
|
stated, but it was (roughly) the inverse of the order in which they were
|
||||||
|
processed by make. In this release, the order in which makefiles are
|
||||||
|
rebuilt is the same order in which make processed them, and this is defined
|
||||||
|
to be true in the GNU Make manual.
|
||||||
|
|
||||||
|
* WARNING: Backward-incompatibility!
|
||||||
|
Previously only simple (one-letter) options were added to the MAKEFLAGS
|
||||||
|
variable that was visible while parsing makefiles. Now, all options are
|
||||||
|
available in MAKEFLAGS. If you want to check MAKEFLAGS for a one-letter
|
||||||
|
option, expanding "$(firstword -$(MAKEFLAGS))" is a reliable way to return
|
||||||
|
the set of one-letter options which can be examined via findstring, etc.
|
||||||
|
|
||||||
|
* WARNING: Backward-incompatibility!
|
||||||
|
Previously makefile variables marked as export were not exported to commands
|
||||||
|
started by the $(shell ...) function. Now, all exported variables are
|
||||||
|
exported to $(shell ...). If this leads to recursion during expansion, then
|
||||||
|
for backward-compatibility the value from the original environment is used.
|
||||||
|
To detect this change search for 'shell-export' in the .FEATURES variable.
|
||||||
|
|
||||||
|
* WARNING: New build requirement
|
||||||
|
GNU Make utilizes facilities from GNU Gnulib: Gnulib requires certain C99
|
||||||
|
features in the C compiler and so these features are required by GNU Make:
|
||||||
|
https://www.gnu.org/software/gnulib/manual/html_node/C99-features-assumed.html
|
||||||
|
The configure script should verify the compiler has these features.
|
||||||
|
|
||||||
|
* New feature: The .WAIT special target
|
||||||
|
If the .WAIT target appears between two prerequisites of a target, then
|
||||||
|
GNU Make will wait for all of the targets to the left of .WAIT in the list
|
||||||
|
to complete before starting any of the targets to the right of .WAIT.
|
||||||
|
This feature is available in some other versions of make, and it will be
|
||||||
|
required by an upcoming version of the POSIX standard for make.
|
||||||
|
Different patches were made by Alexey Neyman <alex.neyman@auriga.ru> (2005)
|
||||||
|
and Steffen Nurpmeso <steffen@sdaoden.eu> (2020) that were useful but the
|
||||||
|
result is a different implementation (closer to Alexey's idea).
|
||||||
|
|
||||||
|
* New feature: .NOTPARALLEL accepts prerequisites
|
||||||
|
If the .NOTPARALLEL special target has prerequisites then all prerequisites
|
||||||
|
of those targets will be run serially (as if .WAIT was specified between
|
||||||
|
each prerequisite).
|
||||||
|
|
||||||
|
* New feature: The .NOTINTERMEDIATE special target
|
||||||
|
.NOTINTERMEDIATE disables intermediate behavior for specific files, for all
|
||||||
|
files built using a pattern, or for the entire makefile.
|
||||||
|
Implementation provided by Dmitry Goncharov <dgoncharov@users.sf.net>
|
||||||
|
|
||||||
|
* New feature: The $(let ...) function
|
||||||
|
This function allows user-defined functions to define a set of local
|
||||||
|
variables: values can be assigned to these variables from within the
|
||||||
|
user-defined function and they will not impact global variable assignments.
|
||||||
|
Implementation provided by Jouke Witteveen <j.witteveen@gmail.com>
|
||||||
|
|
||||||
|
* New feature: The $(intcmp ...) function
|
||||||
|
This function allows conditional evaluation controlled by a numerical
|
||||||
|
comparison.
|
||||||
|
Implementation provided by Jouke Witteveen <j.witteveen@gmail.com>
|
||||||
|
|
||||||
|
* New feature: Improved support for -l / --load-average
|
||||||
|
On systems that provide /proc/loadavg (Linux), GNU Make will use it to
|
||||||
|
determine the number of runnable jobs and use this as the current load,
|
||||||
|
avoiding the need for heuristics.
|
||||||
|
Implementation provided by Sven C. Dack <sdack@gmx.com>
|
||||||
|
|
||||||
|
* New feature: The --shuffle command line option
|
||||||
|
This option reorders goals and prerequisites to simulate non-determinism
|
||||||
|
that may be seen using parallel build. Shuffle mode allows a form of "fuzz
|
||||||
|
testing" of parallel builds to verify that all prerequisites are correctly
|
||||||
|
described in the makefile.
|
||||||
|
Implementation provided by Sergei Trofimovich <siarheit@google.com>
|
||||||
|
|
||||||
|
* New feature: The --jobserver-style command line option and named pipes
|
||||||
|
A new jobserver method is used on systems where mkfifo(3) is supported.
|
||||||
|
This solves a number of obscure issues related to using the jobserver
|
||||||
|
and recursive invocations of GNU Make. This change means that sub-makes
|
||||||
|
will connect to the jobserver even if they are not marked as recursive.
|
||||||
|
It also means that other tools that want to participate in the jobserver
|
||||||
|
will need to be enhanced as described in the GNU Make manual.
|
||||||
|
You can force GNU Make to use the simple pipe-based jobserver (perhaps if
|
||||||
|
you are integrating with other tools or older versions of GNU Make) by
|
||||||
|
adding the '--jobserver-style=pipe' option to the command line of the
|
||||||
|
top-level invocation of GNU Make, or via MAKEFLAGS or GNUMAKEFLAGS.
|
||||||
|
To detect this change search for 'jobserver-fifo' in the .FEATURES variable.
|
||||||
|
|
||||||
|
* Some POSIX systems (*BSD) do not allow locks to be taken on pipes, which
|
||||||
|
caused the output sync feature to not work properly there. Also multiple
|
||||||
|
invocations of make redirecting to the same output file (e.g., /dev/null)
|
||||||
|
would cause hangs. Instead of locking stdout (which does have some useful
|
||||||
|
performance characteristics, but is not portable) create a temporary file
|
||||||
|
and lock that. Windows continues to use a mutex as before.
|
||||||
|
|
||||||
|
* GNU Make has sometimes chosen unexpected, and sub-optimal, chains of
|
||||||
|
implicit rules due to the definition of "ought to exist" in the implicit
|
||||||
|
rule search algorithm, which considered any prerequisite mentioned in the
|
||||||
|
makefile as "ought to exist". This algorithm has been modified to prefer
|
||||||
|
prerequisites mentioned explicitly in the target being built and only if
|
||||||
|
that results in no matching rule, will GNU Make consider prerequisites
|
||||||
|
mentioned in other targets as "ought to exist".
|
||||||
|
Implementation provided by Dmitry Goncharov <dgoncharov@users.sf.net>
|
||||||
|
|
||||||
|
* GNU Make was performing secondary expansion of all targets, even targets
|
||||||
|
which didn't need to be considered during the build. In this release
|
||||||
|
only targets which are considered will be secondarily expanded.
|
||||||
|
Implementation provided by Dmitry Goncharov <dgoncharov@users.sf.net>
|
||||||
|
|
||||||
|
* If the MAKEFLAGS variable is modified in a makefile, it will be re-parsed
|
||||||
|
immediately rather than after all makefiles have been read. Note that
|
||||||
|
although all options are parsed immediately, some special effects won't
|
||||||
|
appear until after all makefiles are read.
|
||||||
|
|
||||||
|
* The -I option accepts an argument "-" (e.g., "-I-") which means "reset the
|
||||||
|
list of search directories to empty". Among other things this can be used
|
||||||
|
to prevent GNU Make from searching in its default list of directories.
|
||||||
|
|
||||||
|
* New debug option "print" will show the recipe to be run, even when silent
|
||||||
|
mode is set, and new debug option "why" will show why a target is rebuilt
|
||||||
|
(which prerequisites caused the target to be considered out of date).
|
||||||
|
Implementation provided by David Boyce <David.S.Boyce@gmail.com>
|
||||||
|
|
||||||
|
* The existing --trace option is made equivalent to --debug=print,why
|
||||||
|
|
||||||
|
* Target-specific variables can now be marked "unexport".
|
||||||
|
|
||||||
|
* Exporting / unexporting target-specific variables is handled correctly, so
|
||||||
|
that the attribute of the most specific variable setting is used.
|
||||||
|
|
||||||
|
* Special targets like .POSIX are detected upon definition, ensuring that any
|
||||||
|
change in behavior takes effect immediately, before the next line is parsed.
|
||||||
|
|
||||||
|
* When the pipe-based jobserver is enabled and GNU Make decides it is invoking
|
||||||
|
a non-make sub-process and closes the jobserver pipes, it will now add a new
|
||||||
|
option to the MAKEFLAGS environment variable that disables the jobserver.
|
||||||
|
This prevents sub-processes that invoke make from accidentally using other
|
||||||
|
open file descriptors as jobserver pipes. For more information see
|
||||||
|
https://savannah.gnu.org/bugs/?57242 and https://savannah.gnu.org/bugs/?62397
|
||||||
|
|
||||||
|
* A long-standing issue with the directory cache has been resolved: changes
|
||||||
|
made as a side-effect of some other target's recipe are now noticed as
|
||||||
|
expected.
|
||||||
|
|
||||||
|
* GNU Make can now be built for MS-Windows using the Tiny C tcc compiler.
|
||||||
|
Port provided by Christian Jullien <eligis@orange.fr>
|
||||||
|
|
||||||
|
|
||||||
|
Version 4.3 (19 Jan 2020)
|
||||||
|
|
||||||
|
A complete list of bugs fixed in this version is available here:
|
||||||
|
|
||||||
|
https://sv.gnu.org/bugs/index.php?group=make&report_id=111&fix_release_id=108&set=custom
|
||||||
|
|
||||||
* WARNING: Backward-incompatibility!
|
* WARNING: Backward-incompatibility!
|
||||||
Number signs (#) appearing inside a macro reference or function invocation
|
Number signs (#) appearing inside a macro reference or function invocation
|
||||||
@@ -36,17 +228,24 @@ http://sv.gnu.org/bugs/index.php?group=make&report_id=111&fix_release_id=108&set
|
|||||||
add a trailing space.
|
add a trailing space.
|
||||||
|
|
||||||
* WARNING: Backward-incompatibility!
|
* WARNING: Backward-incompatibility!
|
||||||
On Linux, and any other systems that provide a /proc/loadavg with similar
|
Previously using the .SILENT pseudo-target in a makefile would force all
|
||||||
syntax, the -l/--load-average option will consult that file to determine how
|
sub-makes to be invoked with the '-s' option, effectively making all
|
||||||
many CPUs are busy at that moment and compare that value to the load value
|
sub-makes silent as well. In this release .SILENT only affects the current
|
||||||
requested. This allows usage such as "-j -lN" for N-processor systems
|
invocation of make. A side-effect of this is that .SILENT will no longer
|
||||||
without fear of overload during initial startup.
|
enable the --no-print-directory option, which using -s will do.
|
||||||
Patch provided by Sven C. Dack <sven.c.dack@sky.com>
|
|
||||||
|
|
||||||
* WARNING: Backward-incompatibility!
|
* NOTE: Deprecated behavior.
|
||||||
Contrary to the documentation, suffix rules with prerequisites were being
|
Contrary to the documentation, suffix rules with prerequisites are being
|
||||||
treated BOTH as simple targets AND as pattern rules. Behavior now matches
|
treated BOTH as simple targets AND as pattern rules. Further, the
|
||||||
the documentation, and pattern rules are no longer created in this case.
|
prerequisites are ignored by the pattern rules. POSIX specifies that in
|
||||||
|
order to be a suffix rule there can be no prerequisites defined. In this
|
||||||
|
release if POSIX mode is enabled then rules with prerequisites cannot be
|
||||||
|
suffix rules. If POSIX mode is not enabled then the previous behavior is
|
||||||
|
preserved (a pattern rule with no extra prerequisites is created) AND a
|
||||||
|
warning about this behavior is generated:
|
||||||
|
warning: ignoring prerequisites on suffix rule definition
|
||||||
|
The POSIX behavior will be adopted as the only behavior in a future release
|
||||||
|
of GNU make so please resolve any warnings.
|
||||||
|
|
||||||
* New feature: Grouped explicit targets
|
* New feature: Grouped explicit targets
|
||||||
Pattern rules have always had the ability to generate multiple targets with
|
Pattern rules have always had the ability to generate multiple targets with
|
||||||
@@ -56,13 +255,21 @@ http://sv.gnu.org/bugs/index.php?group=make&report_id=111&fix_release_id=108&set
|
|||||||
search for 'grouped-target' in the .FEATURES special variable.
|
search for 'grouped-target' in the .FEATURES special variable.
|
||||||
Implementation contributed by Kaz Kylheku <kaz@kylheku.com>
|
Implementation contributed by Kaz Kylheku <kaz@kylheku.com>
|
||||||
|
|
||||||
|
* New feature: .EXTRA_PREREQS variable
|
||||||
|
Words in this variable are considered prerequisites of targets but they are
|
||||||
|
not added to any of the automatic variable values when expanding the
|
||||||
|
recipe. This variable can either be global (applies to all targets) or
|
||||||
|
a target-specific variable. To detect this feature search for 'extra-prereqs'
|
||||||
|
in the .FEATURES special variable.
|
||||||
|
Implementation contributed by Christof Warlich <cwarlich@gmx.de>
|
||||||
|
|
||||||
* Makefiles can now specify the '-j' option in their MAKEFLAGS variable and
|
* Makefiles can now specify the '-j' option in their MAKEFLAGS variable and
|
||||||
this will cause make to enable that parallelism mode.
|
this will cause make to enable that parallelism mode.
|
||||||
|
|
||||||
* GNU make will now use posix_spawn() on systems where it is available.
|
* GNU make will now use posix_spawn() on systems where it is available.
|
||||||
If you prefer to use fork/exec even on systems where posix_spawn() is
|
If you prefer to use fork/exec even on systems where posix_spawn() is
|
||||||
present, you can use the --disable-posix-spawn option to configure. Aron
|
present, you can use the --disable-posix-spawn option to configure.
|
||||||
Barath <baratharon@caesar.elte.hu> provided the basic implementation.
|
Implementation contributed by Aron Barath <baratharon@caesar.elte.hu>
|
||||||
|
|
||||||
* Error messages printed when invoking non-existent commands have been cleaned
|
* Error messages printed when invoking non-existent commands have been cleaned
|
||||||
up and made consistent.
|
up and made consistent.
|
||||||
@@ -100,7 +307,7 @@ Version 4.2.1 (10 Jun 2016)
|
|||||||
|
|
||||||
A complete list of bugs fixed in this version is available here:
|
A complete list of bugs fixed in this version is available here:
|
||||||
|
|
||||||
http://sv.gnu.org/bugs/index.php?group=make&report_id=111&fix_release_id=107&set=custom
|
https://sv.gnu.org/bugs/index.php?group=make&report_id=111&fix_release_id=107&set=custom
|
||||||
|
|
||||||
This release is a bug-fix release.
|
This release is a bug-fix release.
|
||||||
|
|
||||||
@@ -109,7 +316,7 @@ Version 4.2 (22 May 2016)
|
|||||||
|
|
||||||
A complete list of bugs fixed in this version is available here:
|
A complete list of bugs fixed in this version is available here:
|
||||||
|
|
||||||
http://sv.gnu.org/bugs/index.php?group=make&report_id=111&fix_release_id=106&set=custom
|
https://sv.gnu.org/bugs/index.php?group=make&report_id=111&fix_release_id=106&set=custom
|
||||||
|
|
||||||
* New variable: $(.SHELLSTATUS) is set to the exit status of the last != or
|
* New variable: $(.SHELLSTATUS) is set to the exit status of the last != or
|
||||||
$(shell ...) function invoked in this instance of make. This will be "0" if
|
$(shell ...) function invoked in this instance of make. This will be "0" if
|
||||||
@@ -148,7 +355,7 @@ Version 4.1 (05 Oct 2014)
|
|||||||
|
|
||||||
A complete list of bugs fixed in this version is available here:
|
A complete list of bugs fixed in this version is available here:
|
||||||
|
|
||||||
http://sv.gnu.org/bugs/index.php?group=make&report_id=111&fix_release_id=105&set=custom
|
https://sv.gnu.org/bugs/index.php?group=make&report_id=111&fix_release_id=105&set=custom
|
||||||
|
|
||||||
* New variables: $(MAKE_TERMOUT) and $(MAKE_TERMERR) are set to non-empty
|
* New variables: $(MAKE_TERMOUT) and $(MAKE_TERMERR) are set to non-empty
|
||||||
values if stdout or stderr, respectively, are believed to be writing to a
|
values if stdout or stderr, respectively, are believed to be writing to a
|
||||||
@@ -196,7 +403,7 @@ Version 4.0 (09 Oct 2013)
|
|||||||
|
|
||||||
A complete list of bugs fixed in this version is available here:
|
A complete list of bugs fixed in this version is available here:
|
||||||
|
|
||||||
http://sv.gnu.org/bugs/index.php?group=make&report_id=111&fix_release_id=101&set=custom
|
https://sv.gnu.org/bugs/index.php?group=make&report_id=111&fix_release_id=101&set=custom
|
||||||
|
|
||||||
* WARNING: Backward-incompatibility!
|
* WARNING: Backward-incompatibility!
|
||||||
If .POSIX is specified, then make adheres to the POSIX backslash/newline
|
If .POSIX is specified, then make adheres to the POSIX backslash/newline
|
||||||
@@ -248,7 +455,7 @@ http://sv.gnu.org/bugs/index.php?group=make&report_id=111&fix_release_id=101&set
|
|||||||
* New feature: "::=" simple assignment operator as defined by POSIX in 2012.
|
* New feature: "::=" simple assignment operator as defined by POSIX in 2012.
|
||||||
This operator has identical functionality to ":=" in GNU make, but will be
|
This operator has identical functionality to ":=" in GNU make, but will be
|
||||||
portable to any implementation of make conforming to a sufficiently new
|
portable to any implementation of make conforming to a sufficiently new
|
||||||
version of POSIX (see http://austingroupbugs.net/view.php?id=330). It is
|
version of POSIX (see https://austingroupbugs.net/view.php?id=330). It is
|
||||||
not necessary to define the .POSIX target to access this operator.
|
not necessary to define the .POSIX target to access this operator.
|
||||||
|
|
||||||
* New feature: Loadable objects
|
* New feature: Loadable objects
|
||||||
@@ -300,7 +507,7 @@ Version 3.82 (28 Jul 2010)
|
|||||||
|
|
||||||
A complete list of bugs fixed in this version is available here:
|
A complete list of bugs fixed in this version is available here:
|
||||||
|
|
||||||
http://sv.gnu.org/bugs/index.php?group=make&report_id=111&fix_release_id=104&set=custom
|
https://sv.gnu.org/bugs/index.php?group=make&report_id=111&fix_release_id=104&set=custom
|
||||||
|
|
||||||
* Compiling GNU make now requires a conforming ISO C 1989 compiler and
|
* Compiling GNU make now requires a conforming ISO C 1989 compiler and
|
||||||
standard runtime library.
|
standard runtime library.
|
||||||
@@ -465,7 +672,7 @@ Version 3.81 (01 Apr 2006)
|
|||||||
might have caused the target to rebuild. Starting with the _next_
|
might have caused the target to rebuild. Starting with the _next_
|
||||||
release of GNU make, '$?' will contain all prerequisites that caused
|
release of GNU make, '$?' will contain all prerequisites that caused
|
||||||
the target to be considered out of date.
|
the target to be considered out of date.
|
||||||
See http://savannah.gnu.org/bugs/?16051
|
See https://savannah.gnu.org/bugs/?16051
|
||||||
|
|
||||||
* WARNING: Backward-incompatibility!
|
* WARNING: Backward-incompatibility!
|
||||||
GNU make now implements a generic "second expansion" feature on the
|
GNU make now implements a generic "second expansion" feature on the
|
||||||
@@ -589,7 +796,7 @@ Version 3.81 (01 Apr 2006)
|
|||||||
|
|
||||||
A complete list of bugs fixed in this version is available here:
|
A complete list of bugs fixed in this version is available here:
|
||||||
|
|
||||||
http://savannah.gnu.org/bugs/index.php?group=make&report_id=111&fix_release_id=103
|
https://savannah.gnu.org/bugs/index.php?group=make&report_id=111&fix_release_id=103
|
||||||
|
|
||||||
|
|
||||||
Version 3.80 (03 Oct 2002)
|
Version 3.80 (03 Oct 2002)
|
||||||
@@ -707,7 +914,7 @@ Version 3.80 (03 Oct 2002)
|
|||||||
|
|
||||||
A complete list of bugs fixed in this version is available here:
|
A complete list of bugs fixed in this version is available here:
|
||||||
|
|
||||||
http://savannah.gnu.org/bugs/index.php?group=make&report_id=111&fix_release_id=102
|
https://savannah.gnu.org/bugs/index.php?group=make&report_id=111&fix_release_id=102
|
||||||
|
|
||||||
|
|
||||||
Version 3.79.1 (23 Jun 2000)
|
Version 3.79.1 (23 Jun 2000)
|
||||||
@@ -921,7 +1128,7 @@ Version 3.77 (28 Jul 1998)
|
|||||||
This port was done by Klaus Kämpf <kkaempf@rmi.de>
|
This port was done by Klaus Kämpf <kkaempf@rmi.de>
|
||||||
|
|
||||||
* There is first-level support available from proGIS Software, Germany.
|
* There is first-level support available from proGIS Software, Germany.
|
||||||
Visit their web-site at http://www.progis.de to get information
|
Visit their web-site at https://www.progis.de to get information
|
||||||
about other vms software and forthcoming updates to gnu make.
|
about other vms software and forthcoming updates to gnu make.
|
||||||
|
|
||||||
* /bin/sh style I/O redirection is supported. You can now write lines like
|
* /bin/sh style I/O redirection is supported. You can now write lines like
|
||||||
@@ -1611,7 +1818,7 @@ Version 3.05
|
|||||||
(Changes from versions 1 through 3.05 were never recorded. Sorry.)
|
(Changes from versions 1 through 3.05 were never recorded. Sorry.)
|
||||||
|
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 1988-2019 Free Software Foundation, Inc.
|
Copyright (C) 1988-2022 Free Software Foundation, Inc.
|
||||||
This file is part of GNU Make.
|
This file is part of GNU Make.
|
||||||
|
|
||||||
GNU Make is free software; you can redistribute it and/or modify it under the
|
GNU Make is free software; you can redistribute it and/or modify it under the
|
||||||
@@ -1624,4 +1831,4 @@ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|||||||
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
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
|
You should have received a copy of the GNU General Public License along with
|
||||||
this program. If not, see <http://www.gnu.org/licenses/>.
|
this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|||||||
14
README.Amiga
14
README.Amiga
@@ -1,11 +1,11 @@
|
|||||||
Short: Port of GNU make with SAS/C (no ixemul.library required)
|
Short: Port of GNU Make with SAS/C (no ixemul.library required)
|
||||||
Author: GNU, Amiga port by Aaron "Optimizer" Digulla
|
Author: GNU, Amiga port by Aaron "Optimizer" Digulla
|
||||||
Uploader: Aaron "Optimizer" Digulla (digulla@fh-konstanz.de)
|
Uploader: Aaron "Optimizer" Digulla (digulla@fh-konstanz.de)
|
||||||
Type: dev/c
|
Type: dev/c
|
||||||
|
|
||||||
This is a pure Amiga port of GNU make. It needs no extra libraries or
|
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
|
anything. It has the following features (in addition to any features of
|
||||||
GNU make):
|
GNU Make):
|
||||||
|
|
||||||
- Runs Amiga-Commands with SystemTags() (Execute)
|
- Runs Amiga-Commands with SystemTags() (Execute)
|
||||||
- Can run multi-line statements
|
- Can run multi-line statements
|
||||||
@@ -44,9 +44,9 @@ COMPILING FROM SCRATCH
|
|||||||
|
|
||||||
To recompile, you need SAS/C 6.51.
|
To recompile, you need SAS/C 6.51.
|
||||||
|
|
||||||
As of GNU make 4.3, the build environment has been cleaned up and alternate
|
As of GNU Make 4.3, the build environment has been cleaned up and alternate
|
||||||
make files (including smakefiles) have been removed. If you have an existing
|
make files (including smakefiles) have been removed. If you have an existing
|
||||||
version of GNU make available you _should_ be able to run:
|
version of GNU Make available you _should_ be able to run:
|
||||||
|
|
||||||
make -f Basic.mk
|
make -f Basic.mk
|
||||||
|
|
||||||
@@ -64,7 +64,7 @@ If you plan to use recursive makes, install make resident:
|
|||||||
|
|
||||||
|
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 1995-2019 Free Software Foundation, Inc.
|
Copyright (C) 1995-2022 Free Software Foundation, Inc.
|
||||||
This file is part of GNU Make.
|
This file is part of GNU Make.
|
||||||
|
|
||||||
GNU Make is free software; you can redistribute it and/or modify it under the
|
GNU Make is free software; you can redistribute it and/or modify it under the
|
||||||
@@ -77,4 +77,4 @@ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|||||||
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
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
|
You should have received a copy of the GNU General Public License along with
|
||||||
this program. If not, see <http://www.gnu.org/licenses/>.
|
this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ To build from sources:
|
|||||||
|
|
||||||
6. To install copy make.exe to the preferred location.
|
6. To install copy make.exe to the preferred location.
|
||||||
|
|
||||||
Since GNU make 4.3, support for customized platform installations
|
Since GNU Make 4.3, support for customized platform installations
|
||||||
has been removed. If you'd like to collaborate on reinstating
|
has been removed. If you'd like to collaborate on reinstating
|
||||||
these capabilities, contact bug-make@gnu.org.
|
these capabilities, contact bug-make@gnu.org.
|
||||||
|
|
||||||
@@ -280,7 +280,7 @@ Bug reports:
|
|||||||
|
|
||||||
|
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 1996-2019 Free Software Foundation, Inc.
|
Copyright (C) 1996-2022 Free Software Foundation, Inc.
|
||||||
This file is part of GNU Make.
|
This file is part of GNU Make.
|
||||||
|
|
||||||
GNU Make is free software; you can redistribute it and/or modify it under the
|
GNU Make is free software; you can redistribute it and/or modify it under the
|
||||||
@@ -293,4 +293,4 @@ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|||||||
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
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
|
You should have received a copy of the GNU General Public License along with
|
||||||
this program. If not, see <http://www.gnu.org/licenses/>.
|
this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
Port of GNU make to OS/2.
|
Port of GNU Make to OS/2.
|
||||||
|
|
||||||
Features of GNU make that do not work under OS/2:
|
Features of GNU Make that do not work under OS/2:
|
||||||
- remote job execution
|
- remote job execution
|
||||||
- dynamic load balancing
|
- dynamic load balancing
|
||||||
|
|
||||||
@@ -9,7 +9,7 @@ Special features of the OS/2 version:
|
|||||||
|
|
||||||
Due to the fact that some people might want to use sh syntax in
|
Due to the fact that some people might want to use sh syntax in
|
||||||
Makefiles while others might want to use OS/2's native shell cmd.exe,
|
Makefiles while others might want to use OS/2's native shell cmd.exe,
|
||||||
GNU make supports both shell types. The following list defines the order
|
GNU Make supports both shell types. The following list defines the order
|
||||||
that is used to determine the shell:
|
that is used to determine the shell:
|
||||||
|
|
||||||
1. The shell specified by the environment variable MAKESHELL.
|
1. The shell specified by the environment variable MAKESHELL.
|
||||||
@@ -37,7 +37,7 @@ I. ***** SPECIAL OPTIONS *****
|
|||||||
cmd or by specifying SHELL=cmd in your Makefile.
|
cmd or by specifying SHELL=cmd in your Makefile.
|
||||||
|
|
||||||
- At compile time you can set CPPFLAGS="-DNO_CHDIR2" to turn off that
|
- At compile time you can set CPPFLAGS="-DNO_CHDIR2" to turn off that
|
||||||
GNU make prints drive letters. This is necessary if you want to run
|
GNU Make prints drive letters. This is necessary if you want to run
|
||||||
the testsuite.
|
the testsuite.
|
||||||
|
|
||||||
|
|
||||||
@@ -49,7 +49,7 @@ A standard Unix like build environment:
|
|||||||
release 2)
|
release 2)
|
||||||
If you use pdksh it is recommended to update to 5.2.14 release 2. Older
|
If you use pdksh it is recommended to update to 5.2.14 release 2. Older
|
||||||
versions may not work! You can get this version at
|
versions may not work! You can get this version at
|
||||||
http://www.math.ohio-state.edu/~ilya/software/os2/pdksh-5.2.14-bin-2.zip
|
https://www.math.ohio-state.edu/~ilya/software/os2/pdksh-5.2.14-bin-2.zip
|
||||||
- GNU file utilities (make sure that install.exe from the file utilities
|
- GNU file utilities (make sure that install.exe from the file utilities
|
||||||
is in front of your PATH before X:\OS2\INSTALL\INSTALL.EXE. I recommend
|
is in front of your PATH before X:\OS2\INSTALL\INSTALL.EXE. I recommend
|
||||||
also to change the filename to ginstall.exe instead of install.exe
|
also to change the filename to ginstall.exe instead of install.exe
|
||||||
@@ -59,7 +59,7 @@ A standard Unix like build environment:
|
|||||||
- gawk
|
- gawk
|
||||||
- grep
|
- grep
|
||||||
- sed
|
- sed
|
||||||
- GNU make 3.79.1 (special OS/2 patched version) or higher
|
- GNU Make 3.79.1 (special OS/2 patched version) or higher
|
||||||
- perl 5.005 or higher
|
- perl 5.005 or higher
|
||||||
- GNU texinfo (you can use 3.1 (gnuinfo.zip), but I recommend 4.0)
|
- GNU texinfo (you can use 3.1 (gnuinfo.zip), but I recommend 4.0)
|
||||||
|
|
||||||
@@ -105,15 +105,15 @@ Note: You can add -DNO_CMD_DEFAULT and -DNO_CHDIR2 to CPPFLAGS.
|
|||||||
|
|
||||||
IV. ***** NLS support *****
|
IV. ***** NLS support *****
|
||||||
|
|
||||||
GNU make has NLS (National Language Support), with the following
|
GNU Make has NLS (National Language Support), with the following
|
||||||
caveats:
|
caveats:
|
||||||
|
|
||||||
a) It will only work with GNU gettext, and
|
a) It will only work with GNU gettext, and
|
||||||
b) GNU gettext support is not included in the GNU make package.
|
b) GNU gettext support is not included in the GNU Make package.
|
||||||
|
|
||||||
Therefore, if you wish to enable the internationalization features of
|
Therefore, if you wish to enable the internationalization features of
|
||||||
GNU make you must install GNU gettext on your system before configuring
|
GNU Make you must install GNU gettext on your system before configuring
|
||||||
GNU make.
|
GNU Make.
|
||||||
|
|
||||||
You can choose the languages to be installed. To install support for
|
You can choose the languages to be installed. To install support for
|
||||||
English, German and French only enter:
|
English, German and French only enter:
|
||||||
@@ -138,7 +138,7 @@ testsuite itself. -DNO_CMD_DEFAULT causes make to use /bin/sh as default
|
|||||||
shell in every case. Normally you could simply set MAKESHELL="/bin/sh"
|
shell in every case. Normally you could simply set MAKESHELL="/bin/sh"
|
||||||
to do this but the testsuite ignores the environment. -DNO_CHDIR2 causes
|
to do this but the testsuite ignores the environment. -DNO_CHDIR2 causes
|
||||||
make not to use drive letters for directory names (i.e. _chdir2() and
|
make not to use drive letters for directory names (i.e. _chdir2() and
|
||||||
_getcwd2() are NOT used). The testsuite interpretes the whole output of
|
_getcwd2() are NOT used). The testsuite interprets the whole output of
|
||||||
make, especially statements like make[1]: Entering directory
|
make, especially statements like make[1]: Entering directory
|
||||||
'C:/somewhere/make-3.79.1/tests' where the testsuite does not expect the
|
'C:/somewhere/make-3.79.1/tests' where the testsuite does not expect the
|
||||||
drive letter. This would be interpreted as an error even if there is
|
drive letter. This would be interpreted as an error even if there is
|
||||||
@@ -160,7 +160,7 @@ from the make source tree.
|
|||||||
|
|
||||||
|
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2003-2019 Free Software Foundation, Inc.
|
Copyright (C) 2003-2022 Free Software Foundation, Inc.
|
||||||
This file is part of GNU Make.
|
This file is part of GNU Make.
|
||||||
|
|
||||||
GNU Make is free software; you can redistribute it and/or modify it under the
|
GNU Make is free software; you can redistribute it and/or modify it under the
|
||||||
@@ -173,4 +173,4 @@ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|||||||
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
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
|
You should have received a copy of the GNU General Public License along with
|
||||||
this program. If not, see <http://www.gnu.org/licenses/>.
|
this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
90
README.VMS
90
README.VMS
@@ -1,7 +1,7 @@
|
|||||||
Overview: -*-text-mode-*-
|
Overview: -*-text-mode-*-
|
||||||
---------
|
---------
|
||||||
|
|
||||||
This version of GNU make has been tested on:
|
This version of GNU Make has been tested on:
|
||||||
OpenVMS V8.3/V8.4 (Alpha) and V8.4 (Integrity) AND V7.3 (VAX)
|
OpenVMS V8.3/V8.4 (Alpha) and V8.4 (Integrity) AND V7.3 (VAX)
|
||||||
|
|
||||||
This version of GNU Make is intended to be run from DCL to run
|
This version of GNU Make is intended to be run from DCL to run
|
||||||
@@ -11,10 +11,10 @@ Overview: -*-text-mode-*-
|
|||||||
There is an older implementation of GNU Make that was ported to GNV.
|
There is an older implementation of GNU Make that was ported to GNV.
|
||||||
Work is now in progress to merge that port to get a single version
|
Work is now in progress to merge that port to get a single version
|
||||||
of GNU Make available. When that merge is done, GNU Make will auto
|
of GNU Make available. When that merge is done, GNU Make will auto
|
||||||
detect that it is running under a Posix shell and then operate as close to
|
detect that it is running under a POSIX shell and then operate as close to
|
||||||
GNU Make on Unix as possible.
|
GNU Make on Unix as possible.
|
||||||
|
|
||||||
The descriptions below are for running GNU make from DCL or equivalent.
|
The descriptions below are for running GNU Make from DCL or equivalent.
|
||||||
|
|
||||||
Recipe differences:
|
Recipe differences:
|
||||||
-------------------
|
-------------------
|
||||||
@@ -62,15 +62,15 @@ Recipe differences:
|
|||||||
enabled if the GNU Make is set to the older behavior.
|
enabled if the GNU Make is set to the older behavior.
|
||||||
|
|
||||||
The name GNV$MAKE_SHELL_SIM when enabled will cause GNU Make to try to
|
The name GNV$MAKE_SHELL_SIM when enabled will cause GNU Make to try to
|
||||||
simulate a Posix shell more closely. The following behaviors occur:
|
simulate a POSIX shell more closely. The following behaviors occur:
|
||||||
|
|
||||||
* Single quotes are converted to double quotes and any double
|
* Single quotes are converted to double quotes and any double
|
||||||
quotes inside of them are doubled. No environment variable expansion
|
quotes inside of them are doubled. No environment variable expansion
|
||||||
is simulated.
|
is simulated.
|
||||||
* A exit command status will be converted to a Posix Exit
|
* A exit command status will be converted to a POSIX Exit
|
||||||
where 0 is success and non-zero is failure.
|
where 0 is success and non-zero is failure.
|
||||||
* The $ character will cause environment variable expansion.
|
* The $ character will cause environment variable expansion.
|
||||||
* Environent variables can be set on the command line before a command.
|
* Environment variables can be set on the command line before a command.
|
||||||
|
|
||||||
VMS generally uses logical name search lists instead of path variables
|
VMS generally uses logical name search lists instead of path variables
|
||||||
where the resolution is handled by VMS independent of the program. Which
|
where the resolution is handled by VMS independent of the program. Which
|
||||||
@@ -84,11 +84,11 @@ Recipe differences:
|
|||||||
|
|
||||||
The format for recipes are a combination of Unix macros, a subset of
|
The format for recipes are a combination of Unix macros, a subset of
|
||||||
simulated UNIX commands, some shell emulation, and OpenVMS commands.
|
simulated UNIX commands, some shell emulation, and OpenVMS commands.
|
||||||
This makes the resulting makefiles unique to the OpenVMS port of GNU make.
|
This makes the resulting makefiles unique to the OpenVMS port of GNU Make.
|
||||||
|
|
||||||
If you are creating a OpenVMS specific makefile from scratch, you should also
|
If you are creating a OpenVMS specific makefile from scratch, you should also
|
||||||
look at MMK (Madgoat Make) available at https://github.com/endlesssoftware/mmk
|
look at MMK (Madgoat Make) available at https://github.com/endlesssoftware/mmk
|
||||||
MMK uses full OpenVMS syntax and a persistent subprocess is used for the
|
MMK uses full OpenVMS syntax and a persistent sub-process is used for the
|
||||||
recipe lines, allowing multiple line rules.
|
recipe lines, allowing multiple line rules.
|
||||||
|
|
||||||
The default makefile search order is "makefile.vms", "gnumakefile",
|
The default makefile search order is "makefile.vms", "gnumakefile",
|
||||||
@@ -177,7 +177,7 @@ Recipe differences:
|
|||||||
Since the OpenVMS utilities generally expect OpenVMS format paths, you will
|
Since the OpenVMS utilities generally expect OpenVMS format paths, you will
|
||||||
usually have to use OpenVMS format paths for rules and targets.
|
usually have to use OpenVMS format paths for rules and targets.
|
||||||
BUG: Relative OpenVMS paths may not work in targets, especially combined
|
BUG: Relative OpenVMS paths may not work in targets, especially combined
|
||||||
with vpaths. This is because GNU make will just concatenate the directories
|
with vpaths. This is because GNU Make will just concatenate the directories
|
||||||
as it does on Unix.
|
as it does on Unix.
|
||||||
|
|
||||||
The variables $^ and $@ separate files with commas instead of spaces.
|
The variables $^ and $@ separate files with commas instead of spaces.
|
||||||
@@ -207,15 +207,15 @@ foo: $(addsuffix .3,$(subs $(comma),$(space),$^)
|
|||||||
override OpenVMS symbols/logicals.
|
override OpenVMS symbols/logicals.
|
||||||
|
|
||||||
OpenVMS logical and symbols names show up as "environment" using the
|
OpenVMS logical and symbols names show up as "environment" using the
|
||||||
origin function. when the "-e" option is specified, the origion function
|
origin function. when the "-e" option is specified, the origin function
|
||||||
shows them as "environment override". On Posix the test scripts indicate
|
shows them as "environment override". On POSIX the test scripts indicate
|
||||||
that they should show up just as "environment".
|
that they should show up just as "environment".
|
||||||
|
|
||||||
When GNU make reads in a symbol or logical name into the environment, it
|
When GNU Make reads in a symbol or logical name into the environment, it
|
||||||
converts any dollar signs found to double dollar signs for convenience in
|
converts any dollar signs found to double dollar signs for convenience in
|
||||||
using DCL symbols and logical names in recipes. When GNU make exports a
|
using DCL symbols and logical names in recipes. When GNU Make exports a
|
||||||
DCL symbol for a child process, if the first dollar sign found is followed
|
DCL symbol for a child process, if the first dollar sign found is followed
|
||||||
by second dollar sign, then all double dollar signs will be convirted to
|
by second dollar sign, then all double dollar signs will be converted to
|
||||||
single dollar signs.
|
single dollar signs.
|
||||||
|
|
||||||
The variable $(ARCH) is predefined as IA64, ALPHA or VAX respectively.
|
The variable $(ARCH) is predefined as IA64, ALPHA or VAX respectively.
|
||||||
@@ -233,17 +233,17 @@ endif
|
|||||||
|
|
||||||
Empty commands are handled correctly and don't end in a new DCL process.
|
Empty commands are handled correctly and don't end in a new DCL process.
|
||||||
|
|
||||||
The exit command needs to have OpenVMS exit codes. To pass a Posix code
|
The exit command needs to have OpenVMS exit codes. To pass a POSIX code
|
||||||
back to the make script, you need to encode it by multiplying it by 8
|
back to the make script, you need to encode it by multiplying it by 8
|
||||||
and then adding %x1035a002 for a failure code and %x1035a001 for a
|
and then adding %x1035a002 for a failure code and %x1035a001 for a
|
||||||
success. Make will interpret any posix code other than 0 as a failure.
|
success. Make will interpret any POSIX code other than 0 as a failure.
|
||||||
TODO: Add an option have simulate Posix exit commands in recipes.
|
TODO: Add an option have simulate POSIX exit commands in recipes.
|
||||||
|
|
||||||
Lexical functions can be used in pipes to simulate shell file test rules.
|
Lexical functions can be used in pipes to simulate shell file test rules.
|
||||||
|
|
||||||
Example:
|
Example:
|
||||||
|
|
||||||
Posix:
|
POSIX:
|
||||||
b : c ; [ -f $@ ] || echo >> $@
|
b : c ; [ -f $@ ] || echo >> $@
|
||||||
|
|
||||||
OpenVMS:
|
OpenVMS:
|
||||||
@@ -261,16 +261,16 @@ x = %x1035a00a
|
|||||||
|
|
||||||
Runtime issues:
|
Runtime issues:
|
||||||
|
|
||||||
The OpenVMS C Runtime has a convention for encoding a Posix exit status into
|
The OpenVMS C Runtime has a convention for encoding a POSIX exit status into
|
||||||
to OpenVMS exit codes. These status codes will have the hex value of
|
to OpenVMS exit codes. These status codes will have the hex value of
|
||||||
0x35a000. OpenVMS exit code may also have a hex value of %x10000000 set on
|
0x35a000. OpenVMS exit code may also have a hex value of %x10000000 set on
|
||||||
them. This is a flag to tell DCL not to write out the exit code.
|
them. This is a flag to tell DCL not to write out the exit code.
|
||||||
|
|
||||||
To convert an OpenVMS encoded Posix exit status code to the original code
|
To convert an OpenVMS encoded POSIX exit status code to the original code
|
||||||
You subtract %x35a000 and any flags from the OpenVMS code and divide it by 8.
|
You subtract %x35a000 and any flags from the OpenVMS code and divide it by 8.
|
||||||
|
|
||||||
WARNING: Backward-incompatibility!
|
WARNING: Backward-incompatibility!
|
||||||
The make program exit now returns the same encoded Posix exit code as on
|
The make program exit now returns the same encoded POSIX exit code as on
|
||||||
Unix. Previous versions returned the OpenVMS exit status code if that is what
|
Unix. Previous versions returned the OpenVMS exit status code if that is what
|
||||||
caused the recipe to fail.
|
caused the recipe to fail.
|
||||||
TODO: Provide a way for scripts calling make to obtain that OpenVMS status
|
TODO: Provide a way for scripts calling make to obtain that OpenVMS status
|
||||||
@@ -280,11 +280,11 @@ Runtime issues:
|
|||||||
will have the error "-E-" severity set on exit.
|
will have the error "-E-" severity set on exit.
|
||||||
|
|
||||||
MAKE_TROUBLE is returned only if the option "-q" or "--question" is used and
|
MAKE_TROUBLE is returned only if the option "-q" or "--question" is used and
|
||||||
has a Posix value of 1 and an OpenVMS status of %x1035a00a.
|
has a POSIX value of 1 and an OpenVMS status of %x1035a00a.
|
||||||
|
|
||||||
MAKE_FAILURE has a Posix value of 2 and an OpenVMS status of %x1035a012.
|
MAKE_FAILURE has a POSIX value of 2 and an OpenVMS status of %x1035a012.
|
||||||
|
|
||||||
Output from GNU make may have single quotes around some values where on
|
Output from GNU Make may have single quotes around some values where on
|
||||||
other platforms it does not. Also output that would be in double quotes
|
other platforms it does not. Also output that would be in double quotes
|
||||||
on some platforms may show up as single quotes on VMS.
|
on some platforms may show up as single quotes on VMS.
|
||||||
|
|
||||||
@@ -294,10 +294,10 @@ Runtime issues:
|
|||||||
There may be a "Waiting for unfinished jobs..." show up in the output.
|
There may be a "Waiting for unfinished jobs..." show up in the output.
|
||||||
|
|
||||||
Error messages generated by Make or Unix utilities may slightly vary from
|
Error messages generated by Make or Unix utilities may slightly vary from
|
||||||
Posix platforms. Typically the case may be different.
|
POSIX platforms. Typically the case may be different.
|
||||||
|
|
||||||
When make deletes files, on posix platforms it writes out 'rm' and the list
|
When make deletes files, on POSIX platforms it writes out 'rm' and the list
|
||||||
of files. On VMS, only the files are writen out, one per line.
|
of files. On VMS, only the files are written out, one per line.
|
||||||
TODO: VMS
|
TODO: VMS
|
||||||
|
|
||||||
There may be extra leading white space or additional or missing whitespace
|
There may be extra leading white space or additional or missing whitespace
|
||||||
@@ -323,15 +323,15 @@ Runtime issues:
|
|||||||
to override this in your makefile, or whatever).
|
to override this in your makefile, or whatever).
|
||||||
|
|
||||||
|
|
||||||
Unix compatibilty features:
|
Unix compatibility features:
|
||||||
---------------------------
|
----------------------------
|
||||||
|
|
||||||
If the command 'echo' is seen, any single quotes on the line will be
|
If the command 'echo' is seen, any single quotes on the line will be
|
||||||
converted to double quotes.
|
converted to double quotes.
|
||||||
|
|
||||||
The variable $(CD) is implemented as a built in Change Directory
|
The variable $(CD) is implemented as a built in Change Directory
|
||||||
command. This invokes the 'builtin_cd' Executing a 'set default'
|
command. This invokes the 'builtin_cd' Executing a 'set default'
|
||||||
recipe doesn't do the trick, since it only affects the subprocess
|
recipe doesn't do the trick, since it only affects the sub-process
|
||||||
spawned for that command.
|
spawned for that command.
|
||||||
|
|
||||||
The 'builtin_cd' is generally expected to be on its own line.
|
The 'builtin_cd' is generally expected to be on its own line.
|
||||||
@@ -347,13 +347,13 @@ Unix compatibilty features:
|
|||||||
Unix shell style I/O redirection is supported. You can now write lines like:
|
Unix shell style I/O redirection is supported. You can now write lines like:
|
||||||
"<tab>mcr sys$disk:[]program.exe < input.txt > output.txt &> error.txt"
|
"<tab>mcr sys$disk:[]program.exe < input.txt > output.txt &> error.txt"
|
||||||
|
|
||||||
Posix shells have ":" as a null command. These are now handled.
|
POSIX shells have ":" as a null command. These are now handled.
|
||||||
https://savannah.gnu.org/bugs/index.php?41761
|
https://savannah.gnu.org/bugs/index.php?41761
|
||||||
|
|
||||||
A note on appending the redirected output. A simple mechanism is
|
A note on appending the redirected output. A simple mechanism is
|
||||||
implemented to make ">>" work in action lines. In OpenVMS there is no simple
|
implemented to make ">>" work in action lines. In OpenVMS there is no simple
|
||||||
feature like ">>" to have DCL command or program output redirected and
|
feature like ">>" to have DCL command or program output redirected and
|
||||||
appended to a file. GNU make for OpenVMS implements the redirection
|
appended to a file. GNU Make for OpenVMS implements the redirection
|
||||||
of ">>" by using a command procedure.
|
of ">>" by using a command procedure.
|
||||||
|
|
||||||
The current algorithm creates the output file if it does not exist and
|
The current algorithm creates the output file if it does not exist and
|
||||||
@@ -367,10 +367,10 @@ Unix compatibilty features:
|
|||||||
The older implementation wrote the output to a temporary file in
|
The older implementation wrote the output to a temporary file in
|
||||||
in sys$scratch: and then attempted to append the file to the existing file.
|
in sys$scratch: and then attempted to append the file to the existing file.
|
||||||
The temporary file names looked like "CMDxxxxx.". Any time the created
|
The temporary file names looked like "CMDxxxxx.". Any time the created
|
||||||
command procedure can not complete, this happens. Pressing Ctrl+Y to
|
command procedure can not complete, this happens. Pressing CTRL+Y to
|
||||||
abort make is one case.
|
abort make is one case.
|
||||||
|
|
||||||
In case of Ctrl+Y the associated command procedure is left in SYS$SCRATCH:.
|
In case of CTRL+Y the associated command procedure is left in SYS$SCRATCH:.
|
||||||
The command procedures will be named gnv$make_cmd*.com.
|
The command procedures will be named gnv$make_cmd*.com.
|
||||||
|
|
||||||
The CtrlY handler now uses $delprc to delete all children. This way also
|
The CtrlY handler now uses $delprc to delete all children. This way also
|
||||||
@@ -378,12 +378,12 @@ Unix compatibilty features:
|
|||||||
then sends SIGQUIT to itself, which is handled in common code.
|
then sends SIGQUIT to itself, which is handled in common code.
|
||||||
|
|
||||||
Temporary command files are now deleted in the OpenVMS child termination
|
Temporary command files are now deleted in the OpenVMS child termination
|
||||||
handler. That deletes them even if a Ctrl+C was pressed.
|
handler. That deletes them even if a CTRL+C was pressed.
|
||||||
TODO: Does the previous section about >> leaving files still apply?
|
TODO: Does the previous section about >> leaving files still apply?
|
||||||
|
|
||||||
The behavior of pressing Ctrl+C is not changed. It still has only an effect,
|
The behavior of pressing CTRL+C is not changed. It still has only an effect,
|
||||||
after the current action is terminated. If that doesn't happen or takes too
|
after the current action is terminated. If that doesn't happen or takes too
|
||||||
long, Ctrl+Y should be used instead.
|
long, CTRL+Y should be used instead.
|
||||||
|
|
||||||
|
|
||||||
Build Options:
|
Build Options:
|
||||||
@@ -409,7 +409,7 @@ Unimplemented functionality:
|
|||||||
The new feature "Loadable objects" is not yet supported. If you need it,
|
The new feature "Loadable objects" is not yet supported. If you need it,
|
||||||
please send a change request or submit a bug report.
|
please send a change request or submit a bug report.
|
||||||
|
|
||||||
The new option --output-sync (-O) is accepted but has no effect: GNU make
|
The new option --output-sync (-O) is accepted but has no effect: GNU Make
|
||||||
for OpenVMS does not support running multiple commands simultaneously.
|
for OpenVMS does not support running multiple commands simultaneously.
|
||||||
|
|
||||||
|
|
||||||
@@ -421,8 +421,8 @@ Self test failures and todos:
|
|||||||
Need to find a way to set the VMS features before running make as a
|
Need to find a way to set the VMS features before running make as a
|
||||||
child.
|
child.
|
||||||
|
|
||||||
GNU make was not currently translating the OpenVMS encoded POSIX values
|
GNU Make was not currently translating the OpenVMS encoded POSIX values
|
||||||
returned to it back to the Posix values. I have temporarily modified the
|
returned to it back to the POSIX values. I have temporarily modified the
|
||||||
Perl test script to compensate for it. This should be being handled
|
Perl test script to compensate for it. This should be being handled
|
||||||
internally to Make.
|
internally to Make.
|
||||||
TODO: Verify and update the Perl test script.
|
TODO: Verify and update the Perl test script.
|
||||||
@@ -435,7 +435,7 @@ Self test failures and todos:
|
|||||||
Symlink support is not present. Symlinks are supported by OpenVMS 8.3 and
|
Symlink support is not present. Symlinks are supported by OpenVMS 8.3 and
|
||||||
later.
|
later.
|
||||||
|
|
||||||
Error messages should be supressed with the "-" at the beginning of a line.
|
Error messages should be suppressed with the "-" at the beginning of a line.
|
||||||
On openVMS they were showing up. TODO: Is this still an issue?
|
On openVMS they were showing up. TODO: Is this still an issue?
|
||||||
|
|
||||||
The internal vmsify and unixify OpenVMS to/from UNIX are not handling logical
|
The internal vmsify and unixify OpenVMS to/from UNIX are not handling logical
|
||||||
@@ -443,7 +443,7 @@ Self test failures and todos:
|
|||||||
|
|
||||||
|
|
||||||
Build instructions:
|
Build instructions:
|
||||||
------------------
|
-------------------
|
||||||
|
|
||||||
Don't use the HP C V7.2-001 compiler, which has an incompatible change
|
Don't use the HP C V7.2-001 compiler, which has an incompatible change
|
||||||
how __STDC__ is defined. This results at least in compile time warnings.
|
how __STDC__ is defined. This results at least in compile time warnings.
|
||||||
@@ -478,7 +478,7 @@ Running the tests:
|
|||||||
https://sourceforge.net/projects/gnv/files/
|
https://sourceforge.net/projects/gnv/files/
|
||||||
|
|
||||||
As the test scripts need to create some foreign commands that persist
|
As the test scripts need to create some foreign commands that persist
|
||||||
after the test is run, it is recommend that either you use a subprocess or
|
after the test is run, it is recommend that either you use a sub-process or
|
||||||
a dedicated login to run the tests.
|
a dedicated login to run the tests.
|
||||||
|
|
||||||
To get detailed information for running the tests:
|
To get detailed information for running the tests:
|
||||||
@@ -499,12 +499,12 @@ Running the tests:
|
|||||||
$ perl run_make_tests.pl
|
$ perl run_make_tests.pl
|
||||||
|
|
||||||
|
|
||||||
Acknowlegements:
|
Acknowledgments:
|
||||||
----------------
|
----------------
|
||||||
|
|
||||||
See NEWS. for details of past changes.
|
See NEWS. for details of past changes.
|
||||||
|
|
||||||
These are the currently known contributers to this port.
|
These are the currently known contributors to this port.
|
||||||
|
|
||||||
Hartmut Becker
|
Hartmut Becker
|
||||||
John Malmberg
|
John Malmberg
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
This version of GNU make has been tested on:
|
This version of GNU Make has been tested on:
|
||||||
Microsoft Windows 2000/XP/2003/Vista/7/8/10
|
Microsoft Windows 2000/XP/2003/Vista/7/8/10
|
||||||
It has also been used on Windows 95/98/NT, and on OS/2.
|
It has also been used on Windows 95/98/NT, and on OS/2.
|
||||||
|
|
||||||
@@ -15,7 +15,7 @@ which compilation and link switches and libraries need to be mentioned
|
|||||||
on the compiler command lines to correctly link with Guile. A Windows
|
on the compiler command lines to correctly link with Guile. A Windows
|
||||||
port of pkg-config can be found on ezwinports site:
|
port of pkg-config can be found on ezwinports site:
|
||||||
|
|
||||||
http://sourceforge.net/projects/ezwinports/
|
https://sourceforge.net/projects/ezwinports/
|
||||||
|
|
||||||
The libraries on which Guile depends can vary depending on your
|
The libraries on which Guile depends can vary depending on your
|
||||||
version and build of Guile. At the very least, the Boehm's GC library
|
version and build of Guile. At the very least, the Boehm's GC library
|
||||||
@@ -25,7 +25,7 @@ also provide you with these dependencies or a URL where to download
|
|||||||
them. A precompiled 32-bit Windows build of Guile is available from
|
them. A precompiled 32-bit Windows build of Guile is available from
|
||||||
the ezwinports site mentioned above.
|
the ezwinports site mentioned above.
|
||||||
|
|
||||||
The Windows port of GNU make is maintained jointly by various people.
|
The Windows port of GNU Make is maintained jointly by various people.
|
||||||
It was originally made by Rob Tulloh.
|
It was originally made by Rob Tulloh.
|
||||||
It is currently maintained by Eli Zaretskii.
|
It is currently maintained by Eli Zaretskii.
|
||||||
|
|
||||||
@@ -33,12 +33,14 @@ It is currently maintained by Eli Zaretskii.
|
|||||||
Do this first, regardless of the build method you choose:
|
Do this first, regardless of the build method you choose:
|
||||||
---------------------------------------------------------
|
---------------------------------------------------------
|
||||||
|
|
||||||
1. Edit config.h.W32 to your liking (especially the few shell-related
|
1. If you have special requirements, edit config.h.W32 to your liking
|
||||||
defines near the end, or HAVE_CASE_INSENSITIVE_FS which corresponds
|
(especially the shell-related defines, or HAVE_CASE_INSENSITIVE_FS which
|
||||||
to './configure --enable-case-insensitive-file-system'). (We don't
|
corresponds to './configure --enable-case-insensitive-file-system'). We
|
||||||
recommend to define HAVE_CASE_INSENSITIVE_FS, but you may wish to
|
don't recommend to define HAVE_CASE_INSENSITIVE_FS, but you may wish to
|
||||||
consider that if you have a lot of files whose names are in upper
|
consider that if you have a lot of files whose names are in upper case,
|
||||||
case, while Makefile rules are written for lower-case versions.)
|
while Makefile rules are written for lower-case versions.
|
||||||
|
|
||||||
|
If you don't have special requirements no changes are needed.
|
||||||
|
|
||||||
|
|
||||||
Building with (MinGW-)GCC using build_w32.bat
|
Building with (MinGW-)GCC using build_w32.bat
|
||||||
@@ -51,7 +53,7 @@ Building with (MinGW-)GCC using build_w32.bat
|
|||||||
|
|
||||||
This produces gnumake.exe in the GccRel directory.
|
This produces gnumake.exe in the GccRel directory.
|
||||||
|
|
||||||
If you want a version of GNU make built with debugging enabled,
|
If you want a version of GNU Make built with debugging enabled,
|
||||||
add the --debug option. Output goes into the GccDebug directory.
|
add the --debug option. Output goes into the GccDebug directory.
|
||||||
|
|
||||||
The batch file will probe for Guile installation, and will build
|
The batch file will probe for Guile installation, and will build
|
||||||
@@ -73,21 +75,21 @@ Building with (MSVC++-)cl using build_w32.bat
|
|||||||
file will probe your system and choose the newest MSVC version it can
|
file will probe your system and choose the newest MSVC version it can
|
||||||
find.
|
find.
|
||||||
|
|
||||||
If you want a 32bit version of GNU make, add the --x86 option.
|
If you want a 32bit version of GNU Make, add the --x86 option.
|
||||||
|
|
||||||
If you want a Debug build of GNU make, add the --debug option. Output
|
If you want a Debug build of GNU Make, add the --debug option. Output
|
||||||
will go into the .\WinDebug directory.
|
will go into the .\WinDebug directory.
|
||||||
|
|
||||||
The batch file will probe for Guile installation, and will build
|
The batch file will probe for Guile installation, and will build
|
||||||
gnumake.exe with Guile if it finds it. If Guile is installed,
|
gnumake.exe with Guile if it finds it. If Guile is installed,
|
||||||
but you prefer to build GNU make without Guile support, add the
|
but you prefer to build GNU Make without Guile support, add the
|
||||||
--without-guile option.
|
--without-guile option.
|
||||||
|
|
||||||
|
|
||||||
Building with (MinGW-)GCC using GNU make
|
Building with (MinGW-)GCC using GNU Make
|
||||||
----------------------------------------
|
----------------------------------------
|
||||||
|
|
||||||
2. If you already have a version of GNU make available you can use it
|
2. If you already have a version of GNU Make available you can use it
|
||||||
to build this version. Open a W32 command prompt for your installed
|
to build this version. Open a W32 command prompt for your installed
|
||||||
(MinGW-)GCC, setup a correct PATH and other environment variables
|
(MinGW-)GCC, setup a correct PATH and other environment variables
|
||||||
for it, then execute ...
|
for it, then execute ...
|
||||||
@@ -95,7 +97,7 @@ Building with (MinGW-)GCC using GNU make
|
|||||||
make -f Basic.mk TOOLCHAIN=gcc
|
make -f Basic.mk TOOLCHAIN=gcc
|
||||||
|
|
||||||
This produces GccRel\gnumake.exe.
|
This produces GccRel\gnumake.exe.
|
||||||
If you want a version of GNU make built with debugging enabled,
|
If you want a version of GNU Make built with debugging enabled,
|
||||||
add the TARGET_TYPE=debug option:
|
add the TARGET_TYPE=debug option:
|
||||||
|
|
||||||
make -f Basic.mk TOOLCHAIN=gcc TARGET_TYPE=debug
|
make -f Basic.mk TOOLCHAIN=gcc TARGET_TYPE=debug
|
||||||
@@ -104,10 +106,10 @@ Building with (MinGW-)GCC using GNU make
|
|||||||
if you want to build with Guile support.
|
if you want to build with Guile support.
|
||||||
|
|
||||||
|
|
||||||
Building with (MSVC++-)cl using GNU make
|
Building with (MSVC++-)cl using GNU Make
|
||||||
----------------------------------------
|
----------------------------------------
|
||||||
|
|
||||||
2. If you already have a version of GNU make available you can use it
|
2. If you already have a version of GNU Make available you can use it
|
||||||
to build this version. Open a W32 command prompt for your installed
|
to build this version. Open a W32 command prompt for your installed
|
||||||
(MSVC++-)cl, setup a correct PATH and other environment variables
|
(MSVC++-)cl, setup a correct PATH and other environment variables
|
||||||
for it (usually via executing vcvars32.bat or vsvars32.bat from the
|
for it (usually via executing vcvars32.bat or vsvars32.bat from the
|
||||||
@@ -117,7 +119,7 @@ Building with (MSVC++-)cl using GNU make
|
|||||||
make -f Basic.mk
|
make -f Basic.mk
|
||||||
|
|
||||||
This produces an optimized WinRel/gnumake.exe.
|
This produces an optimized WinRel/gnumake.exe.
|
||||||
If you want a version of GNU make built with debugging enabled,
|
If you want a version of GNU Make built with debugging enabled,
|
||||||
add the TARGET_TYPE=debug option:
|
add the TARGET_TYPE=debug option:
|
||||||
|
|
||||||
make -f Basic.mk TARGET_TYPE=debug
|
make -f Basic.mk TARGET_TYPE=debug
|
||||||
@@ -132,7 +134,7 @@ Running the test suite
|
|||||||
3. You will need an installation of Perl. Be sure to use a relatively
|
3. You will need an installation of Perl. Be sure to use a relatively
|
||||||
modern version: older versions will sometimes throw spurious errors.
|
modern version: older versions will sometimes throw spurious errors.
|
||||||
|
|
||||||
To run the suite after building using GNU make, use:
|
To run the suite after building using GNU Make, use:
|
||||||
|
|
||||||
make -f Basic.mk check
|
make -f Basic.mk check
|
||||||
|
|
||||||
@@ -156,7 +158,7 @@ Running the test suite
|
|||||||
-- Notes/Caveats --
|
-- Notes/Caveats --
|
||||||
-------------------
|
-------------------
|
||||||
|
|
||||||
GNU make on Windows 32-bit platforms:
|
GNU Make on Windows 32-bit platforms:
|
||||||
|
|
||||||
This version of make is ported natively to Windows32 platforms
|
This version of make is ported natively to Windows32 platforms
|
||||||
(Windows NT 3.51, Windows NT 4.0, Windows 2000, Windows XP,
|
(Windows NT 3.51, Windows NT 4.0, Windows 2000, Windows XP,
|
||||||
@@ -166,11 +168,11 @@ GNU make on Windows 32-bit platforms:
|
|||||||
officially are the MinGW port of GNU GCC, and the various
|
officially are the MinGW port of GNU GCC, and the various
|
||||||
versions of the Microsoft C compiler.
|
versions of the Microsoft C compiler.
|
||||||
|
|
||||||
Do not confuse this port of GNU make with other Windows32 projects
|
Do not confuse this port of GNU Make with other Windows32 projects
|
||||||
which provide a GNU make binary. These are separate projects
|
which provide a GNU Make binary. These are separate projects
|
||||||
and are not connected to this port effort.
|
and are not connected to this port effort.
|
||||||
|
|
||||||
GNU make and sh.exe:
|
GNU Make and sh.exe:
|
||||||
|
|
||||||
This port prefers if you have a working sh.exe somewhere on
|
This port prefers if you have a working sh.exe somewhere on
|
||||||
your system. If you don't have sh.exe, the port falls back to
|
your system. If you don't have sh.exe, the port falls back to
|
||||||
@@ -180,12 +182,12 @@ GNU make and sh.exe:
|
|||||||
|
|
||||||
There are very few true ports of Bourne shell for NT right now.
|
There are very few true ports of Bourne shell for NT right now.
|
||||||
There is a version of GNU bash available from Cygnus "Cygwin"
|
There is a version of GNU bash available from Cygnus "Cygwin"
|
||||||
porting effort (http://www.cygwin.com/).
|
porting effort (https://www.cygwin.com/).
|
||||||
Other possibilities are the MKS version of sh.exe, or building
|
Other possibilities are the MKS version of sh.exe, or building
|
||||||
your own with a package like NutCracker (DataFocus) or Portage
|
your own with a package like NutCracker (DataFocus) or Portage
|
||||||
(Consensys). Also MinGW includes sh (http://mingw.org/).
|
(Consensys). Also MinGW includes sh.
|
||||||
|
|
||||||
GNU make and brain-dead shells (BATCH_MODE_ONLY_SHELL):
|
GNU Make and brain-dead shells (BATCH_MODE_ONLY_SHELL):
|
||||||
|
|
||||||
Some versions of Bourne shell do not behave well when invoked
|
Some versions of Bourne shell do not behave well when invoked
|
||||||
as 'sh -c' from CreateProcess(). The main problem is they seem
|
as 'sh -c' from CreateProcess(). The main problem is they seem
|
||||||
@@ -211,21 +213,21 @@ Support for parallel builds
|
|||||||
Parallel builds (-jN) are supported in this port. The number of
|
Parallel builds (-jN) are supported in this port. The number of
|
||||||
concurrent processes has a hard limit of 4095.
|
concurrent processes has a hard limit of 4095.
|
||||||
|
|
||||||
GNU make and Cygnus GNU Windows32 tools:
|
GNU Make and Cygnus GNU Windows32 tools:
|
||||||
|
|
||||||
Good news! Make now has native support for Cygwin sh. To enable,
|
Good news! Make now has native support for Cygwin sh. To enable,
|
||||||
define the HAVE_CYGWIN_SHELL in config.h and rebuild make
|
define the HAVE_CYGWIN_SHELL in config.h and rebuild make
|
||||||
from scratch. This version of make tested with B20.1 of Cygwin.
|
from scratch. This version of make tested with B20.1 of Cygwin.
|
||||||
Do not define BATCH_MODE_ONLY_SHELL if you use HAVE_CYGWIN_SHELL.
|
Do not define BATCH_MODE_ONLY_SHELL if you use HAVE_CYGWIN_SHELL.
|
||||||
|
|
||||||
GNU make and the MKS shell:
|
GNU Make and the MKS shell:
|
||||||
|
|
||||||
There is now semi-official support for the MKS shell. To turn this
|
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
|
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
|
build make. Do not define BATCH_MODE_ONLY_SHELL if you turn
|
||||||
on HAVE_MKS_SHELL.
|
on HAVE_MKS_SHELL.
|
||||||
|
|
||||||
GNU make handling of drive letters in pathnames (PATH, vpath, VPATH):
|
GNU Make handling of drive letters in pathnames (PATH, vpath, VPATH):
|
||||||
|
|
||||||
There is a caveat that should be noted with respect to handling
|
There is a caveat that should be noted with respect to handling
|
||||||
single character pathnames on Windows systems. When colon is
|
single character pathnames on Windows systems. When colon is
|
||||||
@@ -291,7 +293,7 @@ Pathnames and Case insensitivity:
|
|||||||
the file with other case permutations will succeed (i.e. opening a
|
the file with other case permutations will succeed (i.e. opening a
|
||||||
file named "target" or "TARGET" will open the file "Target").
|
file named "target" or "TARGET" will open the file "Target").
|
||||||
|
|
||||||
By default, GNU make retains its case sensitivity when comparing
|
By default, GNU Make retains its case sensitivity when comparing
|
||||||
target names and existing files or directories. It can be
|
target names and existing files or directories. It can be
|
||||||
configured, however, into a case preserving and case insensitive
|
configured, however, into a case preserving and case insensitive
|
||||||
mode by adding a define for HAVE_CASE_INSENSITIVE_FS to
|
mode by adding a define for HAVE_CASE_INSENSITIVE_FS to
|
||||||
@@ -309,10 +311,10 @@ Pathnames and Case insensitivity:
|
|||||||
SUBDIR/DepTarget: SubDir/TARGET
|
SUBDIR/DepTarget: SubDir/TARGET
|
||||||
cp $^ $@
|
cp $^ $@
|
||||||
|
|
||||||
Reliance on this behavior also eliminates the ability of GNU make
|
Reliance on this behavior also eliminates the ability of GNU Make
|
||||||
to use case in comparison of matching rules. For example, it is
|
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
|
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
|
than a C rule using %.c. GNU Make will consider these to be the
|
||||||
same rule and will issue a warning.
|
same rule and will issue a warning.
|
||||||
|
|
||||||
SAMBA/NTFS/VFAT:
|
SAMBA/NTFS/VFAT:
|
||||||
@@ -342,10 +344,10 @@ FAT:
|
|||||||
Bug reports:
|
Bug reports:
|
||||||
|
|
||||||
Please submit bugs via the normal bug reporting mechanism which
|
Please submit bugs via the normal bug reporting mechanism which
|
||||||
is described in the GNU make manual and the base README.
|
is described in the GNU Make manual and the base README.
|
||||||
|
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 1996-2019 Free Software Foundation, Inc.
|
Copyright (C) 1996-2022 Free Software Foundation, Inc.
|
||||||
This file is part of GNU Make.
|
This file is part of GNU Make.
|
||||||
|
|
||||||
GNU Make is free software; you can redistribute it and/or modify it under the
|
GNU Make is free software; you can redistribute it and/or modify it under the
|
||||||
@@ -358,4 +360,4 @@ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|||||||
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
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
|
You should have received a copy of the GNU General Public License along with
|
||||||
this program. If not, see <http://www.gnu.org/licenses/>.
|
this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
-*-indented-text-*-
|
-*-indented-text-*-
|
||||||
|
|
||||||
GNU make can utilize the Customs library, distributed with Pmake, to
|
GNU Make can utilize the Customs library, distributed with Pmake, to
|
||||||
provide builds distributed across multiple hosts.
|
provide builds distributed across multiple hosts.
|
||||||
|
|
||||||
In order to utilize this capability, you must first download and build
|
In order to utilize this capability, you must first download and build
|
||||||
@@ -21,11 +21,11 @@ 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.
|
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
|
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
|
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
|
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
|
versions of GNU Make, also). The parts of this patchfile which relate
|
||||||
directly to Customs support have already been incorporated into this
|
directly to Customs support have already been incorporated into this
|
||||||
version of GNU make, so you should _NOT_ apply the patch file.
|
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)
|
However, there are a few non-Customs specific (as far as I could tell)
|
||||||
changes here which are not incorporated (for example, the modification
|
changes here which are not incorporated (for example, the modification
|
||||||
@@ -42,14 +42,14 @@ install' there directly).
|
|||||||
BUILDING GNU MAKE
|
BUILDING GNU MAKE
|
||||||
-----------------
|
-----------------
|
||||||
|
|
||||||
Once you've installed Customs, you can build GNU make to use it. When
|
Once you've installed Customs, you can build GNU Make to use it. When
|
||||||
configuring GNU make, merely use the '--with-customs=DIR' option.
|
configuring GNU Make, merely use the '--with-customs=DIR' option.
|
||||||
Provide the directory containing the 'lib' and 'include/customs'
|
Provide the directory containing the 'lib' and 'include/customs'
|
||||||
subdirectories as DIR. For example, if you installed the customs
|
subdirectories as DIR. For example, if you installed the customs
|
||||||
library in /usr/local/lib and the headers in /usr/local/include/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.
|
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
|
Run make (or use build.sh) normally to build GNU Make as described in
|
||||||
the INSTALL file.
|
the INSTALL file.
|
||||||
|
|
||||||
See the documentation for Customs for information on starting and
|
See the documentation for Customs for information on starting and
|
||||||
@@ -83,7 +83,7 @@ PROBLEMS
|
|||||||
|
|
||||||
SunOS 4.1.x:
|
SunOS 4.1.x:
|
||||||
The customs/sprite.h header file #includes the <malloc.h> header
|
The customs/sprite.h header file #includes the <malloc.h> header
|
||||||
files; this conflicts with GNU make's configuration so you'll get a
|
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).
|
compile error if you use GCC (or any other ANSI-capable C compiler).
|
||||||
|
|
||||||
I commented out the #include in sprite.h:107:
|
I commented out the #include in sprite.h:107:
|
||||||
@@ -96,7 +96,7 @@ SunOS 4.1.x:
|
|||||||
|
|
||||||
|
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 1998-2019 Free Software Foundation, Inc.
|
Copyright (C) 1998-2022 Free Software Foundation, Inc.
|
||||||
This file is part of GNU Make.
|
This file is part of GNU Make.
|
||||||
|
|
||||||
GNU Make is free software; you can redistribute it and/or modify it under the
|
GNU Make is free software; you can redistribute it and/or modify it under the
|
||||||
@@ -109,4 +109,4 @@ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|||||||
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
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
|
You should have received a copy of the GNU General Public License along with
|
||||||
this program. If not, see <http://www.gnu.org/licenses/>.
|
this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|||||||
317
README.git
317
README.git
@@ -1,7 +1,7 @@
|
|||||||
-*-text-*-
|
-*-text-*-
|
||||||
|
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2002-2019 Free Software Foundation, Inc.
|
Copyright (C) 2002-2022 Free Software Foundation, Inc.
|
||||||
This file is part of GNU Make.
|
This file is part of GNU Make.
|
||||||
|
|
||||||
GNU Make is free software; you can redistribute it and/or modify it under the
|
GNU Make is free software; you can redistribute it and/or modify it under the
|
||||||
@@ -14,7 +14,7 @@ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|||||||
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
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
|
You should have received a copy of the GNU General Public License along with
|
||||||
this program. If not, see <http://www.gnu.org/licenses/>.
|
this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
|
|
||||||
Obtaining Git Code
|
Obtaining Git Code
|
||||||
@@ -23,7 +23,7 @@ Obtaining Git Code
|
|||||||
This seems redundant, since if you're reading this you most likely have
|
This seems redundant, since if you're reading this you most likely have
|
||||||
already performed this step; however, for completeness, you can obtain the GNU
|
already performed this step; however, for completeness, you can obtain the GNU
|
||||||
make source code via Git from the FSF's Savannah project
|
make source code via Git from the FSF's Savannah project
|
||||||
<http://savannah.gnu.org/projects/make/>:
|
<https://savannah.gnu.org/projects/make/>:
|
||||||
|
|
||||||
$ git clone git://git.savannah.gnu.org/make.git
|
$ git clone git://git.savannah.gnu.org/make.git
|
||||||
|
|
||||||
@@ -31,10 +31,13 @@ make source code via Git from the FSF's Savannah project
|
|||||||
Changes using Git
|
Changes using Git
|
||||||
-----------------
|
-----------------
|
||||||
|
|
||||||
For non-developers, you can continue to provide patches as before, or if you
|
If you do not have push privileges to the GNU Make Git repository, see the
|
||||||
make a public repository I can pull from that if you prefer.
|
README file section "Submitting Patches" for information.
|
||||||
|
|
||||||
Starting with GNU make 4.0 we no longer keep a separate ChangeLog file in
|
If you have push privileges to the GNU Make Git repository keep this
|
||||||
|
information in mind:
|
||||||
|
|
||||||
|
Starting with GNU Make 4.0 we no longer keep a separate ChangeLog file in
|
||||||
source control. We use the Gnulib git-to-changelog conversion script to
|
source control. We use the Gnulib git-to-changelog conversion script to
|
||||||
convert the Git comments into ChangeLog-style entries for release. As a
|
convert the Git comments into ChangeLog-style entries for release. As a
|
||||||
result, please format your Git comments carefully so they will look clean
|
result, please format your Git comments carefully so they will look clean
|
||||||
@@ -43,61 +46,69 @@ added before it so be sure your comment lines are not longer than 72
|
|||||||
characters; prefer 70 or less. Please use standard ChangeLog formats for
|
characters; prefer 70 or less. Please use standard ChangeLog formats for
|
||||||
your commit messages (sans the leading TAB of course).
|
your commit messages (sans the leading TAB of course).
|
||||||
|
|
||||||
Rule #1: Don't rewrite pushed history (don't use "git push --force").
|
Rule #1: Don't rewrite pushed history on master (no "git push --force").
|
||||||
|
Rule #2: Feel free to rewrite pushed history on personal branches.
|
||||||
|
Rule #3: Squash-merge or rebase + merge --ff-only, rather than merging from
|
||||||
|
personal branches into master.
|
||||||
|
|
||||||
Typical simple workflow might be:
|
Typical simple workflow might be:
|
||||||
|
|
||||||
* Edit files
|
* Edit files / make / make check
|
||||||
* Use "git status" and "git diff" to verify your changes
|
* Use "git status" and "git diff" to verify your changes
|
||||||
* Use "git add" to stage the changes you want to make
|
* Use "git add" to stage the changes you want to make
|
||||||
* Use "git commit" to commit the staged changes to your local repository
|
* Use "git commit" to commit the staged changes to your local repository
|
||||||
* Use "git pull" to accept & merge new changes from the Savannah repository
|
* Use "git pull -r" to accept new changes from the upstream repository
|
||||||
* Use "git push" to push your commits back to the Savannah repository
|
* Use "git push" to push your commits back to the upstream repository
|
||||||
|
|
||||||
For Emacs users, there are many options for Git integration but I strongly
|
For Emacs users, there are many options for Git integration but I strongly
|
||||||
recommend the Magit package: http://www.emacswiki.org/emacs/Magit
|
recommend Magit: https://magit.vc/ It makes the workflow much clearer, and
|
||||||
It makes the workflow much clearer, and has advanced features such as
|
has advanced features such as constructing multiple commits from various files
|
||||||
constructing multiple commits from various files and even from different
|
and even from different diff chunks in the same file. There is a video
|
||||||
diff chunks in the same file. There is a video available which helps a lot.
|
available which helps a lot.
|
||||||
|
|
||||||
|
|
||||||
Coding Standards
|
Coding Standards
|
||||||
----------------
|
----------------
|
||||||
|
|
||||||
GNU make code adheres to the GNU Coding Standards. Please use only spaces and
|
GNU Make code adheres to the GNU Coding Standards. Please use only spaces and
|
||||||
no TAB characters in source code.
|
no TAB characters in source code.
|
||||||
|
|
||||||
Additionally, GNU make is a foundational bootstrap package for the GNU
|
Additionally, GNU Make is a foundational bootstrap package for the GNU
|
||||||
project; as such it is very conservative about language features it expects.
|
project; as such it is conservative about language features it expects.
|
||||||
It should build with any C compiler conforming to the ANSI C89 / ISO C90
|
However, GNU Make does rely on the Gnulib portability library, and Gnulib
|
||||||
standard.
|
currently requires a ISO C99 compiler. So features in ISO C99 can be
|
||||||
|
assumed.
|
||||||
|
|
||||||
|
|
||||||
Building From Git for POSIX
|
Building From Git for POSIX
|
||||||
---------------------------
|
---------------------------
|
||||||
|
|
||||||
To build GNU make from Git on POSIX systems such as GNU/Linux, you will
|
To build GNU Make from Git on POSIX systems such as GNU/Linux, you will
|
||||||
need to install the following extra software:
|
need to install the following extra software:
|
||||||
|
|
||||||
* autoconf
|
* autoconf >= 2.69
|
||||||
* automake >= 1.16.1
|
* automake >= 1.16.1
|
||||||
* gettext
|
* gettext
|
||||||
* autopoint
|
* autopoint
|
||||||
* pkg-config
|
* pkg-config
|
||||||
* texinfo (for makeinfo)
|
* texinfo (for makeinfo)
|
||||||
* GCC (Clang's GCC emulation is not sufficient)
|
* GCC
|
||||||
* GNU make (POSIX make is not sufficient)
|
* GNU Make (POSIX make is not sufficient)
|
||||||
|
|
||||||
And any tools that those utilities require (GNU m4, Perl, etc.)
|
And any tools that those utilities require (GNU m4, etc.)
|
||||||
|
|
||||||
GNU make requires gnulib to provide some facilities. If you want to maintain
|
To run the tests you must install Perl.
|
||||||
|
|
||||||
|
To build a release you'll need to install lzip.
|
||||||
|
|
||||||
|
GNU Make requires Gnulib to provide some facilities. If you want to maintain
|
||||||
a local installation of gnulib you can set GNULIB_SRCDIR to point to it.
|
a local installation of gnulib you can set GNULIB_SRCDIR to point to it.
|
||||||
Otherwise, ./bootstrap will obtain a clone for you.
|
Otherwise, ./bootstrap will obtain a clone for you.
|
||||||
|
|
||||||
Unfortunately due to issues with gnulib's getloadavg, you must have automake
|
Due to issues with gnulib's getloadavg, you must have automake 1.16.1 or
|
||||||
1.16.1 or above. This version may not yet be available through GNU/Linux
|
above. This version may not yet be available through GNU/Linux package
|
||||||
package managers. If you need to install from source be sure to set
|
managers. If you need to install from source be sure to set ACLOCAL_PATH to
|
||||||
ACLOCAL_PATH to point to the pkg-config location (e.g., /usr/share/aclocal).
|
point to the pkg-config location (e.g., /usr/share/aclocal).
|
||||||
|
|
||||||
If you want to build from Git with a non-GCC compiler, add "MAKE_CFLAGS=" to
|
If you want to build from Git with a non-GCC compiler, add "MAKE_CFLAGS=" to
|
||||||
your make command line (or at least remove any flags your compiler does not
|
your make command line (or at least remove any flags your compiler does not
|
||||||
@@ -112,6 +123,16 @@ After checking out the code, you will need to run the bootstrap script:
|
|||||||
|
|
||||||
$ ./bootstrap
|
$ ./bootstrap
|
||||||
|
|
||||||
|
Alternatively you can just pull content from remote locations with:
|
||||||
|
|
||||||
|
$ ./autopull.sh
|
||||||
|
|
||||||
|
And/or just re-generate auto-generatable files with:
|
||||||
|
|
||||||
|
$ ./autogen.sh
|
||||||
|
|
||||||
|
(Running ./bootstrap does both in one step.)
|
||||||
|
|
||||||
At this point you have successfully brought your Git copy of the GNU
|
At this point you have successfully brought your Git copy of the GNU
|
||||||
make source directory up to the point where it can be treated
|
make source directory up to the point where it can be treated
|
||||||
more-or-less like the official package you would get from ftp.gnu.org.
|
more-or-less like the official package you would get from ftp.gnu.org.
|
||||||
@@ -120,9 +141,9 @@ That is, you can just run:
|
|||||||
$ ./configure
|
$ ./configure
|
||||||
$ make check
|
$ make check
|
||||||
|
|
||||||
to build and test GNU make.
|
to build and test GNU Make.
|
||||||
|
|
||||||
NOTE! This method builds GNU make in "maintainer mode". Make programs built
|
NOTE! This method builds GNU Make in "maintainer mode". Make programs built
|
||||||
in this mode it will be slower, possibly MUCH slower: there are various
|
in this mode it will be slower, possibly MUCH slower: there are various
|
||||||
sanity checks enabled. Further this mode assumes a modern GCC, GNU
|
sanity checks enabled. Further this mode assumes a modern GCC, GNU
|
||||||
libc, and well-formed system headers and enables a high level of
|
libc, and well-formed system headers and enables a high level of
|
||||||
@@ -142,40 +163,76 @@ NOTE! This method builds GNU make in "maintainer mode". Make programs built
|
|||||||
Building From Git for Windows
|
Building From Git for Windows
|
||||||
-----------------------------
|
-----------------------------
|
||||||
|
|
||||||
If you have a UNIX emulation like CYGWIN you can opt to run the general
|
If you have a UNIX emulation like CYGWIN you can opt to run the general build
|
||||||
build procedure above; it will work. Consult README.W32.template for
|
procedure above; it will work. Consult README.W32 for information on options
|
||||||
information on options you might want to use when running ./configure.
|
you might want to use when running ./configure.
|
||||||
|
|
||||||
If you can't or don't want to do that, then first run the .\bootstrap.bat
|
If you can't or don't want to do that, then first run the .\bootstrap.bat
|
||||||
script to prime your Git workspace:
|
script to "prime" your Git workspace:
|
||||||
|
|
||||||
> .\bootstrap.bat
|
> .\bootstrap.bat
|
||||||
|
|
||||||
Next, rename the file README.W32.template to README.W32 and follow those
|
Next, follow the instructions in the README.W32 file.
|
||||||
instructions.
|
|
||||||
|
Note, neither of these methods are tested regularly by the GNU Make
|
||||||
|
maintainers. Building for Windows from a distribution tarball IS tested
|
||||||
|
regularly.
|
||||||
|
|
||||||
|
NOTE! "Maintainer mode" (see above) IS ENABLED when building from Git using
|
||||||
|
the build_w32.bat file.
|
||||||
|
|
||||||
|
|
||||||
|
Debugging and Testing
|
||||||
|
---------------------
|
||||||
|
|
||||||
|
These instructions have been tested on GNU systems. I have no idea if they
|
||||||
|
work on non-GNU systems (Windows, MacOS, etc.)
|
||||||
|
|
||||||
|
* Alternate Configurations:
|
||||||
|
The maintMakefile has a rule for running configure with various different
|
||||||
|
options, with and without packages. Run:
|
||||||
|
|
||||||
|
make check-alt-config
|
||||||
|
|
||||||
|
* Valgrind:
|
||||||
|
You can run all tests under valgrind by passing the -memcheck option:
|
||||||
|
|
||||||
|
(cd tests && ./run_make_tests -make ../make -memcheck)
|
||||||
|
|
||||||
|
Note, this is slow! Also some tests will fail because of invoking valgrind.
|
||||||
|
|
||||||
|
* ASAN:
|
||||||
|
You can build with ASAN and run tests, like this:
|
||||||
|
|
||||||
|
make clean
|
||||||
|
make -j8 CFLAGS='-ggdb3 -fsanitize=address' LDFLAGS='-ggdb3 -fsanitize=address'
|
||||||
|
make check
|
||||||
|
|
||||||
|
Note that ASAN is reporting many more errors than valgrind. I don't know
|
||||||
|
which one is wrong: I haven't looked at them closely.
|
||||||
|
|
||||||
|
|
||||||
Creating a Package
|
Creating a Package
|
||||||
------------------
|
------------------
|
||||||
|
|
||||||
Once you have performed the above steps (including the configuration and
|
Once you have performed the above steps (including the configuration and
|
||||||
build) you can create a GNU make package. This is very simple, just
|
build) you can create a GNU Make package. This is very simple, just
|
||||||
run:
|
run:
|
||||||
|
|
||||||
$ make dist-gzip
|
$ make dist-gzip
|
||||||
|
|
||||||
and, if you like:
|
and, if you like:
|
||||||
|
|
||||||
$ make dist-bzip2
|
$ make dist-lzip
|
||||||
|
|
||||||
Even better, you should run this:
|
Even better, you should run this:
|
||||||
|
|
||||||
$ make distcheck
|
$ make distcheck
|
||||||
|
|
||||||
Which will build both .gz and .bz2 package files, then unpack them into
|
Which will build both .gz and .lz package files, then unpack one into a
|
||||||
a temporary location, try to build them, and repack them, verifying that
|
temporary location, try to build it and repack it, then verifying that
|
||||||
everything works, you get the same results, _and_ no extraneous files
|
everything works, you get the same results, _and_ no extraneous files are
|
||||||
are left over after the "distclean" rule.
|
left over after the "distclean" rule.
|
||||||
|
|
||||||
This package can be unpacked and built to give a "normal" (non-maintainer
|
This package can be unpacked and built to give a "normal" (non-maintainer
|
||||||
mode) result.
|
mode) result.
|
||||||
@@ -196,33 +253,117 @@ consistent (that's why we don't finalize the Git tag, etc. until the end).
|
|||||||
"Fixed Release" ID number.
|
"Fixed Release" ID number.
|
||||||
* Run "make distcheck" to be sure it all works.
|
* Run "make distcheck" to be sure it all works.
|
||||||
* Run "make check-alt-config" to be sure alternative configurations work
|
* Run "make check-alt-config" to be sure alternative configurations work
|
||||||
* Run "make update-makeweb" to get a copy of the GNU make web pages
|
|
||||||
* Run "make update-gnuweb" to get a copy of the GNU website boilerplate pages
|
|
||||||
* Update the web page boilerplate if necessary:
|
|
||||||
../gnu-www/www/server/standards/patch-from-parent ../make-web/make.html \
|
|
||||||
../gnu-www/www/server/standards/boilerplate.html
|
|
||||||
* Run "make gendocs" (requires gnulib) to generate the manual files for
|
|
||||||
the GNU make web pages.
|
|
||||||
* Follow the directions from gendocs for the web page repository
|
|
||||||
* run "make tag-release" to create a Git tag for the release
|
* run "make tag-release" to create a Git tag for the release
|
||||||
* Push everything:
|
* Push everything:
|
||||||
git push --tags origin master
|
git push --tags origin master
|
||||||
|
|
||||||
Manage the Savannah project for GNU make:
|
The safest thing is to create an entirely new repository and build the final
|
||||||
|
package from there:
|
||||||
|
|
||||||
>>> This is only for real releases, not release candidate builds <<<
|
git clone git://git.savannah.gnu.org/make.git make-release
|
||||||
|
cd make-release
|
||||||
|
|
||||||
|
If you don't want to create a new repository then run "git clean -fdx".
|
||||||
|
Then:
|
||||||
|
|
||||||
|
./bootstrap.sh
|
||||||
|
./configure
|
||||||
|
make distcheck
|
||||||
|
|
||||||
|
Perform test builds on whichever systems you have access to.
|
||||||
|
|
||||||
|
Use a previous announcement as a template to create an announcement in a text
|
||||||
|
file then sign it with GPG:
|
||||||
|
|
||||||
|
gpg --clearsign <announcement.txt>
|
||||||
|
|
||||||
|
Or, use your mail client's PGP/GPG signing capabilities.
|
||||||
|
|
||||||
|
NOTE! In order to publish a package on the FSF FTP site you need to have my
|
||||||
|
GPG private key, and my passphrase to unlock it.
|
||||||
|
|
||||||
|
Depending on your distribution (whether GnuPG is integrated with your
|
||||||
|
keyring etc.) the upload operation will either pop up a window asking
|
||||||
|
for the GPG key passphrase one time, or else it will use the CLI to ask
|
||||||
|
for the GPG passphrase _THREE_ times. Sigh.
|
||||||
|
|
||||||
|
|
||||||
|
Publishing a Release Candidate
|
||||||
|
------------------------------
|
||||||
|
|
||||||
|
Usually I publish one or two release candidates for people to test before
|
||||||
|
making an official release. Release candidates use a GNU numbering scheme,
|
||||||
|
which add a ".9x" release number to the PREVIOUS major release. So the first
|
||||||
|
release candidate for GNU Make 4.4 would be GNU Make 4.3.90, the second
|
||||||
|
release candidate would be 4.3.91, etc.
|
||||||
|
|
||||||
|
Upload a release candidate using:
|
||||||
|
|
||||||
|
make upload-alpha
|
||||||
|
|
||||||
|
Announce a release candidate to these mailing lists:
|
||||||
|
|
||||||
|
To: bug-make@gnu.org
|
||||||
|
BCC: help-make@gnu.org, make-w32@gnu.org, make-alpha@gnu.org
|
||||||
|
|
||||||
|
You will have to approve the BCC's on the mailing list admin sites. Send
|
||||||
|
separate copies to (don't use CC as replies will go to these lists):
|
||||||
|
|
||||||
|
* coordinator@translationproject.org
|
||||||
|
* platform-testers@gnu.org
|
||||||
|
|
||||||
|
|
||||||
|
Publishing a Release
|
||||||
|
--------------------
|
||||||
|
|
||||||
|
When publishing a final release there are extra steps that need to be taken:
|
||||||
|
|
||||||
|
* Run "make update-makeweb" to get a copy of the GNU Make web pages
|
||||||
|
* Run "make update-gnuweb" to get a copy of the GNU website boilerplate pages
|
||||||
|
* Update the web page boilerplate if necessary:
|
||||||
|
( cd ~/src/make/make-web \
|
||||||
|
&& ~/src/gnu-www/www/server/standards/patch-from-parent \
|
||||||
|
make.html \
|
||||||
|
~/src/gnu-www/www/server/standards/boilerplate.html )
|
||||||
|
* Run "make gendocs" (requires gnulib) to generate the manual files for
|
||||||
|
the GNU Make web pages.
|
||||||
|
* Follow the directions from gendocs for the web page repository
|
||||||
|
|
||||||
|
Manage the Savannah project for GNU Make:
|
||||||
|
|
||||||
* In Savannah modify the "Value", "Rank", and "Description" values for the
|
* In Savannah modify the "Value", "Rank", and "Description" values for the
|
||||||
current "SCM" entry in both "Component Version" and "Fix Release" fields
|
current "SCM" entry in both "Component Version" and "Fix Release" fields
|
||||||
to refer to the new release. The "Rank" field should be 10 less than the
|
to refer to the new release. The "Rank" field should be 10 less than the
|
||||||
previous release so it orders properly.
|
previous release so it orders properly.
|
||||||
* In Savannah create a new entry for the "Component Version" and "Fix
|
|
||||||
Release" fields:
|
* In Savannah create a new entry for the "Component Version" field:
|
||||||
- Value: SCM
|
- Value: SCM
|
||||||
- Rank: 20
|
- Rank: 20
|
||||||
- Descr: Issues found in code retrieved from Source Code Management (Git), rather than a distributed version. Please include the SHA you are working with.
|
- Descr: Issues found in code retrieved from Source Code Management (Git), rather than a distributed version. Please include the SHA you are working with.
|
||||||
|
|
||||||
- Descr: Fixed in Source Code Management (Git). The fix will be included in the next release of GNU make.
|
* In Savannah create a new entry for the "Fix Release" field:
|
||||||
|
- Value: SCM
|
||||||
|
- Rank: 20
|
||||||
|
- Descr: Fixed in Source Code Management (Git). The fix will be included in the next release of GNU Make.
|
||||||
|
|
||||||
|
Upload a release using:
|
||||||
|
|
||||||
|
make upload-ftp
|
||||||
|
|
||||||
|
Announce a release to these mailing lists:
|
||||||
|
|
||||||
|
To: info-gnu@gnu.org, bug-make@gnu.org
|
||||||
|
BCC: help-make@gnu.org, make-w32@gnu.org, make-alpha@gnu.org
|
||||||
|
|
||||||
|
You will have to approve the BCC's on the mailing list admin sites. Send
|
||||||
|
separate copies to (don't use CC as replies will go to these lists):
|
||||||
|
|
||||||
|
* coordinator@translationproject.org
|
||||||
|
* platform-testers@gnu.org
|
||||||
|
|
||||||
|
Announce on Savannah:
|
||||||
|
|
||||||
|
* Add a news item to the Savannah project site.
|
||||||
|
|
||||||
Start the next release:
|
Start the next release:
|
||||||
|
|
||||||
@@ -231,71 +372,11 @@ Start the next release:
|
|||||||
* Update the Savannah URL for the bugs fixed in the NEWS section.
|
* Update the Savannah URL for the bugs fixed in the NEWS section.
|
||||||
|
|
||||||
|
|
||||||
Publishing a Package
|
|
||||||
--------------------
|
|
||||||
|
|
||||||
In order to publish a package on the FSF FTP site, either the release
|
|
||||||
site ftp://ftp.gnu.org, or the prerelease site ftp://alpha.gnu.org, you
|
|
||||||
first need to have my GPG private key and my passphrase to unlock it.
|
|
||||||
And, you can't have them! So there! But, just so I remember here's
|
|
||||||
what to do:
|
|
||||||
|
|
||||||
Make sure the "Steps to Release" are complete and committed and tagged.
|
|
||||||
|
|
||||||
git clone git://git.savannah.gnu.org/make.git make-release
|
|
||||||
|
|
||||||
cd make-release
|
|
||||||
|
|
||||||
<run the commands above to build the release>
|
|
||||||
|
|
||||||
make upload-alpha # for alpha.gnu.org (pre-releases)
|
|
||||||
-OR-
|
|
||||||
make upload-ftp # for ftp.gnu.org (official releases)
|
|
||||||
|
|
||||||
Depending on your distribution (whether GnuPG is integrated with your keyring
|
|
||||||
etc.) it will either pop up a window asking for your GPG key passphrase one
|
|
||||||
time, or else it will use the CLI to ask for the GPG passphrase _THREE_ times.
|
|
||||||
Sigh.
|
|
||||||
|
|
||||||
|
|
||||||
For both final releases and pre-releases, send an email with the URL of
|
|
||||||
the package to the GNU translation robot to allow the translators to
|
|
||||||
work on it:
|
|
||||||
|
|
||||||
<coordinator@translationproject.org>
|
|
||||||
|
|
||||||
|
|
||||||
Where to Announce
|
|
||||||
-----------------
|
|
||||||
|
|
||||||
Create the announcement in a text file, using 'git shortlog',
|
|
||||||
then sign it with GPG:
|
|
||||||
|
|
||||||
gpg --clearsign <announcement.txt>
|
|
||||||
|
|
||||||
Or, use your mail client's PGP/GPG signing capabilities.
|
|
||||||
|
|
||||||
Announce the release:
|
|
||||||
|
|
||||||
* For release candidate builds:
|
|
||||||
To: bug-make@gnu.org
|
|
||||||
CC: coordinator@translationproject.org
|
|
||||||
BCC: help-make@gnu.org, make-w32@gnu.org, make-alpha@gnu.org
|
|
||||||
|
|
||||||
* For release builds
|
|
||||||
To: info-gnu@gnu.org, bug-make@gnu.org
|
|
||||||
CC: coordinator@translationproject.org
|
|
||||||
BCC: help-make@gnu.org, make-w32@gnu.org, make-alpha@gnu.org
|
|
||||||
|
|
||||||
* Add a news item to the Savannah project site.
|
|
||||||
* Add an update to freecode.com (nee freshmeat.net)
|
|
||||||
|
|
||||||
|
|
||||||
Appendix A - For The Brave
|
Appendix A - For The Brave
|
||||||
--------------------------
|
--------------------------
|
||||||
|
|
||||||
For those of you who trust me implicitly, or are just brave (or
|
For those of you who trust me implicitly, or are just brave (or
|
||||||
foolhardy), here is a canned sequence of commands to build a GNU make
|
foolhardy), here is a canned sequence of commands to build a GNU Make
|
||||||
distribution package from a virgin Git source checkout (assuming all the
|
distribution package from a virgin Git source checkout (assuming all the
|
||||||
prerequisites are available of course).
|
prerequisites are available of course).
|
||||||
|
|
||||||
@@ -306,6 +387,6 @@ For a debugging version:
|
|||||||
|
|
||||||
./bootstrap && ./configure CFLAGS=-g && make check
|
./bootstrap && ./configure CFLAGS=-g && make check
|
||||||
|
|
||||||
For a release version
|
For an optimized version
|
||||||
|
|
||||||
./bootstrap && ./configure && make check
|
./bootstrap && ./configure && make check
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
This directory contains the %VERSION% release of GNU Make.
|
This directory contains the @PACKAGE_VERSION@ release of @PACKAGE_NAME@.
|
||||||
|
|
||||||
See the file NEWS for the user-visible changes from previous releases.
|
See the file NEWS for the user-visible changes from previous releases.
|
||||||
In addition, there have been bugs fixed.
|
In addition, there have been bugs fixed.
|
||||||
@@ -6,7 +6,7 @@ In addition, there have been bugs fixed.
|
|||||||
Please check the system-specific notes below for any caveats related to your
|
Please check the system-specific notes below for any caveats related to your
|
||||||
operating system.
|
operating system.
|
||||||
|
|
||||||
If you are trying to build GNU make from a Git clone rather than a downloaded
|
If you are trying to build GNU Make from a Git clone rather than a downloaded
|
||||||
source distribution, see the README.git file for instructions.
|
source distribution, see the README.git file for instructions.
|
||||||
|
|
||||||
For source distribution building and installation instructions, see the file
|
For source distribution building and installation instructions, see the file
|
||||||
@@ -15,12 +15,12 @@ INSTALL.
|
|||||||
If you need to build GNU Make and have no other 'make' program to use, you can
|
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
|
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,
|
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.
|
type 'sh build.sh'. This will compile the program in the current directory.
|
||||||
Then you will have a Make program that you can use for './make install', or
|
Then you will have a 'make' program that you can use for './make install', or
|
||||||
whatever else.
|
whatever else.
|
||||||
|
|
||||||
Some systems' Make programs cannot process the Makefile for GNU Make. If you
|
Some systems' 'make' programs cannot process the Makefile for GNU Make.
|
||||||
get errors from your system's Make when building GNU Make, try using
|
If you get errors from your system's 'make' when building GNU Make, try using
|
||||||
'build.sh' instead.
|
'build.sh' instead.
|
||||||
|
|
||||||
|
|
||||||
@@ -34,20 +34,20 @@ Downloading
|
|||||||
|
|
||||||
GNU Make can be obtained in many different ways. See a description here:
|
GNU Make can be obtained in many different ways. See a description here:
|
||||||
|
|
||||||
http://www.gnu.org/software/software.html
|
https://www.gnu.org/software/software.html
|
||||||
|
|
||||||
|
|
||||||
Documentation
|
Documentation
|
||||||
-------------
|
-------------
|
||||||
|
|
||||||
GNU make is fully documented in the GNU Make manual, which is contained
|
GNU Make is fully documented in the GNU Make manual, which is contained in
|
||||||
in this distribution as the file make.texinfo. You can also find
|
this distribution as the file make.texi. You can also find on-line and
|
||||||
on-line and preformatted (PostScript and DVI) versions at the FSF's web
|
preformatted (PostScript and DVI) versions at the FSF's web site. There is
|
||||||
site. There is information there about ordering hardcopy documentation.
|
information there about ordering hardcopy documentation.
|
||||||
|
|
||||||
http://www.gnu.org/
|
https://www.gnu.org/
|
||||||
http://www.gnu.org/doc/doc.html
|
https://www.gnu.org/doc/doc.html
|
||||||
http://www.gnu.org/manual/manual.html
|
https://www.gnu.org/manual/manual.html
|
||||||
|
|
||||||
|
|
||||||
Development
|
Development
|
||||||
@@ -56,49 +56,82 @@ Development
|
|||||||
GNU Make development is hosted by Savannah, the FSF's online development
|
GNU Make development is hosted by Savannah, the FSF's online development
|
||||||
management tool. Savannah is here:
|
management tool. Savannah is here:
|
||||||
|
|
||||||
http://savannah.gnu.org
|
https://savannah.gnu.org
|
||||||
|
|
||||||
And the GNU Make development page is here:
|
And the GNU Make development page is here:
|
||||||
|
|
||||||
http://savannah.gnu.org/projects/make/
|
https://savannah.gnu.org/projects/make/
|
||||||
|
|
||||||
You can find most information concerning the development of GNU Make at
|
You can find most information concerning the development of GNU Make at
|
||||||
this site.
|
this site.
|
||||||
|
|
||||||
|
|
||||||
|
Regression Tests
|
||||||
|
----------------
|
||||||
|
|
||||||
|
GNU Make contains a suite of regression tests. To run them use "make check"
|
||||||
|
after building GNU Make. If they fail a tar package will be created
|
||||||
|
containing useful information, which can be emailed (as an attachment) to
|
||||||
|
the <bug-make@gnu.org> mailing list.
|
||||||
|
|
||||||
|
Please note that since these tests rely on known-good-output comparisons,
|
||||||
|
they can show spurious failures on some systems (particularly non-POSIX systems
|
||||||
|
such as Windows).
|
||||||
|
|
||||||
|
|
||||||
Bug Reporting
|
Bug Reporting
|
||||||
-------------
|
-------------
|
||||||
|
|
||||||
You can send GNU make bug reports to <bug-make@gnu.org>. Please see the
|
If you need help using GNU Make, try asking on <help-make@gnu.org>.
|
||||||
section of the GNU make manual entitled 'Problems and Bugs' for
|
|
||||||
information on submitting useful and complete bug reports.
|
If you found a bug, you can send a bug reports to <bug-make@gnu.org>.
|
||||||
|
Please see the section of the GNU Make manual entitled 'Problems and Bugs'
|
||||||
|
for information on submitting useful and complete bug reports.
|
||||||
|
|
||||||
|
You do not need to subscribe to these lists first.
|
||||||
|
|
||||||
You can also use the online bug tracking system in the Savannah GNU Make
|
You can also use the online bug tracking system in the Savannah GNU Make
|
||||||
project to submit new problem reports or search for existing ones:
|
project to submit new problem reports or search for existing ones:
|
||||||
|
|
||||||
http://savannah.gnu.org/bugs/?group=make
|
https://savannah.gnu.org/bugs/?group=make
|
||||||
|
|
||||||
If you need help using GNU make, try these forums:
|
We prefer to use the bug tracking system ONLY for bugs or enhancements,
|
||||||
|
not for help requests: please use the mailing lists to get help.
|
||||||
|
|
||||||
help-make@gnu.org
|
|
||||||
help-utils@gnu.org
|
Submitting Patches
|
||||||
news:gnu.utils.help
|
------------------
|
||||||
news:gnu.utils.bug
|
|
||||||
|
If you'd like to propose a change to GNU Make, you can provide a patch with
|
||||||
|
your changes. If you are making your changes in a Git workspace you can run
|
||||||
|
"git format-patch" to create a patch file. If not, you can use the diff(1)
|
||||||
|
utility to create a patch file; please use "diff -u".
|
||||||
|
|
||||||
|
Once you have a patch you can submit it in any of these ways:
|
||||||
|
|
||||||
|
* Create a bug on Savannah and add the patch as an attachment:
|
||||||
|
https://savannah.gnu.org/bugs/?group=make&func=additem
|
||||||
|
|
||||||
|
* Send the patch via email to <bug-make@gnu.org>: be sure to add it as an
|
||||||
|
attachment to avoid interference by email processors.
|
||||||
|
|
||||||
|
All non-trivial changes require FSF copyright paperwork to be completed
|
||||||
|
before they can be accepted. Contact <bug-make@gnu.org> for help.
|
||||||
|
|
||||||
|
|
||||||
Git Access
|
Git Access
|
||||||
----------
|
----------
|
||||||
|
|
||||||
The GNU make source repository is available via Git from the GNU Savannah Git
|
The GNU Make source repository is available via Git from the GNU Savannah Git
|
||||||
server; look here for details:
|
server; look here for details:
|
||||||
|
|
||||||
http://savannah.gnu.org/git/?group=make
|
https://savannah.gnu.org/git/?group=make
|
||||||
|
|
||||||
Please note: you won't be able to build GNU make from Git without installing
|
Please note: you won't be able to build GNU Make from Git without installing
|
||||||
appropriate maintainer's tools, such as GNU m4, automake, autoconf, Perl, GNU
|
appropriate maintainer's tools, such as GNU m4, automake, autoconf, Perl, GNU
|
||||||
make, and GCC.
|
make, and GCC.
|
||||||
|
|
||||||
See the README.git file for instructions on how to build GNU make once these
|
See the README.git file for instructions on how to build GNU Make once these
|
||||||
tools are available. We make no guarantees about the contents or quality of
|
tools are available. We make no guarantees about the contents or quality of
|
||||||
the latest code in the Git repository: it is not unheard of for code that is
|
the latest code in the Git repository: it is not unheard of for code that is
|
||||||
known to be broken to be checked in. Use at your own risk.
|
known to be broken to be checked in. Use at your own risk.
|
||||||
@@ -112,16 +145,16 @@ 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.
|
correctly. It is said that using 'cc' without '-O' does work.
|
||||||
|
|
||||||
The standard /bin/sh on SunOS 4.1.3_U1 and 4.1.4 is broken and cannot be
|
The standard /bin/sh on SunOS 4.1.3_U1 and 4.1.4 is broken and cannot be
|
||||||
used to configure GNU make. Please install a different shell such as
|
used to configure GNU Make. Please install a different shell such as
|
||||||
bash or pdksh in order to run "configure". See this message for more
|
bash or pdksh in order to run "configure". See this message for more
|
||||||
information:
|
information:
|
||||||
http://mail.gnu.org/archive/html/bug-autoconf/2003-10/msg00190.html
|
https://mail.gnu.org/archive/html/bug-autoconf/2003-10/msg00190.html
|
||||||
|
|
||||||
One area that is often a problem in configuration and porting is the code
|
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
|
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
|
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
|
properly on your system. (You must run 'configure' beforehand, but you
|
||||||
need not build Make itself to run this test.)
|
need not build 'make' itself to run this test.)
|
||||||
|
|
||||||
Another potential source of porting problems is the support for large
|
Another potential source of porting problems is the support for large
|
||||||
files (LFS) in configure for those operating systems that provide it.
|
files (LFS) in configure for those operating systems that provide it.
|
||||||
@@ -130,7 +163,7 @@ difficulties, then as a workaround you should be able to disable LFS by
|
|||||||
adding the '--disable-largefile' option to the 'configure' script.
|
adding the '--disable-largefile' option to the 'configure' script.
|
||||||
|
|
||||||
On systems that support micro- and nano-second timestamp values and
|
On systems that support micro- and nano-second timestamp values and
|
||||||
where stat(2) provides this information, GNU make will use it when
|
where stat(2) provides this information, GNU Make will use it when
|
||||||
comparing timestamps to get the most accurate possible result. However,
|
comparing timestamps to get the most accurate possible result. However,
|
||||||
note that many current implementations of tools that *set* timestamps do
|
note that many current implementations of tools that *set* timestamps do
|
||||||
not preserve micro- or nano-second granularity. This means that "cp -p"
|
not preserve micro- or nano-second granularity. This means that "cp -p"
|
||||||
@@ -144,7 +177,7 @@ force make to treat them properly. See the manual for details.
|
|||||||
Ports
|
Ports
|
||||||
-----
|
-----
|
||||||
|
|
||||||
- See README.customs for details on integrating GNU make with the
|
- See README.customs for details on integrating GNU Make with the
|
||||||
Customs distributed build environment from the Pmake distribution.
|
Customs distributed build environment from the Pmake distribution.
|
||||||
|
|
||||||
- See README.VMS for details about GNU Make on OpenVMS.
|
- See README.VMS for details about GNU Make on OpenVMS.
|
||||||
@@ -157,22 +190,22 @@ Ports
|
|||||||
using DJGPP tools.
|
using DJGPP tools.
|
||||||
|
|
||||||
A precompiled binary of the MSDOS port of GNU Make is available as part
|
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
|
of DJGPP; see the WWW page https://www.delorie.com/djgpp/ for more
|
||||||
information.
|
information.
|
||||||
|
|
||||||
The Cygwin project maintains its own port of GNU make. That port may have
|
The Cygwin project maintains its own port of GNU Make. That port may have
|
||||||
patches which are not present in this version. If you are using Cygwin
|
patches which are not present in this version. If you are using Cygwin
|
||||||
you should use their version of GNU make, and if you have questions about
|
you should use their version of GNU Make, and if you have questions about
|
||||||
it you should start by asking on those mailing lists and forums.
|
it you should start by asking on those mailing lists and forums.
|
||||||
|
|
||||||
Please note there are two _separate_ ports of GNU make for Microsoft
|
Please note there are two _separate_ ports of GNU Make for Microsoft
|
||||||
systems: a native Windows tool built with (for example) MSVC or Cygwin,
|
systems: a native Windows tool built with (for example) MSVC or Cygwin,
|
||||||
and a DOS-based tool built with DJGPP. Please be sure you are looking
|
and a DOS-based tool built with DJGPP. Please be sure you are looking
|
||||||
at the right README!
|
at the right README!
|
||||||
|
|
||||||
|
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 1988-2019 Free Software Foundation, Inc.
|
Copyright (C) 1988-2022 Free Software Foundation, Inc.
|
||||||
This file is part of GNU Make.
|
This file is part of GNU Make.
|
||||||
|
|
||||||
GNU Make is free software; you can redistribute it and/or modify it under the
|
GNU Make is free software; you can redistribute it and/or modify it under the
|
||||||
@@ -185,4 +218,4 @@ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|||||||
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
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
|
You should have received a copy of the GNU General Public License along with
|
||||||
this program. If not, see <http://www.gnu.org/licenses/>.
|
this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
@@ -101,7 +101,7 @@ The Rest of the List
|
|||||||
|
|
||||||
|
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 1997-2019 Free Software Foundation, Inc.
|
Copyright (C) 1997-2022 Free Software Foundation, Inc.
|
||||||
This file is part of GNU Make.
|
This file is part of GNU Make.
|
||||||
|
|
||||||
GNU Make is free software; you can redistribute it and/or modify it under the
|
GNU Make is free software; you can redistribute it and/or modify it under the
|
||||||
@@ -114,4 +114,4 @@ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|||||||
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
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
|
You should have received a copy of the GNU General Public License along with
|
||||||
this program. If not, see <http://www.gnu.org/licenses/>.
|
this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|||||||
486
autogen.sh
Executable file
486
autogen.sh
Executable file
@@ -0,0 +1,486 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
# Convenience script for regenerating all autogeneratable files that are
|
||||||
|
# omitted from the version control repository. In particular, this script
|
||||||
|
# also regenerates all aclocal.m4, config.h.in, Makefile.in, configure files
|
||||||
|
# with new versions of autoconf or automake.
|
||||||
|
|
||||||
|
# Copyright (C) 2003-2022 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 3 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
# Originally written by Paul Eggert. The canonical version of this
|
||||||
|
# script is maintained as top/autogen.sh in gnulib. However, to be
|
||||||
|
# useful to your package, you should place a copy of it under version
|
||||||
|
# control in the top-level directory of your package. The intent is
|
||||||
|
# that all customization can be done with a bootstrap.conf file also
|
||||||
|
# maintained in your version control; gnulib comes with a template
|
||||||
|
# build-aux/bootstrap.conf to get you started.
|
||||||
|
#
|
||||||
|
# Alternatively, you can use an autogen.sh script that is specific
|
||||||
|
# to your package.
|
||||||
|
|
||||||
|
scriptversion=2022-07-24.15; # UTC
|
||||||
|
|
||||||
|
me="$0"
|
||||||
|
medir=`dirname "$me"`
|
||||||
|
|
||||||
|
# Read the function library and the configuration.
|
||||||
|
. "$medir"/bootstrap-funclib.sh
|
||||||
|
|
||||||
|
# Ensure that CDPATH is not set. Otherwise, the output from cd
|
||||||
|
# would cause trouble in at least one use below.
|
||||||
|
(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
|
||||||
|
|
||||||
|
# Environment variables that may be set by the user.
|
||||||
|
: "${AUTOPOINT=autopoint}"
|
||||||
|
: "${AUTORECONF=autoreconf}"
|
||||||
|
|
||||||
|
if test "$vc_ignore" = auto; then
|
||||||
|
vc_ignore=
|
||||||
|
test -d .git && vc_ignore=.gitignore
|
||||||
|
test -d CVS && vc_ignore="$vc_ignore .cvsignore"
|
||||||
|
fi
|
||||||
|
|
||||||
|
usage() {
|
||||||
|
cat <<EOF
|
||||||
|
Usage: $me [OPTION]...
|
||||||
|
Bootstrap this package from the checked-out sources.
|
||||||
|
|
||||||
|
Optional environment variables:
|
||||||
|
GNULIB_SRCDIR Specifies the local directory where gnulib
|
||||||
|
sources reside. Use this if you already
|
||||||
|
have gnulib sources on your machine, and
|
||||||
|
you want to use these sources.
|
||||||
|
|
||||||
|
Options:
|
||||||
|
--copy copy files instead of creating symbolic links
|
||||||
|
--force attempt to bootstrap even if the sources seem
|
||||||
|
not to have been checked out
|
||||||
|
EOF
|
||||||
|
bootstrap_print_option_usage_hook
|
||||||
|
cat <<EOF
|
||||||
|
If the file bootstrap.conf exists in the same directory as this script, its
|
||||||
|
contents are read as shell variables to configure the bootstrap.
|
||||||
|
|
||||||
|
For build prerequisites, environment variables like \$AUTOCONF and \$AMTAR
|
||||||
|
are honored.
|
||||||
|
|
||||||
|
Gnulib sources are assumed to be present:
|
||||||
|
* in \$GNULIB_SRCDIR, if that environment variable is set,
|
||||||
|
* otherwise, in the 'gnulib' submodule, if such a submodule is configured,
|
||||||
|
* otherwise, in the 'gnulib' subdirectory.
|
||||||
|
|
||||||
|
Running without arguments will suffice in most cases.
|
||||||
|
EOF
|
||||||
|
}
|
||||||
|
|
||||||
|
# Parse options.
|
||||||
|
|
||||||
|
# Whether to use copies instead of symlinks.
|
||||||
|
copy=false
|
||||||
|
|
||||||
|
for option
|
||||||
|
do
|
||||||
|
case $option in
|
||||||
|
--help)
|
||||||
|
usage
|
||||||
|
exit;;
|
||||||
|
--version)
|
||||||
|
set -e
|
||||||
|
echo "autogen.sh $scriptversion"
|
||||||
|
echo "$copyright"
|
||||||
|
exit 0
|
||||||
|
;;
|
||||||
|
--force)
|
||||||
|
checkout_only_file=;;
|
||||||
|
--copy)
|
||||||
|
copy=true;;
|
||||||
|
*)
|
||||||
|
bootstrap_option_hook $option || die "$option: unknown option";;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
|
test -z "$GNULIB_SRCDIR" || test -d "$GNULIB_SRCDIR" \
|
||||||
|
|| die "Error: \$GNULIB_SRCDIR environment variable or --gnulib-srcdir option is specified, but does not denote a directory"
|
||||||
|
|
||||||
|
if test -n "$checkout_only_file" && test ! -r "$checkout_only_file"; then
|
||||||
|
die "Running this script from a non-checked-out distribution is risky."
|
||||||
|
fi
|
||||||
|
|
||||||
|
if $use_gnulib; then
|
||||||
|
if test -z "$GNULIB_SRCDIR"; then
|
||||||
|
gnulib_path=$(test -f .gitmodules && git config --file .gitmodules submodule.gnulib.path)
|
||||||
|
test -z "$gnulib_path" && gnulib_path=gnulib
|
||||||
|
GNULIB_SRCDIR=$gnulib_path
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
version_controlled_file() {
|
||||||
|
parent=$1
|
||||||
|
file=$2
|
||||||
|
if test -d .git; then
|
||||||
|
git rm -n "$file" > /dev/null 2>&1
|
||||||
|
elif test -d .svn; then
|
||||||
|
svn log -r HEAD "$file" > /dev/null 2>&1
|
||||||
|
elif test -d CVS; then
|
||||||
|
grep -F "/${file##*/}/" "$parent/CVS/Entries" 2>/dev/null |
|
||||||
|
grep '^/[^/]*/[0-9]' > /dev/null
|
||||||
|
else
|
||||||
|
warn_ "no version control for $file?"
|
||||||
|
false
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# Strip blank and comment lines to leave significant entries.
|
||||||
|
gitignore_entries() {
|
||||||
|
sed '/^#/d; /^$/d' "$@"
|
||||||
|
}
|
||||||
|
|
||||||
|
# If $STR is not already on a line by itself in $FILE, insert it at the start.
|
||||||
|
# Entries are inserted at the start of the ignore list to ensure existing
|
||||||
|
# entries starting with ! are not overridden. Such entries support
|
||||||
|
# whitelisting exceptions after a more generic blacklist pattern.
|
||||||
|
insert_if_absent() {
|
||||||
|
file=$1
|
||||||
|
str=$2
|
||||||
|
test -f $file || touch $file
|
||||||
|
test -r $file || die "Error: failed to read ignore file: $file"
|
||||||
|
duplicate_entries=$(gitignore_entries $file | sort | uniq -d)
|
||||||
|
if [ "$duplicate_entries" ] ; then
|
||||||
|
die "Error: Duplicate entries in $file: " $duplicate_entries
|
||||||
|
fi
|
||||||
|
linesold=$(gitignore_entries $file | wc -l)
|
||||||
|
linesnew=$( { echo "$str"; cat $file; } | gitignore_entries | sort -u | wc -l)
|
||||||
|
if [ $linesold != $linesnew ] ; then
|
||||||
|
{ echo "$str" | cat - $file > $file.bak && mv $file.bak $file; } \
|
||||||
|
|| die "insert_if_absent $file $str: failed"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# Adjust $PATTERN for $VC_IGNORE_FILE and insert it with
|
||||||
|
# insert_if_absent.
|
||||||
|
insert_vc_ignore() {
|
||||||
|
vc_ignore_file="$1"
|
||||||
|
pattern="$2"
|
||||||
|
case $vc_ignore_file in
|
||||||
|
*.gitignore)
|
||||||
|
# A .gitignore entry that does not start with '/' applies
|
||||||
|
# recursively to subdirectories, so prepend '/' to every
|
||||||
|
# .gitignore entry.
|
||||||
|
pattern=$(echo "$pattern" | sed s,^,/,);;
|
||||||
|
esac
|
||||||
|
insert_if_absent "$vc_ignore_file" "$pattern"
|
||||||
|
}
|
||||||
|
|
||||||
|
symlink_to_dir()
|
||||||
|
{
|
||||||
|
src=$1/$2
|
||||||
|
dst=${3-$2}
|
||||||
|
|
||||||
|
test -f "$src" && {
|
||||||
|
|
||||||
|
# If the destination directory doesn't exist, create it.
|
||||||
|
# This is required at least for "lib/uniwidth/cjk.h".
|
||||||
|
dst_dir=$(dirname "$dst")
|
||||||
|
if ! test -d "$dst_dir"; then
|
||||||
|
mkdir -p "$dst_dir"
|
||||||
|
|
||||||
|
# If we've just created a directory like lib/uniwidth,
|
||||||
|
# tell version control system(s) it's ignorable.
|
||||||
|
# FIXME: for now, this does only one level
|
||||||
|
parent=$(dirname "$dst_dir")
|
||||||
|
for dot_ig in x $vc_ignore; do
|
||||||
|
test $dot_ig = x && continue
|
||||||
|
ig=$parent/$dot_ig
|
||||||
|
insert_vc_ignore $ig "${dst_dir##*/}"
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
|
if $copy; then
|
||||||
|
{
|
||||||
|
test ! -h "$dst" || {
|
||||||
|
echo "$me: rm -f $dst" &&
|
||||||
|
rm -f "$dst"
|
||||||
|
}
|
||||||
|
} &&
|
||||||
|
test -f "$dst" &&
|
||||||
|
cmp -s "$src" "$dst" || {
|
||||||
|
echo "$me: cp -fp $src $dst" &&
|
||||||
|
cp -fp "$src" "$dst"
|
||||||
|
}
|
||||||
|
else
|
||||||
|
# Leave any existing symlink alone, if it already points to the source,
|
||||||
|
# so that broken build tools that care about symlink times
|
||||||
|
# aren't confused into doing unnecessary builds. Conversely, if the
|
||||||
|
# existing symlink's timestamp is older than the source, make it afresh,
|
||||||
|
# so that broken tools aren't confused into skipping needed builds. See
|
||||||
|
# <https://lists.gnu.org/r/bug-gnulib/2011-05/msg00326.html>.
|
||||||
|
test -h "$dst" &&
|
||||||
|
src_ls=$(ls -diL "$src" 2>/dev/null) && set $src_ls && src_i=$1 &&
|
||||||
|
dst_ls=$(ls -diL "$dst" 2>/dev/null) && set $dst_ls && dst_i=$1 &&
|
||||||
|
test "$src_i" = "$dst_i" &&
|
||||||
|
both_ls=$(ls -dt "$src" "$dst") &&
|
||||||
|
test "X$both_ls" = "X$dst$nl$src" || {
|
||||||
|
dot_dots=
|
||||||
|
case $src in
|
||||||
|
/*) ;;
|
||||||
|
*)
|
||||||
|
case /$dst/ in
|
||||||
|
*//* | */../* | */./* | /*/*/*/*/*/)
|
||||||
|
die "invalid symlink calculation: $src -> $dst";;
|
||||||
|
/*/*/*/*/) dot_dots=../../../;;
|
||||||
|
/*/*/*/) dot_dots=../../;;
|
||||||
|
/*/*/) dot_dots=../;;
|
||||||
|
esac;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
echo "$me: ln -fs $dot_dots$src $dst" &&
|
||||||
|
ln -fs "$dot_dots$src" "$dst"
|
||||||
|
}
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# Die if there is no AC_CONFIG_AUX_DIR($build_aux) line in configure.ac.
|
||||||
|
found_aux_dir=no
|
||||||
|
grep '^[ ]*AC_CONFIG_AUX_DIR(\['"$build_aux"'])' configure.ac \
|
||||||
|
>/dev/null && found_aux_dir=yes
|
||||||
|
grep '^[ ]*AC_CONFIG_AUX_DIR('"$build_aux"')' configure.ac \
|
||||||
|
>/dev/null && found_aux_dir=yes
|
||||||
|
test $found_aux_dir = yes \
|
||||||
|
|| die "configure.ac lacks 'AC_CONFIG_AUX_DIR([$build_aux])'; add it"
|
||||||
|
|
||||||
|
# If $build_aux doesn't exist, create it now, otherwise some bits
|
||||||
|
# below will malfunction. If creating it, also mark it as ignored.
|
||||||
|
if test ! -d $build_aux; then
|
||||||
|
mkdir $build_aux
|
||||||
|
for dot_ig in x $vc_ignore; do
|
||||||
|
test $dot_ig = x && continue
|
||||||
|
insert_vc_ignore $dot_ig $build_aux
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
|
check_build_prerequisites false
|
||||||
|
|
||||||
|
use_libtool=0
|
||||||
|
# We'd like to use grep -E, to see if any of LT_INIT,
|
||||||
|
# AC_PROG_LIBTOOL, AM_PROG_LIBTOOL is used in configure.ac,
|
||||||
|
# but that's not portable enough (e.g., for Solaris).
|
||||||
|
grep '^[ ]*A[CM]_PROG_LIBTOOL' configure.ac >/dev/null \
|
||||||
|
&& use_libtool=1
|
||||||
|
grep '^[ ]*LT_INIT' configure.ac >/dev/null \
|
||||||
|
&& use_libtool=1
|
||||||
|
if test $use_libtool = 1; then
|
||||||
|
find_tool LIBTOOLIZE glibtoolize libtoolize
|
||||||
|
fi
|
||||||
|
|
||||||
|
if $use_gnulib; then
|
||||||
|
gnulib_tool=$GNULIB_SRCDIR/gnulib-tool
|
||||||
|
<$gnulib_tool || exit $?
|
||||||
|
fi
|
||||||
|
|
||||||
|
# NOTE: we have to be careful to run both autopoint and libtoolize
|
||||||
|
# before gnulib-tool, since gnulib-tool is likely to provide newer
|
||||||
|
# versions of files "installed" by these two programs.
|
||||||
|
# Then, *after* gnulib-tool (see below), we have to be careful to
|
||||||
|
# run autoreconf in such a way that it does not run either of these
|
||||||
|
# two just-pre-run programs.
|
||||||
|
|
||||||
|
# Import from gettext.
|
||||||
|
with_gettext=yes
|
||||||
|
grep '^[ ]*AM_GNU_GETTEXT_VERSION(' configure.ac >/dev/null || \
|
||||||
|
with_gettext=no
|
||||||
|
|
||||||
|
if test $with_gettext = yes || test $use_libtool = 1; then
|
||||||
|
|
||||||
|
tempbase=.bootstrap$$
|
||||||
|
trap "rm -f $tempbase.0 $tempbase.1" 1 2 13 15
|
||||||
|
|
||||||
|
> $tempbase.0 > $tempbase.1 &&
|
||||||
|
find . ! -type d -print | sort > $tempbase.0 || exit
|
||||||
|
|
||||||
|
if test $with_gettext = yes; then
|
||||||
|
# Released autopoint has the tendency to install macros that have been
|
||||||
|
# obsoleted in current gnulib, so run this before gnulib-tool.
|
||||||
|
echo "$0: $AUTOPOINT --force"
|
||||||
|
$AUTOPOINT --force || exit
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Autoreconf runs aclocal before libtoolize, which causes spurious
|
||||||
|
# warnings if the initial aclocal is confused by the libtoolized
|
||||||
|
# (or worse out-of-date) macro directory.
|
||||||
|
# libtoolize 1.9b added the --install option; but we support back
|
||||||
|
# to libtoolize 1.5.22, where the install action was default.
|
||||||
|
if test $use_libtool = 1; then
|
||||||
|
install=
|
||||||
|
case $($LIBTOOLIZE --help) in
|
||||||
|
*--install*) install=--install ;;
|
||||||
|
esac
|
||||||
|
echo "running: $LIBTOOLIZE $install --copy"
|
||||||
|
$LIBTOOLIZE $install --copy
|
||||||
|
fi
|
||||||
|
|
||||||
|
find . ! -type d -print | sort >$tempbase.1
|
||||||
|
old_IFS=$IFS
|
||||||
|
IFS=$nl
|
||||||
|
for file in $(comm -13 $tempbase.0 $tempbase.1); do
|
||||||
|
IFS=$old_IFS
|
||||||
|
parent=${file%/*}
|
||||||
|
version_controlled_file "$parent" "$file" || {
|
||||||
|
for dot_ig in x $vc_ignore; do
|
||||||
|
test $dot_ig = x && continue
|
||||||
|
ig=$parent/$dot_ig
|
||||||
|
insert_vc_ignore "$ig" "${file##*/}"
|
||||||
|
done
|
||||||
|
}
|
||||||
|
done
|
||||||
|
IFS=$old_IFS
|
||||||
|
|
||||||
|
rm -f $tempbase.0 $tempbase.1
|
||||||
|
trap - 1 2 13 15
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Import from gnulib.
|
||||||
|
|
||||||
|
if $use_gnulib; then
|
||||||
|
gnulib_tool_options="\
|
||||||
|
--no-changelog\
|
||||||
|
--aux-dir=$build_aux\
|
||||||
|
--doc-base=$doc_base\
|
||||||
|
--lib=$gnulib_name\
|
||||||
|
--m4-base=$m4_base/\
|
||||||
|
--source-base=$source_base/\
|
||||||
|
--tests-base=$tests_base\
|
||||||
|
--local-dir=$local_gl_dir\
|
||||||
|
$gnulib_tool_option_extras\
|
||||||
|
"
|
||||||
|
if test $use_libtool = 1; then
|
||||||
|
case "$gnulib_tool_options " in
|
||||||
|
*' --libtool '*) ;;
|
||||||
|
*) gnulib_tool_options="$gnulib_tool_options --libtool" ;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
echo "$0: $gnulib_tool $gnulib_tool_options --import ..."
|
||||||
|
$gnulib_tool $gnulib_tool_options --import $gnulib_modules \
|
||||||
|
|| die "gnulib-tool failed"
|
||||||
|
|
||||||
|
for file in $gnulib_files; do
|
||||||
|
symlink_to_dir "$GNULIB_SRCDIR" $file \
|
||||||
|
|| die "failed to symlink $file"
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
|
bootstrap_post_import_hook \
|
||||||
|
|| die "bootstrap_post_import_hook failed"
|
||||||
|
|
||||||
|
# Remove any dangling symlink matching "*.m4" or "*.[ch]" in some
|
||||||
|
# gnulib-populated directories. Such .m4 files would cause aclocal to fail.
|
||||||
|
# The following requires GNU find 4.2.3 or newer. Considering the usual
|
||||||
|
# portability constraints of this script, that may seem a very demanding
|
||||||
|
# requirement, but it should be ok. Ignore any failure, which is fine,
|
||||||
|
# since this is only a convenience to help developers avoid the relatively
|
||||||
|
# unusual case in which a symlinked-to .m4 file is git-removed from gnulib
|
||||||
|
# between successive runs of this script.
|
||||||
|
find "$m4_base" "$source_base" \
|
||||||
|
-depth \( -name '*.m4' -o -name '*.[ch]' \) \
|
||||||
|
-type l -xtype l -delete > /dev/null 2>&1
|
||||||
|
|
||||||
|
# Invoke autoreconf with --force --install to ensure upgrades of tools
|
||||||
|
# such as ylwrap.
|
||||||
|
AUTORECONFFLAGS="--verbose --install --force -I $m4_base $ACLOCAL_FLAGS"
|
||||||
|
|
||||||
|
# Some systems (RHEL 5) are using ancient autotools, for which the
|
||||||
|
# --no-recursive option had not been invented. Detect that lack and
|
||||||
|
# omit the option when it's not supported. FIXME in 2017: remove this
|
||||||
|
# hack when RHEL 5 autotools are updated, or when they become irrelevant.
|
||||||
|
case $($AUTORECONF --help) in
|
||||||
|
*--no-recursive*) AUTORECONFFLAGS="$AUTORECONFFLAGS --no-recursive";;
|
||||||
|
esac
|
||||||
|
|
||||||
|
# Tell autoreconf not to invoke autopoint or libtoolize; they were run above.
|
||||||
|
echo "running: AUTOPOINT=true LIBTOOLIZE=true $AUTORECONF $AUTORECONFFLAGS"
|
||||||
|
AUTOPOINT=true LIBTOOLIZE=true $AUTORECONF $AUTORECONFFLAGS \
|
||||||
|
|| die "autoreconf failed"
|
||||||
|
|
||||||
|
# Get some extra files from gnulib, overriding existing files.
|
||||||
|
for file in $gnulib_extra_files; do
|
||||||
|
case $file in
|
||||||
|
*/INSTALL) dst=INSTALL;;
|
||||||
|
build-aux/*) dst=$build_aux/${file#build-aux/};;
|
||||||
|
*) dst=$file;;
|
||||||
|
esac
|
||||||
|
symlink_to_dir "$GNULIB_SRCDIR" $file $dst \
|
||||||
|
|| die "failed to symlink $file"
|
||||||
|
done
|
||||||
|
|
||||||
|
if test $with_gettext = yes; then
|
||||||
|
# Create gettext configuration.
|
||||||
|
echo "$0: Creating po/Makevars from po/Makevars.template ..."
|
||||||
|
rm -f po/Makevars
|
||||||
|
sed '
|
||||||
|
/^EXTRA_LOCALE_CATEGORIES *=/s/=.*/= '"$EXTRA_LOCALE_CATEGORIES"'/
|
||||||
|
/^COPYRIGHT_HOLDER *=/s/=.*/= '"$COPYRIGHT_HOLDER"'/
|
||||||
|
/^MSGID_BUGS_ADDRESS *=/s|=.*|= '"$MSGID_BUGS_ADDRESS"'|
|
||||||
|
/^XGETTEXT_OPTIONS *=/{
|
||||||
|
s/$/ \\/
|
||||||
|
a\
|
||||||
|
'"$XGETTEXT_OPTIONS"' $${end_of_xgettext_options+}
|
||||||
|
}
|
||||||
|
' po/Makevars.template >po/Makevars \
|
||||||
|
|| die 'cannot generate po/Makevars'
|
||||||
|
|
||||||
|
# If the 'gettext' module is in use, grab the latest Makefile.in.in.
|
||||||
|
# If only the 'gettext-h' module is in use, assume autopoint already
|
||||||
|
# put the correct version of this file into place.
|
||||||
|
case $gnulib_modules in
|
||||||
|
*gettext-h*) ;;
|
||||||
|
*gettext*)
|
||||||
|
cp $GNULIB_SRCDIR/build-aux/po/Makefile.in.in po/Makefile.in.in \
|
||||||
|
|| die "cannot create po/Makefile.in.in"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
if test -d runtime-po; then
|
||||||
|
# Similarly for runtime-po/Makevars, but not quite the same.
|
||||||
|
rm -f runtime-po/Makevars
|
||||||
|
sed '
|
||||||
|
/^DOMAIN *=.*/s/=.*/= '"$package"'-runtime/
|
||||||
|
/^subdir *=.*/s/=.*/= runtime-po/
|
||||||
|
/^MSGID_BUGS_ADDRESS *=/s/=.*/= bug-'"$package"'@gnu.org/
|
||||||
|
/^XGETTEXT_OPTIONS *=/{
|
||||||
|
s/$/ \\/
|
||||||
|
a\
|
||||||
|
'"$XGETTEXT_OPTIONS_RUNTIME"' $${end_of_xgettext_options+}
|
||||||
|
}
|
||||||
|
' po/Makevars.template >runtime-po/Makevars \
|
||||||
|
|| die 'cannot generate runtime-po/Makevars'
|
||||||
|
|
||||||
|
# Copy identical files from po to runtime-po.
|
||||||
|
(cd po && cp -p Makefile.in.in *-quot *.header *.sed *.sin ../runtime-po)
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
bootstrap_epilogue
|
||||||
|
|
||||||
|
echo "$0: done. Now you can run './configure'."
|
||||||
|
|
||||||
|
# ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
# Local Variables:
|
||||||
|
# eval: (add-hook 'before-save-hook 'time-stamp)
|
||||||
|
# time-stamp-start: "scriptversion="
|
||||||
|
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
||||||
|
# time-stamp-time-zone: "UTC0"
|
||||||
|
# time-stamp-end: "; # UTC"
|
||||||
|
# End:
|
||||||
273
autopull.sh
Executable file
273
autopull.sh
Executable file
@@ -0,0 +1,273 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
# Convenience script for fetching auxiliary files that are omitted from
|
||||||
|
# the version control repository of this package.
|
||||||
|
|
||||||
|
# Copyright (C) 2003-2022 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 3 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
# Originally written by Paul Eggert. The canonical version of this
|
||||||
|
# script is maintained as top/autopull.sh in gnulib. However, to be
|
||||||
|
# useful to your package, you should place a copy of it under version
|
||||||
|
# control in the top-level directory of your package. The intent is
|
||||||
|
# that all customization can be done with a bootstrap.conf file also
|
||||||
|
# maintained in your version control; gnulib comes with a template
|
||||||
|
# build-aux/bootstrap.conf to get you started.
|
||||||
|
#
|
||||||
|
# Alternatively, you can use an autopull.sh script that is specific
|
||||||
|
# to your package.
|
||||||
|
|
||||||
|
scriptversion=2022-07-24.15; # UTC
|
||||||
|
|
||||||
|
me="$0"
|
||||||
|
medir=`dirname "$me"`
|
||||||
|
|
||||||
|
# Read the function library and the configuration.
|
||||||
|
. "$medir"/bootstrap-funclib.sh
|
||||||
|
|
||||||
|
# Ensure that CDPATH is not set. Otherwise, the output from cd
|
||||||
|
# would cause trouble in at least one use below.
|
||||||
|
(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
|
||||||
|
|
||||||
|
usage() {
|
||||||
|
cat <<EOF
|
||||||
|
Usage: $me [OPTION]...
|
||||||
|
Bootstrap this package from the checked-out sources.
|
||||||
|
|
||||||
|
Optional environment variables:
|
||||||
|
GNULIB_SRCDIR Specifies the local directory where gnulib
|
||||||
|
sources reside. Use this if you already
|
||||||
|
have gnulib sources on your machine, and
|
||||||
|
you want to use these sources.
|
||||||
|
GNULIB_REFDIR Specifies the local directory where a gnulib
|
||||||
|
repository (with a .git subdirectory) resides.
|
||||||
|
Use this if you already have gnulib sources
|
||||||
|
and history on your machine, and do not want
|
||||||
|
to waste your bandwidth downloading them again.
|
||||||
|
GNULIB_URL Cloneable URL of the gnulib repository.
|
||||||
|
|
||||||
|
Options:
|
||||||
|
--bootstrap-sync if this bootstrap script is not identical to
|
||||||
|
the version in the local gnulib sources,
|
||||||
|
update this script, and then restart it with
|
||||||
|
/bin/sh or the shell \$CONFIG_SHELL
|
||||||
|
--no-bootstrap-sync do not check whether bootstrap is out of sync
|
||||||
|
--force attempt to bootstrap even if the sources seem
|
||||||
|
not to have been checked out
|
||||||
|
--no-git do not use git to update gnulib. Requires that
|
||||||
|
\$GNULIB_SRCDIR or the --gnulib-srcdir option
|
||||||
|
points to a gnulib repository with the correct
|
||||||
|
revision
|
||||||
|
--skip-po do not download po files
|
||||||
|
EOF
|
||||||
|
bootstrap_print_option_usage_hook
|
||||||
|
cat <<EOF
|
||||||
|
If the file bootstrap.conf exists in the same directory as this script, its
|
||||||
|
contents are read as shell variables to configure the bootstrap.
|
||||||
|
|
||||||
|
For build prerequisites, environment variables like \$AUTOCONF and \$AMTAR
|
||||||
|
are honored.
|
||||||
|
|
||||||
|
Gnulib sources can be fetched in various ways:
|
||||||
|
|
||||||
|
* If the environment variable GNULIB_SRCDIR is set (either as an
|
||||||
|
environment variable or via the --gnulib-srcdir option), then sources
|
||||||
|
are fetched from that local directory. If it is a git repository and
|
||||||
|
the configuration variable GNULIB_REVISION is set in bootstrap.conf,
|
||||||
|
then that revision is checked out.
|
||||||
|
|
||||||
|
* Otherwise, if this package is in a git repository with a 'gnulib'
|
||||||
|
submodule configured, then that submodule is initialized and updated
|
||||||
|
and sources are fetched from there. If GNULIB_REFDIR is set (either
|
||||||
|
as an environment variable or via the --gnulib-refdir option) and is
|
||||||
|
a git repository, then it is used as a reference.
|
||||||
|
|
||||||
|
* Otherwise, if the 'gnulib' directory does not exist, Gnulib sources
|
||||||
|
are cloned into that directory using git from \$GNULIB_URL, defaulting
|
||||||
|
to $default_gnulib_url.
|
||||||
|
If the configuration variable GNULIB_REVISION is set in bootstrap.conf,
|
||||||
|
then that revision is checked out.
|
||||||
|
|
||||||
|
* Otherwise, the existing Gnulib sources in the 'gnulib' directory are
|
||||||
|
used. If it is a git repository and the configuration variable
|
||||||
|
GNULIB_REVISION is set in bootstrap.conf, then that revision is
|
||||||
|
checked out.
|
||||||
|
|
||||||
|
If you maintain a package and want to pin a particular revision of the
|
||||||
|
Gnulib sources that has been tested with your package, then there are
|
||||||
|
two possible approaches: either configure a 'gnulib' submodule with the
|
||||||
|
appropriate revision, or set GNULIB_REVISION (and if necessary
|
||||||
|
GNULIB_URL) in bootstrap.conf.
|
||||||
|
|
||||||
|
Running without arguments will suffice in most cases.
|
||||||
|
EOF
|
||||||
|
}
|
||||||
|
|
||||||
|
# Parse options.
|
||||||
|
|
||||||
|
# Use git to update gnulib sources
|
||||||
|
use_git=true
|
||||||
|
|
||||||
|
for option
|
||||||
|
do
|
||||||
|
case $option in
|
||||||
|
--help)
|
||||||
|
usage
|
||||||
|
exit;;
|
||||||
|
--version)
|
||||||
|
set -e
|
||||||
|
echo "autopull.sh $scriptversion"
|
||||||
|
echo "$copyright"
|
||||||
|
exit 0
|
||||||
|
;;
|
||||||
|
--skip-po)
|
||||||
|
SKIP_PO=t;;
|
||||||
|
--force)
|
||||||
|
checkout_only_file=;;
|
||||||
|
--bootstrap-sync)
|
||||||
|
bootstrap_sync=true;;
|
||||||
|
--no-bootstrap-sync)
|
||||||
|
bootstrap_sync=false;;
|
||||||
|
--no-git)
|
||||||
|
use_git=false;;
|
||||||
|
*)
|
||||||
|
bootstrap_option_hook $option || die "$option: unknown option";;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
|
$use_git || test -n "$GNULIB_SRCDIR" \
|
||||||
|
|| die "Error: --no-git requires \$GNULIB_SRCDIR environment variable or --gnulib-srcdir option"
|
||||||
|
test -z "$GNULIB_SRCDIR" || test -d "$GNULIB_SRCDIR" \
|
||||||
|
|| die "Error: \$GNULIB_SRCDIR environment variable or --gnulib-srcdir option is specified, but does not denote a directory"
|
||||||
|
|
||||||
|
if test -n "$checkout_only_file" && test ! -r "$checkout_only_file"; then
|
||||||
|
die "Running this script from a non-checked-out distribution is risky."
|
||||||
|
fi
|
||||||
|
|
||||||
|
check_build_prerequisites $use_git
|
||||||
|
|
||||||
|
if $use_gnulib || $bootstrap_sync; then
|
||||||
|
prepare_GNULIB_SRCDIR
|
||||||
|
if $bootstrap_sync; then
|
||||||
|
upgrade_bootstrap
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Find sha1sum, named gsha1sum on MacPorts, shasum on Mac OS X 10.6.
|
||||||
|
# Also find the compatible sha1 utility on the BSDs
|
||||||
|
if test x"$SKIP_PO" = x; then
|
||||||
|
find_tool SHA1SUM sha1sum gsha1sum shasum sha1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# See if we can use gnulib's git-merge-changelog merge driver.
|
||||||
|
if $use_git && test -d .git && check_exists git; then
|
||||||
|
if git config merge.merge-changelog.driver >/dev/null ; then
|
||||||
|
:
|
||||||
|
elif check_exists git-merge-changelog; then
|
||||||
|
echo "$0: initializing git-merge-changelog driver"
|
||||||
|
git config merge.merge-changelog.name 'GNU-style ChangeLog merge driver'
|
||||||
|
git config merge.merge-changelog.driver 'git-merge-changelog %O %A %B'
|
||||||
|
else
|
||||||
|
echo "$0: consider installing git-merge-changelog from gnulib"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
# ----------------------------- Get translations. -----------------------------
|
||||||
|
|
||||||
|
download_po_files() {
|
||||||
|
subdir=$1
|
||||||
|
domain=$2
|
||||||
|
echo "$me: getting translations into $subdir for $domain..."
|
||||||
|
cmd=$(printf "$po_download_command_format" "$subdir" "$domain")
|
||||||
|
eval "$cmd"
|
||||||
|
}
|
||||||
|
|
||||||
|
# Mirror .po files to $po_dir/.reference and copy only the new
|
||||||
|
# or modified ones into $po_dir. Also update $po_dir/LINGUAS.
|
||||||
|
# Note po files that exist locally only are left in $po_dir but will
|
||||||
|
# not be included in LINGUAS and hence will not be distributed.
|
||||||
|
update_po_files() {
|
||||||
|
# Directory containing primary .po files.
|
||||||
|
# Overwrite them only when we're sure a .po file is new.
|
||||||
|
po_dir=$1
|
||||||
|
domain=$2
|
||||||
|
|
||||||
|
# Mirror *.po files into this dir.
|
||||||
|
# Usually contains *.s1 checksum files.
|
||||||
|
ref_po_dir="$po_dir/.reference"
|
||||||
|
|
||||||
|
test -d $ref_po_dir || mkdir $ref_po_dir || return
|
||||||
|
download_po_files $ref_po_dir $domain \
|
||||||
|
&& ls "$ref_po_dir"/*.po 2>/dev/null |
|
||||||
|
sed 's|.*/||; s|\.po$||' > "$po_dir/LINGUAS" || return
|
||||||
|
|
||||||
|
langs=$(cd $ref_po_dir && echo *.po | sed 's/\.po//g')
|
||||||
|
test "$langs" = '*' && langs=x
|
||||||
|
for po in $langs; do
|
||||||
|
case $po in x) continue;; esac
|
||||||
|
new_po="$ref_po_dir/$po.po"
|
||||||
|
cksum_file="$ref_po_dir/$po.s1"
|
||||||
|
if ! test -f "$cksum_file" ||
|
||||||
|
! test -f "$po_dir/$po.po" ||
|
||||||
|
! $SHA1SUM -c "$cksum_file" < "$new_po" > /dev/null 2>&1; then
|
||||||
|
echo "$me: updated $po_dir/$po.po..."
|
||||||
|
cp "$new_po" "$po_dir/$po.po" \
|
||||||
|
&& $SHA1SUM < "$new_po" > "$cksum_file" || return
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
case $SKIP_PO in
|
||||||
|
'')
|
||||||
|
if test -d po; then
|
||||||
|
update_po_files po $package || exit
|
||||||
|
fi
|
||||||
|
|
||||||
|
if test -d runtime-po; then
|
||||||
|
update_po_files runtime-po $package-runtime || exit
|
||||||
|
fi;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
# -----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
bootstrap_post_pull_hook \
|
||||||
|
|| die "bootstrap_post_pull_hook failed"
|
||||||
|
|
||||||
|
# Don't proceed if there are uninitialized submodules. In particular,
|
||||||
|
# autogen.sh will remove dangling links, which might be links into
|
||||||
|
# uninitialized submodules.
|
||||||
|
# But it's OK if the 'gnulib' submodule is uninitialized, as long as
|
||||||
|
# GNULIB_SRCDIR is set.
|
||||||
|
if $use_git; then
|
||||||
|
# Uninitialized submodules are listed with an initial dash.
|
||||||
|
uninitialized=`git submodule | grep '^-' | awk '{ print $2 }'`
|
||||||
|
if test -n "$GNULIB_SRCDIR"; then
|
||||||
|
uninitialized=`echo "$uninitialized" | grep -v '^gnulib$'`
|
||||||
|
fi
|
||||||
|
if test -n "$uninitialized"; then
|
||||||
|
die "Some git submodules are not initialized: "`echo "$uninitialized" | tr '\n' ',' | sed -e 's|,$|.|'`" Either use option '--no-git', or run 'git submodule update --init' and bootstrap again."
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "$0: done. Now you can run './autogen.sh'."
|
||||||
|
|
||||||
|
# ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
# Local Variables:
|
||||||
|
# eval: (add-hook 'before-save-hook 'time-stamp)
|
||||||
|
# time-stamp-start: "scriptversion="
|
||||||
|
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
||||||
|
# time-stamp-time-zone: "UTC0"
|
||||||
|
# time-stamp-end: "; # UTC"
|
||||||
|
# End:
|
||||||
594
bootstrap-funclib.sh
Normal file
594
bootstrap-funclib.sh
Normal file
@@ -0,0 +1,594 @@
|
|||||||
|
# A library of shell functions for autopull.sh, autogen.sh, and bootstrap.
|
||||||
|
|
||||||
|
# Copyright (C) 2003-2022 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 3 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
# Originally written by Paul Eggert. The canonical version of this
|
||||||
|
# script is maintained as top/bootstrap-funclib.sh in gnulib. However,
|
||||||
|
# to be useful to your package, you should place a copy of it under
|
||||||
|
# version control in the top-level directory of your package. The
|
||||||
|
# intent is that all customization can be done with a bootstrap.conf
|
||||||
|
# file also maintained in your version control; gnulib comes with a
|
||||||
|
# template build-aux/bootstrap.conf to get you started.
|
||||||
|
|
||||||
|
scriptversion=2022-07-24.15; # UTC
|
||||||
|
|
||||||
|
nl='
|
||||||
|
'
|
||||||
|
|
||||||
|
# Ensure file names are sorted consistently across platforms.
|
||||||
|
LC_ALL=C
|
||||||
|
export LC_ALL
|
||||||
|
|
||||||
|
# Honor $PERL, but work even if there is none.
|
||||||
|
PERL="${PERL-perl}"
|
||||||
|
|
||||||
|
default_gnulib_url=https://git.savannah.gnu.org/git/gnulib.git
|
||||||
|
|
||||||
|
# Copyright year, for the --version output.
|
||||||
|
copyright_year=`echo "$scriptversion" | sed -e 's/[^0-9].*//'`
|
||||||
|
copyright="Copyright (C) ${copyright_year} Free Software Foundation, Inc.
|
||||||
|
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
|
||||||
|
This is free software: you are free to change and redistribute it.
|
||||||
|
There is NO WARRANTY, to the extent permitted by law."
|
||||||
|
|
||||||
|
# warnf_ FORMAT-STRING ARG1...
|
||||||
|
warnf_ ()
|
||||||
|
{
|
||||||
|
warnf_format_=$1
|
||||||
|
shift
|
||||||
|
nl='
|
||||||
|
'
|
||||||
|
case $* in
|
||||||
|
*$nl*) me_=$(printf "$me"|tr "$nl|" '??')
|
||||||
|
printf "$warnf_format_" "$@" | sed "s|^|$me_: |" ;;
|
||||||
|
*) printf "$me: $warnf_format_" "$@" ;;
|
||||||
|
esac >&2
|
||||||
|
}
|
||||||
|
|
||||||
|
# warn_ WORD1...
|
||||||
|
warn_ ()
|
||||||
|
{
|
||||||
|
# If IFS does not start with ' ', set it and emit the warning in a subshell.
|
||||||
|
case $IFS in
|
||||||
|
' '*) warnf_ '%s\n' "$*";;
|
||||||
|
*) (IFS=' '; warn_ "$@");;
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
|
# die WORD1...
|
||||||
|
die() { warn_ "$@"; exit 1; }
|
||||||
|
|
||||||
|
# ------------------------------ Configuration. ------------------------------
|
||||||
|
|
||||||
|
# Directory that contains package-specific gnulib modules and/or overrides.
|
||||||
|
local_gl_dir=gl
|
||||||
|
|
||||||
|
# Name of the Makefile.am
|
||||||
|
# XXX Not used.
|
||||||
|
gnulib_mk=gnulib.mk
|
||||||
|
|
||||||
|
# List of gnulib modules needed.
|
||||||
|
gnulib_modules=
|
||||||
|
|
||||||
|
# Any gnulib files needed that are not in modules.
|
||||||
|
gnulib_files=
|
||||||
|
|
||||||
|
# A function to be called for each unrecognized option. Returns 0 if
|
||||||
|
# the option in $1 has been processed by the function. Returns 1 if
|
||||||
|
# the option has not been processed by the function. Override it via
|
||||||
|
# your own definition in bootstrap.conf
|
||||||
|
bootstrap_option_hook() { return 1; }
|
||||||
|
|
||||||
|
# A function to be called in order to print the --help information
|
||||||
|
# corresponding to user-defined command-line options.
|
||||||
|
bootstrap_print_option_usage_hook() { :; }
|
||||||
|
|
||||||
|
# A function to be called at the end of autopull.sh.
|
||||||
|
# Override it via your own definition in bootstrap.conf.
|
||||||
|
bootstrap_post_pull_hook() { :; }
|
||||||
|
|
||||||
|
# A function to be called right after gnulib-tool is run.
|
||||||
|
# Override it via your own definition in bootstrap.conf.
|
||||||
|
bootstrap_post_import_hook() { :; }
|
||||||
|
|
||||||
|
# A function to be called after everything else in this script.
|
||||||
|
# Override it via your own definition in bootstrap.conf.
|
||||||
|
bootstrap_epilogue() { :; }
|
||||||
|
|
||||||
|
# The command to download all .po files for a specified domain into a
|
||||||
|
# specified directory. Fill in the first %s with the destination
|
||||||
|
# directory and the second with the domain name.
|
||||||
|
po_download_command_format=\
|
||||||
|
"wget --mirror --level=1 -nd -nv -A.po -P '%s' \
|
||||||
|
https://translationproject.org/latest/%s/"
|
||||||
|
|
||||||
|
# Prefer a non-empty tarname (4th argument of AC_INIT if given), else
|
||||||
|
# fall back to the package name (1st argument with munging).
|
||||||
|
extract_package_name='
|
||||||
|
/^AC_INIT(\[*/{
|
||||||
|
s///
|
||||||
|
/^[^,]*,[^,]*,[^,]*,[ []*\([^][ ,)]\)/{
|
||||||
|
s//\1/
|
||||||
|
s/[],)].*//
|
||||||
|
p
|
||||||
|
q
|
||||||
|
}
|
||||||
|
s/[],)].*//
|
||||||
|
s/^GNU //
|
||||||
|
y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/
|
||||||
|
s/[^abcdefghijklmnopqrstuvwxyz0123456789_]/-/g
|
||||||
|
p
|
||||||
|
}
|
||||||
|
'
|
||||||
|
package=$(${AUTOCONF:-autoconf} --trace AC_INIT:\$4 configure.ac 2>/dev/null)
|
||||||
|
if test -z "$package"; then
|
||||||
|
package=$(sed -n "$extract_package_name" configure.ac) \
|
||||||
|
|| die 'cannot find package name in configure.ac'
|
||||||
|
fi
|
||||||
|
gnulib_name=lib$package
|
||||||
|
|
||||||
|
build_aux=build-aux
|
||||||
|
source_base=lib
|
||||||
|
m4_base=m4
|
||||||
|
doc_base=doc
|
||||||
|
tests_base=tests
|
||||||
|
gnulib_extra_files="
|
||||||
|
build-aux/install-sh
|
||||||
|
build-aux/mdate-sh
|
||||||
|
build-aux/texinfo.tex
|
||||||
|
build-aux/depcomp
|
||||||
|
build-aux/config.guess
|
||||||
|
build-aux/config.sub
|
||||||
|
doc/INSTALL
|
||||||
|
"
|
||||||
|
|
||||||
|
# Additional gnulib-tool options to use. Use "\newline" to break lines.
|
||||||
|
gnulib_tool_option_extras=
|
||||||
|
|
||||||
|
# Other locale categories that need message catalogs.
|
||||||
|
EXTRA_LOCALE_CATEGORIES=
|
||||||
|
|
||||||
|
# Additional xgettext options to use. Use "\\\newline" to break lines.
|
||||||
|
XGETTEXT_OPTIONS='\\\
|
||||||
|
--flag=_:1:pass-c-format\\\
|
||||||
|
--flag=N_:1:pass-c-format\\\
|
||||||
|
--flag=error:3:c-format --flag=error_at_line:5:c-format\\\
|
||||||
|
'
|
||||||
|
|
||||||
|
# Package bug report address and copyright holder for gettext files
|
||||||
|
COPYRIGHT_HOLDER='Free Software Foundation, Inc.'
|
||||||
|
MSGID_BUGS_ADDRESS=bug-$package@gnu.org
|
||||||
|
|
||||||
|
# Files we don't want to import.
|
||||||
|
# XXX Not used.
|
||||||
|
excluded_files=
|
||||||
|
|
||||||
|
# File that should exist in the top directory of a checked out hierarchy,
|
||||||
|
# but not in a distribution tarball.
|
||||||
|
checkout_only_file=README-hacking
|
||||||
|
|
||||||
|
# Set this to '.cvsignore .gitignore' in bootstrap.conf if you want
|
||||||
|
# those files to be generated in directories like lib/, m4/, and po/.
|
||||||
|
# Or set it to 'auto' to make this script select which to use based
|
||||||
|
# on which version control system (if any) is used in the source directory.
|
||||||
|
vc_ignore=auto
|
||||||
|
|
||||||
|
# Set this to true in bootstrap.conf to enable --bootstrap-sync by
|
||||||
|
# default.
|
||||||
|
bootstrap_sync=false
|
||||||
|
|
||||||
|
# Override the default configuration, if necessary.
|
||||||
|
# Make sure that bootstrap.conf is sourced from the current directory
|
||||||
|
# if we were invoked as "sh bootstrap".
|
||||||
|
conffile=`dirname "$me"`/bootstrap.conf
|
||||||
|
test -r "$conffile" && . "$conffile"
|
||||||
|
|
||||||
|
# ------------------------- Build-time prerequisites -------------------------
|
||||||
|
|
||||||
|
check_exists() {
|
||||||
|
if test "$1" = "--verbose"; then
|
||||||
|
($2 --version </dev/null) >/dev/null 2>&1
|
||||||
|
if test $? -ge 126; then
|
||||||
|
# If not found, run with diagnostics as one may be
|
||||||
|
# presented with env variables to set to find the right version
|
||||||
|
($2 --version </dev/null)
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
($1 --version </dev/null) >/dev/null 2>&1
|
||||||
|
fi
|
||||||
|
|
||||||
|
test $? -lt 126
|
||||||
|
}
|
||||||
|
|
||||||
|
# Note this deviates from the version comparison in automake
|
||||||
|
# in that it treats 1.5 < 1.5.0, and treats 1.4.4a < 1.4-p3a
|
||||||
|
# but this should suffice as we won't be specifying old
|
||||||
|
# version formats or redundant trailing .0 in bootstrap.conf.
|
||||||
|
# If we did want full compatibility then we should probably
|
||||||
|
# use m4_version_compare from autoconf.
|
||||||
|
sort_ver() { # sort -V is not generally available
|
||||||
|
ver1="$1"
|
||||||
|
ver2="$2"
|
||||||
|
|
||||||
|
# split on '.' and compare each component
|
||||||
|
i=1
|
||||||
|
while : ; do
|
||||||
|
p1=$(echo "$ver1" | cut -d. -f$i)
|
||||||
|
p2=$(echo "$ver2" | cut -d. -f$i)
|
||||||
|
if [ ! "$p1" ]; then
|
||||||
|
echo "$1 $2"
|
||||||
|
break
|
||||||
|
elif [ ! "$p2" ]; then
|
||||||
|
echo "$2 $1"
|
||||||
|
break
|
||||||
|
elif [ ! "$p1" = "$p2" ]; then
|
||||||
|
if [ "$p1" -gt "$p2" ] 2>/dev/null; then # numeric comparison
|
||||||
|
echo "$2 $1"
|
||||||
|
elif [ "$p2" -gt "$p1" ] 2>/dev/null; then # numeric comparison
|
||||||
|
echo "$1 $2"
|
||||||
|
else # numeric, then lexicographic comparison
|
||||||
|
lp=$(printf "%s\n%s\n" "$p1" "$p2" | LANG=C sort -n | tail -n1)
|
||||||
|
if [ "$lp" = "$p2" ]; then
|
||||||
|
echo "$1 $2"
|
||||||
|
else
|
||||||
|
echo "$2 $1"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
i=$(($i+1))
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
get_version_sed='
|
||||||
|
# Move version to start of line.
|
||||||
|
s/.*[v ]\([0-9]\)/\1/
|
||||||
|
|
||||||
|
# Skip lines that do not start with version.
|
||||||
|
/^[0-9]/!d
|
||||||
|
|
||||||
|
# Remove characters after the version.
|
||||||
|
s/[^.a-z0-9-].*//
|
||||||
|
|
||||||
|
# The first component must be digits only.
|
||||||
|
s/^\([0-9]*\)[a-z-].*/\1/
|
||||||
|
|
||||||
|
#the following essentially does s/5.005/5.5/
|
||||||
|
s/\.0*\([1-9]\)/.\1/g
|
||||||
|
p
|
||||||
|
q'
|
||||||
|
|
||||||
|
get_version() {
|
||||||
|
app=$1
|
||||||
|
|
||||||
|
$app --version >/dev/null 2>&1 || { $app --version; return 1; }
|
||||||
|
|
||||||
|
$app --version 2>&1 | sed -n "$get_version_sed"
|
||||||
|
}
|
||||||
|
|
||||||
|
check_versions() {
|
||||||
|
ret=0
|
||||||
|
|
||||||
|
while read app req_ver; do
|
||||||
|
# We only need libtoolize from the libtool package.
|
||||||
|
if test "$app" = libtool; then
|
||||||
|
app=libtoolize
|
||||||
|
fi
|
||||||
|
# Exempt git if git is not needed.
|
||||||
|
if test "$app" = git; then
|
||||||
|
$check_git || continue
|
||||||
|
fi
|
||||||
|
# Honor $APP variables ($TAR, $AUTOCONF, etc.)
|
||||||
|
appvar=$(echo $app | LC_ALL=C tr '[a-z]-' '[A-Z]_')
|
||||||
|
test "$appvar" = TAR && appvar=AMTAR
|
||||||
|
case $appvar in
|
||||||
|
GZIP) ;; # Do not use $GZIP: it contains gzip options.
|
||||||
|
PERL::*) ;; # Keep perl modules as-is
|
||||||
|
*) eval "app=\${$appvar-$app}" ;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
# Handle the still-experimental Automake-NG programs specially.
|
||||||
|
# They remain named as the mainstream Automake programs ("automake",
|
||||||
|
# and "aclocal") to avoid gratuitous incompatibilities with
|
||||||
|
# pre-existing usages (by, say, autoreconf, or custom autogen.sh
|
||||||
|
# scripts), but correctly identify themselves (as being part of
|
||||||
|
# "GNU automake-ng") when asked their version.
|
||||||
|
case $app in
|
||||||
|
automake-ng|aclocal-ng)
|
||||||
|
app=${app%-ng}
|
||||||
|
($app --version | grep '(GNU automake-ng)') >/dev/null 2>&1 || {
|
||||||
|
warn_ "Error: '$app' not found or not from Automake-NG"
|
||||||
|
ret=1
|
||||||
|
continue
|
||||||
|
} ;;
|
||||||
|
# Another check is for perl modules. These can be written as
|
||||||
|
# e.g. perl::XML::XPath in case of XML::XPath module, etc.
|
||||||
|
perl::*)
|
||||||
|
# Extract module name
|
||||||
|
app="${app#perl::}"
|
||||||
|
if ! $PERL -m"$app" -e 'exit 0' >/dev/null 2>&1; then
|
||||||
|
warn_ "Error: perl module '$app' not found"
|
||||||
|
ret=1
|
||||||
|
fi
|
||||||
|
continue
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
if [ "$req_ver" = "-" ]; then
|
||||||
|
# Merely require app to exist; not all prereq apps are well-behaved
|
||||||
|
# so we have to rely on $? rather than get_version.
|
||||||
|
if ! check_exists --verbose $app; then
|
||||||
|
warn_ "Error: '$app' not found"
|
||||||
|
ret=1
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
# Require app to produce a new enough version string.
|
||||||
|
inst_ver=$(get_version $app)
|
||||||
|
if [ ! "$inst_ver" ]; then
|
||||||
|
warn_ "Error: '$app' not found"
|
||||||
|
ret=1
|
||||||
|
else
|
||||||
|
latest_ver=$(sort_ver $req_ver $inst_ver | cut -d' ' -f2)
|
||||||
|
if [ ! "$latest_ver" = "$inst_ver" ]; then
|
||||||
|
warnf_ '%s\n' \
|
||||||
|
"Error: '$app' version == $inst_ver is too old" \
|
||||||
|
" '$app' version >= $req_ver is required"
|
||||||
|
ret=1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
return $ret
|
||||||
|
}
|
||||||
|
|
||||||
|
print_versions() {
|
||||||
|
echo "Program Min_version"
|
||||||
|
echo "----------------------"
|
||||||
|
printf %s "$buildreq"
|
||||||
|
echo "----------------------"
|
||||||
|
# can't depend on column -t
|
||||||
|
}
|
||||||
|
|
||||||
|
# check_build_prerequisites check_git
|
||||||
|
check_build_prerequisites()
|
||||||
|
{
|
||||||
|
check_git="$1"
|
||||||
|
|
||||||
|
# gnulib-tool requires at least automake and autoconf.
|
||||||
|
# If either is not listed, add it (with minimum version) as a prerequisite.
|
||||||
|
case $buildreq in
|
||||||
|
*automake*) ;;
|
||||||
|
*) buildreq="automake 1.9
|
||||||
|
$buildreq" ;;
|
||||||
|
esac
|
||||||
|
case $buildreq in
|
||||||
|
*autoconf*) ;;
|
||||||
|
*) buildreq="autoconf 2.59
|
||||||
|
$buildreq" ;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
# When we can deduce that gnulib-tool will require patch,
|
||||||
|
# and when patch is not already listed as a prerequisite, add it, too.
|
||||||
|
if test -d "$local_gl_dir" \
|
||||||
|
&& ! find "$local_gl_dir" -name '*.diff' -exec false {} +; then
|
||||||
|
case $buildreq in
|
||||||
|
*patch*) ;;
|
||||||
|
*) buildreq="patch -
|
||||||
|
$buildreq" ;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
|
||||||
|
if ! printf '%s' "$buildreq" | check_versions; then
|
||||||
|
echo >&2
|
||||||
|
if test -f README-prereq; then
|
||||||
|
die "See README-prereq for how to get the prerequisite programs"
|
||||||
|
else
|
||||||
|
die "Please install the prerequisite programs"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Warn the user if autom4te appears to be broken; this causes known
|
||||||
|
# issues with at least gettext 0.18.3.
|
||||||
|
probe=$(echo 'm4_quote([hi])' | autom4te -l M4sugar -t 'm4_quote:$%' -)
|
||||||
|
if test "x$probe" != xhi; then
|
||||||
|
warn_ "WARNING: your autom4te wrapper eats stdin;"
|
||||||
|
warn_ "if bootstrap fails, consider upgrading your autotools"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# find_tool ENVVAR NAMES...
|
||||||
|
# -------------------------
|
||||||
|
# Search for a required program. Use the value of ENVVAR, if set,
|
||||||
|
# otherwise find the first of the NAMES that can be run.
|
||||||
|
# If found, set ENVVAR to the program name, die otherwise.
|
||||||
|
#
|
||||||
|
# FIXME: code duplication, see also gnu-web-doc-update.
|
||||||
|
find_tool ()
|
||||||
|
{
|
||||||
|
find_tool_envvar=$1
|
||||||
|
shift
|
||||||
|
find_tool_names=$@
|
||||||
|
eval "find_tool_res=\$$find_tool_envvar"
|
||||||
|
if test x"$find_tool_res" = x; then
|
||||||
|
for i; do
|
||||||
|
if check_exists $i; then
|
||||||
|
find_tool_res=$i
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
if test x"$find_tool_res" = x; then
|
||||||
|
warn_ "one of these is required: $find_tool_names;"
|
||||||
|
die "alternatively set $find_tool_envvar to a compatible tool"
|
||||||
|
fi
|
||||||
|
eval "$find_tool_envvar=\$find_tool_res"
|
||||||
|
eval "export $find_tool_envvar"
|
||||||
|
}
|
||||||
|
|
||||||
|
# --------------------- Preparing GNULIB_SRCDIR for use. ---------------------
|
||||||
|
# This is part of autopull.sh, but bootstrap needs it too, for self-upgrading.
|
||||||
|
|
||||||
|
cleanup_gnulib() {
|
||||||
|
status=$?
|
||||||
|
# XXX It's a bad idea to erase the submodule directory if it contains local
|
||||||
|
# modifications.
|
||||||
|
rm -fr "$gnulib_path"
|
||||||
|
exit $status
|
||||||
|
}
|
||||||
|
|
||||||
|
git_modules_config () {
|
||||||
|
test -f .gitmodules && git config --file .gitmodules "$@"
|
||||||
|
}
|
||||||
|
|
||||||
|
prepare_GNULIB_SRCDIR ()
|
||||||
|
{
|
||||||
|
if test -n "$GNULIB_SRCDIR"; then
|
||||||
|
# Use GNULIB_SRCDIR directly.
|
||||||
|
# We already checked that $GNULIB_SRCDIR references a directory.
|
||||||
|
# Verify that it contains a gnulib checkout.
|
||||||
|
test -f "$GNULIB_SRCDIR/gnulib-tool" \
|
||||||
|
|| die "Error: --gnulib-srcdir or \$GNULIB_SRCDIR is specified, but does not contain gnulib-tool"
|
||||||
|
elif $use_git; then
|
||||||
|
gnulib_path=$(git_modules_config submodule.gnulib.path)
|
||||||
|
test -z "$gnulib_path" && gnulib_path=gnulib
|
||||||
|
|
||||||
|
# Get gnulib files. Populate $gnulib_path, possibly updating a
|
||||||
|
# submodule, for use in the rest of the script.
|
||||||
|
|
||||||
|
if test -n "$GNULIB_REFDIR" && test -d "$GNULIB_REFDIR"/.git \
|
||||||
|
&& git_modules_config submodule.gnulib.url >/dev/null; then
|
||||||
|
# Use GNULIB_REFDIR as a reference.
|
||||||
|
echo "$0: getting gnulib files..."
|
||||||
|
if git submodule -h|grep -- --reference > /dev/null; then
|
||||||
|
# Prefer the one-liner available in git 1.6.4 or newer.
|
||||||
|
git submodule update --init --reference "$GNULIB_REFDIR" \
|
||||||
|
"$gnulib_path" || exit $?
|
||||||
|
else
|
||||||
|
# This fallback allows at least git 1.5.5.
|
||||||
|
if test -f "$gnulib_path"/gnulib-tool; then
|
||||||
|
# Since file already exists, assume submodule init already complete.
|
||||||
|
git submodule update -- "$gnulib_path" || exit $?
|
||||||
|
else
|
||||||
|
# Older git can't clone into an empty directory.
|
||||||
|
rmdir "$gnulib_path" 2>/dev/null
|
||||||
|
git clone --reference "$GNULIB_REFDIR" \
|
||||||
|
"$(git_modules_config submodule.gnulib.url)" "$gnulib_path" \
|
||||||
|
&& git submodule init -- "$gnulib_path" \
|
||||||
|
&& git submodule update -- "$gnulib_path" \
|
||||||
|
|| exit $?
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
# GNULIB_REFDIR is not set or not usable. Ignore it.
|
||||||
|
if git_modules_config submodule.gnulib.url >/dev/null; then
|
||||||
|
echo "$0: getting gnulib files..."
|
||||||
|
git submodule init -- "$gnulib_path" || exit $?
|
||||||
|
git submodule update -- "$gnulib_path" || exit $?
|
||||||
|
|
||||||
|
elif [ ! -d "$gnulib_path" ]; then
|
||||||
|
echo "$0: getting gnulib files..."
|
||||||
|
|
||||||
|
trap cleanup_gnulib 1 2 13 15
|
||||||
|
|
||||||
|
shallow=
|
||||||
|
if test -z "$GNULIB_REVISION"; then
|
||||||
|
if git clone -h 2>&1 | grep -- --depth > /dev/null; then
|
||||||
|
shallow='--depth 2'
|
||||||
|
fi
|
||||||
|
git clone $shallow ${GNULIB_URL:-$default_gnulib_url} "$gnulib_path" \
|
||||||
|
|| cleanup_gnulib
|
||||||
|
else
|
||||||
|
if git fetch -h 2>&1 | grep -- --depth > /dev/null; then
|
||||||
|
shallow='--depth 2'
|
||||||
|
fi
|
||||||
|
mkdir -p "$gnulib_path"
|
||||||
|
# Only want a shallow checkout of $GNULIB_REVISION, but git does not
|
||||||
|
# support cloning by commit hash. So attempt a shallow fetch by commit
|
||||||
|
# hash to minimize the amount of data downloaded and changes needed to
|
||||||
|
# be processed, which can drastically reduce download and processing
|
||||||
|
# time for checkout. If the fetch by commit fails, a shallow fetch can
|
||||||
|
# not be performed because we do not know what the depth of the commit
|
||||||
|
# is without fetching all commits. So fallback to fetching all commits.
|
||||||
|
git -C "$gnulib_path" init
|
||||||
|
git -C "$gnulib_path" remote add origin \
|
||||||
|
${GNULIB_URL:-$default_gnulib_url}
|
||||||
|
git -C "$gnulib_path" fetch $shallow origin "$GNULIB_REVISION" \
|
||||||
|
|| git -C "$gnulib_path" fetch origin \
|
||||||
|
|| cleanup_gnulib
|
||||||
|
git -C "$gnulib_path" reset --hard FETCH_HEAD
|
||||||
|
fi
|
||||||
|
|
||||||
|
trap - 1 2 13 15
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
GNULIB_SRCDIR=$gnulib_path
|
||||||
|
# Verify that the submodule contains a gnulib checkout.
|
||||||
|
test -f "$gnulib_path/gnulib-tool" \
|
||||||
|
|| die "Error: $gnulib_path is supposed to contain a gnulib checkout, but does not contain gnulib-tool"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# XXX Should this be done if $use_git is false?
|
||||||
|
if test -d "$GNULIB_SRCDIR"/.git && test -n "$GNULIB_REVISION" \
|
||||||
|
&& ! git_modules_config submodule.gnulib.url >/dev/null; then
|
||||||
|
(cd "$GNULIB_SRCDIR" && git checkout "$GNULIB_REVISION") || cleanup_gnulib
|
||||||
|
fi
|
||||||
|
|
||||||
|
# $GNULIB_SRCDIR now points to the version of gnulib to use, and
|
||||||
|
# we no longer need to use git or $gnulib_path below here.
|
||||||
|
}
|
||||||
|
|
||||||
|
# -------- Upgrading bootstrap to the version found in GNULIB_SRCDIR. --------
|
||||||
|
|
||||||
|
upgrade_bootstrap ()
|
||||||
|
{
|
||||||
|
{ cmp -s "$medir"/bootstrap "$GNULIB_SRCDIR/top/bootstrap" \
|
||||||
|
&& cmp -s "$medir"/bootstrap-funclib.sh "$GNULIB_SRCDIR/top/bootstrap-funclib.sh" \
|
||||||
|
&& cmp -s "$medir"/autopull.sh "$GNULIB_SRCDIR/top/autopull.sh" \
|
||||||
|
&& cmp -s "$medir"/autogen.sh "$GNULIB_SRCDIR/top/autogen.sh"; \
|
||||||
|
} || {
|
||||||
|
echo "$0: updating bootstrap & companions and restarting..."
|
||||||
|
case $(sh -c 'echo "$1"' -- a) in
|
||||||
|
a) ignored=--;;
|
||||||
|
*) ignored=ignored;;
|
||||||
|
esac
|
||||||
|
exec sh -c \
|
||||||
|
'{ if test -f "$1"; then cp "$1" "$3"; else cp "$2" "$3"; fi; } && { if test -f "$4"; then cp "$4" "$5"; else rm -f "$5"; fi; } && { if test -f "$6"; then cp "$6" "$7"; else rm -f "$7"; fi; } && { if test -f "$8"; then cp "$8" "$9"; else rm -f "$9"; fi; } && shift && shift && shift && shift && shift && shift && shift && shift && shift && exec "${CONFIG_SHELL-/bin/sh}" "$@"' \
|
||||||
|
$ignored \
|
||||||
|
"$GNULIB_SRCDIR/top/bootstrap" "$GNULIB_SRCDIR/build-aux/bootstrap" "$medir/bootstrap" \
|
||||||
|
"$GNULIB_SRCDIR/top/bootstrap-funclib.sh" "$medir/bootstrap-funclib.sh" \
|
||||||
|
"$GNULIB_SRCDIR/top/autopull.sh" "$medir/autopull.sh" \
|
||||||
|
"$GNULIB_SRCDIR/top/autogen.sh" "$medir/autogen.sh" \
|
||||||
|
"$0" "$@" --no-bootstrap-sync
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
if test x"$gnulib_modules$gnulib_files$gnulib_extra_files" = x; then
|
||||||
|
use_gnulib=false
|
||||||
|
else
|
||||||
|
use_gnulib=true
|
||||||
|
fi
|
||||||
|
|
||||||
|
# ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
# Local Variables:
|
||||||
|
# eval: (add-hook 'before-save-hook 'time-stamp)
|
||||||
|
# time-stamp-start: "scriptversion="
|
||||||
|
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
||||||
|
# time-stamp-time-zone: "UTC0"
|
||||||
|
# time-stamp-end: "; # UTC"
|
||||||
|
# End:
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
@echo off
|
@echo off
|
||||||
:: Copyright (C) 2018-2019 Free Software Foundation, Inc.
|
:: Copyright (C) 2018-2022 Free Software Foundation, Inc.
|
||||||
:: This file is part of GNU Make.
|
:: This file is part of GNU Make.
|
||||||
::
|
::
|
||||||
:: GNU Make is free software; you can redistribute it and/or modify it under
|
:: GNU Make is free software; you can redistribute it and/or modify it under
|
||||||
@@ -13,22 +13,79 @@
|
|||||||
:: more details.
|
:: more details.
|
||||||
::
|
::
|
||||||
:: You should have received a copy of the GNU General Public License along
|
:: You should have received a copy of the GNU General Public License along
|
||||||
:: with this program. If not, see <http://www.gnu.org/licenses/>.
|
:: with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
setlocal
|
setlocal
|
||||||
set "svurl=https://git.savannah.gnu.org/cgit"
|
set "svurl=https://git.savannah.gnu.org/cgit"
|
||||||
set "gnuliburl=%svurl%/gnulib.git/plain"
|
set "gnuliburl=%svurl%/gnulib.git/plain"
|
||||||
|
|
||||||
|
where curl >nul 2>&1
|
||||||
|
if ERRORLEVEL 1 (
|
||||||
|
echo Cannot find curl: it must be installed for bootstrap
|
||||||
|
exit /b 1
|
||||||
|
)
|
||||||
|
|
||||||
|
where sed >nul 2>&1
|
||||||
|
if ERRORLEVEL 1 (
|
||||||
|
echo Cannot find sed: it must be installed for bootstrap
|
||||||
|
echo Hint: you can use the sed provided in the Git for Windows install
|
||||||
|
exit /b 1
|
||||||
|
)
|
||||||
|
|
||||||
|
if exist lib goto Downloads
|
||||||
|
mkdir lib
|
||||||
|
if ERRORLEVEL 1 exit /b 1
|
||||||
|
|
||||||
|
:Downloads
|
||||||
|
echo -- Downloading Gnulib modules
|
||||||
call :Download lib getloadavg.c
|
call :Download lib getloadavg.c
|
||||||
call :Download lib intprops.h
|
call :Download lib intprops.h
|
||||||
goto :Done
|
call :Download lib intprops-internal.h
|
||||||
|
|
||||||
|
echo -- Configuring the workspace
|
||||||
|
copy /Y gl\lib\*.* lib > nul
|
||||||
|
|
||||||
|
:: Create a sed script to convert templates
|
||||||
|
if exist convert.sed del /Q convert.sed
|
||||||
|
echo s,@PACKAGE@,make,g > convert.sed
|
||||||
|
if ERRORLEVEL 1 goto Failed
|
||||||
|
echo s,@PACKAGE_BUGREPORT@,bug-make@gnu.org,g >> convert.sed
|
||||||
|
if ERRORLEVEL 1 goto Failed
|
||||||
|
echo s,@PACKAGE_NAME@,GNU Make,g >> convert.sed
|
||||||
|
if ERRORLEVEL 1 goto Failed
|
||||||
|
echo s,@PACKAGE_TARNAME@,make,g >> convert.sed
|
||||||
|
if ERRORLEVEL 1 goto Failed
|
||||||
|
echo s,@PACKAGE_URL@,https://www.gnu.org/software/make/,g >> convert.sed
|
||||||
|
sed -n "s/^AC_INIT(\[GNU.Make\],\[\([0-9.]*\)\].*/s,@PACKAGE_VERSION@,\1,g/p" configure.ac >> convert.sed
|
||||||
|
if ERRORLEVEL 1 goto Failed
|
||||||
|
sed -z -e s/\\\n//g -e "s/[ \t][ \t]*/ /g" -e "s, [^ ]*\.h,,g" -e "s,src/,$(src),g" -e "s,lib/,$(lib),g" Makefile.am | sed -n "s/^\([A-Za-z0-9]*\)_SRCS *= *\(.*\)/s,%%\1_SOURCES%%,\2,/p" >> convert.sed
|
||||||
|
if ERRORLEVEL 1 goto Failed
|
||||||
|
|
||||||
|
echo - Creating Basic.mk
|
||||||
|
sed -f convert.sed Basic.mk.template > Basic.mk
|
||||||
|
if ERRORLEVEL 1 goto Failed
|
||||||
|
echo - Creating src\mkconfig.h
|
||||||
|
sed -f convert.sed src\mkconfig.h.in > src\mkconfig.h
|
||||||
|
if ERRORLEVEL 1 goto Failed
|
||||||
|
|
||||||
|
echo - Creating src\gmk-default.h
|
||||||
|
echo static const char *const GUILE_module_defn = ^" \ > src\gmk-default.h
|
||||||
|
sed -e "s/;.*//" -e "/^[ \t]*$/d" -e "s/\"/\\\\\"/g" -e "s/$/ \\\/" src\gmk-default.scm >> src\gmk-default.h
|
||||||
|
if ERRORLEVEL 1 goto Failed
|
||||||
|
echo ^";>> src\gmk-default.h
|
||||||
|
|
||||||
|
echo.
|
||||||
|
echo Done. Run build_w32.bat to build GNU make.
|
||||||
|
goto :EOF
|
||||||
|
|
||||||
:Download
|
:Download
|
||||||
echo Downloading %1\%2
|
if exist "%1\%2" goto :EOF
|
||||||
curl -sS -o %1\%2 "%gnuliburl%/%1/%2"
|
echo - Downloading %1\%2
|
||||||
|
curl -sS -o "%1\%2" "%gnuliburl%/%1/%2"
|
||||||
if ERRORLEVEL 1 exit /b 1
|
if ERRORLEVEL 1 exit /b 1
|
||||||
goto :EOF
|
goto :EOF
|
||||||
|
|
||||||
:Done
|
:Failed
|
||||||
echo Done. Run buld_w32.bat to build GNU make.
|
echo *** Bootstrap failed.
|
||||||
goto :EOF
|
echo Resolve the issue, or use the configured source in the release tarball
|
||||||
|
exit /b 1
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
# Bootstrap configuration. -*-shell-script-*-
|
# Bootstrap configuration. -*-shell-script-*-
|
||||||
|
|
||||||
# Copyright (C) 2018-2019 Free Software Foundation, Inc.
|
# Copyright (C) 2018-2022 Free Software Foundation, Inc.
|
||||||
|
|
||||||
# GNU Make is free software: you can redistribute it and/or modify it under
|
# 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
|
# the terms of the GNU General Public License as published by the Free
|
||||||
@@ -18,6 +18,12 @@
|
|||||||
# Allow bootstrap to know that this is not a package
|
# Allow bootstrap to know that this is not a package
|
||||||
checkout_only_file=README.git
|
checkout_only_file=README.git
|
||||||
|
|
||||||
|
# Choose a specific version of gnulib, when checking out
|
||||||
|
GNULIB_REVISION=stable-202207
|
||||||
|
|
||||||
|
# Always copy files rather than symlink
|
||||||
|
copy=true
|
||||||
|
|
||||||
# Additional xgettext options to use. Use "\\\newline" to break lines.
|
# Additional xgettext options to use. Use "\\\newline" to break lines.
|
||||||
# Ensure that all our magical output macros are correctly marked as
|
# Ensure that all our magical output macros are correctly marked as
|
||||||
# C (printf) format strings.
|
# C (printf) format strings.
|
||||||
@@ -41,7 +47,12 @@ automake 1.16.1
|
|||||||
"
|
"
|
||||||
|
|
||||||
gnulib_name=libgnu
|
gnulib_name=libgnu
|
||||||
gnulib_files=doc/make-stds.texi
|
gnulib_files="doc/make-stds.texi m4/sig_atomic_t.m4"
|
||||||
|
|
||||||
|
# Using the full strtoll module pulls in a lot of stuff. But, it's pretty
|
||||||
|
# simple to use just the base source file, so pull that. We'll use it in
|
||||||
|
# src/misc.c if strtoll() is not found.
|
||||||
|
gnulib_files="$gnulib_files lib/strtol.c"
|
||||||
|
|
||||||
gnulib_modules="\
|
gnulib_modules="\
|
||||||
alloca
|
alloca
|
||||||
@@ -49,5 +60,6 @@ fdl
|
|||||||
findprog-in
|
findprog-in
|
||||||
getloadavg
|
getloadavg
|
||||||
host-cpu-c-abi
|
host-cpu-c-abi
|
||||||
strerror
|
largefile
|
||||||
make-glob"
|
make-glob
|
||||||
|
make-macros"
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
# Configuration for building GNU Make in the absence of any 'make' program.
|
# Configuration for building GNU Make in the absence of any 'make' program.
|
||||||
# @configure_input@
|
# @configure_input@
|
||||||
|
|
||||||
# Copyright (C) 1993-2019 Free Software Foundation, Inc.
|
# Copyright (C) 1993-2022 Free Software Foundation, Inc.
|
||||||
# This file is part of GNU Make.
|
# This file is part of GNU Make.
|
||||||
#
|
#
|
||||||
# GNU Make is free software; you can redistribute it and/or modify it under
|
# GNU Make is free software; you can redistribute it and/or modify it under
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
# details.
|
# details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License along with
|
# You should have received a copy of the GNU General Public License along with
|
||||||
# this program. If not, see <http://www.gnu.org/licenses/>.
|
# this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
# See Makefile.in for comments describing these variables.
|
# See Makefile.in for comments describing these variables.
|
||||||
|
|
||||||
|
|||||||
61
build.sh
61
build.sh
@@ -1,7 +1,7 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
# Shell script to build GNU Make in the absence of any 'make' program.
|
# Shell script to build GNU Make in the absence of any 'make' program.
|
||||||
|
|
||||||
# Copyright (C) 1993-2019 Free Software Foundation, Inc.
|
# Copyright (C) 1993-2022 Free Software Foundation, Inc.
|
||||||
# This file is part of GNU Make.
|
# This file is part of GNU Make.
|
||||||
#
|
#
|
||||||
# GNU Make is free software; you can redistribute it and/or modify it under
|
# GNU Make is free software; you can redistribute it and/or modify it under
|
||||||
@@ -15,11 +15,16 @@
|
|||||||
# details.
|
# details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License along with
|
# You should have received a copy of the GNU General Public License along with
|
||||||
# this program. If not, see <http://www.gnu.org/licenses/>.
|
# this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
# Get configure-generated values
|
# Get configure-generated values
|
||||||
. ./build.cfg
|
. ./build.cfg
|
||||||
|
|
||||||
|
die () { echo "$*" 1>&2; exit 1; }
|
||||||
|
usage () { echo "$0 [-k]"; exit $1; }
|
||||||
|
|
||||||
|
keep_going=false
|
||||||
|
|
||||||
: ${OUTDIR:=.}
|
: ${OUTDIR:=.}
|
||||||
OUTLIB="$OUTDIR/lib"
|
OUTLIB="$OUTDIR/lib"
|
||||||
|
|
||||||
@@ -55,15 +60,29 @@ get_mk_var ()
|
|||||||
# Compile source files. Object files are put into $objs.
|
# Compile source files. Object files are put into $objs.
|
||||||
compile ()
|
compile ()
|
||||||
{
|
{
|
||||||
|
success=true
|
||||||
objs=
|
objs=
|
||||||
for ofile in "$@"; do
|
for ofile in "$@"; do
|
||||||
|
# We should try to use a Makefile variable like libgnu_a_SOURCES or
|
||||||
|
# something but just hardcode it.
|
||||||
file="${ofile%.$OBJEXT}.c"
|
file="${ofile%.$OBJEXT}.c"
|
||||||
|
case $file in
|
||||||
|
(lib/libgnu_a-*.c) file="lib/${file#lib/libgnu_a-}" ;;
|
||||||
|
esac
|
||||||
echo "compiling $file..."
|
echo "compiling $file..."
|
||||||
of="$OUTDIR/$ofile"
|
of="$OUTDIR/$ofile"
|
||||||
mkdir -p "${of%/*}"
|
mkdir -p "${of%/*}" || exit 1
|
||||||
$CC $cflags $CPPFLAGS $CFLAGS -c -o "$of" "$top_srcdir/$file"
|
if $CC $cflags $CPPFLAGS $CFLAGS -c -o "$of" "$top_srcdir/$file"; then
|
||||||
|
: worked
|
||||||
|
else
|
||||||
|
$keep_going || die "Compilation failed."
|
||||||
|
success=false
|
||||||
|
fi
|
||||||
|
|
||||||
objs="${objs:+$objs }$of"
|
objs="${objs:+$objs }$of"
|
||||||
done
|
done
|
||||||
|
|
||||||
|
$success
|
||||||
}
|
}
|
||||||
|
|
||||||
# Use config.status to convert a .in file. Output file is put into $out.
|
# Use config.status to convert a .in file. Output file is put into $out.
|
||||||
@@ -75,10 +94,13 @@ convert ()
|
|||||||
var="GENERATE_$(echo $base | tr 'a-z./+' A-Z__X)"
|
var="GENERATE_$(echo $base | tr 'a-z./+' A-Z__X)"
|
||||||
|
|
||||||
# Is this file disabled?
|
# Is this file disabled?
|
||||||
grep "${var}_FALSE\"]=\"\"" config.status >/dev/null && return
|
grep "${var}_FALSE\"]=\"\"" config.status >/dev/null && return 0
|
||||||
|
|
||||||
|
# If there's no .in file then no conversion needed
|
||||||
|
in="$top_srcdir/lib/$(echo ${base%.*}.in.${base##*.} | tr / _)"
|
||||||
|
test -f "$in" || return 0
|
||||||
|
|
||||||
# Not disabled, so create it
|
# Not disabled, so create it
|
||||||
in="$top_srcdir/lib/$(echo ${base%.*}.in.${base##*.} | tr / _)"
|
|
||||||
out="$OUTLIB/$base"
|
out="$OUTLIB/$base"
|
||||||
mkdir -p "${out%/*}"
|
mkdir -p "${out%/*}"
|
||||||
|
|
||||||
@@ -103,7 +125,7 @@ convert ()
|
|||||||
esac
|
esac
|
||||||
|
|
||||||
fn="$top_srcdir/lib/${fn##*/}"
|
fn="$top_srcdir/lib/${fn##*/}"
|
||||||
[ -f "$fn" ] || { echo "Missing file: $fn"; exit 1; }
|
test -f "$fn" || { echo "Missing file: $fn"; exit 1; }
|
||||||
|
|
||||||
sed "/definitions* of $inc/r $fn" "$int" > "${int}_"
|
sed "/definitions* of $inc/r $fn" "$int" > "${int}_"
|
||||||
int=${int}_
|
int=${int}_
|
||||||
@@ -122,28 +144,39 @@ done
|
|||||||
# Get object files from the Makefile
|
# Get object files from the Makefile
|
||||||
OBJS=$(get_mk_var Makefile make_OBJECTS | sed "s=\$[\(\{]OBJEXT[\)\}]=$OBJEXT=g")
|
OBJS=$(get_mk_var Makefile make_OBJECTS | sed "s=\$[\(\{]OBJEXT[\)\}]=$OBJEXT=g")
|
||||||
|
|
||||||
# Exit as soon as any command fails.
|
while test -n "$1"; do
|
||||||
set -e
|
case $1 in
|
||||||
|
(-k) keep_going=true; shift ;;
|
||||||
|
(--) shift; break ;;
|
||||||
|
(-[h?]) usage 0 ;;
|
||||||
|
(-*) echo "Unknown option: $1"; usage 1 ;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
|
test -z "$1" || die "Unknown argument: $*"
|
||||||
|
|
||||||
# Generate gnulib header files that would normally be created by make
|
# Generate gnulib header files that would normally be created by make
|
||||||
|
set -e
|
||||||
for b in $(get_mk_var lib/Makefile BUILT_SOURCES); do
|
for b in $(get_mk_var lib/Makefile BUILT_SOURCES); do
|
||||||
convert $b
|
convert $b
|
||||||
done
|
done
|
||||||
|
set +e
|
||||||
|
|
||||||
# Build the gnulib library
|
# Build the gnulib library
|
||||||
cflags="$DEFS -I$OUTLIB -Ilib -I$top_srcdir/lib -I$OUTDIR/src -Isrc -I$top_srcdir/src"
|
cflags="$DEFS -I$OUTLIB -Ilib -I$top_srcdir/lib -I$OUTDIR/src -Isrc -I$top_srcdir/src"
|
||||||
compile $LIBOBJS
|
compile $LIBOBJS || die "Compilation failed."
|
||||||
|
|
||||||
echo "creating libgnu.a..."
|
echo "creating libgnu.a..."
|
||||||
$AR $ARFLAGS "$OUTLIB"/libgnu.a $objs
|
$AR $ARFLAGS "$OUTLIB"/libgnu.a $objs || die "Archive of libgnu failed."
|
||||||
|
|
||||||
# Compile the source files into those objects.
|
# Compile the source files into those objects.
|
||||||
cflags="$DEFS $defines -I$OUTDIR/src -Isrc -I$top_srcdir/src -I$OUTLIB -Ilib -I$top_srcdir/lib"
|
cflags="$DEFS $defines -I$OUTDIR/src -Isrc -I$top_srcdir/src -I$OUTLIB -Ilib -I$top_srcdir/lib"
|
||||||
compile $OBJS
|
compile $OBJS || die "Compilation failed."
|
||||||
|
|
||||||
# Link all the objects together.
|
# Link all the objects together.
|
||||||
echo "linking make..."
|
echo "linking make..."
|
||||||
$CC $CFLAGS $LDFLAGS -L"$OUTLIB" $objs -lgnu $LOADLIBES -o "$OUTDIR/makenew$EXEEXT"
|
$CC $CFLAGS $LDFLAGS -L"$OUTLIB" -o "$OUTDIR/makenew$EXEEXT" $objs -lgnu $LOADLIBES || die "Link failed."
|
||||||
mv -f "$OUTDIR/makenew$EXEEXT" "$OUTDIR/make$EXEEXT"
|
|
||||||
|
mv -f "$OUTDIR/makenew$EXEEXT" "$OUTDIR/make$EXEEXT" || exit 1
|
||||||
|
|
||||||
echo done.
|
echo done.
|
||||||
|
|||||||
135
build_w32.bat
Executable file → Normal file
135
build_w32.bat
Executable file → Normal file
@@ -1,5 +1,5 @@
|
|||||||
@echo off
|
@echo off
|
||||||
:: Copyright (C) 1996-2019 Free Software Foundation, Inc.
|
:: Copyright (C) 1996-2022 Free Software Foundation, Inc.
|
||||||
:: This file is part of GNU Make.
|
:: This file is part of GNU Make.
|
||||||
::
|
::
|
||||||
:: GNU Make is free software; you can redistribute it and/or modify it under
|
:: GNU Make is free software; you can redistribute it and/or modify it under
|
||||||
@@ -13,7 +13,7 @@
|
|||||||
:: more details.
|
:: more details.
|
||||||
::
|
::
|
||||||
:: You should have received a copy of the GNU General Public License along
|
:: You should have received a copy of the GNU General Public License along
|
||||||
:: with this program. If not, see <http://www.gnu.org/licenses/>.
|
:: with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
setlocal
|
setlocal
|
||||||
if not "%RECURSEME%"=="%~0" (
|
if not "%RECURSEME%"=="%~0" (
|
||||||
@@ -37,6 +37,8 @@ set COMPILER=cl.exe
|
|||||||
set O=obj
|
set O=obj
|
||||||
set ARCH=x64
|
set ARCH=x64
|
||||||
set DEBUG=N
|
set DEBUG=N
|
||||||
|
set DIRENT=Y
|
||||||
|
set VERBOSE=N
|
||||||
|
|
||||||
if exist maintMakefile (
|
if exist maintMakefile (
|
||||||
set MAINT=Y
|
set MAINT=Y
|
||||||
@@ -45,13 +47,20 @@ if exist maintMakefile (
|
|||||||
)
|
)
|
||||||
|
|
||||||
:ParseSW
|
:ParseSW
|
||||||
|
if "%1" == "--verbose" goto SetVerbose
|
||||||
if "%1" == "--debug" goto SetDebug
|
if "%1" == "--debug" goto SetDebug
|
||||||
if "%1" == "--without-guile" goto NoGuile
|
if "%1" == "--without-guile" goto NoGuile
|
||||||
if "%1" == "--x86" goto Set32Bit
|
if "%1" == "--x86" goto Set32Bit
|
||||||
if "%1" == "gcc" goto SetCC
|
if "%1" == "gcc" goto SetCC
|
||||||
|
if "%1" == "tcc" goto SetTCC
|
||||||
if "%1" == "" goto DoneSW
|
if "%1" == "" goto DoneSW
|
||||||
goto Usage
|
goto Usage
|
||||||
|
|
||||||
|
:SetVerbose
|
||||||
|
set VERBOSE=Y
|
||||||
|
shift
|
||||||
|
goto ParseSW
|
||||||
|
|
||||||
:SetDebug
|
:SetDebug
|
||||||
set DEBUG=Y
|
set DEBUG=Y
|
||||||
echo - Building without compiler optimizations
|
echo - Building without compiler optimizations
|
||||||
@@ -77,20 +86,28 @@ echo - Building with GCC
|
|||||||
shift
|
shift
|
||||||
goto ParseSW
|
goto ParseSW
|
||||||
|
|
||||||
|
:SetTCC
|
||||||
|
set COMPILER=tcc
|
||||||
|
set O=o
|
||||||
|
echo - Building with TinyC
|
||||||
|
shift
|
||||||
|
goto ParseSW
|
||||||
|
|
||||||
:DoneSW
|
:DoneSW
|
||||||
if "%MAINT%" == "Y" echo - Enabling maintainer mode
|
if "%MAINT%" == "Y" echo - Enabling maintainer mode
|
||||||
|
|
||||||
if "%COMPILER%" == "gcc" goto FindGcc
|
if "%COMPILER%" == "gcc" goto FindGcc
|
||||||
|
if "%COMPILER%" == "tcc" goto FindTcc
|
||||||
|
|
||||||
:: Find a compiler. Visual Studio requires a lot of effort to locate :-/.
|
:: Find a compiler. Visual Studio requires a lot of effort to locate :-/.
|
||||||
%COMPILER% >nul 2>&1
|
call %COMPILER% >nul 2>&1
|
||||||
if not ERRORLEVEL 1 goto FoundMSVC
|
if not ERRORLEVEL 1 goto FoundMSVC
|
||||||
|
|
||||||
:: Visual Studio 17 and above provides the "vswhere" tool
|
:: Visual Studio 17 and above provides the "vswhere" tool
|
||||||
call :FindVswhere
|
call :FindVswhere
|
||||||
if ERRORLEVEL 1 goto LegacyVS
|
if ERRORLEVEL 1 goto LegacyVS
|
||||||
|
|
||||||
for /f "tokens=* usebackq" %%i in (`%VSWHERE% -latest -property installationPath`) do (
|
for /f "tokens=* usebackq" %%i in (`"%VSWHERE%" -latest -property installationPath`) do (
|
||||||
set InstallPath=%%i
|
set InstallPath=%%i
|
||||||
)
|
)
|
||||||
set "VSVARS=%InstallPath%\VC\Auxiliary\Build\vcvarsall.bat"
|
set "VSVARS=%InstallPath%\VC\Auxiliary\Build\vcvarsall.bat"
|
||||||
@@ -165,20 +182,36 @@ if "%MAINT%" == "Y" set "OPTS=%OPTS% /D MAKE_MAINTAINER_MODE"
|
|||||||
:: Show the compiler version that we found
|
:: Show the compiler version that we found
|
||||||
:: Unfortunately this also shows a "usage" note; I can't find anything better.
|
:: Unfortunately this also shows a "usage" note; I can't find anything better.
|
||||||
echo.
|
echo.
|
||||||
%COMPILER%
|
call %COMPILER%
|
||||||
goto Build
|
goto Build
|
||||||
|
|
||||||
:FindGcc
|
:FindGcc
|
||||||
set OUTDIR=.\GccRel
|
set OUTDIR=.\GccRel
|
||||||
set LNKOUT=./GccRel
|
set LNKOUT=./GccRel
|
||||||
set OPTS=-O2
|
set OPTS=-O2
|
||||||
|
set DIRENT=N
|
||||||
if "%DEBUG%" == "Y" set OPTS=-O0
|
if "%DEBUG%" == "Y" set OPTS=-O0
|
||||||
if "%DEBUG%" == "Y" set OUTDIR=.\GccDebug
|
if "%DEBUG%" == "Y" set OUTDIR=.\GccDebug
|
||||||
if "%DEBUG%" == "Y" set LNKOUT=./GccDebug
|
if "%DEBUG%" == "Y" set LNKOUT=./GccDebug
|
||||||
if "%MAINT%" == "Y" set "OPTS=%OPTS% -DMAKE_MAINTAINER_MODE"
|
if "%MAINT%" == "Y" set "OPTS=%OPTS% -DMAKE_MAINTAINER_MODE"
|
||||||
:: Show the compiler version that we found
|
:: Show the compiler version that we found
|
||||||
echo.
|
echo.
|
||||||
%COMPILER% --version
|
call %COMPILER% --version
|
||||||
|
if not ERRORLEVEL 1 goto Build
|
||||||
|
echo No %COMPILER% found.
|
||||||
|
exit 1
|
||||||
|
|
||||||
|
:FindTcc
|
||||||
|
set OUTDIR=.\TccRel
|
||||||
|
set LNKOUT=./TccRel
|
||||||
|
set OPTS=-O2
|
||||||
|
if "%DEBUG%" == "Y" set OPTS=-O0
|
||||||
|
if "%DEBUG%" == "Y" set OUTDIR=.\TccDebug
|
||||||
|
if "%DEBUG%" == "Y" set LNKOUT=./TccDebug
|
||||||
|
if "%MAINT%" == "Y" set "OPTS=%OPTS% -DMAKE_MAINTAINER_MODE"
|
||||||
|
:: Show the compiler version that we found
|
||||||
|
echo.
|
||||||
|
call %COMPILER% -v
|
||||||
if not ERRORLEVEL 1 goto Build
|
if not ERRORLEVEL 1 goto Build
|
||||||
echo No %COMPILER% found.
|
echo No %COMPILER% found.
|
||||||
exit 1
|
exit 1
|
||||||
@@ -197,10 +230,11 @@ mkdir %OUTDIR%\lib
|
|||||||
|
|
||||||
if "%GUILE%" == "Y" call :ChkGuile
|
if "%GUILE%" == "Y" call :ChkGuile
|
||||||
|
|
||||||
|
if not exist src\config.h.W32 goto NotConfig
|
||||||
|
|
||||||
echo.
|
echo.
|
||||||
echo Compiling %OUTDIR% version
|
echo Compiling %OUTDIR% version
|
||||||
|
|
||||||
if exist src\config.h.W32.template call :ConfigSCM
|
|
||||||
copy src\config.h.W32 %OUTDIR%\src\config.h
|
copy src\config.h.W32 %OUTDIR%\src\config.h
|
||||||
|
|
||||||
copy lib\glob.in.h %OUTDIR%\lib\glob.h
|
copy lib\glob.in.h %OUTDIR%\lib\glob.h
|
||||||
@@ -231,6 +265,7 @@ call :Compile src/read
|
|||||||
call :Compile src/remake
|
call :Compile src/remake
|
||||||
call :Compile src/remote-stub
|
call :Compile src/remote-stub
|
||||||
call :Compile src/rule
|
call :Compile src/rule
|
||||||
|
call :Compile src/shuffle
|
||||||
call :Compile src/signame
|
call :Compile src/signame
|
||||||
call :Compile src/strcache
|
call :Compile src/strcache
|
||||||
call :Compile src/variable
|
call :Compile src/variable
|
||||||
@@ -246,7 +281,8 @@ call :Compile lib/fnmatch
|
|||||||
call :Compile lib/glob
|
call :Compile lib/glob
|
||||||
call :Compile lib/getloadavg
|
call :Compile lib/getloadavg
|
||||||
|
|
||||||
if not "%COMPILER%" == "gcc" call :Compile src\w32\compat\dirent
|
:: Compile dirent unless it is supported by compiler library (like with gcc).
|
||||||
|
if "%DIRENT%" == "Y" call :Compile src\w32\compat\dirent
|
||||||
|
|
||||||
call :Link
|
call :Link
|
||||||
|
|
||||||
@@ -258,6 +294,7 @@ exit 1
|
|||||||
:Success
|
:Success
|
||||||
echo %OUTDIR% build succeeded.
|
echo %OUTDIR% build succeeded.
|
||||||
if exist Basic.mk copy /Y Basic.mk Makefile
|
if exist Basic.mk copy /Y Basic.mk Makefile
|
||||||
|
if not exist tests\config-flags.pm copy /Y tests\config-flags.pm.W32 tests\config-flags.pm
|
||||||
call :Reset
|
call :Reset
|
||||||
goto :EOF
|
goto :EOF
|
||||||
|
|
||||||
@@ -266,23 +303,33 @@ goto :EOF
|
|||||||
::
|
::
|
||||||
|
|
||||||
:Compile
|
:Compile
|
||||||
|
if "%VERBOSE%" == "N" echo - Compiling %1.c
|
||||||
echo %LNKOUT%/%1.%O% >>%OUTDIR%\link.sc
|
echo %LNKOUT%/%1.%O% >>%OUTDIR%\link.sc
|
||||||
set EXTRAS=
|
set EXTRAS=
|
||||||
if "%2" == "GUILE" set "EXTRAS=%GUILECFLAGS%"
|
if "%2" == "GUILE" set "EXTRAS=%GUILECFLAGS%"
|
||||||
if exist "%OUTDIR%\%1.%O%" del "%OUTDIR%\%1.%O%"
|
if exist "%OUTDIR%\%1.%O%" del "%OUTDIR%\%1.%O%"
|
||||||
if "%COMPILER%" == "gcc" goto GccCompile
|
if "%COMPILER%" == "gcc" goto GccCompile
|
||||||
|
if "%COMPILER%" == "tcc" goto TccCompile
|
||||||
|
|
||||||
:: MSVC Compile
|
:: MSVC Compile
|
||||||
echo on
|
if "%VERBOSE%" == "Y" echo on
|
||||||
%COMPILER% /nologo /MT /W4 /EHsc %OPTS% /I %OUTDIR%/src /I src /I %OUTDIR%/lib /I lib /I src/w32/include /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR%OUTDIR% /Fp%OUTDIR%\%MAKE%.pch /Fo%OUTDIR%\%1.%O% /Fd%OUTDIR%\%MAKE%.pdb %EXTRAS% /c %1.c
|
call %COMPILER% /nologo /MT /W4 /EHsc %OPTS% /I %OUTDIR%/src /I src /I %OUTDIR%/lib /I lib /I src/w32/include /D _CONSOLE /D HAVE_CONFIG_H /FR%OUTDIR% /Fp%OUTDIR%\%MAKE%.pch /Fo%OUTDIR%\%1.%O% /Fd%OUTDIR%\%MAKE%.pdb %EXTRAS% /c %1.c
|
||||||
@echo off
|
@echo off
|
||||||
goto CompileDone
|
goto CompileDone
|
||||||
|
|
||||||
:GccCompile
|
:GccCompile
|
||||||
:: GCC Compile
|
:: GCC Compile
|
||||||
echo on
|
if "%VERBOSE%" == "Y" echo on
|
||||||
%COMPILER% -mthreads -Wall -std=gnu99 -gdwarf-2 -g3 %OPTS% -I%OUTDIR%/src -I./src -I%OUTDIR%/lib -I./lib -I./src/w32/include -DWINDOWS32 -DHAVE_CONFIG_H %EXTRAS% -o %OUTDIR%/%1.%O% -c %1.c
|
call %COMPILER% -mthreads -Wall -std=gnu99 -gdwarf-2 -g3 %OPTS% -I%OUTDIR%/src -I./src -I%OUTDIR%/lib -I./lib -I./src/w32/include -DHAVE_CONFIG_H %EXTRAS% -o %OUTDIR%/%1.%O% -c %1.c
|
||||||
@echo off
|
@echo off
|
||||||
|
goto CompileDone
|
||||||
|
|
||||||
|
:TccCompile
|
||||||
|
:: TCC Compile
|
||||||
|
if "%VERBOSE%" == "Y" echo on
|
||||||
|
call %COMPILER% -mthreads -Wall -std=c11 %OPTS% -I%OUTDIR%/src -I./src -I%OUTDIR%/lib -I./lib -I./src/w32/include -D_cdecl= -D_MSC_VER -DHAVE_CONFIG_H %EXTRAS% -o %OUTDIR%/%1.%O% -c %1.c
|
||||||
|
@echo off
|
||||||
|
goto CompileDone
|
||||||
|
|
||||||
:CompileDone
|
:CompileDone
|
||||||
if not exist "%OUTDIR%\%1.%O%" exit 1
|
if not exist "%OUTDIR%\%1.%O%" exit 1
|
||||||
@@ -290,56 +337,57 @@ goto :EOF
|
|||||||
|
|
||||||
:Link
|
:Link
|
||||||
echo.
|
echo.
|
||||||
echo Linking %LNKOUT%/%MAKE%.exe
|
echo - Linking %LNKOUT%/%MAKE%.exe
|
||||||
if "%COMPILER%" == "gcc" goto GccLink
|
if "%COMPILER%" == "gcc" goto GccLink
|
||||||
|
if "%COMPILER%" == "tcc" goto TccLink
|
||||||
|
|
||||||
:: MSVC Link
|
:: MSVC Link
|
||||||
echo %GUILELIBS% kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib >>%OUTDIR%\link.sc
|
echo %GUILELIBS% kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib >>%OUTDIR%\link.sc
|
||||||
echo on
|
if "%VERBOSE%" == "Y" echo on
|
||||||
link.exe /NOLOGO /SUBSYSTEM:console /PDB:%LNKOUT%\%MAKE%.pdb %LINKOPTS% /OUT:%LNKOUT%\%MAKE%.exe @%LNKOUT%\link.sc
|
call link.exe /NOLOGO /SUBSYSTEM:console /PDB:%LNKOUT%\%MAKE%.pdb %LINKOPTS% /OUT:%LNKOUT%\%MAKE%.exe @%LNKOUT%\link.sc
|
||||||
@echo off
|
@echo off
|
||||||
goto :EOF
|
goto :EOF
|
||||||
|
|
||||||
:GccLink
|
:GccLink
|
||||||
:: GCC Link
|
:: GCC Link
|
||||||
echo on
|
if "%VERBOSE%" == "Y" echo on
|
||||||
echo %GUILELIBS% -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -luuid -lodbc32 -lodbccp32 >>%OUTDIR%\link.sc
|
echo %GUILELIBS% -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -luuid -lodbc32 -lodbccp32 >>%OUTDIR%\link.sc
|
||||||
%COMPILER% -mthreads -gdwarf-2 -g3 %OPTS% -o %LNKOUT%/%MAKE%.exe @%LNKOUT%/link.sc -Wl,--out-implib=%LNKOUT%/libgnumake-1.dll.a
|
call %COMPILER% -mthreads -gdwarf-2 -g3 %OPTS% -o %LNKOUT%/%MAKE%.exe @%LNKOUT%/link.sc -Wl,--out-implib=%LNKOUT%/libgnumake-1.dll.a
|
||||||
@echo off
|
@echo off
|
||||||
goto :EOF
|
goto :EOF
|
||||||
|
|
||||||
:ConfigSCM
|
:TccLink
|
||||||
echo Generating config from SCM templates
|
:: TCC Link
|
||||||
sed -n "s/^AC_INIT(\[GNU make\],\[\([^]]\+\)\].*/s,%%VERSION%%,\1,g/p" configure.ac > %OUTDIR%\src\config.h.W32.sed
|
if "%VERBOSE%" == "Y" echo on
|
||||||
echo s,%%PACKAGE%%,make,g >> %OUTDIR%\src\config.h.W32.sed
|
echo %GUILELIBS% -lkernel32 -luser32 -lgdi32 -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -lodbc32 -lodbccp32 >>%OUTDIR%\link.sc
|
||||||
sed -f %OUTDIR%\src\config.h.W32.sed src\config.h.W32.template > src\config.h.W32
|
call %COMPILER% -mthreads %OPTS% -o %LNKOUT%/%MAKE%.exe @%LNKOUT%/link.sc
|
||||||
echo static const char *const GUILE_module_defn = ^" \ > src\gmk-default.h
|
@echo off
|
||||||
sed -e "s/;.*//" -e "/^[ \t]*$/d" -e "s/\"/\\\\\"/g" -e "s/$/ \\\/" src\gmk-default.scm >> src\gmk-default.h
|
|
||||||
echo ^";>> src\gmk-default.h
|
|
||||||
goto :EOF
|
goto :EOF
|
||||||
|
|
||||||
:ChkGuile
|
:ChkGuile
|
||||||
:: Build with Guile is supported only on NT and later versions
|
:: Build with Guile is supported only on NT and later versions
|
||||||
if not "%OS%" == "Windows_NT" goto NoGuile
|
if not "%OS%" == "Windows_NT" goto NoGuile
|
||||||
pkg-config --help > %OUTDIR%\guile.tmp 2> NUL
|
call pkg-config --help > %OUTDIR%\guile.tmp 2> NUL
|
||||||
if ERRORLEVEL 1 goto NoPkgCfg
|
if ERRORLEVEL 1 goto NoPkgCfg
|
||||||
|
|
||||||
echo Checking for Guile 2.0
|
set PKGMSC=
|
||||||
if not "%COMPILER%" == "gcc" set PKGMSC=--msvc-syntax
|
if not "%COMPILER%" == "gcc" set PKGMSC=--msvc-syntax
|
||||||
pkg-config --cflags --short-errors "guile-2.0" > %OUTDIR%\guile.tmp
|
|
||||||
if not ERRORLEVEL 1 set /P GUILECFLAGS= < %OUTDIR%\guile.tmp
|
|
||||||
|
|
||||||
pkg-config --libs --static --short-errors %PKGMSC% "guile-2.0" > %OUTDIR%\guile.tmp
|
echo Checking for Guile 2.0
|
||||||
if not ERRORLEVEL 1 set /P GUILELIBS= < %OUTDIR%\guile.tmp
|
call pkg-config --cflags --short-errors "guile-2.0" > %OUTDIR%\gl-c2.tmp 2> NUL
|
||||||
|
if not ERRORLEVEL 1 set /P GUILECFLAGS= < %OUTDIR%\gl-c2.tmp
|
||||||
|
|
||||||
|
call pkg-config --libs --static --short-errors %PKGMSC% "guile-2.0" > %OUTDIR%\gl-l2.tmp 2> NUL
|
||||||
|
if not ERRORLEVEL 1 set /P GUILELIBS= < %OUTDIR%\gl-l2.tmp
|
||||||
|
|
||||||
if not "%GUILECFLAGS%" == "" goto GuileDone
|
if not "%GUILECFLAGS%" == "" goto GuileDone
|
||||||
|
|
||||||
echo Checking for Guile 1.8
|
echo Checking for Guile 1.8
|
||||||
pkg-config --cflags --short-errors "guile-1.8" > %OUTDIR%\guile.tmp
|
call pkg-config --cflags --short-errors "guile-1.8" > %OUTDIR%\gl-c18.tmp 2> NUL
|
||||||
if not ERRORLEVEL 1 set /P GUILECFLAGS= < %OUTDIR%\guile.tmp
|
if not ERRORLEVEL 1 set /P GUILECFLAGS= < %OUTDIR%\gl-c18.tmp
|
||||||
|
|
||||||
pkg-config --libs --static --short-errors %PKGMSC% "guile-1.8" > %OUTDIR%\guile.tmp
|
call pkg-config --libs --static --short-errors %PKGMSC% "guile-1.8" > %OUTDIR%\gl-l18.tmp 2> NUL
|
||||||
if not ERRORLEVEL 1 set /P GUILELIBS= < %OUTDIR%\guile.tmp
|
if not ERRORLEVEL 1 set /P GUILELIBS= < %OUTDIR%\gl-l18.tmp
|
||||||
|
|
||||||
if not "%GUILECFLAGS%" == "" goto GuileDone
|
if not "%GUILECFLAGS%" == "" goto GuileDone
|
||||||
|
|
||||||
@@ -358,10 +406,10 @@ goto :EOF
|
|||||||
|
|
||||||
:FindVswhere
|
:FindVswhere
|
||||||
set VSWHERE=vswhere
|
set VSWHERE=vswhere
|
||||||
%VSWHERE% -help >nul 2>&1
|
call "%VSWHERE%" -help >nul 2>&1
|
||||||
if not ERRORLEVEL 1 exit /b 0
|
if not ERRORLEVEL 1 exit /b 0
|
||||||
set "VSWHERE=C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere"
|
set "VSWHERE=C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere"
|
||||||
%VSWHERE% -help >nul 2>&1
|
call "%VSWHERE%" -help >nul 2>&1
|
||||||
if ERRORLEVEL 1 exit /b 1
|
if ERRORLEVEL 1 exit /b 1
|
||||||
goto :EOF
|
goto :EOF
|
||||||
|
|
||||||
@@ -369,17 +417,26 @@ goto :EOF
|
|||||||
if not exist "%VSVARS%" exit /b 1
|
if not exist "%VSVARS%" exit /b 1
|
||||||
call "%VSVARS%" %ARCH%
|
call "%VSVARS%" %ARCH%
|
||||||
if ERRORLEVEL 1 exit /b 1
|
if ERRORLEVEL 1 exit /b 1
|
||||||
%COMPILER% >nul 2>&1
|
call %COMPILER% >nul 2>&1
|
||||||
if ERRORLEVEL 1 exit /b 1
|
if ERRORLEVEL 1 exit /b 1
|
||||||
goto :EOF
|
goto :EOF
|
||||||
|
|
||||||
|
:NotConfig
|
||||||
|
echo.
|
||||||
|
echo *** This workspace is not configured.
|
||||||
|
echo Either retrieve the configured source in the release tarball
|
||||||
|
echo or, if building from Git, run the .\bootstrap.bat script first.
|
||||||
|
exit /b 1
|
||||||
|
|
||||||
:Usage
|
:Usage
|
||||||
echo Usage: %0 [options] [gcc]
|
echo Usage: %0 [options] [gcc] OR [tcc]
|
||||||
echo Options:
|
echo Options:
|
||||||
echo. --without-guile Do not compile Guile support even if found
|
echo. --without-guile Do not compile Guile support even if found
|
||||||
echo. --debug Make a Debug build--default is Release
|
echo. --debug Make a Debug build--default is Release
|
||||||
echo. --x86 Make a 32bit binary--default is 64bit
|
echo. --x86 Make a 32bit binary--default is 64bit
|
||||||
echo. --help Display these instructions and exit
|
echo. --help Display these instructions and exit
|
||||||
|
echo.
|
||||||
|
echo. "gcc" means compile with GCC, "tcc" means compile with Tiny C's TCC
|
||||||
goto :EOF
|
goto :EOF
|
||||||
|
|
||||||
:Reset
|
:Reset
|
||||||
|
|||||||
24
builddos.bat
24
builddos.bat
@@ -1,5 +1,5 @@
|
|||||||
@echo off
|
@echo off
|
||||||
rem Copyright (C) 1998-2019 Free Software Foundation, Inc.
|
rem Copyright (C) 1998-2022 Free Software Foundation, Inc.
|
||||||
rem This file is part of GNU Make.
|
rem This file is part of GNU Make.
|
||||||
rem
|
rem
|
||||||
rem GNU Make is free software; you can redistribute it and/or modify it under
|
rem GNU Make is free software; you can redistribute it and/or modify it under
|
||||||
@@ -13,7 +13,7 @@ rem FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for.
|
|||||||
rem more details.
|
rem more details.
|
||||||
rem
|
rem
|
||||||
rem You should have received a copy of the GNU General Public License along
|
rem You should have received a copy of the GNU General Public License along
|
||||||
rem with this program. If not, see <http://www.gnu.org/licenses/>.
|
rem with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
echo Building Make for MSDOS with DJGPP
|
echo Building Make for MSDOS with DJGPP
|
||||||
|
|
||||||
@@ -49,14 +49,14 @@ gcc -c -I./src -I%XSRC%/src -I./lib -I%XSRC%/lib -DHAVE_CONFIG_H -O2 -g %XSRC%/s
|
|||||||
gcc -c -I./src -I%XSRC%/src -I./lib -I%XSRC%/lib -DHAVE_CONFIG_H -O2 -g %XSRC%/src/dir.c -o dir.o
|
gcc -c -I./src -I%XSRC%/src -I./lib -I%XSRC%/lib -DHAVE_CONFIG_H -O2 -g %XSRC%/src/dir.c -o dir.o
|
||||||
gcc -c -I./src -I%XSRC%/src -I./lib -I%XSRC%/lib -DHAVE_CONFIG_H -O2 -g %XSRC%/src/file.c -o file.o
|
gcc -c -I./src -I%XSRC%/src -I./lib -I%XSRC%/lib -DHAVE_CONFIG_H -O2 -g %XSRC%/src/file.c -o file.o
|
||||||
gcc -c -I./src -I%XSRC%/src -I./lib -I%XSRC%/lib -DHAVE_CONFIG_H -O2 -g %XSRC%/src/misc.c -o misc.o
|
gcc -c -I./src -I%XSRC%/src -I./lib -I%XSRC%/lib -DHAVE_CONFIG_H -O2 -g %XSRC%/src/misc.c -o misc.o
|
||||||
gcc -c -I./src -I%XSRC%/src -I./lib -I%XSRC%/lib -DHAVE_CONFIG_H -O2 -g %XSRC%/src/main.c -o main.o
|
gcc -c -I./src -I%XSRC%/src -I./lib -I%XSRC%/lib -DHAVE_CONFIG_H -DLOCALEDIR=\"/dev/env/DJDIR/share/locale\" -O2 -g %XSRC%/src/main.c -o main.o
|
||||||
gcc -c -I./src -I%XSRC%/src -I./lib -I%XSRC%/lib -DHAVE_CONFIG_H -DINCLUDEDIR=\"c:/djgpp/include\" -O2 -g %XSRC%/src/read.c -o read.o
|
gcc -c -I./src -I%XSRC%/src -I./lib -I%XSRC%/lib -DHAVE_CONFIG_H -DINCLUDEDIR=\"/dev/env/DJDIR/include\" -O2 -g %XSRC%/src/read.c -o read.o
|
||||||
gcc -c -I./src -I%XSRC%/src -I./lib -I%XSRC%/lib -DHAVE_CONFIG_H -DLIBDIR=\"c:/djgpp/lib\" -O2 -g %XSRC%/src/remake.c -o remake.o
|
gcc -c -I./src -I%XSRC%/src -I./lib -I%XSRC%/lib -DHAVE_CONFIG_H -DLIBDIR=\"/dev/env/DJDIR/lib\" -O2 -g %XSRC%/src/remake.c -o remake.o
|
||||||
gcc -c -I./src -I%XSRC%/src -I./lib -I%XSRC%/lib -DHAVE_CONFIG_H -O2 -g %XSRC%/src/rule.c -o rule.o
|
gcc -c -I./src -I%XSRC%/src -I./lib -I%XSRC%/lib -DHAVE_CONFIG_H -O2 -g %XSRC%/src/rule.c -o rule.o
|
||||||
gcc -c -I./src -I%XSRC%/src -I./lib -I%XSRC%/lib -DHAVE_CONFIG_H -O2 -g %XSRC%/src/implicit.c -o implicit.o
|
gcc -c -I./src -I%XSRC%/src -I./lib -I%XSRC%/lib -DHAVE_CONFIG_H -O2 -g %XSRC%/src/implicit.c -o implicit.o
|
||||||
gcc -c -I./src -I%XSRC%/src -I./lib -I%XSRC%/lib -DHAVE_CONFIG_H -O2 -g %XSRC%/src/default.c -o default.o
|
gcc -c -I./src -I%XSRC%/src -I./lib -I%XSRC%/lib -DHAVE_CONFIG_H -O2 -g %XSRC%/src/default.c -o default.o
|
||||||
gcc -c -I./src -I%XSRC%/src -I./lib -I%XSRC%/lib -DHAVE_CONFIG_H -O2 -g %XSRC%/src/variable.c -o variable.o
|
gcc -c -I./src -I%XSRC%/src -I./lib -I%XSRC%/lib -DHAVE_CONFIG_H -O2 -g %XSRC%/src/variable.c -o variable.o
|
||||||
gcc -c -I./src -I%XSRC%/src -I./lib -I%XSRC%/lib -DHAVE_CONFIG_H -O2 -g %XSRC%/src/expand.c -o eyxpand.o
|
gcc -c -I./src -I%XSRC%/src -I./lib -I%XSRC%/lib -DHAVE_CONFIG_H -O2 -g %XSRC%/src/expand.c -o expand.o
|
||||||
gcc -c -I./src -I%XSRC%/src -I./lib -I%XSRC%/lib -DHAVE_CONFIG_H -O2 -g %XSRC%/src/function.c -o function.o
|
gcc -c -I./src -I%XSRC%/src -I./lib -I%XSRC%/lib -DHAVE_CONFIG_H -O2 -g %XSRC%/src/function.c -o function.o
|
||||||
gcc -c -I./src -I%XSRC%/src -I./lib -I%XSRC%/lib -DHAVE_CONFIG_H -O2 -g %XSRC%/src/vpath.c -o vpath.o
|
gcc -c -I./src -I%XSRC%/src -I./lib -I%XSRC%/lib -DHAVE_CONFIG_H -O2 -g %XSRC%/src/vpath.c -o vpath.o
|
||||||
gcc -c -I./src -I%XSRC%/src -I./lib -I%XSRC%/lib -DHAVE_CONFIG_H -O2 -g %XSRC%/src/hash.c -o hash.o
|
gcc -c -I./src -I%XSRC%/src -I./lib -I%XSRC%/lib -DHAVE_CONFIG_H -O2 -g %XSRC%/src/hash.c -o hash.o
|
||||||
@@ -68,15 +68,17 @@ gcc -c -I./src -I%XSRC%/src -I./lib -I%XSRC%/lib -DHAVE_CONFIG_H -O2 -g %XSRC%/s
|
|||||||
gcc -c -I./src -I%XSRC%/src -I./lib -I%XSRC%/lib -DHAVE_CONFIG_H -O2 -g %XSRC%/src/remote-stub.c -o remote-stub.o
|
gcc -c -I./src -I%XSRC%/src -I./lib -I%XSRC%/lib -DHAVE_CONFIG_H -O2 -g %XSRC%/src/remote-stub.c -o remote-stub.o
|
||||||
gcc -c -I./src -I%XSRC%/src -I./lib -I%XSRC%/lib -DHAVE_CONFIG_H -O2 -g %XSRC%/src/getopt.c -o getopt.o
|
gcc -c -I./src -I%XSRC%/src -I./lib -I%XSRC%/lib -DHAVE_CONFIG_H -O2 -g %XSRC%/src/getopt.c -o getopt.o
|
||||||
gcc -c -I./src -I%XSRC%/src -I./lib -I%XSRC%/lib -DHAVE_CONFIG_H -O2 -g %XSRC%/src/getopt1.c -o getopt1.o
|
gcc -c -I./src -I%XSRC%/src -I./lib -I%XSRC%/lib -DHAVE_CONFIG_H -O2 -g %XSRC%/src/getopt1.c -o getopt1.o
|
||||||
|
gcc -c -I./src -I%XSRC%/src -I./lib -I%XSRC%/lib -DHAVE_CONFIG_H -O2 -g %XSRC%/src/shuffle.c -o shuffle.o
|
||||||
|
gcc -c -I./src -I%XSRC%/src -I./lib -I%XSRC%/lib -DHAVE_CONFIG_H -O2 -g %XSRC%/src/load.c -o load.o
|
||||||
gcc -c -I./src -I%XSRC%/src -I./lib -I%XSRC%/lib -DHAVE_CONFIG_H -O2 -g %XSRC%/lib/glob.c -o lib/glob.o
|
gcc -c -I./src -I%XSRC%/src -I./lib -I%XSRC%/lib -DHAVE_CONFIG_H -O2 -g %XSRC%/lib/glob.c -o lib/glob.o
|
||||||
gcc -c -I./src -I%XSRC%/src -I./lib -I%XSRC%/lib -DHAVE_CONFIG_H -O2 -g %XSRC%/lib/fnmatch.c -o lib/fnmatch.o
|
gcc -c -I./src -I%XSRC%/src -I./lib -I%XSRC%/lib -DHAVE_CONFIG_H -O2 -g %XSRC%/lib/fnmatch.c -o lib/fnmatch.o
|
||||||
@echo off
|
@echo off
|
||||||
echo commands.o > respf.$$$
|
echo commands.o > respf.$$$
|
||||||
for %%f in (job output dir file misc main read remake rule implicit default variable) do echo %%f.o >> respf.$$$
|
for %%f in (job output dir file misc main read remake rule implicit default variable load) do echo %%f.o >> respf.$$$
|
||||||
for %%f in (expand function vpath hash strcache version ar arscan signame remote-stub getopt getopt1) do echo %%f.o >> respf.$$$
|
for %%f in (expand function vpath hash strcache version ar arscan signame remote-stub getopt getopt1 shuffle) do echo %%f.o >> respf.$$$
|
||||||
for %%f in (lib\glob lib\fnmatch) do echo %%f.o >> respf.$$$
|
for %%f in (lib\glob lib\fnmatch) do echo %%f.o >> respf.$$$
|
||||||
rem gcc -c -I./src -I%XSRC% -I./lib -I%XSRC%/lib -DHAVE_CONFIG_H -O2 -g %XSRC%/guile.c -o guile.o
|
gcc -c -I./src -I%XSRC%/src -I./lib -I%XSRC%/lib -DHAVE_CONFIG_H -O2 -g %XSRC%/src/guile.c -o guile.o
|
||||||
rem echo guile.o >> respf.$$$
|
echo guile.o >> respf.$$$
|
||||||
@echo Linking...
|
@echo Linking...
|
||||||
@echo on
|
@echo on
|
||||||
gcc -o make.exe @respf.$$$
|
gcc -o make.exe @respf.$$$
|
||||||
@@ -84,7 +86,7 @@ gcc -o make.exe @respf.$$$
|
|||||||
if not exist make.exe echo Make.exe build failed...
|
if not exist make.exe echo Make.exe build failed...
|
||||||
if exist make.exe echo make.exe is now built!
|
if exist make.exe echo make.exe is now built!
|
||||||
if exist make.exe del respf.$$$
|
if exist make.exe del respf.$$$
|
||||||
if exist make.exe copy /Y Basic.mk Makefile
|
if exist make.exe copy /Y %XSRC%\Basic.mk Makefile
|
||||||
goto End
|
goto End
|
||||||
|
|
||||||
:SmallEnv
|
:SmallEnv
|
||||||
|
|||||||
141
configure.ac
141
configure.ac
@@ -1,6 +1,6 @@
|
|||||||
# Process this file with autoconf to produce a configure script.
|
# Process this file with autoconf to produce a configure script.
|
||||||
#
|
#
|
||||||
# Copyright (C) 1993-2019 Free Software Foundation, Inc.
|
# Copyright (C) 1993-2022 Free Software Foundation, Inc.
|
||||||
# This file is part of GNU Make.
|
# This file is part of GNU Make.
|
||||||
#
|
#
|
||||||
# GNU Make is free software; you can redistribute it and/or modify it under
|
# GNU Make is free software; you can redistribute it and/or modify it under
|
||||||
@@ -14,9 +14,9 @@
|
|||||||
# details.
|
# details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License along with
|
# You should have received a copy of the GNU General Public License along with
|
||||||
# this program. If not, see <http://www.gnu.org/licenses/>.
|
# this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
AC_INIT([GNU make],[4.2.91],[bug-make@gnu.org])
|
AC_INIT([GNU Make],[4.4],[bug-make@gnu.org])
|
||||||
|
|
||||||
AC_PREREQ([2.69])
|
AC_PREREQ([2.69])
|
||||||
|
|
||||||
@@ -31,7 +31,7 @@ AC_CONFIG_LIBOBJ_DIR([lib])
|
|||||||
# We have to enable "foreign" because ChangeLog is auto-generated
|
# We have to enable "foreign" because ChangeLog is auto-generated
|
||||||
# Automake 1.15 and gnulib don't get along: gnulib has some strange error
|
# Automake 1.15 and gnulib don't get along: gnulib has some strange error
|
||||||
# in the way it handles getloadavg.c which causes make distcheck to fail.
|
# in the way it handles getloadavg.c which causes make distcheck to fail.
|
||||||
# http://lists.gnu.org/archive/html/bug-gnulib/2018-06/msg00024.html
|
# https://lists.gnu.org/archive/html/bug-gnulib/2018-06/msg00024.html
|
||||||
AM_INIT_AUTOMAKE([1.16.1 foreign -Werror -Wall])
|
AM_INIT_AUTOMAKE([1.16.1 foreign -Werror -Wall])
|
||||||
|
|
||||||
# Checks for programs.
|
# Checks for programs.
|
||||||
@@ -51,42 +51,36 @@ AC_CHECK_PROG([PERL], [perl], [perl], [perl])
|
|||||||
|
|
||||||
# Specialized system macros
|
# Specialized system macros
|
||||||
AC_CANONICAL_HOST
|
AC_CANONICAL_HOST
|
||||||
AC_AIX
|
|
||||||
AC_ISC_POSIX
|
|
||||||
AC_MINIX
|
|
||||||
AC_C_BIGENDIAN
|
AC_C_BIGENDIAN
|
||||||
|
|
||||||
# Enable gettext, in "external" mode.
|
# Enable gettext, in "external" mode.
|
||||||
AM_GNU_GETTEXT_VERSION([0.19.4])
|
AM_GNU_GETTEXT_VERSION([0.19.4])
|
||||||
AM_GNU_GETTEXT([external])
|
AM_GNU_GETTEXT([external])
|
||||||
|
|
||||||
# This test must come as early as possible after the compiler configuration
|
|
||||||
# tests, because the choice of the file model can (in principle) affect
|
|
||||||
# whether functions and headers are available, whether they work, etc.
|
|
||||||
AC_SYS_LARGEFILE
|
|
||||||
|
|
||||||
# Checks for libraries.
|
# Checks for libraries.
|
||||||
|
AC_SEARCH_LIBS([strerror],[cposix])
|
||||||
AC_SEARCH_LIBS([getpwnam], [sun])
|
AC_SEARCH_LIBS([getpwnam], [sun])
|
||||||
|
|
||||||
# Checks for header files.
|
|
||||||
AC_HEADER_STDC
|
|
||||||
AC_HEADER_DIRENT
|
AC_HEADER_DIRENT
|
||||||
AC_HEADER_STAT
|
AC_HEADER_STAT
|
||||||
AC_HEADER_TIME
|
|
||||||
AC_CHECK_HEADERS([stdlib.h locale.h unistd.h limits.h fcntl.h string.h \
|
AC_CHECK_HEADERS([stdlib.h locale.h unistd.h limits.h fcntl.h string.h \
|
||||||
memory.h sys/param.h sys/resource.h sys/time.h sys/timeb.h \
|
memory.h sys/param.h sys/resource.h sys/timeb.h sys/time.h \
|
||||||
sys/select.h sys/file.h spawn.h])
|
sys/select.h sys/file.h spawn.h])
|
||||||
|
|
||||||
AM_PROG_CC_C_O
|
AM_PROG_CC_C_O
|
||||||
AC_C_CONST
|
AC_C_CONST
|
||||||
AC_TYPE_SIGNAL
|
|
||||||
AC_TYPE_UID_T
|
AC_TYPE_UID_T
|
||||||
AC_TYPE_PID_T
|
AC_TYPE_PID_T
|
||||||
AC_TYPE_OFF_T
|
AC_TYPE_OFF_T
|
||||||
AC_TYPE_SIZE_T
|
AC_TYPE_SIZE_T
|
||||||
AC_TYPE_SSIZE_T
|
AC_TYPE_SSIZE_T
|
||||||
|
AC_TYPE_INTMAX_T
|
||||||
AC_TYPE_UINTMAX_T
|
AC_TYPE_UINTMAX_T
|
||||||
|
|
||||||
|
# Check for sig_atomic_t
|
||||||
|
gt_TYPE_SIG_ATOMIC_T
|
||||||
|
|
||||||
# Find out whether our struct stat returns nanosecond resolution timestamps.
|
# Find out whether our struct stat returns nanosecond resolution timestamps.
|
||||||
|
|
||||||
AC_STRUCT_ST_MTIM_NSEC
|
AC_STRUCT_ST_MTIM_NSEC
|
||||||
@@ -115,9 +109,6 @@ AS_IF([test "$make_cv_file_timestamp_hi_res" = yes],
|
|||||||
])
|
])
|
||||||
])
|
])
|
||||||
|
|
||||||
# Check for DOS-style pathnames.
|
|
||||||
pds_AC_DOS_PATHS
|
|
||||||
|
|
||||||
# See if we have a standard version of gettimeofday(). Since actual
|
# See if we have a standard version of gettimeofday(). Since actual
|
||||||
# implementations can differ, just make sure we have the most common
|
# implementations can differ, just make sure we have the most common
|
||||||
# one.
|
# one.
|
||||||
@@ -127,8 +118,8 @@ AC_CACHE_CHECK([for standard gettimeofday], [ac_cv_func_gettimeofday],
|
|||||||
int main ()
|
int main ()
|
||||||
{
|
{
|
||||||
struct timeval t; t.tv_sec = -1; t.tv_usec = -1;
|
struct timeval t; t.tv_sec = -1; t.tv_usec = -1;
|
||||||
exit (gettimeofday (&t, 0) != 0
|
return gettimeofday (&t, 0) != 0
|
||||||
|| t.tv_sec < 0 || t.tv_usec < 0);
|
|| t.tv_sec < 0 || t.tv_usec < 0;
|
||||||
}]])],
|
}]])],
|
||||||
[ac_cv_func_gettimeofday=yes],
|
[ac_cv_func_gettimeofday=yes],
|
||||||
[ac_cv_func_gettimeofday=no],
|
[ac_cv_func_gettimeofday=no],
|
||||||
@@ -138,10 +129,10 @@ AS_IF([test "$ac_cv_func_gettimeofday" = yes],
|
|||||||
[Define to 1 if you have a standard gettimeofday function])
|
[Define to 1 if you have a standard gettimeofday function])
|
||||||
])
|
])
|
||||||
|
|
||||||
AC_CHECK_FUNCS([strdup strndup umask mkstemp mktemp fdopen \
|
AC_CHECK_FUNCS([strtoll strdup strndup stpcpy memrchr mempcpy umask mkstemp \
|
||||||
dup dup2 getcwd realpath sigsetmask sigaction \
|
mktemp fdopen dup dup2 getcwd realpath sigsetmask sigaction \
|
||||||
getgroups seteuid setegid setlinebuf setreuid setregid \
|
getgroups seteuid setegid setlinebuf setreuid setregid \
|
||||||
getrlimit setrlimit setvbuf pipe strsignal \
|
mkfifo getrlimit setrlimit setvbuf pipe strerror strsignal \
|
||||||
lstat readlink atexit isatty ttyname pselect posix_spawn \
|
lstat readlink atexit isatty ttyname pselect posix_spawn \
|
||||||
posix_spawnattr_setsigmask])
|
posix_spawnattr_setsigmask])
|
||||||
|
|
||||||
@@ -153,8 +144,6 @@ AC_CHECK_DECLS([bsd_signal], [], [], [[#define _GNU_SOURCE 1
|
|||||||
|
|
||||||
AC_FUNC_FORK
|
AC_FUNC_FORK
|
||||||
|
|
||||||
AC_FUNC_SETVBUF_REVERSED
|
|
||||||
|
|
||||||
# Rumor has it that strcasecmp lives in -lresolv on some odd systems.
|
# Rumor has it that strcasecmp lives in -lresolv on some odd systems.
|
||||||
# It doesn't hurt much to use our own if we can't find it so I don't
|
# It doesn't hurt much to use our own if we can't find it so I don't
|
||||||
# make the effort here.
|
# make the effort here.
|
||||||
@@ -176,7 +165,7 @@ AC_ARG_WITH([guile], [AS_HELP_STRING([--with-guile],
|
|||||||
PKG_PROG_PKG_CONFIG
|
PKG_PROG_PKG_CONFIG
|
||||||
|
|
||||||
AS_IF([test "x$with_guile" != xno],
|
AS_IF([test "x$with_guile" != xno],
|
||||||
[ guile_versions="2.2 2.0 1.8"
|
[ guile_versions="3.0 2.2 2.0 1.8"
|
||||||
guile_version=no
|
guile_version=no
|
||||||
have_guile=no
|
have_guile=no
|
||||||
AC_MSG_CHECKING([for GNU Guile])
|
AC_MSG_CHECKING([for GNU Guile])
|
||||||
@@ -184,13 +173,41 @@ AS_IF([test "x$with_guile" != xno],
|
|||||||
PKG_CHECK_EXISTS([guile-$v], [guile_version=$v; have_guile=yes; break], [])
|
PKG_CHECK_EXISTS([guile-$v], [guile_version=$v; have_guile=yes; break], [])
|
||||||
done
|
done
|
||||||
AC_MSG_RESULT([$guile_version])
|
AC_MSG_RESULT([$guile_version])
|
||||||
if test "$have_guile" = yes; then
|
AS_IF([test "$have_guile" = yes],
|
||||||
PKG_CHECK_MODULES(GUILE, [guile-$guile_version])
|
[ PKG_CHECK_MODULES(GUILE, [guile-$guile_version])
|
||||||
AC_DEFINE([HAVE_GUILE], [1], [Embed GNU Guile support])
|
# Unfortunately pkg doesn't help in multi-arch environments where the
|
||||||
fi
|
# package is installed for some architectures but not others; we need
|
||||||
|
# to try to link.
|
||||||
|
keep_CPPFLAGS="$CPPFLAGS"
|
||||||
|
keep_LIBS="$LIBS"
|
||||||
|
CPPFLAGS="$CPPFLAGS $GUILE_CFLAGS"
|
||||||
|
LIBS="$LIBS $GUILE_LIBS"
|
||||||
|
AC_CHECK_HEADER([libguile.h],
|
||||||
|
[AC_DEFINE([HAVE_GUILE], [1], [Embed GNU Guile support])],
|
||||||
|
[have_guile=no],
|
||||||
|
[/* Avoid configuration error warnings. */])
|
||||||
|
AS_IF([test "$have_guile" = yes],
|
||||||
|
[ AC_MSG_CHECKING([whether we can link GNU Guile])
|
||||||
|
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
|
||||||
|
#include <libguile.h>
|
||||||
|
static void *
|
||||||
|
guile_init (void *arg)
|
||||||
|
{
|
||||||
|
(void) arg;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
]], [[
|
||||||
|
scm_with_guile (guile_init, 0);
|
||||||
|
]])],
|
||||||
|
[have_guile=yes],
|
||||||
|
[have_guile=no])
|
||||||
|
AC_MSG_RESULT([$have_guile])])
|
||||||
|
CPPFLAGS="$keep_CPPFLAGS"
|
||||||
|
LIBS="$keep_LIBS"
|
||||||
|
])
|
||||||
])
|
])
|
||||||
|
|
||||||
AM_CONDITIONAL([HAVE_GUILE], [test "$have_guile" = yes])
|
AM_CONDITIONAL([HAVE_GUILE], [test "$have_guile" = "yes"])
|
||||||
|
|
||||||
AC_CHECK_DECLS([sys_siglist, _sys_siglist, __sys_siglist], , ,
|
AC_CHECK_DECLS([sys_siglist, _sys_siglist, __sys_siglist], , ,
|
||||||
[AC_INCLUDES_DEFAULT
|
[AC_INCLUDES_DEFAULT
|
||||||
@@ -243,8 +260,7 @@ AS_IF([test "$PATH_SEPARATOR" = ';'],
|
|||||||
AC_SUBST([REMOTE]) REMOTE=stub
|
AC_SUBST([REMOTE]) REMOTE=stub
|
||||||
use_customs=false
|
use_customs=false
|
||||||
AC_ARG_WITH([customs],
|
AC_ARG_WITH([customs],
|
||||||
[AC_HELP_STRING([--with-customs=DIR],
|
[AS_HELP_STRING([--with-customs=DIR],[enable remote jobs via Customs--see README.customs])],
|
||||||
[enable remote jobs via Customs--see README.customs])],
|
|
||||||
[ AS_CASE([$withval], [n|no], [:],
|
[ AS_CASE([$withval], [n|no], [:],
|
||||||
[make_cppflags="$CPPFLAGS"
|
[make_cppflags="$CPPFLAGS"
|
||||||
AS_CASE([$withval],
|
AS_CASE([$withval],
|
||||||
@@ -267,14 +283,12 @@ AM_CONDITIONAL([USE_CUSTOMS], [test "$use_customs" = true])
|
|||||||
# See if the user asked to handle case insensitive file systems.
|
# See if the user asked to handle case insensitive file systems.
|
||||||
AH_TEMPLATE([HAVE_CASE_INSENSITIVE_FS], [Use case insensitive file names])
|
AH_TEMPLATE([HAVE_CASE_INSENSITIVE_FS], [Use case insensitive file names])
|
||||||
AC_ARG_ENABLE([case-insensitive-file-system],
|
AC_ARG_ENABLE([case-insensitive-file-system],
|
||||||
AC_HELP_STRING([--enable-case-insensitive-file-system],
|
AS_HELP_STRING([--enable-case-insensitive-file-system],[assume file systems are case insensitive]),
|
||||||
[assume file systems are case insensitive]),
|
|
||||||
[AS_IF([test "$enableval" = yes], [AC_DEFINE([HAVE_CASE_INSENSITIVE_FS])])])
|
[AS_IF([test "$enableval" = yes], [AC_DEFINE([HAVE_CASE_INSENSITIVE_FS])])])
|
||||||
|
|
||||||
# See if we can handle the job server feature, and if the user wants it.
|
# See if we can handle the job server feature, and if the user wants it.
|
||||||
AC_ARG_ENABLE([job-server],
|
AC_ARG_ENABLE([job-server],
|
||||||
AC_HELP_STRING([--disable-job-server],
|
AS_HELP_STRING([--disable-job-server],[disallow recursive make communication during -jN]),
|
||||||
[disallow recursive make communication during -jN]),
|
|
||||||
[make_cv_job_server="$enableval" user_job_server="$enableval"],
|
[make_cv_job_server="$enableval" user_job_server="$enableval"],
|
||||||
[make_cv_job_server="yes"])
|
[make_cv_job_server="yes"])
|
||||||
|
|
||||||
@@ -312,8 +326,7 @@ AC_CHECK_DECLS([dlopen, dlsym, dlerror], [], [],
|
|||||||
[[#include <dlfcn.h>]])
|
[[#include <dlfcn.h>]])
|
||||||
|
|
||||||
AC_ARG_ENABLE([load],
|
AC_ARG_ENABLE([load],
|
||||||
AC_HELP_STRING([--disable-load],
|
AS_HELP_STRING([--disable-load],[disable support for the 'load' operation]),
|
||||||
[disable support for the 'load' operation]),
|
|
||||||
[make_cv_load="$enableval" user_load="$enableval"],
|
[make_cv_load="$enableval" user_load="$enableval"],
|
||||||
[make_cv_load="yes"])
|
[make_cv_load="yes"])
|
||||||
|
|
||||||
@@ -363,15 +376,31 @@ AS_IF([test "$ac_cv_func_lstat" = yes && test "$ac_cv_func_readlink" = yes],
|
|||||||
# Use posix_spawn if we have support and the user didn't disable it
|
# Use posix_spawn if we have support and the user didn't disable it
|
||||||
|
|
||||||
AC_ARG_ENABLE([posix-spawn],
|
AC_ARG_ENABLE([posix-spawn],
|
||||||
AC_HELP_STRING([--disable-posix-spawn],
|
AS_HELP_STRING([--disable-posix-spawn],[disable support for posix_spawn()]),
|
||||||
[disable support for posix_spawn()]),
|
|
||||||
[make_cv_posix_spawn="$enableval" user_posix_spawn="$enableval"],
|
[make_cv_posix_spawn="$enableval" user_posix_spawn="$enableval"],
|
||||||
[make_cv_posix_spawn="yes"])
|
[make_cv_posix_spawn="yes"])
|
||||||
|
|
||||||
AS_CASE([/$ac_cv_header_spawn/$ac_cv_func_posix_spawn/],
|
AS_CASE([/$ac_cv_header_spawn/$ac_cv_func_posix_spawn/],
|
||||||
[*/no/*], [make_cv_posix_spawn=no])
|
[*/no/*], [make_cv_posix_spawn=no])
|
||||||
|
|
||||||
AS_CASE([/$make_cv_posix_spawn/$user_posix_spawn/],
|
AS_IF([test "$make_cv_posix_spawn" = yes],
|
||||||
|
AC_CACHE_CHECK([for posix_spawn that fails synchronously],
|
||||||
|
[make_cv_synchronous_posix_spawn],
|
||||||
|
[make_cv_synchronous_posix_spawn=no
|
||||||
|
AC_RUN_IFELSE([AC_LANG_SOURCE([[
|
||||||
|
#include <errno.h>
|
||||||
|
#include <spawn.h>
|
||||||
|
extern char **environ;
|
||||||
|
int main () {
|
||||||
|
char path[[]] = "./xxx-non-existent";
|
||||||
|
char *argv[[]] = {path, 0};
|
||||||
|
return posix_spawn (0, path, 0, 0, argv, environ) == ENOENT ? 0 : 1;
|
||||||
|
}]])],
|
||||||
|
[make_cv_synchronous_posix_spawn=yes],
|
||||||
|
[make_cv_synchronous_posix_spawn=no],
|
||||||
|
[make_cv_synchronous_posix_spawn="no (cross-compiling)"])]))
|
||||||
|
|
||||||
|
AS_CASE([/$user_posix_spawn/$make_cv_posix_spawn/$make_cv_synchronous_posix_spawn/],
|
||||||
[*/no/*], [make_cv_posix_spawn=no],
|
[*/no/*], [make_cv_posix_spawn=no],
|
||||||
[AC_DEFINE(USE_POSIX_SPAWN, 1, [Define to 1 to use posix_spawn().])
|
[AC_DEFINE(USE_POSIX_SPAWN, 1, [Define to 1 to use posix_spawn().])
|
||||||
])
|
])
|
||||||
@@ -416,13 +445,21 @@ AS_CASE([$host],
|
|||||||
[*-*-mingw32],
|
[*-*-mingw32],
|
||||||
[AM_CONDITIONAL([WINDOWSENV], [true])
|
[AM_CONDITIONAL([WINDOWSENV], [true])
|
||||||
w32_target_env=yes
|
w32_target_env=yes
|
||||||
AC_DEFINE([WINDOWS32], [1], [Use platform specific coding])
|
AC_DEFINE([WINDOWS32], [1], [Build for the WINDOWS32 API.])
|
||||||
AC_DEFINE([HAVE_DOS_PATHS], [1], [Use platform specific coding])
|
AC_DEFINE([HAVE_DOS_PATHS], [1], [Support DOS-style pathnames.])
|
||||||
])
|
])
|
||||||
|
|
||||||
AC_DEFINE_UNQUOTED([PATH_SEPARATOR_CHAR],['$PATH_SEPARATOR'],
|
AC_DEFINE_UNQUOTED([PATH_SEPARATOR_CHAR],['$PATH_SEPARATOR'],
|
||||||
[Define to the character that separates directories in PATH.])
|
[Define to the character that separates directories in PATH.])
|
||||||
|
|
||||||
|
AC_DEFINE_UNQUOTED([HAVE_DECL_GETLOADAVG],[$HAVE_DECL_GETLOADAVG],
|
||||||
|
[Define to 1 if you have the declaration of 'getloadavg'.])
|
||||||
|
|
||||||
|
# Remember that we ran configure to generate config.h
|
||||||
|
|
||||||
|
AC_DEFINE([MK_CONFIGURE], [1],
|
||||||
|
[Define to 1 if config.h is generated by running the configure script.])
|
||||||
|
|
||||||
# Include the Maintainer's Makefile section, if it's here.
|
# Include the Maintainer's Makefile section, if it's here.
|
||||||
|
|
||||||
MAINT_MAKEFILE=/dev/null
|
MAINT_MAKEFILE=/dev/null
|
||||||
@@ -491,12 +528,20 @@ AS_IF([test "x$make_cv_posix_spawn" = xno && test "x$user_posix_spawn" = xyes],
|
|||||||
echo
|
echo
|
||||||
])
|
])
|
||||||
|
|
||||||
|
# autoconf initializes $prefix to NONE.
|
||||||
|
AM_CONDITIONAL([KNOWN_PREFIX],
|
||||||
|
[test "x$prefix" = xNONE -o "x$prefix" = x/usr/local \
|
||||||
|
-o "x$prefix" = x/usr/gnu -o "x$prefix" = x/usr])
|
||||||
|
|
||||||
# Specify what files are to be created.
|
# Specify what files are to be created.
|
||||||
AC_CONFIG_FILES([Makefile build.cfg lib/Makefile po/Makefile.in doc/Makefile \
|
AC_CONFIG_FILES([build.cfg tests/config-flags.pm \
|
||||||
tests/config-flags.pm])
|
Makefile lib/Makefile doc/Makefile po/Makefile.in])
|
||||||
# We don't need this: the standard automake output suffices for POSIX systems.
|
# We don't need this: the standard automake output suffices for POSIX systems.
|
||||||
#mk/Posix.mk
|
#mk/Posix.mk
|
||||||
|
|
||||||
|
# Put build.sh in the build directory so it's easy to find
|
||||||
|
AC_CONFIG_LINKS([build.sh:build.sh])
|
||||||
|
|
||||||
# OK, do it!
|
# OK, do it!
|
||||||
|
|
||||||
AC_OUTPUT
|
AC_OUTPUT
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
# -*-Makefile-*-, or close enough
|
# -*-Makefile-*-, or close enough
|
||||||
# Copyright (C) 2000-2019 Free Software Foundation, Inc.
|
# Copyright (C) 2000-2022 Free Software Foundation, Inc.
|
||||||
# This file is part of GNU Make.
|
# This file is part of GNU Make.
|
||||||
#
|
#
|
||||||
# GNU Make is free software; you can redistribute it and/or modify it under
|
# GNU Make is free software; you can redistribute it and/or modify it under
|
||||||
@@ -13,7 +13,7 @@
|
|||||||
# details.
|
# details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License along with
|
# You should have received a copy of the GNU General Public License along with
|
||||||
# this program. If not, see <http://www.gnu.org/licenses/>.
|
# this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
TEXI2HTML = texi2html
|
TEXI2HTML = texi2html
|
||||||
TEXI2HTML_FLAGS = -split_chapter
|
TEXI2HTML_FLAGS = -split_chapter
|
||||||
|
|||||||
77
doc/make.1
77
doc/make.1
@@ -1,4 +1,4 @@
|
|||||||
.TH MAKE 1 "28 February 2016" "GNU" "User Commands"
|
.TH MAKE 1 "31 May 2022" "GNU" "User Commands"
|
||||||
.SH NAME
|
.SH NAME
|
||||||
make \- GNU make utility to maintain groups of programs
|
make \- GNU make utility to maintain groups of programs
|
||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
@@ -26,9 +26,9 @@ To prepare to use
|
|||||||
.BR make ,
|
.BR make ,
|
||||||
you must write a file called the
|
you must write a file called the
|
||||||
.I makefile
|
.I makefile
|
||||||
that describes the relationships among files in your program, and the states
|
that describes the relationships among files in your program, and provides
|
||||||
the commands for updating each file. In a program, typically the executable
|
commands for updating each file. In a program, typically the executable file
|
||||||
file is updated from object files, which are in turn made by compiling source
|
is updated from object files, which are in turn made by compiling source
|
||||||
files.
|
files.
|
||||||
.LP
|
.LP
|
||||||
Once a suitable makefile exists, each time you change some source files,
|
Once a suitable makefile exists, each time you change some source files,
|
||||||
@@ -48,10 +48,10 @@ files, it issues the commands recorded in the makefile.
|
|||||||
.B make
|
.B make
|
||||||
executes commands in the
|
executes commands in the
|
||||||
.I makefile
|
.I makefile
|
||||||
to update one or more target
|
to update one or more
|
||||||
.IR names ,
|
.IR targets ,
|
||||||
where
|
where
|
||||||
.I name
|
.I target
|
||||||
is typically a program.
|
is typically a program.
|
||||||
If no
|
If no
|
||||||
.B \-f
|
.B \-f
|
||||||
@@ -130,21 +130,28 @@ are omitted, then the behavior is the same as if
|
|||||||
.B \-d
|
.B \-d
|
||||||
was specified.
|
was specified.
|
||||||
.I FLAGS
|
.I FLAGS
|
||||||
may be
|
may be any or all of the following names, comma- or space-separated. Only the
|
||||||
.I a
|
first character is significant: the rest may be omitted:
|
||||||
|
.I all
|
||||||
for all debugging output (same as using
|
for all debugging output (same as using
|
||||||
.BR \-d ),
|
.BR \-d ),
|
||||||
.I b
|
.I basic
|
||||||
for basic debugging,
|
for basic debugging,
|
||||||
.I v
|
.I verbose
|
||||||
for more verbose basic debugging,
|
for more verbose basic debugging,
|
||||||
.I i
|
.I implicit
|
||||||
for showing implicit rules,
|
for showing implicit rule search operations,
|
||||||
.I j
|
.I jobs
|
||||||
for details on invocation of commands, and
|
for details on invocation of commands,
|
||||||
.I m
|
.I makefile
|
||||||
for debugging while remaking makefiles. Use
|
for debugging while remaking makefiles,
|
||||||
.I n
|
.I print
|
||||||
|
shows all recipes that are run even if they are silent, and
|
||||||
|
.I why
|
||||||
|
shows the reason
|
||||||
|
.BR make
|
||||||
|
decided to rebuild each target. Use
|
||||||
|
.I none
|
||||||
to disable all previous debugging flags.
|
to disable all previous debugging flags.
|
||||||
.TP 0.5i
|
.TP 0.5i
|
||||||
\fB\-e\fR, \fB\-\-environment\-overrides\fR
|
\fB\-e\fR, \fB\-\-environment\-overrides\fR
|
||||||
@@ -198,6 +205,16 @@ option is given without an argument,
|
|||||||
.BR make
|
.BR make
|
||||||
will not limit the number of jobs that can run simultaneously.
|
will not limit the number of jobs that can run simultaneously.
|
||||||
.TP 0.5i
|
.TP 0.5i
|
||||||
|
\fB\--jobserver-style=\fR\fIstyle\fR
|
||||||
|
The style of jobserver to use. The
|
||||||
|
.I style
|
||||||
|
may be one of
|
||||||
|
.BR fifo ,
|
||||||
|
.BR pipe ,
|
||||||
|
or
|
||||||
|
.B sem
|
||||||
|
(Windows only).
|
||||||
|
.TP 0.5i
|
||||||
\fB\-k\fR, \fB\-\-keep\-going\fR
|
\fB\-k\fR, \fB\-\-keep\-going\fR
|
||||||
Continue as much as possible after an error.
|
Continue as much as possible after an error.
|
||||||
While the target that failed, and those that depend on it, cannot
|
While the target that failed, and those that depend on it, cannot
|
||||||
@@ -312,6 +329,26 @@ Turn off
|
|||||||
.BR \-w ,
|
.BR \-w ,
|
||||||
even if it was turned on implicitly.
|
even if it was turned on implicitly.
|
||||||
.TP 0.5i
|
.TP 0.5i
|
||||||
|
.BI \-\-shuffle "[=MODE]"
|
||||||
|
Enable shuffling of goal and prerequisite ordering.
|
||||||
|
.I MODE
|
||||||
|
is one of
|
||||||
|
.I none
|
||||||
|
to disable shuffle mode,
|
||||||
|
.I random
|
||||||
|
to shuffle prerequisites in random order,
|
||||||
|
.I reverse
|
||||||
|
to consider prerequisites in reverse order, or an integer
|
||||||
|
.I <seed>
|
||||||
|
which enables
|
||||||
|
.I random
|
||||||
|
mode with a specific
|
||||||
|
.I seed
|
||||||
|
value. If
|
||||||
|
.I MODE
|
||||||
|
is omitted the default is
|
||||||
|
.IR random .
|
||||||
|
.TP 0.5i
|
||||||
\fB\-W\fR \fIfile\fR, \fB\-\-what\-if\fR=\fIfile\fR, \fB\-\-new\-file\fR=\fIfile\fR, \fB\-\-assume\-new\fR=\fIfile\fR
|
\fB\-W\fR \fIfile\fR, \fB\-\-what\-if\fR=\fIfile\fR, \fB\-\-new\-file\fR=\fIfile\fR, \fB\-\-assume\-new\fR=\fIfile\fR
|
||||||
Pretend that the target
|
Pretend that the target
|
||||||
.I file
|
.I file
|
||||||
@@ -361,7 +398,7 @@ This manual page contributed by Dennis Morse of Stanford University.
|
|||||||
Further updates contributed by Mike Frysinger. It has been reworked by Roland
|
Further updates contributed by Mike Frysinger. It has been reworked by Roland
|
||||||
McGrath. Maintained by Paul Smith.
|
McGrath. Maintained by Paul Smith.
|
||||||
.SH "COPYRIGHT"
|
.SH "COPYRIGHT"
|
||||||
Copyright \(co 1992-1993, 1996-2019 Free Software Foundation, Inc.
|
Copyright \(co 1992-1993, 1996-2022 Free Software Foundation, Inc.
|
||||||
This file is part of
|
This file is part of
|
||||||
.IR "GNU make" .
|
.IR "GNU make" .
|
||||||
.LP
|
.LP
|
||||||
@@ -376,4 +413,4 @@ A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
|||||||
.LP
|
.LP
|
||||||
You should have received a copy of the GNU General Public License along with
|
You should have received a copy of the GNU General Public License along with
|
||||||
this program. If not, see
|
this program. If not, see
|
||||||
.IR http://www.gnu.org/licenses/ .
|
.IR https://www.gnu.org/licenses/ .
|
||||||
|
|||||||
1923
doc/make.texi
1923
doc/make.texi
File diff suppressed because it is too large
Load Diff
10
gl/.gitignore
vendored
Normal file
10
gl/.gitignore
vendored
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
*~
|
||||||
|
#*
|
||||||
|
.#*
|
||||||
|
.*cache
|
||||||
|
*.diff
|
||||||
|
*.patch
|
||||||
|
*.orig
|
||||||
|
*.rej
|
||||||
|
*.out
|
||||||
|
*.log
|
||||||
65
gl/README
Normal file
65
gl/README
Normal file
@@ -0,0 +1,65 @@
|
|||||||
|
04 July 2022 -*-text-*-
|
||||||
|
|
||||||
|
The gnulib project provides a fantastic array of modules that can support both
|
||||||
|
POSIX and also extended features for GNU software.
|
||||||
|
|
||||||
|
Unfortunately using it in GNU make is problematic: GNU make is a foundational
|
||||||
|
utility (if you don't have a "make" program you pretty much can't build any
|
||||||
|
software), one of our goals in GNU make is to provide scripts (e.g.,
|
||||||
|
"build.sh") that will build GNU make without needing an instance of make.
|
||||||
|
|
||||||
|
Instead of running "./configure && make", you should be able to run
|
||||||
|
"./configure && ./build.sh" and get a build of GNU make as a result.
|
||||||
|
|
||||||
|
However, more and more gnulib modules are relying not on M4 macros and
|
||||||
|
the configure script to manage their configuration, but in addition special
|
||||||
|
makefile recipes that perform various post-configure operations. Since we
|
||||||
|
don't have an instance of "make", we cannot use these modules as-is.
|
||||||
|
|
||||||
|
There are various options we could choose for solving this:
|
||||||
|
|
||||||
|
- Avoid gnulib modules and write our own portability interfaces.
|
||||||
|
I really am not too excited about this.
|
||||||
|
|
||||||
|
- Give up on "build.sh" and require users to already have "make".
|
||||||
|
The argument here is that you must already have a compiler, and it couldn't
|
||||||
|
have been built without "make", and/or if you build it with a cross-compiler
|
||||||
|
then you should be able to use that cross-development environment to build
|
||||||
|
GNU make as well.
|
||||||
|
|
||||||
|
- Provide a "mini-make" with just enough functionality to support the gnulib
|
||||||
|
makefiles but no extra features, that didn't need any complex gnulib
|
||||||
|
modules. As with the first option, I'm not too excited about this.
|
||||||
|
|
||||||
|
Although arguably the second option is the sane one, I'm not really excited
|
||||||
|
about any of them for the time being. So I elected to try something between
|
||||||
|
the first and second options:
|
||||||
|
|
||||||
|
The gnulib-port Git branch will contain unmodified copies of gnulib modules
|
||||||
|
that we want to use with GNU make. From there, we merge them into the main
|
||||||
|
Git branch then modify / simplify them to avoid unnecessary extra modules and
|
||||||
|
allow "build.sh" to be used.
|
||||||
|
|
||||||
|
By keeping the unmodified versions on the gnulib-port branch, we enable Git
|
||||||
|
merge facilities to merge in new versions as follows:
|
||||||
|
|
||||||
|
* Check out the gnulib-port branch
|
||||||
|
|
||||||
|
* Update its content with any updates to gnulib modules. Something like:
|
||||||
|
(
|
||||||
|
cd gl \
|
||||||
|
&& find */. -type f \
|
||||||
|
| while read fn; do
|
||||||
|
test -f "$GNULIB_SRCDIR/$fn" && cp "$GNULIB_SRCDIR/$fn" "$fn"
|
||||||
|
done
|
||||||
|
)
|
||||||
|
|
||||||
|
* Commit the changes _without modification_
|
||||||
|
|
||||||
|
* Check out the main branch
|
||||||
|
|
||||||
|
* Run "git merge --no-ff gnulib-port" to merge in the changes
|
||||||
|
|
||||||
|
* Resolve any conflicts and commit the merge.
|
||||||
|
|
||||||
|
-- pds
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
dnl acinclude.m4 -- Extra macros needed for GNU make.
|
dnl acinclude.m4 -- Extra macros needed for GNU make.
|
||||||
dnl
|
dnl
|
||||||
dnl Automake will incorporate this into its generated aclocal.m4.
|
dnl Automake will incorporate this into its generated aclocal.m4.
|
||||||
dnl Copyright (C) 1998-2019 Free Software Foundation, Inc.
|
dnl Copyright (C) 1998-2022 Free Software Foundation, Inc.
|
||||||
dnl This file is part of GNU Make.
|
dnl This file is part of GNU Make.
|
||||||
dnl
|
dnl
|
||||||
dnl GNU Make is free software; you can redistribute it and/or modify it under
|
dnl GNU Make is free software; you can redistribute it and/or modify it under
|
||||||
@@ -15,7 +15,7 @@ dnl FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for.
|
|||||||
dnl more details.
|
dnl more details.
|
||||||
dnl
|
dnl
|
||||||
dnl You should have received a copy of the GNU General Public License along
|
dnl You should have received a copy of the GNU General Public License along
|
||||||
dnl with this program. If not, see <http://www.gnu.org/licenses/>.
|
dnl with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
dnl ---------------------------------------------------------------------------
|
dnl ---------------------------------------------------------------------------
|
||||||
dnl Got this from the lynx 2.8 distribution.
|
dnl Got this from the lynx 2.8 distribution.
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
# Test if the system uses DOS-style pathnames (drive specs and backslashes)
|
# Test if the system uses DOS-style pathnames (drive specs and backslashes)
|
||||||
# By Paul Smith <psmith@gnu.org>. Based on dos.m4 by Jim Meyering.
|
# By Paul Smith <psmith@gnu.org>. Based on dos.m4 by Jim Meyering.
|
||||||
#
|
#
|
||||||
# Copyright (C) 1993-2019 Free Software Foundation, Inc.
|
# Copyright (C) 1993-2022 Free Software Foundation, Inc.
|
||||||
# This file is part of GNU Make.
|
# This file is part of GNU Make.
|
||||||
#
|
#
|
||||||
# GNU Make is free software; you can redistribute it and/or modify it under
|
# GNU Make is free software; you can redistribute it and/or modify it under
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
# details.
|
# details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License along with
|
# You should have received a copy of the GNU General Public License along with
|
||||||
# this program. If not, see <http://www.gnu.org/licenses/>.
|
# this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
AC_DEFUN([pds_AC_DOS_PATHS], [
|
AC_DEFUN([pds_AC_DOS_PATHS], [
|
||||||
AC_CACHE_CHECK([whether system uses MSDOS-style paths], [ac_cv_dos_paths], [
|
AC_CACHE_CHECK([whether system uses MSDOS-style paths], [ac_cv_dos_paths], [
|
||||||
216
gl/m4/getloadavg.m4
Normal file
216
gl/m4/getloadavg.m4
Normal file
@@ -0,0 +1,216 @@
|
|||||||
|
# Check for getloadavg.
|
||||||
|
|
||||||
|
# Copyright (C) 1992-1996, 1999-2000, 2002-2003, 2006, 2008-2022 Free Software
|
||||||
|
# Foundation, Inc.
|
||||||
|
|
||||||
|
# This file is free software; the Free Software Foundation
|
||||||
|
# gives unlimited permission to copy and/or distribute it,
|
||||||
|
# with or without modifications, as long as this notice is preserved.
|
||||||
|
|
||||||
|
#serial 10
|
||||||
|
|
||||||
|
# Autoconf defines AC_FUNC_GETLOADAVG, but that is obsolescent.
|
||||||
|
# New applications should use gl_GETLOADAVG instead.
|
||||||
|
|
||||||
|
# gl_GETLOADAVG
|
||||||
|
# -------------
|
||||||
|
AC_DEFUN([gl_GETLOADAVG],
|
||||||
|
[AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
|
||||||
|
|
||||||
|
# Persuade glibc <stdlib.h> to declare getloadavg().
|
||||||
|
AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
|
||||||
|
|
||||||
|
gl_save_LIBS=$LIBS
|
||||||
|
|
||||||
|
# getloadavg is present in libc on glibc >= 2.2, Mac OS X, FreeBSD >= 2.0,
|
||||||
|
# NetBSD >= 0.9, OpenBSD >= 2.0, Solaris >= 7.
|
||||||
|
HAVE_GETLOADAVG=1
|
||||||
|
AC_CHECK_FUNC([getloadavg], [],
|
||||||
|
[gl_func_getloadavg_done=no
|
||||||
|
|
||||||
|
# Some systems with -lutil have (and need) -lkvm as well, some do not.
|
||||||
|
# On Solaris, -lkvm requires nlist from -lelf, so check that first
|
||||||
|
# to get the right answer into the cache.
|
||||||
|
# For kstat on solaris, we need to test for libelf and libkvm to force the
|
||||||
|
# definition of SVR4 below.
|
||||||
|
if test $gl_func_getloadavg_done = no; then
|
||||||
|
AC_CHECK_LIB([elf], [elf_begin], [LIBS="-lelf $LIBS"])
|
||||||
|
AC_CHECK_LIB([kvm], [kvm_open], [LIBS="-lkvm $LIBS"])
|
||||||
|
# Check for the 4.4BSD definition of getloadavg.
|
||||||
|
AC_CHECK_LIB([util], [getloadavg],
|
||||||
|
[LIBS="-lutil $LIBS" gl_func_getloadavg_done=yes])
|
||||||
|
fi
|
||||||
|
|
||||||
|
if test $gl_func_getloadavg_done = no; then
|
||||||
|
# There is a commonly available library for RS/6000 AIX.
|
||||||
|
# Since it is not a standard part of AIX, it might be installed locally.
|
||||||
|
gl_getloadavg_LIBS=$LIBS
|
||||||
|
if test $cross_compiling != yes; then
|
||||||
|
LIBS="-L/usr/local/lib $LIBS"
|
||||||
|
fi
|
||||||
|
AC_CHECK_LIB([getloadavg], [getloadavg],
|
||||||
|
[LIBS="-lgetloadavg $LIBS" gl_func_getloadavg_done=yes],
|
||||||
|
[LIBS=$gl_getloadavg_LIBS])
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Set up the replacement function if necessary.
|
||||||
|
if test $gl_func_getloadavg_done = no; then
|
||||||
|
HAVE_GETLOADAVG=0
|
||||||
|
|
||||||
|
# Solaris has libkstat which does not require root.
|
||||||
|
AC_CHECK_LIB([kstat], [kstat_open])
|
||||||
|
test $ac_cv_lib_kstat_kstat_open = yes && gl_func_getloadavg_done=yes
|
||||||
|
|
||||||
|
# AIX has libperfstat which does not require root
|
||||||
|
if test $gl_func_getloadavg_done = no; then
|
||||||
|
AC_CHECK_LIB([perfstat], [perfstat_cpu_total])
|
||||||
|
test $ac_cv_lib_perfstat_perfstat_cpu_total = yes && gl_func_getloadavg_done=yes
|
||||||
|
fi
|
||||||
|
|
||||||
|
if test $gl_func_getloadavg_done = no; then
|
||||||
|
AC_CHECK_HEADER([sys/dg_sys_info.h],
|
||||||
|
[gl_func_getloadavg_done=yes
|
||||||
|
AC_DEFINE([DGUX], [1], [Define to 1 for DGUX with <sys/dg_sys_info.h>.])
|
||||||
|
AC_CHECK_LIB([dgc], [dg_sys_info])])
|
||||||
|
fi
|
||||||
|
fi])
|
||||||
|
|
||||||
|
if test "x$gl_save_LIBS" = x; then
|
||||||
|
GETLOADAVG_LIBS=$LIBS
|
||||||
|
else
|
||||||
|
GETLOADAVG_LIBS=`echo "$LIBS" | sed "s!$gl_save_LIBS!!"`
|
||||||
|
fi
|
||||||
|
LIBS=$gl_save_LIBS
|
||||||
|
|
||||||
|
AC_SUBST([GETLOADAVG_LIBS])dnl
|
||||||
|
|
||||||
|
# Test whether the system declares getloadavg. Solaris has the function
|
||||||
|
# but declares it in <sys/loadavg.h>, not <stdlib.h>.
|
||||||
|
AC_CHECK_HEADERS([sys/loadavg.h])
|
||||||
|
if test $ac_cv_header_sys_loadavg_h = yes; then
|
||||||
|
HAVE_SYS_LOADAVG_H=1
|
||||||
|
else
|
||||||
|
HAVE_SYS_LOADAVG_H=0
|
||||||
|
fi
|
||||||
|
AC_CHECK_DECL([getloadavg], [], [HAVE_DECL_GETLOADAVG=0],
|
||||||
|
[[#if HAVE_SYS_LOADAVG_H
|
||||||
|
/* OpenIndiana has a bug: <sys/time.h> must be included before
|
||||||
|
<sys/loadavg.h>. */
|
||||||
|
# include <sys/time.h>
|
||||||
|
# include <sys/loadavg.h>
|
||||||
|
#endif
|
||||||
|
#include <stdlib.h>]])
|
||||||
|
])# gl_GETLOADAVG
|
||||||
|
|
||||||
|
|
||||||
|
# gl_PREREQ_GETLOADAVG
|
||||||
|
# --------------------
|
||||||
|
# Set up the AC_LIBOBJ replacement of 'getloadavg'.
|
||||||
|
AC_DEFUN([gl_PREREQ_GETLOADAVG],
|
||||||
|
[
|
||||||
|
# Figure out what our getloadavg.c needs.
|
||||||
|
|
||||||
|
AC_CHECK_HEADERS_ONCE([sys/param.h unistd.h])
|
||||||
|
|
||||||
|
# On HPUX9, an unprivileged user can get load averages this way.
|
||||||
|
if test $gl_func_getloadavg_done = no; then
|
||||||
|
AC_CHECK_FUNCS([pstat_getdynamic], [gl_func_getloadavg_done=yes])
|
||||||
|
fi
|
||||||
|
|
||||||
|
# We cannot check for <dwarf.h>, because Solaris 2 does not use dwarf (it
|
||||||
|
# uses stabs), but it is still SVR4. We cannot check for <elf.h> because
|
||||||
|
# Irix 4.0.5F has the header but not the library.
|
||||||
|
if test $gl_func_getloadavg_done = no && test "$ac_cv_lib_elf_elf_begin" = yes \
|
||||||
|
&& test "$ac_cv_lib_kvm_kvm_open" = yes; then
|
||||||
|
gl_func_getloadavg_done=yes
|
||||||
|
AC_DEFINE([SVR4], [1], [Define to 1 on System V Release 4.])
|
||||||
|
fi
|
||||||
|
|
||||||
|
if test $gl_func_getloadavg_done = no; then
|
||||||
|
AC_CHECK_HEADER([inq_stats/cpustats.h],
|
||||||
|
[gl_func_getloadavg_done=yes
|
||||||
|
AC_DEFINE([UMAX], [1], [Define to 1 for Encore UMAX.])
|
||||||
|
AC_DEFINE([UMAX4_3], [1],
|
||||||
|
[Define to 1 for Encore UMAX 4.3 that has <inq_status/cpustats.h>
|
||||||
|
instead of <sys/cpustats.h>.])])
|
||||||
|
fi
|
||||||
|
|
||||||
|
if test $gl_func_getloadavg_done = no; then
|
||||||
|
AC_CHECK_HEADER([sys/cpustats.h],
|
||||||
|
[gl_func_getloadavg_done=yes; AC_DEFINE([UMAX])])
|
||||||
|
fi
|
||||||
|
|
||||||
|
if test $gl_func_getloadavg_done = no; then
|
||||||
|
AC_CHECK_HEADERS([mach/mach.h])
|
||||||
|
fi
|
||||||
|
|
||||||
|
AC_CHECK_HEADERS([nlist.h],
|
||||||
|
[AC_CHECK_MEMBERS([struct nlist.n_un.n_name],
|
||||||
|
[], [],
|
||||||
|
[#include <nlist.h>])
|
||||||
|
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <nlist.h>]],
|
||||||
|
[[struct nlist x;
|
||||||
|
#ifdef HAVE_STRUCT_NLIST_N_UN_N_NAME
|
||||||
|
x.n_un.n_name = "";
|
||||||
|
#else
|
||||||
|
x.n_name = "";
|
||||||
|
#endif]])],
|
||||||
|
[AC_DEFINE([N_NAME_POINTER], [1],
|
||||||
|
[Define to 1 if the nlist n_name member is a pointer])])
|
||||||
|
])dnl
|
||||||
|
])# gl_PREREQ_GETLOADAVG
|
||||||
|
|
||||||
|
# ---- GNU make
|
||||||
|
# These macros are imported from stdlib which we don't want to include
|
||||||
|
# Only the getloadavg content is imported.
|
||||||
|
|
||||||
|
AC_DEFUN_ONCE([gl_STDLIB_H],
|
||||||
|
[
|
||||||
|
AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
|
||||||
|
|
||||||
|
dnl Check for declarations of anything we want to poison if the
|
||||||
|
dnl corresponding gnulib module is not in use, and which is not
|
||||||
|
dnl guaranteed by C89.
|
||||||
|
gl_WARN_ON_USE_PREPARE([[#include <stdlib.h>
|
||||||
|
#if HAVE_SYS_LOADAVG_H
|
||||||
|
/* OpenIndiana has a bug: <sys/time.h> must be included before
|
||||||
|
<sys/loadavg.h>. */
|
||||||
|
# include <sys/time.h>
|
||||||
|
# include <sys/loadavg.h>
|
||||||
|
#endif
|
||||||
|
#if HAVE_RANDOM_H
|
||||||
|
# include <random.h>
|
||||||
|
#endif
|
||||||
|
]], [getloadavg])
|
||||||
|
])
|
||||||
|
|
||||||
|
# gl_STDLIB_MODULE_INDICATOR([modulename])
|
||||||
|
# sets the shell variable that indicates the presence of the given module
|
||||||
|
# to a C preprocessor expression that will evaluate to 1.
|
||||||
|
# This macro invocation must not occur in macros that are AC_REQUIREd.
|
||||||
|
AC_DEFUN([gl_STDLIB_MODULE_INDICATOR],
|
||||||
|
[
|
||||||
|
dnl Ensure to expand the default settings once only.
|
||||||
|
gl_STDLIB_H_REQUIRE_DEFAULTS
|
||||||
|
gl_MODULE_INDICATOR_SET_VARIABLE([$1])
|
||||||
|
dnl Define it also as a C macro, for the benefit of the unit tests.
|
||||||
|
gl_MODULE_INDICATOR_FOR_TESTS([$1])
|
||||||
|
])
|
||||||
|
|
||||||
|
# Initializes the default values for AC_SUBSTed shell variables.
|
||||||
|
# This macro must not be AC_REQUIREd. It must only be invoked, and only
|
||||||
|
# outside of macros or in macros that are not AC_REQUIREd.
|
||||||
|
AC_DEFUN([gl_STDLIB_H_REQUIRE_DEFAULTS],
|
||||||
|
[
|
||||||
|
m4_defun(GL_MODULE_INDICATOR_PREFIX[_STDLIB_H_MODULE_INDICATOR_DEFAULTS], [
|
||||||
|
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETLOADAVG])
|
||||||
|
])
|
||||||
|
m4_require(GL_MODULE_INDICATOR_PREFIX[_STDLIB_H_MODULE_INDICATOR_DEFAULTS])
|
||||||
|
AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_DEFUN([gl_STDLIB_H_DEFAULTS],
|
||||||
|
[
|
||||||
|
dnl Assume proper GNU behavior unless another module says otherwise.
|
||||||
|
HAVE_DECL_GETLOADAVG=1; AC_SUBST([HAVE_DECL_GETLOADAVG])
|
||||||
|
])
|
||||||
24
gl/modules/concat-filename
Normal file
24
gl/modules/concat-filename
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
Description:
|
||||||
|
Construct a full filename by concatenating a directory name, a relative
|
||||||
|
filename, and a suffix.
|
||||||
|
|
||||||
|
Files:
|
||||||
|
lib/concat-filename.h
|
||||||
|
lib/concat-filename.c
|
||||||
|
|
||||||
|
Depends-on:
|
||||||
|
filename
|
||||||
|
|
||||||
|
configure.ac:
|
||||||
|
|
||||||
|
Makefile.am:
|
||||||
|
lib_SOURCES += concat-filename.c
|
||||||
|
|
||||||
|
Include:
|
||||||
|
"concat-filename.h"
|
||||||
|
|
||||||
|
License:
|
||||||
|
LGPLv2+
|
||||||
|
|
||||||
|
Maintainer:
|
||||||
|
all
|
||||||
28
gl/modules/findprog-in
Normal file
28
gl/modules/findprog-in
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
Description:
|
||||||
|
Locating a program in a given path.
|
||||||
|
|
||||||
|
Files:
|
||||||
|
lib/findprog.h
|
||||||
|
lib/findprog-in.c
|
||||||
|
m4/findprog-in.m4
|
||||||
|
m4/eaccess.m4
|
||||||
|
|
||||||
|
Depends-on:
|
||||||
|
stdbool
|
||||||
|
filename
|
||||||
|
concat-filename
|
||||||
|
|
||||||
|
configure.ac:
|
||||||
|
gl_FINDPROG_IN
|
||||||
|
|
||||||
|
Makefile.am:
|
||||||
|
lib_SOURCES += findprog.h findprog-in.c
|
||||||
|
|
||||||
|
Include:
|
||||||
|
"findprog.h"
|
||||||
|
|
||||||
|
License:
|
||||||
|
LGPLv2+
|
||||||
|
|
||||||
|
Maintainer:
|
||||||
|
all
|
||||||
40
gl/modules/getloadavg
Normal file
40
gl/modules/getloadavg
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
Description:
|
||||||
|
Return the current system load averages.
|
||||||
|
|
||||||
|
Files:
|
||||||
|
lib/getloadavg.c
|
||||||
|
m4/getloadavg.m4
|
||||||
|
|
||||||
|
Depends-on:
|
||||||
|
snippet/warn-on-use
|
||||||
|
extensions
|
||||||
|
intprops [test $HAVE_GETLOADAVG = 0]
|
||||||
|
stdbool [test $HAVE_GETLOADAVG = 0]
|
||||||
|
|
||||||
|
configure.ac:
|
||||||
|
gl_STDLIB_H
|
||||||
|
gl_STDLIB_H_REQUIRE_DEFAULTS
|
||||||
|
AC_REQUIRE([AC_CANONICAL_HOST])
|
||||||
|
gl_GETLOADAVG
|
||||||
|
gl_CONDITIONAL([GL_COND_OBJ_GETLOADAVG], [test $HAVE_GETLOADAVG = 0])
|
||||||
|
AM_COND_IF([GL_COND_OBJ_GETLOADAVG], [
|
||||||
|
gl_PREREQ_GETLOADAVG
|
||||||
|
])
|
||||||
|
gl_STDLIB_MODULE_INDICATOR([getloadavg])
|
||||||
|
|
||||||
|
Makefile.am:
|
||||||
|
if GL_COND_OBJ_GETLOADAVG
|
||||||
|
lib_SOURCES += getloadavg.c
|
||||||
|
endif
|
||||||
|
|
||||||
|
Include:
|
||||||
|
<stdlib.h>
|
||||||
|
|
||||||
|
Link:
|
||||||
|
$(GETLOADAVG_LIBS)
|
||||||
|
|
||||||
|
License:
|
||||||
|
GPL
|
||||||
|
|
||||||
|
Maintainer:
|
||||||
|
Jim Meyering
|
||||||
@@ -2,6 +2,11 @@ Description:
|
|||||||
GNU make version of fnmatch()/glob() functions. This is a holdover from
|
GNU make version of fnmatch()/glob() functions. This is a holdover from
|
||||||
a very old version of the globbing library.
|
a very old version of the globbing library.
|
||||||
|
|
||||||
|
Files:
|
||||||
|
lib/fnmatch.c
|
||||||
|
lib/fnmatch.in.h
|
||||||
|
lib/glob.c
|
||||||
|
lib/glob.in.h
|
||||||
|
|
||||||
configure.ac:
|
configure.ac:
|
||||||
# Check the system to see if it provides GNU glob. If not, use our
|
# Check the system to see if it provides GNU glob. If not, use our
|
||||||
@@ -28,7 +33,6 @@ AM_CONDITIONAL([USE_SYSTEM_GLOB], [test "$make_cv_sys_gnu_glob" = yes])
|
|||||||
USE_SYSTEM_GLOB="$make_cv_sys_gnu_glob"
|
USE_SYSTEM_GLOB="$make_cv_sys_gnu_glob"
|
||||||
AC_SUBST([USE_SYSTEM_GLOB])
|
AC_SUBST([USE_SYSTEM_GLOB])
|
||||||
|
|
||||||
|
|
||||||
Makefile.am:
|
Makefile.am:
|
||||||
if !USE_SYSTEM_GLOB
|
if !USE_SYSTEM_GLOB
|
||||||
libgnu_a_SOURCES += fnmatch.c
|
libgnu_a_SOURCES += fnmatch.c
|
||||||
@@ -60,7 +64,6 @@ endif
|
|||||||
|
|
||||||
EXTRA_DIST += fnmatch.in.h glob.in.h
|
EXTRA_DIST += fnmatch.in.h glob.in.h
|
||||||
|
|
||||||
|
|
||||||
Include:
|
Include:
|
||||||
<glob.h>
|
<glob.h>
|
||||||
|
|
||||||
|
|||||||
16
gl/modules/make-macros
Normal file
16
gl/modules/make-macros
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
Description:
|
||||||
|
Install m4 macros for GNU make.
|
||||||
|
|
||||||
|
Files:
|
||||||
|
m4/acinclude.m4
|
||||||
|
m4/dospaths.m4
|
||||||
|
|
||||||
|
configure.ac:
|
||||||
|
# Check for DOS-style pathnames.
|
||||||
|
pds_AC_DOS_PATHS
|
||||||
|
|
||||||
|
License:
|
||||||
|
GPLv3+
|
||||||
|
|
||||||
|
Maintainer:
|
||||||
|
gnumake
|
||||||
11
lib/.gitignore
vendored
11
lib/.gitignore
vendored
@@ -1,11 +0,0 @@
|
|||||||
*
|
|
||||||
!/.gitignore
|
|
||||||
|
|
||||||
!/fnmatch.c
|
|
||||||
!/fnmatch.in.h
|
|
||||||
/fnmatch.h
|
|
||||||
|
|
||||||
!/glob.c
|
|
||||||
!/glob.in.h
|
|
||||||
/glob.h
|
|
||||||
|
|
||||||
5
m4/.gitignore
vendored
5
m4/.gitignore
vendored
@@ -1,5 +0,0 @@
|
|||||||
*
|
|
||||||
!/.gitignore
|
|
||||||
!/aclocal.m4
|
|
||||||
!/dospaths.m4
|
|
||||||
|
|
||||||
214
maintMakefile
214
maintMakefile
@@ -17,15 +17,15 @@ GPG_KEYID := 80CB727A20C79BB2
|
|||||||
# SRCROOTDIR is just a handy location to keep source files in
|
# SRCROOTDIR is just a handy location to keep source files in
|
||||||
SRCROOTDIR ?= $(HOME)/src
|
SRCROOTDIR ?= $(HOME)/src
|
||||||
|
|
||||||
# Where the gnulib project has been locally cloned
|
|
||||||
GNULIBDIR ?= $(SRCROOTDIR)/gnulib
|
|
||||||
|
|
||||||
# Where to put the CVS checkout of the GNU web repository
|
# Where to put the CVS checkout of the GNU web repository
|
||||||
GNUWEBDIR ?= $(SRCROOTDIR)/gnu-www
|
GNUWEBDIR ?= $(SRCROOTDIR)/gnu-www
|
||||||
|
|
||||||
# Where to put the CVS checkout of the GNU make web repository
|
# Where to put the CVS checkout of the GNU make web repository
|
||||||
MAKEWEBDIR ?= $(SRCROOTDIR)/make/make-web
|
MAKEWEBDIR ?= $(SRCROOTDIR)/make/make-web
|
||||||
|
|
||||||
|
# Enable Perl warnings for the test suite
|
||||||
|
PERLFLAGS := -w
|
||||||
|
|
||||||
# We like mondo-warnings!
|
# We like mondo-warnings!
|
||||||
# Also force comments to be preserved. This helps when using ccache, in
|
# Also force comments to be preserved. This helps when using ccache, in
|
||||||
# combination with GCC 7's implicit-fallthrough warning.
|
# combination with GCC 7's implicit-fallthrough warning.
|
||||||
@@ -43,31 +43,28 @@ GUILE_CFLAGS := $(patsubst -I%,-isystem %,$(GUILE_CFLAGS))
|
|||||||
MAKE_MAINTAINER_MODE := -DMAKE_MAINTAINER_MODE
|
MAKE_MAINTAINER_MODE := -DMAKE_MAINTAINER_MODE
|
||||||
AM_CPPFLAGS += $(MAKE_MAINTAINER_MODE)
|
AM_CPPFLAGS += $(MAKE_MAINTAINER_MODE)
|
||||||
|
|
||||||
TEMPLATES = README README.DOS README.W32 README.OS2 \
|
|
||||||
src/config.ami src/configh.dos src/config.h.W32 src/config.h-vms
|
|
||||||
|
|
||||||
all: $(TEMPLATES)
|
|
||||||
|
|
||||||
# Create preprocessor output files--GCC specific!
|
# Create preprocessor output files--GCC specific!
|
||||||
%.i : %.c
|
%.i : %.c
|
||||||
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) -E -dD -o $@ $<
|
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) -E -dD -o $@ $<
|
||||||
|
|
||||||
# General rule for turning a .template into a regular file.
|
# Create the mkconfig.h file for non-POSIX config headers
|
||||||
#
|
|
||||||
$(TEMPLATES) : % : %.template Makefile
|
all: src/mkconfig.h
|
||||||
rm -f $@
|
src/mkconfig.h: src/mkconfig.h.in config.status
|
||||||
sed -e 's@%VERSION%@$(VERSION)@g' \
|
./config.status --header=$@
|
||||||
-e 's@%PACKAGE%@$(PACKAGE)@g' \
|
|
||||||
$< > $@
|
# Build the README
|
||||||
chmod a-w $@
|
|
||||||
|
all: README
|
||||||
|
README : README.in config.status
|
||||||
|
./config.status --file=$@
|
||||||
|
|
||||||
# Construct Makefiles by adding on dependencies, etc.
|
# Construct Makefiles by adding on dependencies, etc.
|
||||||
#
|
#
|
||||||
cvt = $(patsubst $1/%,$$($1)%,$(filter %.c,$2))
|
cvt = $(patsubst $1/%,$$($1)%,$(filter %.c,$2))
|
||||||
Basic.mk: Basic.mk.template .dep_segment Makefile
|
Basic.mk: Basic.mk.template .dep_segment Makefile
|
||||||
rm -f $@
|
rm -f $@
|
||||||
sed -e 's@%VERSION%@$(VERSION)@g' \
|
sed -e 's@%make_SOURCES%@$(call cvt,src,$(make_SRCS))@g' \
|
||||||
-e 's@%make_SOURCES%@$(call cvt,src,$(make_SRCS))@g' \
|
|
||||||
-e 's@%w32_SOURCES%@$(call cvt,src,$(w32_SRCS))@g' \
|
-e 's@%w32_SOURCES%@$(call cvt,src,$(w32_SRCS))@g' \
|
||||||
-e 's@%vms_SOURCES%@$(call cvt,src,$(vms_SRCS))@g' \
|
-e 's@%vms_SOURCES%@$(call cvt,src,$(vms_SRCS))@g' \
|
||||||
-e 's@%amiga_SOURCES%@$(call cvt,src,$(amiga_SRCS))@g' \
|
-e 's@%amiga_SOURCES%@$(call cvt,src,$(amiga_SRCS))@g' \
|
||||||
@@ -76,12 +73,12 @@ Basic.mk: Basic.mk.template .dep_segment Makefile
|
|||||||
-e 's@%glob_SOURCES%@$(call cvt,lib,$(glob_SRCS))@g' \
|
-e 's@%glob_SOURCES%@$(call cvt,lib,$(glob_SRCS))@g' \
|
||||||
$< > $@
|
$< > $@
|
||||||
echo >>$@; echo '# --------------- DEPENDENCIES' >>$@; echo '#' >>$@; \
|
echo >>$@; echo '# --------------- DEPENDENCIES' >>$@; echo '#' >>$@; \
|
||||||
|
echo >>$@; echo '$$(OBJECTS): $$(SRCDIR)/src/mkconfig.h' >>$@; \
|
||||||
sed -e 's@^\([^ ]*\)\.o:@$$(OUTDIR)\1.$$(OBJEXT):@' \
|
sed -e 's@^\([^ ]*\)\.o:@$$(OUTDIR)\1.$$(OBJEXT):@' \
|
||||||
-e 's@\([^ ]*\.[ch]\)@$$(SRCDIR)/\1@g' \
|
-e 's@\([^ ]*\.[ch]\)@$$(SRCDIR)/\1@g' \
|
||||||
-e 's@$$(SRCDIR)/src/config.h@$$(OUTDIR)src/config.h@g' \
|
-e 's@$$(SRCDIR)/src/config.h@$$(OUTDIR)src/config.h@g' \
|
||||||
-e 's@$$(SRCDIR)/lib/stdlib.h@@g' \
|
-e 's@$$(SRCDIR)/lib/alloca.h@@g' \
|
||||||
-e 's@$$(SRCDIR)/lib/sys/types.h@@g' \
|
-e 's@$$(SRCDIR)/lib/stdbool.h@@g' \
|
||||||
-e 's@$$(SRCDIR)/lib/unistd.h@@g' \
|
|
||||||
$(word 2,$^) >>$@
|
$(word 2,$^) >>$@
|
||||||
chmod a-w $@
|
chmod a-w $@
|
||||||
|
|
||||||
@@ -116,13 +113,16 @@ GIT := git
|
|||||||
git-clean:
|
git-clean:
|
||||||
-$(GIT) clean -fdX
|
-$(GIT) clean -fdX
|
||||||
git-very-clean: git-clean
|
git-very-clean: git-clean
|
||||||
-$(GIT) clean -fd
|
-$(GIT) clean -fdx
|
||||||
|
|
||||||
|
|
||||||
## ---------------------- ##
|
## ---------------------- ##
|
||||||
## Generating ChangeLog. ##
|
## Generating ChangeLog. ##
|
||||||
## ---------------------- ##
|
## ---------------------- ##
|
||||||
|
|
||||||
|
# Where the gnulib project has been locally cloned
|
||||||
|
GNULIBDIR ?= $(or $(wildcard $(GNULIB_SRCDIR)),./gnulib)
|
||||||
|
|
||||||
gl2cl-date := 2013-10-10
|
gl2cl-date := 2013-10-10
|
||||||
gl2cl := $(GNULIBDIR)/build-aux/gitlog-to-changelog
|
gl2cl := $(GNULIBDIR)/build-aux/gitlog-to-changelog
|
||||||
|
|
||||||
@@ -134,12 +134,13 @@ ChangeLog: .check-git-HEAD
|
|||||||
echo "WARNING: $(gl2cl) is not available. No $@ generated."; \
|
echo "WARNING: $(gl2cl) is not available. No $@ generated."; \
|
||||||
fi
|
fi
|
||||||
|
|
||||||
.PHONY: .check-git-HEAD
|
.check-git-HEAD: FORCE
|
||||||
.check-git-HEAD:
|
|
||||||
sha="`git rev-parse HEAD`"; \
|
sha="`git rev-parse HEAD`"; \
|
||||||
[ -f '$@' ] && [ "`cat '$@' 2>/dev/null`" = "$$sha" ] \
|
test -f '$@' && [ "`cat '$@' 2>/dev/null`" = "$$sha" ] \
|
||||||
|| echo "$$sha" > '$@'
|
|| echo "$$sha" > '$@'
|
||||||
|
|
||||||
|
.PHONY: FORCE
|
||||||
|
FORCE:;@:
|
||||||
|
|
||||||
## ---------------- ##
|
## ---------------- ##
|
||||||
## Updating files. ##
|
## Updating files. ##
|
||||||
@@ -165,16 +166,15 @@ update: po-check
|
|||||||
|
|
||||||
# PO archive mirrors --- Be careful; some might not be fully populated!
|
# PO archive mirrors --- Be careful; some might not be fully populated!
|
||||||
# ftp://ftp.unex.es/pub/gnu-i18n/po/maint/
|
# ftp://ftp.unex.es/pub/gnu-i18n/po/maint/
|
||||||
# http://translation.sf.net/maint/
|
|
||||||
# ftp://tiger.informatik.hu-berlin.de/pub/po/maint/
|
# ftp://tiger.informatik.hu-berlin.de/pub/po/maint/
|
||||||
|
|
||||||
po_wget_flags = --recursive --level=1 --no-directories --no-check-certificate
|
po_wget_flags = --recursive --level=1 --no-directories --no-check-certificate
|
||||||
po_repo = https://translationproject.org/latest/$(PACKAGE)
|
po_repo = https://translationproject.org/latest/$(PACKAGE)
|
||||||
po_sync = translationproject.org::tp/latest/$(PACKAGE)/
|
po_sync = translationproject.org::tp/latest/$(PACKAGE)/
|
||||||
|
|
||||||
.PHONY: do-po-update po-update
|
.PHONY: do-po-update po-update
|
||||||
do-po-update:
|
do-po-update:
|
||||||
tmppo="/tmp/po-$(PACKAGE)-$(VERSION).$$$$" \
|
tmppo="/tmp/po-$(PACKAGE)-$(PACKAGE_VERSION).$$$$" \
|
||||||
&& rm -rf "$$tmppo" \
|
&& rm -rf "$$tmppo" \
|
||||||
&& mkdir "$$tmppo" \
|
&& mkdir "$$tmppo" \
|
||||||
&& $(RSYNC) $(po_sync) "$$tmppo" \
|
&& $(RSYNC) $(po_sync) "$$tmppo" \
|
||||||
@@ -184,7 +184,7 @@ do-po-update:
|
|||||||
$(MAKE) po-check
|
$(MAKE) po-check
|
||||||
|
|
||||||
po-update:
|
po-update:
|
||||||
[ -d "po" ] && $(MAKE) do-po-update
|
test -d "po" && $(MAKE) do-po-update
|
||||||
|
|
||||||
# -------------------------- #
|
# -------------------------- #
|
||||||
# Updating GNU build files. #
|
# Updating GNU build files. #
|
||||||
@@ -207,36 +207,86 @@ target = $(patsubst get-%,%,$@)
|
|||||||
|
|
||||||
config-url = $(git-url)/config.git/plain/$(patsubst get-build-aux/%,%,$@)
|
config-url = $(git-url)/config.git/plain/$(patsubst get-build-aux/%,%,$@)
|
||||||
get-build-aux/config.guess get-build-aux/config.sub:
|
get-build-aux/config.guess get-build-aux/config.sub:
|
||||||
@echo $(WGET) $(config-url) -O $(target) \
|
@echo Retrieving $(target) from $(config-url)
|
||||||
&& $(WGET) $(config-url) -O $(target).t \
|
$(WGET) $(config-url) -O $(target).t \
|
||||||
&& $(move_if_change)
|
&& $(move_if_change)
|
||||||
|
|
||||||
gnulib-url = $(git-url)/gnulib.git/plain/build-aux/$(patsubst get-build-aux/%,%,$@)
|
gnulib-url = $(git-url)/gnulib.git/plain/build-aux/$(patsubst get-build-aux/%,%,$@)
|
||||||
get-build-aux/texinfo.tex:
|
get-build-aux/texinfo.tex:
|
||||||
@echo $(WGET) $(gnulib-url) -O $(target) \
|
@echo Retrieving $(target) from $(gnulib-url)
|
||||||
&& $(WGET) $(gnulib-url) -O $(target).t \
|
$(WGET) $(gnulib-url) -O $(target).t \
|
||||||
&& $(move_if_change)
|
&& $(move_if_change)
|
||||||
|
|
||||||
gnustandards-url = $(cvs-url)/gnustandards/gnustandards/$(patsubst get-doc/%,%,$@)
|
gnustandards-url = $(cvs-url)/gnustandards/gnustandards/$(patsubst get-doc/%,%,$@)
|
||||||
get-doc/make-stds.texi get-doc/fdl.texi:
|
get-doc/make-stds.texi get-doc/fdl.texi:
|
||||||
@echo $(WGET) $(gnustandards-url) -O $(target) \
|
@echo Retrieving $(target) from $(gnustandards-url)
|
||||||
&& $(WGET) $(gnustandards-url) -O $(target).t \
|
$(WGET) $(gnustandards-url) -O $(target).t \
|
||||||
&& $(move_if_change)
|
&& $(move_if_change)
|
||||||
|
|
||||||
|
|
||||||
|
# ---------------------------- #
|
||||||
|
# Extra configuration checks. #
|
||||||
|
# ---------------------------- #
|
||||||
|
|
||||||
|
# Make the dist file contents more regular, if we're using GNU tar.
|
||||||
|
# Suggested by Tzvetelin Katchov <katchov@gnu.org>
|
||||||
|
|
||||||
|
export TAR_OPTIONS := --mode=u+w,go-w --owner=0 --group=0 --numeric-owner --sort=name
|
||||||
|
|
||||||
|
# When I released 4.3 somehow the INSTALL file was missing.
|
||||||
|
# When I tried to build it again, it was there. I have no idea what happened
|
||||||
|
# but add a new check to be sure it doesn't happen again.
|
||||||
|
mk_dist_files = AUTHORS ChangeLog COPYING INSTALL README src/mkconfig.h
|
||||||
|
|
||||||
|
dist: mk-distcheck
|
||||||
|
|
||||||
|
.PHONY: mk-distcheck
|
||||||
|
mk-distcheck: distdir
|
||||||
|
@echo "Checking for extra installed files..."
|
||||||
|
for fn in $(mk_dist_files); do \
|
||||||
|
test -f '$(distdir)'/"$$fn" \
|
||||||
|
|| { echo "Missing dist file: $$fn"; exit 1; }; \
|
||||||
|
done; true
|
||||||
|
|
||||||
|
|
||||||
# ---------------------------------- #
|
# ---------------------------------- #
|
||||||
# Alternative configuration checks. #
|
# Alternative configuration checks. #
|
||||||
# ---------------------------------- #
|
# ---------------------------------- #
|
||||||
|
|
||||||
|
CFGCHECK_CONFIGFLAGS =
|
||||||
|
CFGCHECK_BUILDFLAGS =
|
||||||
|
# We can't use our mondo warnings as these are used to compile gnulib modules
|
||||||
|
# as well, and that will fail.
|
||||||
|
CFGCHECK_MAKEFLAGS = # CFLAGS='$(AM_CFLAGS)'
|
||||||
|
|
||||||
|
# We don't support C90 anymore, strictly, but this test still works (with lots
|
||||||
|
# of warnings) and it helps us avoid egregious incompatibilities.
|
||||||
|
checkcfg.strict-c90: CFGCHECK_CONFIGFLAGS = CFLAGS='-std=c90 -pedantic'
|
||||||
|
checkcfg.strict-c90: CFGCHECK_MAKEFLAGS =
|
||||||
|
|
||||||
|
checkcfg.no-jobserver:CFGCHECK_CONFIGFLAGS = --disable-job-server
|
||||||
|
checkcfg.no-load: CFGCHECK_CONFIGFLAGS = --disable-load
|
||||||
|
checkcfg.no-guile: CFGCHECK_CONFIGFLAGS = --without-guile
|
||||||
|
checkcfg.no-spawn: CFGCHECK_CONFIGFLAGS = --disable-posix-spawn
|
||||||
|
checkcfg.no-sysglob: CFGCHECK_CONFIGFLAGS = make_cv_sys_gnu_glob=no
|
||||||
|
checkcfg.no-loadavg: CFGCHECK_CONFIGFLAGS = ac_cv_func_getloadavg=no \
|
||||||
|
ac_cv_have_decl_getloadavg=no \
|
||||||
|
gl_cv_have_raw_decl_getloadavg=no \
|
||||||
|
ac_cv_lib_util_getloadavg=no \
|
||||||
|
ac_cv_lib_getloadavg_getloadavg=no
|
||||||
|
checkcfg.no-sync: CFGCHECK_CONFIGFLAGS = CPPFLAGS=-DNO_OUTPUT_SYNC
|
||||||
|
checkcfg.no-archives: CFGCHECK_CONFIGFLAGS = CPPFLAGS=-DNO_ARCHIVES
|
||||||
|
|
||||||
CONFIG_CHECKS := \
|
CONFIG_CHECKS := \
|
||||||
checkcfg.--disable-job-server \
|
checkcfg.strict-c90 \
|
||||||
checkcfg.--disable-load \
|
checkcfg.no-jobserver \
|
||||||
checkcfg.--without-guile \
|
checkcfg.no-load \
|
||||||
checkcfg.--disable-posix-spawn \
|
checkcfg.no-guile \
|
||||||
checkcfg.make_cv_sys_gnu_glob^no \
|
checkcfg.no-spawn \
|
||||||
checkcfg.ac_cv_func_getloadavg^no+ac_cv_have_decl_getloadavg^no+gl_cv_have_raw_decl_getloadavg^no+ac_cv_lib_util_getloadavg^no+ac_cv_lib_getloadavg_getloadavg^no \
|
checkcfg.no-sysglob \
|
||||||
checkcfg.CPPFLAGS^-DNO_OUTPUT_SYNC \
|
checkcfg.no-loadavg \
|
||||||
checkcfg.CPPFLAGS^-DNO_ARCHIVES
|
checkcfg.no-sync \
|
||||||
|
checkcfg.no-archives
|
||||||
|
|
||||||
.PHONY: check-alt-config
|
.PHONY: check-alt-config
|
||||||
check-alt-config: $(CONFIG_CHECKS)
|
check-alt-config: $(CONFIG_CHECKS)
|
||||||
@@ -245,25 +295,29 @@ check-alt-config: $(CONFIG_CHECKS)
|
|||||||
NR_MAKE = $(MAKE)
|
NR_MAKE = $(MAKE)
|
||||||
|
|
||||||
# Check builds both with build.sh and with make
|
# Check builds both with build.sh and with make
|
||||||
|
build.sh_SCRIPT = exec >>'checkcfg.$*.log' 2>&1; set -x; \
|
||||||
|
cd $(distdir)/_build \
|
||||||
|
&& OUTDIR=_bld ../build.sh -k $(CFGCHECK_BUILD_FLAGS) \
|
||||||
|
&& _bld/make GMK_OUTDIR=../_bld $(AM_MAKEFLAGS) check-local \
|
||||||
|
&& _bld/make GMK_OUTDIR=../_bld $(AM_MAKEFLAGS) clean
|
||||||
|
|
||||||
|
nrmake_SCRIPT = exec >>'checkcfg.$*.log' 2>&1; set -x; \
|
||||||
|
cd $(distdir)/_build \
|
||||||
|
&& $(NR_MAKE) $(AM_MAKEFLAGS) $(CFGCHECK_MAKEFLAGS) \
|
||||||
|
&& ./make $(AM_MAKEFLAGS) check \
|
||||||
|
&& ./make $(AM_MAKEFLAGS) clean
|
||||||
|
|
||||||
$(CONFIG_CHECKS): checkcfg.%: distdir
|
$(CONFIG_CHECKS): checkcfg.%: distdir
|
||||||
@echo "Building $@ (output in checkcfg.$*.log)"
|
@echo "Building $@ (output in checkcfg.$*.log)"
|
||||||
exec >'checkcfg.$*.log' 2>&1; \
|
exec >'checkcfg.$*.log' 2>&1; \
|
||||||
echo "Testing configure with $(subst ^,=,$(subst +, ,$*))"; set -x; \
|
echo "Testing configure with $(CFGCHECK_CONFIGFLAGS)"; set -x; \
|
||||||
rm -rf $(distdir)/_build \
|
rm -rf $(distdir)/_build \
|
||||||
&& mkdir $(distdir)/_build \
|
&& mkdir $(distdir)/_build \
|
||||||
&& cd $(distdir)/_build \
|
&& cd $(distdir)/_build \
|
||||||
&& ../configure --srcdir=.. $(subst ^,=,$(subst +, ,$*)) \
|
&& ../configure --srcdir=.. $(CFGCHECK_CONFIGFLAGS) \
|
||||||
$(AM_DISTCHECK_CONFIGURE_FLAGS) $(DISTCHECK_CONFIGURE_FLAGS)
|
$(AM_DISTCHECK_CONFIGURE_FLAGS) $(DISTCHECK_CONFIGURE_FLAGS)
|
||||||
exec >>'checkcfg.$*.log' 2>&1; set -x; \
|
$(build.sh_SCRIPT)
|
||||||
cd $(distdir)/_build \
|
$(nrmake_SCRIPT)
|
||||||
&& OUTDIR=_bld ../build.sh \
|
|
||||||
&& _bld/make $(AM_MAKEFLAGS) check-local \
|
|
||||||
&& _bld/make $(AM_MAKEFLAGS) clean
|
|
||||||
exec >>'checkcfg.$*.log' 2>&1; set -x; \
|
|
||||||
cd $(distdir)/_build \
|
|
||||||
&& $(NR_MAKE) $(AM_MAKEFLAGS) CFLAGS='$(AM_CFLAGS)' \
|
|
||||||
&& ./make $(AM_MAKEFLAGS) check \
|
|
||||||
&& ./make $(AM_MAKEFLAGS) clean
|
|
||||||
|
|
||||||
# Try using Basic.mk. I can't test this on POSIX systems because it is only
|
# Try using Basic.mk. I can't test this on POSIX systems because it is only
|
||||||
# used for non-POSIX systems; POSIX systems can just use normal
|
# used for non-POSIX systems; POSIX systems can just use normal
|
||||||
@@ -276,10 +330,10 @@ checkcfg.basicmk: checkcfg.% : distdir
|
|||||||
&& mkdir $(distdir)/_build \
|
&& mkdir $(distdir)/_build \
|
||||||
&& cd $(distdir)/_build \
|
&& cd $(distdir)/_build \
|
||||||
&& ../configure --srcdir=.. \
|
&& ../configure --srcdir=.. \
|
||||||
$(AM_DISTCHECK_CONFIGURE_FLAGS) $(DISTCHECK_CONFIGURE_FLAGS)
|
$(AM_DISTCHECK_CONFIGURE_FLAGS) $(DISTCHECK_CONFIGURE_FLAGS)
|
||||||
exec >>'checkcfg.$*.log' 2>&1; set -x; \
|
exec >>'checkcfg.$*.log' 2>&1; set -x; \
|
||||||
cd $(distdir)/_build \
|
cd $(distdir)/_build \
|
||||||
&& $(NR_MAKE) $(AM_MAKEFLAGS) -f ../Basic.mk SRCDIR=.. CFLAGS='$(AM_CFLAGS)' \
|
&& $(NR_MAKE) $(AM_MAKEFLAGS) -f ../Basic.mk SRCDIR=.. $(CFGCHECK_MAKEFLAGS)
|
||||||
&& ./make $(AM_MAKEFLAGS) -f ../Basic.mk SRCDIR=.. check \
|
&& ./make $(AM_MAKEFLAGS) -f ../Basic.mk SRCDIR=.. check \
|
||||||
&& ./make $(AM_MAKEFLAGS) -f ../Basic.mk SRCDIR=.. clean
|
&& ./make $(AM_MAKEFLAGS) -f ../Basic.mk SRCDIR=.. clean
|
||||||
exec >>'checkcfg.$*.log' 2>&1; \
|
exec >>'checkcfg.$*.log' 2>&1; \
|
||||||
@@ -287,8 +341,8 @@ checkcfg.basicmk: checkcfg.% : distdir
|
|||||||
&& rm -rf $(distdir)/_build \
|
&& rm -rf $(distdir)/_build \
|
||||||
&& cd $(distdir) \
|
&& cd $(distdir) \
|
||||||
&& ./configure \
|
&& ./configure \
|
||||||
$(AM_DISTCHECK_CONFIGURE_FLAGS) $(DISTCHECK_CONFIGURE_FLAGS) \
|
$(AM_DISTCHECK_CONFIGURE_FLAGS) $(DISTCHECK_CONFIGURE_FLAGS) \
|
||||||
&& $(NR_MAKE) $(AM_MAKEFLAGS) -f Basic.mk CFLAGS='$(AM_CFLAGS)' \
|
&& $(NR_MAKE) $(AM_MAKEFLAGS) -f Basic.mk $(CFGCHECK_MAKEFLAGS)' \
|
||||||
&& ./make $(AM_MAKEFLAGS) -f Basic.mk check \
|
&& ./make $(AM_MAKEFLAGS) -f Basic.mk check \
|
||||||
&& ./make $(AM_MAKEFLAGS) -f Basic.mk clean
|
&& ./make $(AM_MAKEFLAGS) -f Basic.mk clean
|
||||||
|
|
||||||
@@ -309,10 +363,10 @@ local-check: po-check changelog-check
|
|||||||
# copyright-check writable-files
|
# copyright-check writable-files
|
||||||
|
|
||||||
changelog-check:
|
changelog-check:
|
||||||
if head $(top_srcdir)/ChangeLog | grep 'Version $(VERSION)' >/dev/null; then \
|
if head $(top_srcdir)/ChangeLog | grep 'Version $(PACKAGE_VERSION)' >/dev/null; then \
|
||||||
:; \
|
:; \
|
||||||
else \
|
else \
|
||||||
echo "$(VERSION) not in ChangeLog" 1>&2; \
|
echo "$(PACKAGE_VERSION) not in ChangeLog" 1>&2; \
|
||||||
exit 1; \
|
exit 1; \
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -341,16 +395,16 @@ gnuweb-dir = www/server/standards
|
|||||||
|
|
||||||
# Get the GNU make web page boilerplate etc.
|
# Get the GNU make web page boilerplate etc.
|
||||||
update-makeweb:
|
update-makeweb:
|
||||||
[ -d '$(MAKEWEBDIR)' ] || mkdir -p '$(MAKEWEBDIR)'
|
test -d '$(MAKEWEBDIR)' || mkdir -p '$(MAKEWEBDIR)'
|
||||||
[ -d '$(MAKEWEBDIR)'/CVS ] \
|
test -d '$(MAKEWEBDIR)'/CVS \
|
||||||
&& { cd '$(MAKEWEBDIR)' && $(CVS) update; } \
|
&& { cd '$(MAKEWEBDIR)' && $(CVS) update; } \
|
||||||
|| { mkdir -p '$(dir $(MAKEWEBDIR))' && cd '$(dir $(MAKEWEBDIR))' \
|
|| { mkdir -p '$(dir $(MAKEWEBDIR))' && cd '$(dir $(MAKEWEBDIR))' \
|
||||||
&& $(CVS) -d $(makeweb-repo) co -d '$(notdir $(MAKEWEBDIR))' make; }
|
&& $(CVS) -d $(makeweb-repo) co -d '$(notdir $(MAKEWEBDIR))' make; }
|
||||||
|
|
||||||
# Get the GNU web page boilerplate etc.
|
# Get the GNU web page boilerplate etc.
|
||||||
update-gnuweb:
|
update-gnuweb:
|
||||||
[ -d '$(GNUWEBDIR)' ] || mkdir -p '$(GNUWEBDIR)'
|
test -d '$(GNUWEBDIR)' || mkdir -p '$(GNUWEBDIR)'
|
||||||
[ -d '$(GNUWEBDIR)/$(gnuweb-dir)'/CVS ] \
|
test -d '$(GNUWEBDIR)/$(gnuweb-dir)'/CVS \
|
||||||
&& { cd '$(GNUWEBDIR)/$(gnuweb-dir)' && $(CVS) update; } \
|
&& { cd '$(GNUWEBDIR)/$(gnuweb-dir)' && $(CVS) update; } \
|
||||||
|| { cd '$(GNUWEBDIR)' && $(CVS) -d $(gnuweb-repo) co '$(gnuweb-dir)'; }
|
|| { cd '$(GNUWEBDIR)' && $(CVS) -d $(gnuweb-repo) co '$(gnuweb-dir)'; }
|
||||||
|
|
||||||
@@ -359,7 +413,7 @@ gendocs: update-gnuweb update-makeweb
|
|||||||
cd doc \
|
cd doc \
|
||||||
&& rm -rf doc/manual \
|
&& rm -rf doc/manual \
|
||||||
&& $(GNULIBDIR)/build-aux/gendocs.sh --email '$(BUGLIST)' \
|
&& $(GNULIBDIR)/build-aux/gendocs.sh --email '$(BUGLIST)' \
|
||||||
make 'GNU Make Manual'
|
make '$(PACKAGE_NAME) Manual'
|
||||||
find '$(MAKEWEBDIR)'/manual \( -name CVS -prune \) -o \( -name '[!.]*' -type f -exec rm -f '{}' \; \)
|
find '$(MAKEWEBDIR)'/manual \( -name CVS -prune \) -o \( -name '[!.]*' -type f -exec rm -f '{}' \; \)
|
||||||
cp -r doc/manual '$(MAKEWEBDIR)'
|
cp -r doc/manual '$(MAKEWEBDIR)'
|
||||||
@echo 'Status of $(MAKEWEBDIR) repo:' && cd '$(MAKEWEBDIR)' \
|
@echo 'Status of $(MAKEWEBDIR) repo:' && cd '$(MAKEWEBDIR)' \
|
||||||
@@ -367,7 +421,7 @@ gendocs: update-gnuweb update-makeweb
|
|||||||
@echo '- cvs add <new files>' \
|
@echo '- cvs add <new files>' \
|
||||||
&& echo '- cvs remove <deleted files>' \
|
&& echo '- cvs remove <deleted files>' \
|
||||||
&& echo '- cvs commit' \
|
&& echo '- cvs commit' \
|
||||||
&& echo '- cvs tag make-$(subst .,-,$(VERSION))'
|
&& echo '- cvs tag make-$(subst .,-,$(PACKAGE_VERSION))'
|
||||||
|
|
||||||
|
|
||||||
## --------------------------------------------- ##
|
## --------------------------------------------- ##
|
||||||
@@ -392,7 +446,7 @@ $(COV_BUILD_FILE): $(filter %.c %.h,$(DISTFILES))
|
|||||||
cd '$(distdir)'/_build \
|
cd '$(distdir)'/_build \
|
||||||
&& ../configure --srcdir=.. \
|
&& ../configure --srcdir=.. \
|
||||||
$(AM_DISTCHECK_CONFIGURE_FLAGS) $(DISTCHECK_CONFIGURE_FLAGS) \
|
$(AM_DISTCHECK_CONFIGURE_FLAGS) $(DISTCHECK_CONFIGURE_FLAGS) \
|
||||||
CFLAGS='$(AM_CFLAGS)'
|
$(CFGCHECK_MAKEFLAGS)
|
||||||
PATH="$${COVERITY_PATH:+$$COVERITY_PATH/bin:}$$PATH"; \
|
PATH="$${COVERITY_PATH:+$$COVERITY_PATH/bin:}$$PATH"; \
|
||||||
cd '$(distdir)'/_build \
|
cd '$(distdir)'/_build \
|
||||||
&& cov-build --dir cov-int ../build.sh
|
&& cov-build --dir cov-int ../build.sh
|
||||||
@@ -402,18 +456,18 @@ $(COV_BUILD_FILE): $(filter %.c %.h,$(DISTFILES))
|
|||||||
cov-submit: $(COV_BUILD_FILE)-submitted
|
cov-submit: $(COV_BUILD_FILE)-submitted
|
||||||
|
|
||||||
$(COV_BUILD_FILE)-submitted: $(COV_BUILD_FILE)
|
$(COV_BUILD_FILE)-submitted: $(COV_BUILD_FILE)
|
||||||
@[ -n "$(COVERITY_TOKEN)" ] || { echo 'COVERITY_TOKEN not set'; exit 1; }
|
@test -n "$(COVERITY_TOKEN)" || { echo 'COVERITY_TOKEN not set'; exit 1; }
|
||||||
@[ -n "$(COVERITY_EMAIL)" ] || { echo 'COVERITY_EMAIL not set'; exit 1; }
|
@test -n "$(COVERITY_EMAIL)" || { echo 'COVERITY_EMAIL not set'; exit 1; }
|
||||||
rm -f '$@'
|
rm -f '$@'
|
||||||
case '$(VERSION)' in \
|
case '$(PACKAGE_VERSION)' in \
|
||||||
(*.*.9*) type="daily build"; ext=".$$(date +%Y%m%d)" ;; \
|
(*.*.9*) type="daily build"; ext=".$$(date +%Y%m%d)" ;; \
|
||||||
(*) type="release"; ext= ;; \
|
(*) type="release"; ext= ;; \
|
||||||
esac; \
|
esac; \
|
||||||
curl --form token='$(COVERITY_TOKEN)' \
|
curl --form token='$(COVERITY_TOKEN)' \
|
||||||
--form email='$(COVERITY_EMAIL)' \
|
--form email='$(COVERITY_EMAIL)' \
|
||||||
--form file='@$<' \
|
--form file='@$<' \
|
||||||
--form version="$(VERSION)$$ext" \
|
--form version="$(PACKAGE_VERSION)$$ext" \
|
||||||
--form description="GNU make $$type" \
|
--form description="$(PACKAGE_NAME) $$type" \
|
||||||
'https://scan.coverity.com/builds?project=gmake'
|
'https://scan.coverity.com/builds?project=gmake'
|
||||||
cp '$<' '$@'
|
cp '$<' '$@'
|
||||||
|
|
||||||
@@ -424,11 +478,11 @@ $(COV_BUILD_FILE)-submitted: $(COV_BUILD_FILE)
|
|||||||
|
|
||||||
.PHONY: tag-release
|
.PHONY: tag-release
|
||||||
tag-release:
|
tag-release:
|
||||||
case '$(VERSION)' in \
|
case '$(PACKAGE_VERSION)' in \
|
||||||
(*.*.9*) message=" candidate" ;; \
|
(*.*.9*) message=" candidate" ;; \
|
||||||
(*) message= ;; \
|
(*) message= ;; \
|
||||||
esac; \
|
esac; \
|
||||||
$(GIT) tag -m "GNU Make release$$message $(VERSION)" -u '$(GPG_KEYID)' '$(VERSION)'
|
$(GIT) tag -m "$(PACKAGE_NAME) release$$message $(PACKAGE_VERSION)" -u '$(GPG_KEYID)' '$(PACKAGE_VERSION)'
|
||||||
|
|
||||||
|
|
||||||
## ------------------------- ##
|
## ------------------------- ##
|
||||||
@@ -459,14 +513,14 @@ distsign: $(DIST_ARCHIVES_SIG) $(DIST_ARCHIVES_DIRECTIVE)
|
|||||||
echo 'version: 1.2'; \
|
echo 'version: 1.2'; \
|
||||||
echo 'directory: make'; \
|
echo 'directory: make'; \
|
||||||
echo 'filename: $*'; \
|
echo 'filename: $*'; \
|
||||||
echo 'comment: Official upload of GNU make version $(VERSION)'; \
|
echo 'comment: Official upload of $(PACKAGE_NAME) version $(PACKAGE_VERSION)'; \
|
||||||
) > "$*.directive"
|
) > "$*.directive"
|
||||||
$(GPG) $(GPGFLAGS) -o "$@" --clearsign "$*.directive"
|
$(GPG) $(GPGFLAGS) -o "$@" --clearsign "$*.directive"
|
||||||
@rm -f "$*.directive"
|
@rm -f "$*.directive"
|
||||||
|
|
||||||
# Upload the artifacts
|
# Upload the artifacts
|
||||||
|
|
||||||
FTPPUT = ncftpput
|
FTPPUT := $(firstword $(shell command -v ncftpput) $(wildcard $(GNULIBDIR)/build-aux/ncftpput-ftp) invalid)
|
||||||
gnu-upload-host = ftp-upload.gnu.org
|
gnu-upload-host = ftp-upload.gnu.org
|
||||||
gnu-upload-dir = /incoming
|
gnu-upload-dir = /incoming
|
||||||
|
|
||||||
@@ -480,7 +534,7 @@ $(UPLOADS): $(DIST_ARCHIVES) $(DIST_ARCHIVES_SIG) $(DIST_ARCHIVES_DIRECTIVE)
|
|||||||
# Rebuild Makefile.in if this file is modifed.
|
# Rebuild Makefile.in if this file is modifed.
|
||||||
Makefile.in: maintMakefile
|
Makefile.in: maintMakefile
|
||||||
|
|
||||||
# Copyright (C) 1997-2019 Free Software Foundation, Inc.
|
# Copyright (C) 1997-2022 Free Software Foundation, Inc.
|
||||||
# This file is part of GNU Make.
|
# This file is part of GNU Make.
|
||||||
#
|
#
|
||||||
# GNU Make is free software; you can redistribute it and/or modify it under
|
# GNU Make is free software; you can redistribute it and/or modify it under
|
||||||
@@ -494,4 +548,4 @@ Makefile.in: maintMakefile
|
|||||||
# details.
|
# details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License along with
|
# You should have received a copy of the GNU General Public License along with
|
||||||
# this program. If not, see <http://www.gnu.org/licenses/>.
|
# this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|||||||
162
make-gdb.py
162
make-gdb.py
@@ -1,11 +1,15 @@
|
|||||||
import re
|
"""GDB pretty-printer macros for GNU Make."""
|
||||||
|
|
||||||
|
import gdb # pylint: disable=import-error
|
||||||
|
import gdb.printing # pylint: disable=import-error
|
||||||
|
|
||||||
import gdb #pylint: disable=import-error
|
|
||||||
import gdb.printing #pylint: disable=import-error
|
|
||||||
|
|
||||||
# Memoize types we commonly use
|
# Memoize types we commonly use
|
||||||
_TYPES = {}
|
_TYPES = {}
|
||||||
|
|
||||||
|
|
||||||
def getType(tname):
|
def getType(tname):
|
||||||
|
"""Given a type name return a GDB type."""
|
||||||
global _TYPES
|
global _TYPES
|
||||||
if tname not in _TYPES:
|
if tname not in _TYPES:
|
||||||
tn = tname.rstrip('*')
|
tn = tname.rstrip('*')
|
||||||
@@ -18,48 +22,129 @@ def getType(tname):
|
|||||||
_TYPES[tn] = _TYPES[t].pointer()
|
_TYPES[tn] = _TYPES[t].pointer()
|
||||||
return _TYPES[tname]
|
return _TYPES[tname]
|
||||||
|
|
||||||
class ShowArgv(gdb.Function):
|
|
||||||
"""Return the pretty-print of a null-terminated array of strings
|
def isNullptr(val):
|
||||||
|
"""Return True if the value is a null pointer."""
|
||||||
|
return int(val.cast(getType('unsigned long long'))) == 0
|
||||||
|
|
||||||
|
|
||||||
|
class ShowArgv(gdb.Command):
|
||||||
|
"""Print a null-terminated array of strings.
|
||||||
|
|
||||||
Argument:
|
Argument:
|
||||||
A char** where the last one is NULL (e.g., argv)
|
A char** where the last one is NULL (e.g., argv)
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
gdb.Function.__init__(self, "showargv")
|
"""Create the showargv function."""
|
||||||
|
gdb.Command.__init__(self, "showargv", gdb.COMMAND_USER)
|
||||||
|
|
||||||
|
def invoke(self, arg, from_tty):
|
||||||
|
"""Show the argv."""
|
||||||
|
args = gdb.string_to_argv(arg)
|
||||||
|
if len(args) != 1:
|
||||||
|
raise gdb.GdbError(self._usage)
|
||||||
|
|
||||||
|
val = gdb.parse_and_eval(args[0])
|
||||||
|
if val is None:
|
||||||
|
raise gdb.GdbError('%s is not a valid expression' % (args[0]))
|
||||||
|
|
||||||
|
strs = []
|
||||||
|
while not isNullptr(val.dereference()):
|
||||||
|
strs.append('"'+val.dereference().string()+'"')
|
||||||
|
val += 1
|
||||||
|
|
||||||
|
gdb.write("[%d] = [%s]\n" % (len(strs), ', '.join(strs)))
|
||||||
|
gdb.flush()
|
||||||
|
|
||||||
def invoke(self, argv):
|
|
||||||
str = '['
|
|
||||||
i = 0
|
|
||||||
while argv[i] != 0:
|
|
||||||
if i > 0:
|
|
||||||
str += ', '
|
|
||||||
str += argv[i].string()
|
|
||||||
i += 1
|
|
||||||
str += ']'
|
|
||||||
return str
|
|
||||||
|
|
||||||
ShowArgv()
|
ShowArgv()
|
||||||
|
|
||||||
|
|
||||||
|
class ShowNextList(gdb.Command):
|
||||||
|
"""Print a structure that has a "next" pointer.
|
||||||
|
|
||||||
|
Argument:
|
||||||
|
A pointer to a struct which contains a "next" member.
|
||||||
|
"""
|
||||||
|
|
||||||
|
_usage = 'usage: showlist <listptr>'
|
||||||
|
|
||||||
|
def __init__(self):
|
||||||
|
"""Create a "showlist" function."""
|
||||||
|
gdb.Command.__init__(self, "showlist", gdb.COMMAND_USER)
|
||||||
|
|
||||||
|
def invoke(self, arg, from_tty):
|
||||||
|
"""Show the elements in the provided list."""
|
||||||
|
args = gdb.string_to_argv(arg)
|
||||||
|
if len(args) != 1:
|
||||||
|
raise gdb.GdbError(self._usage)
|
||||||
|
|
||||||
|
val = gdb.parse_and_eval(args[0])
|
||||||
|
if val is None:
|
||||||
|
raise gdb.GdbError('%s is not a valid expression' % (args[0]))
|
||||||
|
i = 0
|
||||||
|
while not isNullptr(val):
|
||||||
|
gdb.write("%s : %s\n" % (val, val.dereference()))
|
||||||
|
gdb.flush()
|
||||||
|
i += 1
|
||||||
|
val = val['next']
|
||||||
|
gdb.write("%s contains %d elements\n" % (args[0], i))
|
||||||
|
gdb.flush()
|
||||||
|
|
||||||
|
|
||||||
|
ShowNextList()
|
||||||
|
|
||||||
|
|
||||||
class FileLocation(object):
|
class FileLocation(object):
|
||||||
"""Print a file location"""
|
"""Print a file location."""
|
||||||
|
|
||||||
def __init__(self, val):
|
def __init__(self, val):
|
||||||
|
"""Create a FileLocation object."""
|
||||||
self.val = val
|
self.val = val
|
||||||
|
|
||||||
def to_string(self):
|
def to_string(self):
|
||||||
if long(self.val['filenm']):
|
"""Convert a FileLocation to a string."""
|
||||||
|
if int(self.val['filenm']):
|
||||||
return "%s:%d" % (str(self.val['filenm']), self.val['lineno'])
|
return "%s:%d" % (str(self.val['filenm']), self.val['lineno'])
|
||||||
return ''
|
return 'NILF'
|
||||||
|
|
||||||
|
|
||||||
|
class StringListPrinter(object):
|
||||||
|
"""Print a stringlist."""
|
||||||
|
|
||||||
|
def __init__(self, val):
|
||||||
|
"""Create a StringListPrinter object."""
|
||||||
|
self.val = val
|
||||||
|
|
||||||
|
def to_string(self):
|
||||||
|
"""Convert a HashTable into a string."""
|
||||||
|
return "size=%d, capacity=%d" % (self.val['idx'], self.val['max'])
|
||||||
|
|
||||||
|
def children(self):
|
||||||
|
"""Yield each string in the list."""
|
||||||
|
i = 0
|
||||||
|
elts = self.val['list']
|
||||||
|
while i < self.val['idx']:
|
||||||
|
nm = '[%d] ' % i
|
||||||
|
yield (nm, elts.dereference())
|
||||||
|
i += 1
|
||||||
|
elts += 1
|
||||||
|
|
||||||
|
def display_hint(self):
|
||||||
|
"""Show the display hint for the pretty-printer."""
|
||||||
|
return 'array'
|
||||||
|
|
||||||
|
|
||||||
class VariablePrinter(object):
|
class VariablePrinter(object):
|
||||||
"""Print a struct variable"""
|
"""Print a struct variable."""
|
||||||
|
|
||||||
def __init__(self, val):
|
def __init__(self, val):
|
||||||
|
"""Create a VariablePrinter object."""
|
||||||
self.val = val
|
self.val = val
|
||||||
|
|
||||||
def to_string(self):
|
def to_string(self):
|
||||||
|
"""Convert a VariablePrinter object into a string."""
|
||||||
if self.val['append']:
|
if self.val['append']:
|
||||||
a = '+='
|
a = '+='
|
||||||
elif self.val['conditional']:
|
elif self.val['conditional']:
|
||||||
@@ -80,48 +165,58 @@ class VariablePrinter(object):
|
|||||||
self.val['fileinfo'], ','.join(flags),
|
self.val['fileinfo'], ','.join(flags),
|
||||||
self.val['name'].string(), a, self.val['value'].string())
|
self.val['name'].string(), a, self.val['value'].string())
|
||||||
|
|
||||||
|
|
||||||
class HashTablePrinter(object):
|
class HashTablePrinter(object):
|
||||||
"""Manage a hash table."""
|
"""Pretty-print a hash table."""
|
||||||
|
|
||||||
DELITEM = None
|
DELITEM = None
|
||||||
|
|
||||||
def __init__(self, val):
|
def __init__(self, val):
|
||||||
|
"""Create a HashTablePrinter object."""
|
||||||
self.val = val
|
self.val = val
|
||||||
|
|
||||||
def to_string(self):
|
def to_string(self):
|
||||||
|
"""Convert a HashTable into a string."""
|
||||||
return "size=%d, capacity=%d, empty=%d, collisions=%d, rehashes=%d" % (
|
return "size=%d, capacity=%d, empty=%d, collisions=%d, rehashes=%d" % (
|
||||||
self.val['ht_size'], self.val['ht_capacity'],
|
self.val['ht_size'], self.val['ht_capacity'],
|
||||||
self.val['ht_empty_slots'], self.val['ht_collisions'],
|
self.val['ht_empty_slots'], self.val['ht_collisions'],
|
||||||
self.val['ht_rehashes'])
|
self.val['ht_rehashes'])
|
||||||
|
|
||||||
def children(self):
|
def children(self):
|
||||||
|
"""Yield each ID and value."""
|
||||||
for (i, v) in self.iterator():
|
for (i, v) in self.iterator():
|
||||||
nm = '[%d] ' % i
|
nm = '[%d] ' % i
|
||||||
yield (nm, i)
|
yield (nm, i)
|
||||||
yield (nm, v)
|
yield (nm, v)
|
||||||
|
|
||||||
def iterator(self):
|
def iterator(self):
|
||||||
|
"""Provide an iterator for HashTable."""
|
||||||
if HashTablePrinter.DELITEM is None:
|
if HashTablePrinter.DELITEM is None:
|
||||||
HashTablePrinter.DELITEM = gdb.lookup_global_symbol('hash_deleted_item').value()
|
HashTablePrinter.DELITEM = gdb.lookup_global_symbol('hash_deleted_item').value()
|
||||||
lst = self.val['ht_vec']
|
lst = self.val['ht_vec']
|
||||||
for i in xrange(0, self.val['ht_size']):
|
for i in range(0, self.val['ht_size']):
|
||||||
v = lst[i]
|
v = lst[i]
|
||||||
if long(v) != 0 and v != HashTablePrinter.DELITEM:
|
if int(v) != 0 and v != HashTablePrinter.DELITEM:
|
||||||
yield (i, v)
|
yield (i, v)
|
||||||
|
|
||||||
def display_hint(self):
|
def display_hint(self):
|
||||||
|
"""Show the display hint for the pretty-printer."""
|
||||||
return 'map'
|
return 'map'
|
||||||
|
|
||||||
|
|
||||||
class VariableSetPrinter(object):
|
class VariableSetPrinter(object):
|
||||||
"""Print a variable_set"""
|
"""Print a variable_set."""
|
||||||
|
|
||||||
def __init__(self, val):
|
def __init__(self, val):
|
||||||
|
"""Create a variable_set pretty-printer."""
|
||||||
self.tbl = HashTablePrinter(val['table'])
|
self.tbl = HashTablePrinter(val['table'])
|
||||||
|
|
||||||
def to_string(self):
|
def to_string(self):
|
||||||
|
"""Convert a variable_set to string."""
|
||||||
return self.tbl.to_string()
|
return self.tbl.to_string()
|
||||||
|
|
||||||
def children(self):
|
def children(self):
|
||||||
|
"""Iterate through variables and values."""
|
||||||
for (i, v) in self.tbl.iterator():
|
for (i, v) in self.tbl.iterator():
|
||||||
ptr = v.cast(getType('struct variable*'))
|
ptr = v.cast(getType('struct variable*'))
|
||||||
nm = '[%d] ' % (i)
|
nm = '[%d] ' % (i)
|
||||||
@@ -129,29 +224,35 @@ class VariableSetPrinter(object):
|
|||||||
yield (nm, str(ptr.dereference()))
|
yield (nm, str(ptr.dereference()))
|
||||||
|
|
||||||
def display_hint(self):
|
def display_hint(self):
|
||||||
|
"""Show the display hint for the pretty-printer."""
|
||||||
return 'map'
|
return 'map'
|
||||||
|
|
||||||
|
|
||||||
class VariableSetListPrinter(object):
|
class VariableSetListPrinter(object):
|
||||||
"""Print a variable_set_list"""
|
"""Print a variable_set_list."""
|
||||||
|
|
||||||
GLOBALSET = None
|
GLOBALSET = None
|
||||||
|
|
||||||
def __init__(self, val):
|
def __init__(self, val):
|
||||||
|
"""Create a variable_set_list pretty-printer."""
|
||||||
self.val = val
|
self.val = val
|
||||||
|
|
||||||
def to_string(self):
|
def to_string(self):
|
||||||
|
"""Convert a variable_set_list to string."""
|
||||||
return str(self.val.address)
|
return str(self.val.address)
|
||||||
|
|
||||||
def children(self):
|
def children(self):
|
||||||
|
"""Iterate through variables and values."""
|
||||||
if VariableSetListPrinter.GLOBALSET is None:
|
if VariableSetListPrinter.GLOBALSET is None:
|
||||||
block = gdb.lookup_global_symbol('init_hash_global_variable_set').symtab.static_block()
|
block = gdb.lookup_global_symbol('init_hash_global_variable_set').symtab.static_block()
|
||||||
VariableSetListPrinter.GLOBALSET = gdb.lookup_symbol('global_variable_set', block)[0].value().address
|
VariableSetListPrinter.GLOBALSET = gdb.lookup_symbol(
|
||||||
|
'global_variable_set', block)[0].value().address
|
||||||
ptr = self.val.address
|
ptr = self.val.address
|
||||||
i = 0
|
i = 0
|
||||||
while long(ptr) != 0:
|
while not isNullptr(ptr):
|
||||||
nm = '[%d] ' % (i)
|
nm = '[%d] ' % (i)
|
||||||
yield (nm, ptr['set'])
|
yield (nm, ptr['set'])
|
||||||
if long(ptr['set']) == long(VariableSetListPrinter.GLOBALSET):
|
if int(ptr['set']) == int(VariableSetListPrinter.GLOBALSET):
|
||||||
yield (nm, "global_variable_set")
|
yield (nm, "global_variable_set")
|
||||||
else:
|
else:
|
||||||
yield (nm, str(ptr['set'].dereference()))
|
yield (nm, str(ptr['set'].dereference()))
|
||||||
@@ -159,17 +260,22 @@ class VariableSetListPrinter(object):
|
|||||||
ptr = ptr['next']
|
ptr = ptr['next']
|
||||||
|
|
||||||
def display_hint(self):
|
def display_hint(self):
|
||||||
|
"""Show the display hint for the pretty-printer."""
|
||||||
return 'map'
|
return 'map'
|
||||||
|
|
||||||
|
|
||||||
def build_pretty_printer():
|
def build_pretty_printer():
|
||||||
|
"""Install all the pretty-printers."""
|
||||||
pp = gdb.printing.RegexpCollectionPrettyPrinter("gnumake")
|
pp = gdb.printing.RegexpCollectionPrettyPrinter("gnumake")
|
||||||
pp.add_printer('floc', r'^floc$', FileLocation)
|
pp.add_printer('floc', r'^floc$', FileLocation)
|
||||||
|
pp.add_printer('stringlist', r'^stringlist$', StringListPrinter)
|
||||||
pp.add_printer('variable', r'^variable$', VariablePrinter)
|
pp.add_printer('variable', r'^variable$', VariablePrinter)
|
||||||
pp.add_printer('hashtable', r'^hash_table$', HashTablePrinter)
|
pp.add_printer('hashtable', r'^hash_table$', HashTablePrinter)
|
||||||
pp.add_printer('variableset', r'^variable_set$', VariableSetPrinter)
|
pp.add_printer('variableset', r'^variable_set$', VariableSetPrinter)
|
||||||
pp.add_printer('variablesetlist', r'^variable_set_list$', VariableSetListPrinter)
|
pp.add_printer('variablesetlist', r'^variable_set_list$', VariableSetListPrinter)
|
||||||
return pp
|
return pp
|
||||||
|
|
||||||
|
|
||||||
# Use replace=True so we can re-source this file
|
# Use replace=True so we can re-source this file
|
||||||
gdb.printing.register_pretty_printer(gdb.current_objfile(),
|
gdb.printing.register_pretty_printer(gdb.current_objfile(),
|
||||||
build_pretty_printer(), replace=True)
|
build_pretty_printer(), replace=True)
|
||||||
|
|||||||
@@ -76,7 +76,7 @@ $ filelist = "[.src]ar [.src]arscan [.src]commands [.src]default [.src]dir " + -
|
|||||||
"[.src]hash [.src]implicit [.src]job [.src]load [.src]main " + -
|
"[.src]hash [.src]implicit [.src]job [.src]load [.src]main " + -
|
||||||
"[.src]misc [.src]read [.src]remake [.src]remote-stub " + -
|
"[.src]misc [.src]read [.src]remake [.src]remote-stub " + -
|
||||||
"[.src]rule [.src]output [.src]signame [.src]variable " + -
|
"[.src]rule [.src]output [.src]signame [.src]variable " + -
|
||||||
"[.src]version [.src]strcache [.src]vpath " + -
|
"[.src]version [.src]shuffle [.src]strcache [.src]vpath " + -
|
||||||
"[.src]vmsfunctions [.src]vmsify [.src]vms_progname " + -
|
"[.src]vmsfunctions [.src]vmsify [.src]vms_progname " + -
|
||||||
"[.src]vms_exit [.src]vms_export_symbol " + -
|
"[.src]vms_exit [.src]vms_export_symbol " + -
|
||||||
"[.lib]alloca [.lib]fnmatch [.lib]glob [.src]getopt1 [.src]getopt"
|
"[.lib]alloca [.lib]fnmatch [.lib]glob [.src]getopt1 [.src]getopt"
|
||||||
@@ -154,7 +154,7 @@ $ exit
|
|||||||
$ endsubroutine : compileit
|
$ endsubroutine : compileit
|
||||||
$!
|
$!
|
||||||
$!-----------------------------------------------------------------------------
|
$!-----------------------------------------------------------------------------
|
||||||
$!Copyright (C) 1996-2019 Free Software Foundation, Inc.
|
$!Copyright (C) 1996-2022 Free Software Foundation, Inc.
|
||||||
$!This file is part of GNU Make.
|
$!This file is part of GNU Make.
|
||||||
$!
|
$!
|
||||||
$!GNU Make is free software; you can redistribute it and/or modify it under
|
$!GNU Make is free software; you can redistribute it and/or modify it under
|
||||||
@@ -168,4 +168,4 @@ $!FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
|||||||
$!details.
|
$!details.
|
||||||
$!
|
$!
|
||||||
$!You should have received a copy of the GNU General Public License along with
|
$!You should have received a copy of the GNU General Public License along with
|
||||||
$!this program. If not, see <http://www.gnu.org/licenses/>.
|
$!this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
#
|
#
|
||||||
# Amiga overrides for use with Basic.mk.
|
# Amiga overrides for use with Basic.mk.
|
||||||
#
|
#
|
||||||
# Copyright (C) 2017-2019 Free Software Foundation, Inc.
|
# Copyright (C) 2017-2022 Free Software Foundation, Inc.
|
||||||
# This file is part of GNU Make.
|
# This file is part of GNU Make.
|
||||||
#
|
#
|
||||||
# GNU Make is free software; you can redistribute it and/or modify it under
|
# GNU Make is free software; you can redistribute it and/or modify it under
|
||||||
@@ -16,7 +16,7 @@
|
|||||||
# details.
|
# details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License along with
|
# You should have received a copy of the GNU General Public License along with
|
||||||
# this program. If not, see <http://www.gnu.org/licenses/>.
|
# this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
CC = sc
|
CC = sc
|
||||||
LD = $(CC) Link
|
LD = $(CC) Link
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
#
|
#
|
||||||
# POSIX overrides for use with Basic.mk.
|
# POSIX overrides for use with Basic.mk.
|
||||||
#
|
#
|
||||||
# Copyright (C) 2017-2019 Free Software Foundation, Inc.
|
# Copyright (C) 2017-2022 Free Software Foundation, Inc.
|
||||||
# This file is part of GNU Make.
|
# This file is part of GNU Make.
|
||||||
#
|
#
|
||||||
# GNU Make is free software; you can redistribute it and/or modify it under
|
# GNU Make is free software; you can redistribute it and/or modify it under
|
||||||
@@ -16,11 +16,11 @@
|
|||||||
# details.
|
# details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License along with
|
# You should have received a copy of the GNU General Public License along with
|
||||||
# this program. If not, see <http://www.gnu.org/licenses/>.
|
# this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
# Very little is needed here since the default Basic.mk assumes POSIX
|
# Very little is needed here since the default Basic.mk assumes POSIX
|
||||||
|
|
||||||
prog_SOURCES += $(posix_SOURCES)
|
prog_SOURCES += $(src)/posixos.c
|
||||||
|
|
||||||
extra_CPPFLAGS += @GUILE_CFLAGS@
|
extra_CPPFLAGS += @GUILE_CFLAGS@
|
||||||
extra_LDFLAGS += @AM_LDFLAGS@
|
extra_LDFLAGS += @AM_LDFLAGS@
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
#
|
#
|
||||||
# VMS overrides for use with Basic.mk.
|
# VMS overrides for use with Basic.mk.
|
||||||
#
|
#
|
||||||
# Copyright (C) 2017-2019 Free Software Foundation, Inc.
|
# Copyright (C) 2017-2022 Free Software Foundation, Inc.
|
||||||
# This file is part of GNU Make.
|
# This file is part of GNU Make.
|
||||||
#
|
#
|
||||||
# GNU Make is free software; you can redistribute it and/or modify it under
|
# GNU Make is free software; you can redistribute it and/or modify it under
|
||||||
@@ -16,7 +16,7 @@
|
|||||||
# details.
|
# details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License along with
|
# You should have received a copy of the GNU General Public License along with
|
||||||
# this program. If not, see <http://www.gnu.org/licenses/>.
|
# this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
src = [.src]
|
src = [.src]
|
||||||
lib = [.lib]
|
lib = [.lib]
|
||||||
@@ -93,5 +93,5 @@ define CLEANSPACE
|
|||||||
endef
|
endef
|
||||||
|
|
||||||
|
|
||||||
$(OUTDIR)$(src)config.h: $(SRCDIR)$(src)config.h.W32
|
$(OUTDIR)$(src)config.h: $(SRCDIR)$(src)config.h-vms
|
||||||
$(call CP.cmd,$<,$@)
|
$(call CP.cmd,$<,$@)
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
#
|
#
|
||||||
# Windows overrides for use with Basic.mk.
|
# Windows overrides for use with Basic.mk.
|
||||||
#
|
#
|
||||||
# Copyright (C) 2017-2019 Free Software Foundation, Inc.
|
# Copyright (C) 2017-2022 Free Software Foundation, Inc.
|
||||||
# This file is part of GNU Make.
|
# This file is part of GNU Make.
|
||||||
#
|
#
|
||||||
# GNU Make is free software; you can redistribute it and/or modify it under
|
# GNU Make is free software; you can redistribute it and/or modify it under
|
||||||
@@ -16,7 +16,7 @@
|
|||||||
# details.
|
# details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License along with
|
# You should have received a copy of the GNU General Public License along with
|
||||||
# this program. If not, see <http://www.gnu.org/licenses/>.
|
# this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
# TARGET_TYPE can be either "release" or "debug"
|
# TARGET_TYPE can be either "release" or "debug"
|
||||||
TARGET_TYPE = release
|
TARGET_TYPE = release
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
#
|
#
|
||||||
# MS-DOS overrides for use with Basic.mk.
|
# MS-DOS overrides for use with Basic.mk.
|
||||||
#
|
#
|
||||||
# Copyright (C) 2017-2019 Free Software Foundation, Inc.
|
# Copyright (C) 2017-2022 Free Software Foundation, Inc.
|
||||||
# This file is part of GNU Make.
|
# This file is part of GNU Make.
|
||||||
#
|
#
|
||||||
# GNU Make is free software; you can redistribute it and/or modify it under
|
# GNU Make is free software; you can redistribute it and/or modify it under
|
||||||
@@ -16,7 +16,7 @@
|
|||||||
# details.
|
# details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License along with
|
# You should have received a copy of the GNU General Public License along with
|
||||||
# this program. If not, see <http://www.gnu.org/licenses/>.
|
# this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
OBJEXT = o
|
OBJEXT = o
|
||||||
EXEEXT = .exe
|
EXEEXT = .exe
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ nl
|
|||||||
pl
|
pl
|
||||||
pt
|
pt
|
||||||
pt_BR
|
pt_BR
|
||||||
|
ro
|
||||||
ru
|
ru
|
||||||
sr
|
sr
|
||||||
sv
|
sv
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
# List of source files containing translatable strings.
|
# List of source files containing translatable strings.
|
||||||
# Copyright (C) 2000-2019 Free Software Foundation, Inc.
|
# Copyright (C) 2000-2022 Free Software Foundation, Inc.
|
||||||
# This file is part of GNU Make.
|
# This file is part of GNU Make.
|
||||||
#
|
#
|
||||||
# GNU Make is free software; you can redistribute it and/or modify it under
|
# GNU Make is free software; you can redistribute it and/or modify it under
|
||||||
@@ -13,7 +13,7 @@
|
|||||||
# details.
|
# details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License along with
|
# You should have received a copy of the GNU General Public License along with
|
||||||
# this program. If not, see <http://www.gnu.org/licenses/>.
|
# this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
src/ar.c
|
src/ar.c
|
||||||
src/arscan.c
|
src/arscan.c
|
||||||
@@ -37,6 +37,7 @@ src/read.c
|
|||||||
src/remake.c
|
src/remake.c
|
||||||
src/remote-cstms.c
|
src/remote-cstms.c
|
||||||
src/rule.c
|
src/rule.c
|
||||||
|
src/shuffle.c
|
||||||
src/signame.c
|
src/signame.c
|
||||||
src/strcache.c
|
src/strcache.c
|
||||||
src/variable.c
|
src/variable.c
|
||||||
|
|||||||
@@ -4,28 +4,27 @@ $!
|
|||||||
$! This is used for building off the master instead of a release tarball.
|
$! This is used for building off the master instead of a release tarball.
|
||||||
$!
|
$!
|
||||||
$!
|
$!
|
||||||
$!
|
|
||||||
$! First try ODS-5, Pathworks V6 or UNZIP name.
|
$! First try ODS-5, Pathworks V6 or UNZIP name.
|
||||||
$!
|
$!
|
||||||
$ config_template = f$search("sys$disk:[]config*h-vms.template")
|
$ config_template = f$search("sys$disk:[.src]mkconfig*h.in")
|
||||||
$ if config_template .eqs. ""
|
$ if config_template .eqs. ""
|
||||||
$ then
|
$ then
|
||||||
$!
|
$!
|
||||||
$! Try NFS, VMStar, or Pathworks V5 ODS-2 encoded name.
|
$! Try NFS, VMStar, or Pathworks V5 ODS-2 encoded name.
|
||||||
$!
|
$!
|
||||||
$ config_template = f$search("sys$disk:[]config.h-vms*template")
|
$ config_template = f$search("sys$disk:[.src]mkconfig.h*in")
|
||||||
$ if config_template .eqs. ""
|
$ if config_template .eqs. ""
|
||||||
$ then
|
$ then
|
||||||
$ write sys$output "Could not find config.h-vms*template!"
|
$ write sys$output "Could not find mkconfig.h.in!"
|
||||||
$ exit 44
|
$ exit 44
|
||||||
$ endif
|
$ endif
|
||||||
$ endif
|
$ endif
|
||||||
$ config_template_file = f$parse(config_template,,,"name")
|
$ config_template_file = f$parse(config_template,,,"name")
|
||||||
$ config_template_type = f$parse(config_template,,,"type")
|
$ config_template_type = f$parse(config_template,,,"type")
|
||||||
$ config_template = "sys$disk:[]" + config_template_file + config_template_type
|
$ config_template = "sys$disk:[.src]" + config_template_file + config_template_type
|
||||||
$!
|
$!
|
||||||
$!
|
$!
|
||||||
$! Pull the package and version from configure.ac
|
$! Pull the version from configure.ac
|
||||||
$!
|
$!
|
||||||
$ open/read ac_file sys$disk:[]configure.ac
|
$ open/read ac_file sys$disk:[]configure.ac
|
||||||
$ac_read_loop:
|
$ac_read_loop:
|
||||||
@@ -39,21 +38,26 @@ $ version = f$element (0,"]",version)
|
|||||||
$ac_read_loop_end:
|
$ac_read_loop_end:
|
||||||
$ close ac_file
|
$ close ac_file
|
||||||
$!
|
$!
|
||||||
$ if (package .eqs. "") .or. (version .eqs. "")
|
$ if (version .eqs. "")
|
||||||
$ then
|
$ then
|
||||||
$ write sys$output "Unable to determine package and/or version!"
|
$ write sys$output "Unable to determine version!"
|
||||||
$ exit 44
|
$ exit 44
|
||||||
$ endif
|
$ endif
|
||||||
$!
|
$!
|
||||||
$!
|
$!
|
||||||
$ outfile = "sys$disk:[]config.h-vms"
|
$ outfile = "sys$disk:[.src]mkconfig.h"
|
||||||
$!
|
$!
|
||||||
$! Note the pipe command is close to the length of 255, which is the
|
$! Note the pipe command is close to the length of 255, which is the
|
||||||
$! maximum token length prior to VMS V8.2:
|
$! maximum token length prior to VMS V8.2:
|
||||||
$! %DCL-W-TKNOVF, command element is too long - shorten
|
$! %DCL-W-TKNOVF, command element is too long - shorten
|
||||||
$ pipe (write sys$output "sub/%PACKAGE%/''package'/WHOLE/NOTYPE" ;-
|
$! PDS: Blown out; someone else will have to figure this out
|
||||||
write sys$output "sub/%VERSION%/''version'/WHOLE/NOTYPE" ;-
|
$ pipe (write sys$output "sub,@PACKAGE@,make,WHOLE/NOTYPE" ;-
|
||||||
|
write sys$output "sub,@PACKAGE_BUGREPORT@,bug-make@gnu.org,WHOLE/NOTYPE" ;-
|
||||||
|
write sys$output "sub,@PACKAGE_NAME@,GNU Make,WHOLE/NOTYPE" ;-
|
||||||
|
write sys$output "sub,@PACKAGE_TARNAME@,make,WHOLE/NOTYPE" ;-
|
||||||
|
write sys$output "sub,@PACKAGE_URL@,https://www.gnu.org/software/make/,WHOLE/NOTYPE" ;-
|
||||||
|
write sys$output "sub,@PACKAGE_VERSION@,''version',WHOLE/NOTYPE" ;-
|
||||||
write sys$output "exit") |-
|
write sys$output "exit") |-
|
||||||
edit/edt 'config_template'/out='outfile'/command=sys$pipe >nla0:
|
edit/edt 'config_template'/out='outfile'/command=sys$pipe >nla0:
|
||||||
$!
|
$!
|
||||||
$ write sys$output package, ", version: ", version, " prepared for VMS"
|
$ write sys$output "GNU Make version: ", version, " prepared for VMS"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
#
|
#
|
||||||
# Copyright (C) 2014-2019 Free Software Foundation, Inc.
|
# Copyright (C) 2014-2022 Free Software Foundation, Inc.
|
||||||
# This file is part of GNU Make.
|
# This file is part of GNU Make.
|
||||||
#
|
#
|
||||||
# Update GNU make copyrights using gnulib update-copyright
|
# Update GNU make copyrights using gnulib update-copyright
|
||||||
@@ -17,7 +17,7 @@ getfiles () {
|
|||||||
|
|
||||||
run () {
|
run () {
|
||||||
cmd=$(command -v "$update") || die "Cannot locate update-copyright ($update)"
|
cmd=$(command -v "$update") || die "Cannot locate update-copyright ($update)"
|
||||||
[ -x "$cmd" ] || die "Cannot locate update-copyright ($update)"
|
test -x "$cmd" || die "Cannot locate update-copyright ($update)"
|
||||||
|
|
||||||
force=false
|
force=false
|
||||||
|
|
||||||
@@ -30,9 +30,9 @@ run () {
|
|||||||
|
|
||||||
if $force; then
|
if $force; then
|
||||||
: just do it
|
: just do it
|
||||||
elif [ ! -f src/makeint.h ]; then
|
elif test ! -f src/makeint.h; then
|
||||||
die "Run in the root of the GNU make workspace"
|
die "Run in the root of the GNU make workspace"
|
||||||
elif [ -f configure ]; then
|
elif test -f configure; then
|
||||||
die "Run in a clean workspace (git clean -fdX)"
|
die "Run in a clean workspace (git clean -fdX)"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -60,4 +60,4 @@ run "$@"
|
|||||||
# details.
|
# details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License along with
|
# You should have received a copy of the GNU General Public License along with
|
||||||
# this program. If not, see <http://www.gnu.org/licenses/>.
|
# this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|||||||
16
src/amiga.c
16
src/amiga.c
@@ -1,5 +1,5 @@
|
|||||||
/* Running commands on Amiga
|
/* Running commands on Amiga
|
||||||
Copyright (C) 1995-2019 Free Software Foundation, Inc.
|
Copyright (C) 1995-2022 Free Software Foundation, Inc.
|
||||||
This file is part of GNU Make.
|
This file is part of GNU Make.
|
||||||
|
|
||||||
GNU Make is free software; you can redistribute it and/or modify it under the
|
GNU Make is free software; you can redistribute it and/or modify it under the
|
||||||
@@ -12,7 +12,7 @@ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|||||||
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
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
|
You should have received a copy of the GNU General Public License along with
|
||||||
this program. If not, see <http://www.gnu.org/licenses/>. */
|
this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||||
|
|
||||||
#include "makeint.h"
|
#include "makeint.h"
|
||||||
#include "variable.h"
|
#include "variable.h"
|
||||||
@@ -42,7 +42,7 @@ MyExecute (char **argv)
|
|||||||
buffer = AllocMem (len, MEMF_ANY);
|
buffer = AllocMem (len, MEMF_ANY);
|
||||||
|
|
||||||
if (!buffer)
|
if (!buffer)
|
||||||
O (fatal, NILF, "MyExecute: Cannot allocate space for calling a command\n");
|
O (fatal, NILF, "MyExecute: Cannot allocate space for calling a command");
|
||||||
|
|
||||||
ptr = buffer;
|
ptr = buffer;
|
||||||
|
|
||||||
@@ -51,9 +51,8 @@ MyExecute (char **argv)
|
|||||||
if (((*aptr)[0] == ';' && !(*aptr)[1]))
|
if (((*aptr)[0] == ';' && !(*aptr)[1]))
|
||||||
{
|
{
|
||||||
*ptr ++ = '"';
|
*ptr ++ = '"';
|
||||||
strcpy (ptr, *aptr);
|
ptr = stpcpy (ptr, *aptr);
|
||||||
ptr += strlen (ptr);
|
*(ptr++) = '"';
|
||||||
*ptr ++ = '"';
|
|
||||||
}
|
}
|
||||||
else if ((*aptr)[0] == '@' && (*aptr)[1] == '@' && !(*aptr)[2])
|
else if ((*aptr)[0] == '@' && (*aptr)[1] == '@' && !(*aptr)[2])
|
||||||
{
|
{
|
||||||
@@ -61,10 +60,7 @@ MyExecute (char **argv)
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
ptr = stpcpy (ptr, *aptr);
|
||||||
strcpy (ptr, *aptr);
|
|
||||||
ptr += strlen (ptr);
|
|
||||||
}
|
|
||||||
*ptr ++ = ' ';
|
*ptr ++ = ' ';
|
||||||
*ptr = 0;
|
*ptr = 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/* Definitions for amiga specific things
|
/* Definitions for amiga specific things
|
||||||
Copyright (C) 1995-2019 Free Software Foundation, Inc.
|
Copyright (C) 1995-2022 Free Software Foundation, Inc.
|
||||||
This file is part of GNU Make.
|
This file is part of GNU Make.
|
||||||
|
|
||||||
GNU Make is free software; you can redistribute it and/or modify it under the
|
GNU Make is free software; you can redistribute it and/or modify it under the
|
||||||
@@ -12,7 +12,7 @@ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|||||||
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
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
|
You should have received a copy of the GNU General Public License along with
|
||||||
this program. If not, see <http://www.gnu.org/licenses/>. */
|
this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||||
|
|
||||||
int MyExecute (char ** argv);
|
int MyExecute (char ** argv);
|
||||||
char * wildcard_expansion (char * wc, char * o);
|
char * wildcard_expansion (char * wc, char * o);
|
||||||
|
|||||||
24
src/ar.c
24
src/ar.c
@@ -1,5 +1,5 @@
|
|||||||
/* Interface to 'ar' archives for GNU Make.
|
/* Interface to 'ar' archives for GNU Make.
|
||||||
Copyright (C) 1988-2019 Free Software Foundation, Inc.
|
Copyright (C) 1988-2022 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This file is part of GNU Make.
|
This file is part of GNU Make.
|
||||||
|
|
||||||
@@ -13,7 +13,7 @@ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|||||||
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
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
|
You should have received a copy of the GNU General Public License along with
|
||||||
this program. If not, see <http://www.gnu.org/licenses/>. */
|
this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||||
|
|
||||||
#include "makeint.h"
|
#include "makeint.h"
|
||||||
|
|
||||||
@@ -22,6 +22,7 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
|
|||||||
#include "filedef.h"
|
#include "filedef.h"
|
||||||
#include "dep.h"
|
#include "dep.h"
|
||||||
#include <fnmatch.h>
|
#include <fnmatch.h>
|
||||||
|
#include <intprops.h>
|
||||||
|
|
||||||
/* Return nonzero if NAME is an archive-member reference, zero if not. An
|
/* Return nonzero if NAME is an archive-member reference, zero if not. An
|
||||||
archive-member reference is a name like 'lib(member)' where member is a
|
archive-member reference is a name like 'lib(member)' where member is a
|
||||||
@@ -35,7 +36,7 @@ ar_name (const char *name)
|
|||||||
const char *p = strchr (name, '(');
|
const char *p = strchr (name, '(');
|
||||||
const char *end;
|
const char *end;
|
||||||
|
|
||||||
if (p == 0 || p == name)
|
if (p == NULL || p == name)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
end = p + strlen (p) - 1;
|
end = p + strlen (p) - 1;
|
||||||
@@ -60,6 +61,9 @@ ar_parse_name (const char *name, char **arname_p, char **memname_p)
|
|||||||
|
|
||||||
*arname_p = xstrdup (name);
|
*arname_p = xstrdup (name);
|
||||||
p = strchr (*arname_p, '(');
|
p = strchr (*arname_p, '(');
|
||||||
|
/* This is never called unless ar_name() is true so p cannot be NULL. */
|
||||||
|
if (!p)
|
||||||
|
OS (fatal, NILF, "Internal: ar_parse_name: bad name '%s'", *arname_p);
|
||||||
*(p++) = '\0';
|
*(p++) = '\0';
|
||||||
p[strlen (p) - 1] = '\0';
|
p[strlen (p) - 1] = '\0';
|
||||||
*memname_p = p;
|
*memname_p = p;
|
||||||
@@ -69,10 +73,10 @@ ar_parse_name (const char *name, char **arname_p, char **memname_p)
|
|||||||
/* This function is called by 'ar_scan' to find which member to look at. */
|
/* This function is called by 'ar_scan' to find which member to look at. */
|
||||||
|
|
||||||
/* ARGSUSED */
|
/* ARGSUSED */
|
||||||
static long int
|
static intmax_t
|
||||||
ar_member_date_1 (int desc UNUSED, const char *mem, int truncated,
|
ar_member_date_1 (int desc UNUSED, const char *mem, int truncated,
|
||||||
long int hdrpos UNUSED, long int datapos UNUSED,
|
long int hdrpos UNUSED, long int datapos UNUSED,
|
||||||
long int size UNUSED, long int date,
|
long int size UNUSED, intmax_t date,
|
||||||
int uid UNUSED, int gid UNUSED, unsigned int mode UNUSED,
|
int uid UNUSED, int gid UNUSED, unsigned int mode UNUSED,
|
||||||
const void *name)
|
const void *name)
|
||||||
{
|
{
|
||||||
@@ -86,7 +90,7 @@ ar_member_date (const char *name)
|
|||||||
{
|
{
|
||||||
char *arname;
|
char *arname;
|
||||||
char *memname;
|
char *memname;
|
||||||
long int val;
|
intmax_t val;
|
||||||
|
|
||||||
ar_parse_name (name, &arname, &memname);
|
ar_parse_name (name, &arname, &memname);
|
||||||
|
|
||||||
@@ -111,7 +115,7 @@ ar_member_date (const char *name)
|
|||||||
|
|
||||||
free (arname);
|
free (arname);
|
||||||
|
|
||||||
return (val <= 0 ? (time_t) -1 : (time_t) val);
|
return 0 < val && val <= TYPE_MAXIMUM (time_t) ? val : -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Set the archive-member NAME's modtime to now. */
|
/* Set the archive-member NAME's modtime to now. */
|
||||||
@@ -194,10 +198,10 @@ struct ar_glob_state
|
|||||||
/* This function is called by 'ar_scan' to match one archive
|
/* This function is called by 'ar_scan' to match one archive
|
||||||
element against the pattern in STATE. */
|
element against the pattern in STATE. */
|
||||||
|
|
||||||
static long int
|
static intmax_t
|
||||||
ar_glob_match (int desc UNUSED, const char *mem, int truncated UNUSED,
|
ar_glob_match (int desc UNUSED, const char *mem, int truncated UNUSED,
|
||||||
long int hdrpos UNUSED, long int datapos UNUSED,
|
long int hdrpos UNUSED, long int datapos UNUSED,
|
||||||
long int size UNUSED, long int date UNUSED, int uid UNUSED,
|
long int size UNUSED, intmax_t date UNUSED, int uid UNUSED,
|
||||||
int gid UNUSED, unsigned int mode UNUSED, const void *arg)
|
int gid UNUSED, unsigned int mode UNUSED, const void *arg)
|
||||||
{
|
{
|
||||||
struct ar_glob_state *state = (struct ar_glob_state *)arg;
|
struct ar_glob_state *state = (struct ar_glob_state *)arg;
|
||||||
@@ -218,7 +222,7 @@ ar_glob_match (int desc UNUSED, const char *mem, int truncated UNUSED,
|
|||||||
++state->n;
|
++state->n;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0L;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Return nonzero if PATTERN contains any metacharacters.
|
/* Return nonzero if PATTERN contains any metacharacters.
|
||||||
|
|||||||
124
src/arscan.c
124
src/arscan.c
@@ -1,5 +1,5 @@
|
|||||||
/* Library function for scanning an archive file.
|
/* Library function for scanning an archive file.
|
||||||
Copyright (C) 1987-2019 Free Software Foundation, Inc.
|
Copyright (C) 1987-2022 Free Software Foundation, Inc.
|
||||||
This file is part of GNU Make.
|
This file is part of GNU Make.
|
||||||
|
|
||||||
GNU Make is free software; you can redistribute it and/or modify it under the
|
GNU Make is free software; you can redistribute it and/or modify it under the
|
||||||
@@ -12,7 +12,7 @@ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|||||||
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
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
|
You should have received a copy of the GNU General Public License along with
|
||||||
this program. If not, see <http://www.gnu.org/licenses/>. */
|
this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||||
|
|
||||||
#include "makeint.h"
|
#include "makeint.h"
|
||||||
|
|
||||||
@@ -75,9 +75,9 @@ static void *VMS_lib_idx;
|
|||||||
|
|
||||||
static const void *VMS_saved_arg;
|
static const void *VMS_saved_arg;
|
||||||
|
|
||||||
static long int (*VMS_function) ();
|
static intmax_t (*VMS_function) ();
|
||||||
|
|
||||||
static long int VMS_function_ret;
|
static intmax_t VMS_function_ret;
|
||||||
|
|
||||||
|
|
||||||
/* This is a callback procedure for lib$get_index */
|
/* This is a callback procedure for lib$get_index */
|
||||||
@@ -203,7 +203,7 @@ VMS_get_member_info(struct dsc$descriptor_s *module, unsigned long *rfa)
|
|||||||
Returns -2 if archive has invalid format.
|
Returns -2 if archive has invalid format.
|
||||||
Returns 0 if have scanned successfully. */
|
Returns 0 if have scanned successfully. */
|
||||||
|
|
||||||
long int
|
intmax_t
|
||||||
ar_scan (const char *archive, ar_member_func_t function, const void *varg)
|
ar_scan (const char *archive, ar_member_func_t function, const void *varg)
|
||||||
{
|
{
|
||||||
char *vms_archive;
|
char *vms_archive;
|
||||||
@@ -376,8 +376,41 @@ struct ar_hdr
|
|||||||
# define AR_HDR_SIZE (sizeof (struct ar_hdr))
|
# define AR_HDR_SIZE (sizeof (struct ar_hdr))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include "intprops.h"
|
||||||
|
|
||||||
#include "output.h"
|
#include "output.h"
|
||||||
|
|
||||||
|
|
||||||
|
static uintmax_t
|
||||||
|
parse_int (const char *ptr, const size_t len, const int base, uintmax_t max,
|
||||||
|
const char *type, const char *archive, const char *name)
|
||||||
|
{
|
||||||
|
const char *const ep = ptr + len;
|
||||||
|
const int maxchar = '0' + base - 1;
|
||||||
|
uintmax_t val = 0;
|
||||||
|
|
||||||
|
/* In all the versions I know of the spaces come last, but be safe. */
|
||||||
|
while (ptr < ep && *ptr == ' ')
|
||||||
|
++ptr;
|
||||||
|
|
||||||
|
while (ptr < ep && *ptr != ' ')
|
||||||
|
{
|
||||||
|
uintmax_t nv;
|
||||||
|
|
||||||
|
if (*ptr < '0' || *ptr > maxchar)
|
||||||
|
OSSS (fatal, NILF,
|
||||||
|
_("Invalid %s for archive %s member %s"), type, archive, name);
|
||||||
|
nv = (val * base) + (*ptr - '0');
|
||||||
|
if (nv < val || nv > max)
|
||||||
|
OSSS (fatal, NILF,
|
||||||
|
_("Invalid %s for archive %s member %s"), type, archive, name);
|
||||||
|
val = nv;
|
||||||
|
++ptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
return val;
|
||||||
|
}
|
||||||
|
|
||||||
/* Takes three arguments ARCHIVE, FUNCTION and ARG.
|
/* Takes three arguments ARCHIVE, FUNCTION and ARG.
|
||||||
|
|
||||||
Open the archive named ARCHIVE, find its members one by one,
|
Open the archive named ARCHIVE, find its members one by one,
|
||||||
@@ -405,7 +438,7 @@ struct ar_hdr
|
|||||||
Returns -2 if archive has invalid format.
|
Returns -2 if archive has invalid format.
|
||||||
Returns 0 if have scanned successfully. */
|
Returns 0 if have scanned successfully. */
|
||||||
|
|
||||||
long int
|
intmax_t
|
||||||
ar_scan (const char *archive, ar_member_func_t function, const void *arg)
|
ar_scan (const char *archive, ar_member_func_t function, const void *arg)
|
||||||
{
|
{
|
||||||
#ifdef AIAMAG
|
#ifdef AIAMAG
|
||||||
@@ -416,7 +449,7 @@ ar_scan (const char *archive, ar_member_func_t function, const void *arg)
|
|||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
char *namemap = 0;
|
char *namemap = 0;
|
||||||
int namemap_size = 0;
|
unsigned int namemap_size = 0;
|
||||||
int desc = open (archive, O_RDONLY, 0);
|
int desc = open (archive, O_RDONLY, 0);
|
||||||
if (desc < 0)
|
if (desc < 0)
|
||||||
return -1;
|
return -1;
|
||||||
@@ -516,7 +549,7 @@ ar_scan (const char *archive, ar_member_func_t function, const void *arg)
|
|||||||
|
|
||||||
while (1)
|
while (1)
|
||||||
{
|
{
|
||||||
int nread;
|
ssize_t nread;
|
||||||
struct ar_hdr member_header;
|
struct ar_hdr member_header;
|
||||||
#ifdef AIAMAGBIG
|
#ifdef AIAMAGBIG
|
||||||
struct ar_hdr_big member_header_big;
|
struct ar_hdr_big member_header_big;
|
||||||
@@ -525,7 +558,7 @@ ar_scan (const char *archive, ar_member_func_t function, const void *arg)
|
|||||||
# define ARNAME_MAX 255
|
# define ARNAME_MAX 255
|
||||||
char name[ARNAME_MAX + 1];
|
char name[ARNAME_MAX + 1];
|
||||||
int name_len;
|
int name_len;
|
||||||
long int dateval;
|
intmax_t dateval;
|
||||||
int uidval, gidval;
|
int uidval, gidval;
|
||||||
long int data_offset;
|
long int data_offset;
|
||||||
#else
|
#else
|
||||||
@@ -537,9 +570,13 @@ ar_scan (const char *archive, ar_member_func_t function, const void *arg)
|
|||||||
#endif
|
#endif
|
||||||
long int eltsize;
|
long int eltsize;
|
||||||
unsigned int eltmode;
|
unsigned int eltmode;
|
||||||
long int fnval;
|
intmax_t eltdate;
|
||||||
|
int eltuid, eltgid;
|
||||||
|
intmax_t fnval;
|
||||||
off_t o;
|
off_t o;
|
||||||
|
|
||||||
|
memset(&member_header, '\0', sizeof (member_header));
|
||||||
|
|
||||||
EINTRLOOP (o, lseek (desc, member_offset, 0));
|
EINTRLOOP (o, lseek (desc, member_offset, 0));
|
||||||
if (o < 0)
|
if (o < 0)
|
||||||
goto invalid;
|
goto invalid;
|
||||||
@@ -566,7 +603,7 @@ ar_scan (const char *archive, ar_member_func_t function, const void *arg)
|
|||||||
|
|
||||||
name[name_len] = '\0';
|
name[name_len] = '\0';
|
||||||
|
|
||||||
sscanf (member_header_big.ar_date, "%12ld", &dateval);
|
sscanf (member_header_big.ar_date, "%12" SCNdMAX, &dateval);
|
||||||
sscanf (member_header_big.ar_uid, "%12d", &uidval);
|
sscanf (member_header_big.ar_uid, "%12d", &uidval);
|
||||||
sscanf (member_header_big.ar_gid, "%12d", &gidval);
|
sscanf (member_header_big.ar_gid, "%12d", &gidval);
|
||||||
sscanf (member_header_big.ar_mode, "%12o", &eltmode);
|
sscanf (member_header_big.ar_mode, "%12o", &eltmode);
|
||||||
@@ -594,7 +631,7 @@ ar_scan (const char *archive, ar_member_func_t function, const void *arg)
|
|||||||
|
|
||||||
name[name_len] = '\0';
|
name[name_len] = '\0';
|
||||||
|
|
||||||
sscanf (member_header.ar_date, "%12ld", &dateval);
|
sscanf (member_header.ar_date, "%12" SCNdMAX, &dateval);
|
||||||
sscanf (member_header.ar_uid, "%12d", &uidval);
|
sscanf (member_header.ar_uid, "%12d", &uidval);
|
||||||
sscanf (member_header.ar_gid, "%12d", &gidval);
|
sscanf (member_header.ar_gid, "%12d", &gidval);
|
||||||
sscanf (member_header.ar_mode, "%12o", &eltmode);
|
sscanf (member_header.ar_mode, "%12o", &eltmode);
|
||||||
@@ -669,10 +706,11 @@ ar_scan (const char *archive, ar_member_func_t function, const void *arg)
|
|||||||
&& (name[0] == ' ' || name[0] == '/')
|
&& (name[0] == ' ' || name[0] == '/')
|
||||||
&& namemap != 0)
|
&& namemap != 0)
|
||||||
{
|
{
|
||||||
int name_off = atoi (name + 1);
|
const char* err;
|
||||||
int name_len;
|
unsigned int name_off = make_toui (name + 1, &err);
|
||||||
|
size_t name_len;
|
||||||
|
|
||||||
if (name_off < 0 || name_off >= namemap_size)
|
if (err|| name_off >= namemap_size)
|
||||||
goto invalid;
|
goto invalid;
|
||||||
|
|
||||||
name = namemap + name_off;
|
name = namemap + name_off;
|
||||||
@@ -685,14 +723,15 @@ ar_scan (const char *archive, ar_member_func_t function, const void *arg)
|
|||||||
&& name[1] == '1'
|
&& name[1] == '1'
|
||||||
&& name[2] == '/')
|
&& name[2] == '/')
|
||||||
{
|
{
|
||||||
int name_len = atoi (name + 3);
|
const char* err;
|
||||||
|
unsigned int name_len = make_toui (name + 3, &err);
|
||||||
|
|
||||||
if (name_len < 1)
|
if (err || name_len == 0 || name_len >= MIN (PATH_MAX, INT_MAX))
|
||||||
goto invalid;
|
goto invalid;
|
||||||
|
|
||||||
name = alloca (name_len + 1);
|
name = alloca (name_len + 1);
|
||||||
nread = readbuf (desc, name, name_len);
|
nread = readbuf (desc, name, name_len);
|
||||||
if (nread != name_len)
|
if (nread < 0 || (unsigned int) nread != name_len)
|
||||||
goto invalid;
|
goto invalid;
|
||||||
|
|
||||||
name[name_len] = '\0';
|
name[name_len] = '\0';
|
||||||
@@ -703,8 +742,16 @@ ar_scan (const char *archive, ar_member_func_t function, const void *arg)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifndef M_XENIX
|
#ifndef M_XENIX
|
||||||
sscanf (TOCHAR (member_header.ar_mode), "%o", &eltmode);
|
#define PARSE_INT(_m, _t, _b, _n) \
|
||||||
eltsize = atol (TOCHAR (member_header.ar_size));
|
(_t) parse_int (TOCHAR (member_header._m), sizeof (member_header._m), \
|
||||||
|
_b, TYPE_MAXIMUM (_t), _n, archive, name)
|
||||||
|
|
||||||
|
eltmode = PARSE_INT (ar_mode, unsigned int, 8, "mode");
|
||||||
|
eltsize = PARSE_INT (ar_size, long, 10, "size");
|
||||||
|
eltdate = PARSE_INT (ar_date, intmax_t, 10, "date");
|
||||||
|
eltuid = PARSE_INT (ar_uid, int, 10, "uid");
|
||||||
|
eltgid = PARSE_INT (ar_gid, int, 10, "gid");
|
||||||
|
#undef PARSE_INT
|
||||||
#else /* Xenix. */
|
#else /* Xenix. */
|
||||||
eltmode = (unsigned short int) member_header.ar_mode;
|
eltmode = (unsigned short int) member_header.ar_mode;
|
||||||
eltsize = member_header.ar_size;
|
eltsize = member_header.ar_size;
|
||||||
@@ -714,9 +761,7 @@ ar_scan (const char *archive, ar_member_func_t function, const void *arg)
|
|||||||
(*function) (desc, name, ! long_name, member_offset,
|
(*function) (desc, name, ! long_name, member_offset,
|
||||||
member_offset + AR_HDR_SIZE, eltsize,
|
member_offset + AR_HDR_SIZE, eltsize,
|
||||||
#ifndef M_XENIX
|
#ifndef M_XENIX
|
||||||
atol (TOCHAR (member_header.ar_date)),
|
eltdate, eltuid, eltgid,
|
||||||
atoi (TOCHAR (member_header.ar_uid)),
|
|
||||||
atoi (TOCHAR (member_header.ar_gid)),
|
|
||||||
#else /* Xenix. */
|
#else /* Xenix. */
|
||||||
member_header.ar_date,
|
member_header.ar_date,
|
||||||
member_header.ar_uid,
|
member_header.ar_uid,
|
||||||
@@ -856,10 +901,10 @@ ar_name_equal (const char *name, const char *mem, int truncated)
|
|||||||
|
|
||||||
#ifndef VMS
|
#ifndef VMS
|
||||||
/* ARGSUSED */
|
/* ARGSUSED */
|
||||||
static long int
|
static intmax_t
|
||||||
ar_member_pos (int desc UNUSED, const char *mem, int truncated,
|
ar_member_pos (int desc UNUSED, const char *mem, int truncated,
|
||||||
long int hdrpos, long int datapos UNUSED, long int size UNUSED,
|
long int hdrpos, long int datapos UNUSED, long int size UNUSED,
|
||||||
long int date UNUSED, int uid UNUSED, int gid UNUSED,
|
intmax_t date UNUSED, int uid UNUSED, int gid UNUSED,
|
||||||
unsigned int mode UNUSED, const void *name)
|
unsigned int mode UNUSED, const void *name)
|
||||||
{
|
{
|
||||||
if (!ar_name_equal (name, mem, truncated))
|
if (!ar_name_equal (name, mem, truncated))
|
||||||
@@ -877,12 +922,13 @@ ar_member_pos (int desc UNUSED, const char *mem, int truncated,
|
|||||||
int
|
int
|
||||||
ar_member_touch (const char *arname, const char *memname)
|
ar_member_touch (const char *arname, const char *memname)
|
||||||
{
|
{
|
||||||
long int pos = ar_scan (arname, ar_member_pos, memname);
|
intmax_t pos = ar_scan (arname, ar_member_pos, memname);
|
||||||
|
off_t opos;
|
||||||
int fd;
|
int fd;
|
||||||
struct ar_hdr ar_hdr;
|
struct ar_hdr ar_hdr;
|
||||||
off_t o;
|
off_t o;
|
||||||
int r;
|
int r;
|
||||||
unsigned int ui;
|
int datelen;
|
||||||
struct stat statbuf;
|
struct stat statbuf;
|
||||||
|
|
||||||
if (pos < 0)
|
if (pos < 0)
|
||||||
@@ -890,11 +936,13 @@ ar_member_touch (const char *arname, const char *memname)
|
|||||||
if (!pos)
|
if (!pos)
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
|
opos = (off_t) pos;
|
||||||
|
|
||||||
EINTRLOOP (fd, open (arname, O_RDWR, 0666));
|
EINTRLOOP (fd, open (arname, O_RDWR, 0666));
|
||||||
if (fd < 0)
|
if (fd < 0)
|
||||||
return -3;
|
return -3;
|
||||||
/* Read in this member's header */
|
/* Read in this member's header */
|
||||||
EINTRLOOP (o, lseek (fd, pos, 0));
|
EINTRLOOP (o, lseek (fd, opos, 0));
|
||||||
if (o < 0)
|
if (o < 0)
|
||||||
goto lose;
|
goto lose;
|
||||||
r = readbuf (fd, &ar_hdr, AR_HDR_SIZE);
|
r = readbuf (fd, &ar_hdr, AR_HDR_SIZE);
|
||||||
@@ -906,15 +954,16 @@ ar_member_touch (const char *arname, const char *memname)
|
|||||||
goto lose;
|
goto lose;
|
||||||
/* Advance member's time to that time */
|
/* Advance member's time to that time */
|
||||||
#if defined(ARFMAG) || defined(ARFZMAG) || defined(AIAMAG) || defined(WINDOWS32)
|
#if defined(ARFMAG) || defined(ARFZMAG) || defined(AIAMAG) || defined(WINDOWS32)
|
||||||
for (ui = 0; ui < sizeof ar_hdr.ar_date; ui++)
|
datelen = snprintf (TOCHAR (ar_hdr.ar_date), sizeof ar_hdr.ar_date,
|
||||||
ar_hdr.ar_date[ui] = ' ';
|
"%" PRIdMAX, (intmax_t) statbuf.st_mtime);
|
||||||
sprintf (TOCHAR (ar_hdr.ar_date), "%lu", (long unsigned) statbuf.st_mtime);
|
if (! (0 <= datelen && datelen < (int) sizeof ar_hdr.ar_date))
|
||||||
ar_hdr.ar_date[strlen ((char *) ar_hdr.ar_date)] = ' ';
|
goto lose;
|
||||||
|
memset (ar_hdr.ar_date + datelen, ' ', sizeof ar_hdr.ar_date - datelen);
|
||||||
#else
|
#else
|
||||||
ar_hdr.ar_date = statbuf.st_mtime;
|
ar_hdr.ar_date = statbuf.st_mtime;
|
||||||
#endif
|
#endif
|
||||||
/* Write back this member's header */
|
/* Write back this member's header */
|
||||||
EINTRLOOP (o, lseek (fd, pos, 0));
|
EINTRLOOP (o, lseek (fd, opos, 0));
|
||||||
if (o < 0)
|
if (o < 0)
|
||||||
goto lose;
|
goto lose;
|
||||||
r = writebuf (fd, &ar_hdr, AR_HDR_SIZE);
|
r = writebuf (fd, &ar_hdr, AR_HDR_SIZE);
|
||||||
@@ -933,18 +982,21 @@ ar_member_touch (const char *arname, const char *memname)
|
|||||||
|
|
||||||
#ifdef TEST
|
#ifdef TEST
|
||||||
|
|
||||||
long int
|
intmax_t
|
||||||
describe_member (int desc, const char *name, int truncated,
|
describe_member (int desc, const char *name, int truncated,
|
||||||
long int hdrpos, long int datapos, long int size,
|
long int hdrpos, long int datapos, long int size,
|
||||||
long int date, int uid, int gid, unsigned int mode,
|
intmax_t date, int uid, int gid, unsigned int mode,
|
||||||
const void *arg)
|
const void *arg)
|
||||||
{
|
{
|
||||||
extern char *ctime ();
|
extern char *ctime ();
|
||||||
|
time_t d = date;
|
||||||
|
char const *ds;
|
||||||
|
|
||||||
printf (_("Member '%s'%s: %ld bytes at %ld (%ld).\n"),
|
printf (_("Member '%s'%s: %ld bytes at %ld (%ld).\n"),
|
||||||
name, truncated ? _(" (name might be truncated)") : "",
|
name, truncated ? _(" (name might be truncated)") : "",
|
||||||
size, hdrpos, datapos);
|
size, hdrpos, datapos);
|
||||||
printf (_(" Date %s"), ctime (&date));
|
ds = ctime (&d);
|
||||||
|
printf (_(" Date %s"), ds ? ds : "?");
|
||||||
printf (_(" uid = %d, gid = %d, mode = 0%o.\n"), uid, gid, mode);
|
printf (_(" uid = %d, gid = %d, mode = 0%o.\n"), uid, gid, mode);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
149
src/commands.c
149
src/commands.c
@@ -1,5 +1,5 @@
|
|||||||
/* Command processing for GNU Make.
|
/* Command processing for GNU Make.
|
||||||
Copyright (C) 1988-2019 Free Software Foundation, Inc.
|
Copyright (C) 1988-2022 Free Software Foundation, Inc.
|
||||||
This file is part of GNU Make.
|
This file is part of GNU Make.
|
||||||
|
|
||||||
GNU Make is free software; you can redistribute it and/or modify it under the
|
GNU Make is free software; you can redistribute it and/or modify it under the
|
||||||
@@ -12,10 +12,11 @@ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|||||||
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
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
|
You should have received a copy of the GNU General Public License along with
|
||||||
this program. If not, see <http://www.gnu.org/licenses/>. */
|
this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||||
|
|
||||||
#include "makeint.h"
|
#include "makeint.h"
|
||||||
#include "filedef.h"
|
#include "filedef.h"
|
||||||
|
#include "os.h"
|
||||||
#include "dep.h"
|
#include "dep.h"
|
||||||
#include "variable.h"
|
#include "variable.h"
|
||||||
#include "job.h"
|
#include "job.h"
|
||||||
@@ -30,10 +31,6 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
|
|||||||
#else
|
#else
|
||||||
# define FILE_LIST_SEPARATOR ' '
|
# define FILE_LIST_SEPARATOR ' '
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef HAVE_UNISTD_H
|
|
||||||
pid_t getpid ();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
static unsigned long
|
static unsigned long
|
||||||
@@ -58,10 +55,13 @@ dep_hash_cmp (const void *x, const void *y)
|
|||||||
return strcmp (dep_name (dx), dep_name (dy));
|
return strcmp (dep_name (dx), dep_name (dy));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Set FILE's automatic variables up. */
|
/* Set FILE's automatic variables up.
|
||||||
|
* Use STEM to set $*.
|
||||||
|
* If STEM is 0, then set FILE->STEM and $* to the target name with any
|
||||||
|
* suffix in the .SUFFIXES list stripped off. */
|
||||||
|
|
||||||
void
|
void
|
||||||
set_file_variables (struct file *file)
|
set_file_variables (struct file *file, const char *stem)
|
||||||
{
|
{
|
||||||
struct dep *d;
|
struct dep *d;
|
||||||
const char *at, *percent, *star, *less;
|
const char *at, *percent, *star, *less;
|
||||||
@@ -95,7 +95,7 @@ set_file_variables (struct file *file)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* $* is the stem from an implicit or static pattern rule. */
|
/* $* is the stem from an implicit or static pattern rule. */
|
||||||
if (file->stem == 0)
|
if (stem == 0)
|
||||||
{
|
{
|
||||||
/* In Unix make, $* is set to the target name with
|
/* In Unix make, $* is set to the target name with
|
||||||
any suffix in the .SUFFIXES list stripped off for
|
any suffix in the .SUFFIXES list stripped off for
|
||||||
@@ -118,25 +118,25 @@ set_file_variables (struct file *file)
|
|||||||
|
|
||||||
for (d = enter_file (strcache_add (".SUFFIXES"))->deps; d ; d = d->next)
|
for (d = enter_file (strcache_add (".SUFFIXES"))->deps; d ; d = d->next)
|
||||||
{
|
{
|
||||||
size_t slen = strlen (dep_name (d));
|
const char *dn = dep_name (d);
|
||||||
if (len > slen && strneq (dep_name (d), name + (len - slen), slen))
|
size_t slen = strlen (dn);
|
||||||
|
if (len > slen && memcmp (dn, name + (len - slen), slen) == 0)
|
||||||
{
|
{
|
||||||
file->stem = strcache_add_len (name, len - slen);
|
file->stem = stem = strcache_add_len (name, len - slen);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (d == 0)
|
if (d == 0)
|
||||||
file->stem = "";
|
file->stem = stem = "";
|
||||||
}
|
}
|
||||||
star = file->stem;
|
star = stem;
|
||||||
|
|
||||||
/* $< is the first not order-only dependency. */
|
/* $< is the first not order-only dependency. */
|
||||||
less = "";
|
less = "";
|
||||||
for (d = file->deps; d != 0; d = d->next)
|
for (d = file->deps; d != 0; d = d->next)
|
||||||
if (!d->ignore_mtime)
|
if (!d->ignore_mtime && !d->ignore_automatic_vars && !d->need_2nd_expansion)
|
||||||
{
|
{
|
||||||
if (!d->need_2nd_expansion)
|
less = dep_name (d);
|
||||||
less = dep_name (d);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -178,7 +178,7 @@ set_file_variables (struct file *file)
|
|||||||
bar_len = 0;
|
bar_len = 0;
|
||||||
for (d = file->deps; d != 0; d = d->next)
|
for (d = file->deps; d != 0; d = d->next)
|
||||||
{
|
{
|
||||||
if (!d->need_2nd_expansion)
|
if (!d->need_2nd_expansion && !d->ignore_automatic_vars)
|
||||||
{
|
{
|
||||||
if (d->ignore_mtime)
|
if (d->ignore_mtime)
|
||||||
bar_len += strlen (dep_name (d)) + 1;
|
bar_len += strlen (dep_name (d)) + 1;
|
||||||
@@ -200,7 +200,7 @@ set_file_variables (struct file *file)
|
|||||||
|
|
||||||
qmark_len = plus_len + 1; /* Will be this or less. */
|
qmark_len = plus_len + 1; /* Will be this or less. */
|
||||||
for (d = file->deps; d != 0; d = d->next)
|
for (d = file->deps; d != 0; d = d->next)
|
||||||
if (! d->ignore_mtime && ! d->need_2nd_expansion)
|
if (! d->ignore_mtime && ! d->need_2nd_expansion && ! d->ignore_automatic_vars)
|
||||||
{
|
{
|
||||||
const char *c = dep_name (d);
|
const char *c = dep_name (d);
|
||||||
|
|
||||||
@@ -214,8 +214,7 @@ set_file_variables (struct file *file)
|
|||||||
#endif
|
#endif
|
||||||
len = strlen (c);
|
len = strlen (c);
|
||||||
|
|
||||||
memcpy (cp, c, len);
|
cp = mempcpy (cp, c, len);
|
||||||
cp += len;
|
|
||||||
*cp++ = FILE_LIST_SEPARATOR;
|
*cp++ = FILE_LIST_SEPARATOR;
|
||||||
if (! (d->changed || always_make_flag))
|
if (! (d->changed || always_make_flag))
|
||||||
qmark_len -= len + 1; /* Don't space in $? for this one. */
|
qmark_len -= len + 1; /* Don't space in $? for this one. */
|
||||||
@@ -247,7 +246,7 @@ set_file_variables (struct file *file)
|
|||||||
|
|
||||||
for (d = file->deps; d != 0; d = d->next)
|
for (d = file->deps; d != 0; d = d->next)
|
||||||
{
|
{
|
||||||
if (d->need_2nd_expansion)
|
if (d->need_2nd_expansion || d->ignore_automatic_vars)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
slot = hash_find_slot (&dep_hash, d);
|
slot = hash_find_slot (&dep_hash, d);
|
||||||
@@ -269,7 +268,7 @@ set_file_variables (struct file *file)
|
|||||||
{
|
{
|
||||||
const char *c;
|
const char *c;
|
||||||
|
|
||||||
if (d->need_2nd_expansion || hash_find_item (&dep_hash, d) != d)
|
if (d->need_2nd_expansion || d->ignore_automatic_vars || hash_find_item (&dep_hash, d) != d)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
c = dep_name (d);
|
c = dep_name (d);
|
||||||
@@ -285,19 +284,16 @@ set_file_variables (struct file *file)
|
|||||||
|
|
||||||
if (d->ignore_mtime)
|
if (d->ignore_mtime)
|
||||||
{
|
{
|
||||||
memcpy (bp, c, len);
|
bp = mempcpy (bp, c, len);
|
||||||
bp += len;
|
|
||||||
*bp++ = FILE_LIST_SEPARATOR;
|
*bp++ = FILE_LIST_SEPARATOR;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
memcpy (cp, c, len);
|
cp = mempcpy (cp, c, len);
|
||||||
cp += len;
|
|
||||||
*cp++ = FILE_LIST_SEPARATOR;
|
*cp++ = FILE_LIST_SEPARATOR;
|
||||||
if (d->changed || always_make_flag)
|
if (d->changed || always_make_flag)
|
||||||
{
|
{
|
||||||
memcpy (qp, c, len);
|
qp = mempcpy (qp, c, len);
|
||||||
qp += len;
|
|
||||||
*qp++ = FILE_LIST_SEPARATOR;
|
*qp++ = FILE_LIST_SEPARATOR;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -326,14 +322,12 @@ set_file_variables (struct file *file)
|
|||||||
void
|
void
|
||||||
chop_commands (struct commands *cmds)
|
chop_commands (struct commands *cmds)
|
||||||
{
|
{
|
||||||
unsigned int nlines;
|
unsigned short nlines;
|
||||||
unsigned short idx;
|
unsigned short i;
|
||||||
char **lines;
|
char **lines;
|
||||||
|
|
||||||
/* If we don't have any commands,
|
/* If we don't have any commands, or we already parsed them, never mind. */
|
||||||
or we already parsed them, never mind. */
|
if (!cmds || cmds->command_lines != NULL)
|
||||||
|
|
||||||
if (!cmds || cmds->command_lines != 0)
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/* Chop CMDS->commands up into lines in CMDS->command_lines. */
|
/* Chop CMDS->commands up into lines in CMDS->command_lines. */
|
||||||
@@ -352,25 +346,27 @@ chop_commands (struct commands *cmds)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
const char *p;
|
const char *p = cmds->commands;
|
||||||
|
size_t max = 5;
|
||||||
|
|
||||||
nlines = 5;
|
nlines = 0;
|
||||||
lines = xmalloc (nlines * sizeof (char *));
|
lines = xmalloc (max * sizeof (char *));
|
||||||
idx = 0;
|
|
||||||
p = cmds->commands;
|
|
||||||
while (*p != '\0')
|
while (*p != '\0')
|
||||||
{
|
{
|
||||||
const char *end = p;
|
const char *end = p;
|
||||||
find_end:;
|
find_end:;
|
||||||
end = strchr (end, '\n');
|
end = strchr (end, '\n');
|
||||||
if (end == 0)
|
if (end == NULL)
|
||||||
end = p + strlen (p);
|
end = p + strlen (p);
|
||||||
else if (end > p && end[-1] == '\\')
|
else if (end > p && end[-1] == '\\')
|
||||||
{
|
{
|
||||||
int backslash = 1;
|
int backslash = 1;
|
||||||
const char *b;
|
if (end > p + 1)
|
||||||
for (b = end - 2; b >= p && *b == '\\'; --b)
|
{
|
||||||
backslash = !backslash;
|
const char *b;
|
||||||
|
for (b = end - 2; b >= p && *b == '\\'; --b)
|
||||||
|
backslash = !backslash;
|
||||||
|
}
|
||||||
if (backslash)
|
if (backslash)
|
||||||
{
|
{
|
||||||
++end;
|
++end;
|
||||||
@@ -378,40 +374,36 @@ chop_commands (struct commands *cmds)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (idx == nlines)
|
if (nlines == USHRT_MAX)
|
||||||
|
ON (fatal, &cmds->fileinfo,
|
||||||
|
_("Recipe has too many lines (limit %hu)"), nlines);
|
||||||
|
|
||||||
|
if (nlines == max)
|
||||||
{
|
{
|
||||||
nlines += 2;
|
max += 2;
|
||||||
lines = xrealloc (lines, nlines * sizeof (char *));
|
lines = xrealloc (lines, max * sizeof (char *));
|
||||||
}
|
}
|
||||||
lines[idx++] = xstrndup (p, (size_t) (end - p));
|
|
||||||
|
lines[nlines++] = xstrndup (p, (size_t) (end - p));
|
||||||
p = end;
|
p = end;
|
||||||
if (*p != '\0')
|
if (*p != '\0')
|
||||||
++p;
|
++p;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (idx != nlines)
|
|
||||||
{
|
|
||||||
nlines = idx;
|
|
||||||
lines = xrealloc (lines, nlines * sizeof (char *));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Finally, set the corresponding CMDS->lines_flags elements and the
|
/* Finally, set the corresponding CMDS->lines_flags elements and the
|
||||||
CMDS->any_recurse flag. */
|
CMDS->any_recurse flag. */
|
||||||
|
|
||||||
if (nlines > USHRT_MAX)
|
cmds->ncommand_lines = nlines;
|
||||||
ON (fatal, &cmds->fileinfo, _("Recipe has too many lines (%ud)"), nlines);
|
|
||||||
|
|
||||||
cmds->ncommand_lines = (unsigned short)nlines;
|
|
||||||
cmds->command_lines = lines;
|
cmds->command_lines = lines;
|
||||||
|
|
||||||
cmds->any_recurse = 0;
|
cmds->any_recurse = 0;
|
||||||
cmds->lines_flags = xmalloc (nlines);
|
cmds->lines_flags = xmalloc (nlines);
|
||||||
|
|
||||||
for (idx = 0; idx < nlines; ++idx)
|
for (i = 0; i < nlines; ++i)
|
||||||
{
|
{
|
||||||
unsigned char flags = 0;
|
unsigned char flags = 0;
|
||||||
const char *p = lines[idx];
|
const char *p = lines[i];
|
||||||
|
|
||||||
while (ISBLANK (*p) || *p == '-' || *p == '@' || *p == '+')
|
while (ISBLANK (*p) || *p == '-' || *p == '@' || *p == '+')
|
||||||
switch (*(p++))
|
switch (*(p++))
|
||||||
@@ -428,12 +420,12 @@ chop_commands (struct commands *cmds)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* If no explicit '+' was given, look for MAKE variable references. */
|
/* If no explicit '+' was given, look for MAKE variable references. */
|
||||||
if (!(flags & COMMANDS_RECURSE)
|
if (! ANY_SET (flags, COMMANDS_RECURSE)
|
||||||
&& (strstr (p, "$(MAKE)") != 0 || strstr (p, "${MAKE}") != 0))
|
&& (strstr (p, "$(MAKE)") != 0 || strstr (p, "${MAKE}") != 0))
|
||||||
flags |= COMMANDS_RECURSE;
|
flags |= COMMANDS_RECURSE;
|
||||||
|
|
||||||
cmds->lines_flags[idx] = flags;
|
cmds->lines_flags[i] = flags;
|
||||||
cmds->any_recurse |= flags & COMMANDS_RECURSE ? 1 : 0;
|
cmds->any_recurse |= ANY_SET (flags, COMMANDS_RECURSE) ? 1 : 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -465,12 +457,17 @@ execute_file_commands (struct file *file)
|
|||||||
|
|
||||||
initialize_file_variables (file, 0);
|
initialize_file_variables (file, 0);
|
||||||
|
|
||||||
set_file_variables (file);
|
set_file_variables (file, file->stem);
|
||||||
|
|
||||||
/* If this is a loaded dynamic object, unload it before remaking.
|
/* Some systems don't support overwriting a loaded object so if this one
|
||||||
Some systems don't support overwriting a loaded object. */
|
unload it before remaking. Keep its name in .LOADED: it will be rebuilt
|
||||||
if (file->loaded)
|
and loaded again. If rebuilding or loading again fail, then we'll exit
|
||||||
unload_file (file->name);
|
anyway and it won't matter. */
|
||||||
|
if (file->loaded && unload_file (file->name) == 0)
|
||||||
|
{
|
||||||
|
file->loaded = 0;
|
||||||
|
file->unloaded = 1;
|
||||||
|
}
|
||||||
|
|
||||||
/* Start the commands running. */
|
/* Start the commands running. */
|
||||||
new_job (file);
|
new_job (file);
|
||||||
@@ -479,11 +476,11 @@ execute_file_commands (struct file *file)
|
|||||||
/* This is set while we are inside fatal_error_signal,
|
/* This is set while we are inside fatal_error_signal,
|
||||||
so things can avoid nonreentrant operations. */
|
so things can avoid nonreentrant operations. */
|
||||||
|
|
||||||
int handling_fatal_signal = 0;
|
volatile sig_atomic_t handling_fatal_signal = 0;
|
||||||
|
|
||||||
/* Handle fatal signals. */
|
/* Handle fatal signals. */
|
||||||
|
|
||||||
RETSIGTYPE
|
void
|
||||||
fatal_error_signal (int sig)
|
fatal_error_signal (int sig)
|
||||||
{
|
{
|
||||||
#ifdef __MSDOS__
|
#ifdef __MSDOS__
|
||||||
@@ -508,7 +505,7 @@ fatal_error_signal (int sig)
|
|||||||
#ifdef WINDOWS32
|
#ifdef WINDOWS32
|
||||||
extern HANDLE main_thread;
|
extern HANDLE main_thread;
|
||||||
|
|
||||||
/* Windows creates a sperate thread for handling Ctrl+C, so we need
|
/* Windows creates a separate thread for handling Ctrl+C, so we need
|
||||||
to suspend the main thread, or else we will have race conditions
|
to suspend the main thread, or else we will have race conditions
|
||||||
when both threads call reap_children. */
|
when both threads call reap_children. */
|
||||||
if (main_thread)
|
if (main_thread)
|
||||||
@@ -516,12 +513,12 @@ fatal_error_signal (int sig)
|
|||||||
DWORD susp_count = SuspendThread (main_thread);
|
DWORD susp_count = SuspendThread (main_thread);
|
||||||
|
|
||||||
if (susp_count != 0)
|
if (susp_count != 0)
|
||||||
fprintf (stderr, "SuspendThread: suspend count = %ld\n", susp_count);
|
fprintf (stderr, "SuspendThread: suspend count = %lu\n", susp_count);
|
||||||
else if (susp_count == (DWORD)-1)
|
else if (susp_count == (DWORD)-1)
|
||||||
{
|
{
|
||||||
DWORD ierr = GetLastError ();
|
DWORD ierr = GetLastError ();
|
||||||
|
|
||||||
fprintf (stderr, "SuspendThread: error %ld: %s\n",
|
fprintf (stderr, "SuspendThread: error %lu: %s\n",
|
||||||
ierr, map_windows32_error_to_string (ierr));
|
ierr, map_windows32_error_to_string (ierr));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -532,6 +529,10 @@ fatal_error_signal (int sig)
|
|||||||
It is blocked now while we run this handler. */
|
It is blocked now while we run this handler. */
|
||||||
signal (sig, SIG_DFL);
|
signal (sig, SIG_DFL);
|
||||||
|
|
||||||
|
temp_stdin_unlink ();
|
||||||
|
osync_clear ();
|
||||||
|
jobserver_clear ();
|
||||||
|
|
||||||
/* A termination signal won't be sent to the entire
|
/* A termination signal won't be sent to the entire
|
||||||
process group, but it means we want to kill the children. */
|
process group, but it means we want to kill the children. */
|
||||||
|
|
||||||
@@ -596,7 +597,7 @@ fatal_error_signal (int sig)
|
|||||||
#else
|
#else
|
||||||
/* Signal the same code; this time it will really be fatal. The signal
|
/* 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. */
|
will be unblocked when we return and arrive then to kill us. */
|
||||||
if (kill (getpid (), sig) < 0)
|
if (kill (make_pid (), sig) < 0)
|
||||||
pfatal_with_name ("kill");
|
pfatal_with_name ("kill");
|
||||||
#endif /* not WINDOWS32 */
|
#endif /* not WINDOWS32 */
|
||||||
#endif /* not Amiga */
|
#endif /* not Amiga */
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/* Definition of data structures describing shell commands for GNU Make.
|
/* Definition of data structures describing shell commands for GNU Make.
|
||||||
Copyright (C) 1988-2019 Free Software Foundation, Inc.
|
Copyright (C) 1988-2022 Free Software Foundation, Inc.
|
||||||
This file is part of GNU Make.
|
This file is part of GNU Make.
|
||||||
|
|
||||||
GNU Make is free software; you can redistribute it and/or modify it under the
|
GNU Make is free software; you can redistribute it and/or modify it under the
|
||||||
@@ -12,7 +12,7 @@ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|||||||
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
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
|
You should have received a copy of the GNU General Public License along with
|
||||||
this program. If not, see <http://www.gnu.org/licenses/>. */
|
this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||||
|
|
||||||
/* Structure that gives the commands to make a file
|
/* Structure that gives the commands to make a file
|
||||||
and information about where these commands came from. */
|
and information about where these commands came from. */
|
||||||
@@ -34,9 +34,12 @@ struct commands
|
|||||||
#define COMMANDS_SILENT 2 /* Silent: @. */
|
#define COMMANDS_SILENT 2 /* Silent: @. */
|
||||||
#define COMMANDS_NOERROR 4 /* No errors: -. */
|
#define COMMANDS_NOERROR 4 /* No errors: -. */
|
||||||
|
|
||||||
RETSIGTYPE fatal_error_signal (int sig);
|
struct file;
|
||||||
|
struct child;
|
||||||
|
|
||||||
|
void fatal_error_signal (int sig);
|
||||||
void execute_file_commands (struct file *file);
|
void execute_file_commands (struct file *file);
|
||||||
void print_commands (const struct commands *cmds);
|
void print_commands (const struct commands *cmds);
|
||||||
void delete_child_targets (struct child *child);
|
void delete_child_targets (struct child *child);
|
||||||
void chop_commands (struct commands *cmds);
|
void chop_commands (struct commands *cmds);
|
||||||
void set_file_variables (struct file *file);
|
void set_file_variables (struct file *file, const char *stem);
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/* config.h -- hand-massaged for Amiga -*-C-*-
|
/* config.h -- hand-massaged for Amiga -*-C-*-
|
||||||
Copyright (C) 1995-2019 Free Software Foundation, Inc.
|
Copyright (C) 1995-2022 Free Software Foundation, Inc.
|
||||||
This file is part of GNU Make.
|
This file is part of GNU Make.
|
||||||
|
|
||||||
GNU Make is free software; you can redistribute it and/or modify it under the
|
GNU Make is free software; you can redistribute it and/or modify it under the
|
||||||
@@ -12,7 +12,11 @@ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|||||||
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
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
|
You should have received a copy of the GNU General Public License along with
|
||||||
this program. If not, see <http://www.gnu.org/licenses/>. */
|
this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||||
|
|
||||||
|
#include "mkconfig.h"
|
||||||
|
|
||||||
|
#define MK_AMIGAOS 1
|
||||||
|
|
||||||
/* Define if on AIX 3.
|
/* Define if on AIX 3.
|
||||||
System headers sometimes define this.
|
System headers sometimes define this.
|
||||||
@@ -37,8 +41,9 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
|
|||||||
/* Define for DGUX with <sys/dg_sys_info.h>. */
|
/* 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. */
|
/* Define to the widest signed integer type if <stdint.h> and <inttypes.h> do
|
||||||
/* #undef GETLOADAVG_PRIVILEGED */
|
not define. */
|
||||||
|
#define intmax_t long
|
||||||
|
|
||||||
/* Define to 'unsigned long' or 'unsigned long long'
|
/* Define to 'unsigned long' or 'unsigned long long'
|
||||||
if <inttypes.h> doesn't define. */
|
if <inttypes.h> doesn't define. */
|
||||||
@@ -53,12 +58,12 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
|
|||||||
/* Define if you have <alloca.h> and it should be used (not on Ultrix). */
|
/* Define if you have <alloca.h> and it should be used (not on Ultrix). */
|
||||||
/* #undef HAVE_ALLOCA_H */
|
/* #undef HAVE_ALLOCA_H */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the declaration of 'getloadavg'. */
|
||||||
|
/* #undef HAVE_DECL_GETLOADAVG */
|
||||||
|
|
||||||
/* Define if your system has a working fnmatch function. */
|
/* Define if your system has a working fnmatch function. */
|
||||||
/* #undef HAVE_FNMATCH */
|
/* #undef HAVE_FNMATCH */
|
||||||
|
|
||||||
/* Define if your system has its own 'getloadavg' function. */
|
|
||||||
/* #undef HAVE_GETLOADAVG */
|
|
||||||
|
|
||||||
/* Define if you have the getmntent function. */
|
/* Define if you have the getmntent function. */
|
||||||
/* #undef HAVE_GETMNTENT */
|
/* #undef HAVE_GETMNTENT */
|
||||||
|
|
||||||
@@ -134,14 +139,6 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
|
|||||||
/* Define if you need to in order for stat and other things to work. */
|
/* Define if you need to in order for stat and other things to work. */
|
||||||
/* #undef _POSIX_SOURCE */
|
/* #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
|
/* If using the C implementation of alloca, define if you know the
|
||||||
direction of stack growth for your system; otherwise it will be
|
direction of stack growth for your system; otherwise it will be
|
||||||
automatically deduced at run-time.
|
automatically deduced at run-time.
|
||||||
@@ -173,12 +170,6 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
|
|||||||
instead of <sys/cpustats.h>. */
|
instead of <sys/cpustats.h>. */
|
||||||
/* #undef UMAX4_3 */
|
/* #undef UMAX4_3 */
|
||||||
|
|
||||||
/* 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 to the name of the SCCS 'get' command. */
|
||||||
#define SCCS_GET "get"
|
#define SCCS_GET "get"
|
||||||
|
|
||||||
@@ -261,6 +252,9 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
|
|||||||
/* Define if you have the strsignal function. */
|
/* Define if you have the strsignal function. */
|
||||||
/* #undef HAVE_STRSIGNAL */
|
/* #undef HAVE_STRSIGNAL */
|
||||||
|
|
||||||
|
/* Define if you have the strtoll function. */
|
||||||
|
/* #undef HAVE_STRTOLL */
|
||||||
|
|
||||||
/* Define if you have the wait3 function. */
|
/* Define if you have the wait3 function. */
|
||||||
/* #undef HAVE_WAIT3 */
|
/* #undef HAVE_WAIT3 */
|
||||||
|
|
||||||
@@ -324,10 +318,10 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
|
|||||||
/* Define if you have the sun library (-lsun). */
|
/* Define if you have the sun library (-lsun). */
|
||||||
/* #undef HAVE_LIBSUN */
|
/* #undef HAVE_LIBSUN */
|
||||||
|
|
||||||
/* Output sync sypport */
|
/* Output sync support */
|
||||||
#define NO_OUTPUT_SYNC
|
#define NO_OUTPUT_SYNC
|
||||||
|
|
||||||
/* Define for Case Insensitve behavior */
|
/* Define for Case Insensitive behavior */
|
||||||
#define HAVE_CASE_INSENSITIVE_FS
|
#define HAVE_CASE_INSENSITIVE_FS
|
||||||
|
|
||||||
/* Build host information. */
|
/* Build host information. */
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
/* config.h-vms. Generated by hand by Klaus Kämpf <kkaempf@rmi.de> -*-C-*-
|
/* config.h-vms. Generated by hand by Klaus Kämpf <kkaempf@rmi.de> -*-C-*-
|
||||||
|
|
||||||
Copyright (C) 1996-2019 Free Software Foundation, Inc.
|
Copyright (C) 1996-2022 Free Software Foundation, Inc.
|
||||||
This file is part of GNU Make.
|
This file is part of GNU Make.
|
||||||
|
|
||||||
GNU Make is free software; you can redistribute it and/or modify it under the
|
GNU Make is free software; you can redistribute it and/or modify it under the
|
||||||
@@ -13,10 +13,11 @@ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|||||||
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
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
|
You should have received a copy of the GNU General Public License along with
|
||||||
this program. If not, see <http://www.gnu.org/licenses/>. */
|
this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||||
|
|
||||||
/* config.h. Generated automatically by configure. */
|
#include "mkconfig.h"
|
||||||
/* config.h.in. Generated automatically from configure.ac by autoheader. */
|
|
||||||
|
#define MK_VMS 1
|
||||||
|
|
||||||
/* Pull in types.h here to get __CRTL_VER defined for old versions of the
|
/* Pull in types.h here to get __CRTL_VER defined for old versions of the
|
||||||
compiler which don't define it. */
|
compiler which don't define it. */
|
||||||
@@ -65,8 +66,9 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
|
|||||||
/* Define for DGUX with <sys/dg_sys_info.h>. */
|
/* Define for DGUX with <sys/dg_sys_info.h>. */
|
||||||
/* #undef DGUX */
|
/* #undef DGUX */
|
||||||
|
|
||||||
/* Define to 1 if the 'getloadavg' function needs to be run setuid or setgid. */
|
/* Define to the widest signed integer type if <stdint.h> and <inttypes.h> do
|
||||||
/* #undef GETLOADAVG_PRIVILEGED */
|
not define. */
|
||||||
|
#define intmax_t unsigned long
|
||||||
|
|
||||||
/* Define to 'unsigned long' or 'unsigned long long'
|
/* Define to 'unsigned long' or 'unsigned long long'
|
||||||
if <inttypes.h> doesn't define. */
|
if <inttypes.h> doesn't define. */
|
||||||
@@ -81,15 +83,15 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
|
|||||||
/* Define to 1 if you have <alloca.h> and it should be used (not on Ultrix). */
|
/* Define to 1 if you have <alloca.h> and it should be used (not on Ultrix). */
|
||||||
/* #undef HAVE_ALLOCA_H */
|
/* #undef HAVE_ALLOCA_H */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the declaration of 'getloadavg'. */
|
||||||
|
/* #undef HAVE_DECL_GETLOADAVG */
|
||||||
|
|
||||||
/* Define to 1 if you have the fdopen function. */
|
/* Define to 1 if you have the fdopen function. */
|
||||||
#define HAVE_FDOPEN 1
|
#define HAVE_FDOPEN 1
|
||||||
|
|
||||||
/* Define to 1 if your system has a working fnmatch function. */
|
/* Define to 1 if your system has a working fnmatch function. */
|
||||||
/* #undef HAVE_FNMATCH */
|
/* #undef HAVE_FNMATCH */
|
||||||
|
|
||||||
/* Define to 1 if your system has its own 'getloadavg' function. */
|
|
||||||
/* #undef HAVE_GETLOADAVG */
|
|
||||||
|
|
||||||
/* Define to 1 if you have the getmntent function. */
|
/* Define to 1 if you have the getmntent function. */
|
||||||
/* #undef HAVE_GETMNTENT */
|
/* #undef HAVE_GETMNTENT */
|
||||||
|
|
||||||
@@ -172,14 +174,6 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
|
|||||||
/* Define to 1 if you need to in order for stat and other things to work. */
|
/* Define to 1 if you need to in order for stat and other things to work. */
|
||||||
/* #undef _POSIX_SOURCE */
|
/* #undef _POSIX_SOURCE */
|
||||||
|
|
||||||
/* Define as the return type of signal handlers (int or void). */
|
|
||||||
#define RETSIGTYPE void
|
|
||||||
|
|
||||||
/* Define to 1 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
|
/* If using the C implementation of alloca, define if you know the
|
||||||
direction of stack growth for your system; otherwise it will be
|
direction of stack growth for your system; otherwise it will be
|
||||||
automatically deduced at run-time.
|
automatically deduced at run-time.
|
||||||
@@ -213,12 +207,6 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
|
|||||||
instead of <sys/cpustats.h>. */
|
instead of <sys/cpustats.h>. */
|
||||||
/* #undef UMAX4_3 */
|
/* #undef UMAX4_3 */
|
||||||
|
|
||||||
/* 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 to the name of the SCCS 'get' command. */
|
||||||
/* #undef SCCS_GET */
|
/* #undef SCCS_GET */
|
||||||
|
|
||||||
@@ -259,6 +247,9 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
|
|||||||
/* Define to 1 if you have the memmove function. */
|
/* Define to 1 if you have the memmove function. */
|
||||||
#define HAVE_MEMMOVE 1
|
#define HAVE_MEMMOVE 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the 'mkfifo' function. */
|
||||||
|
/* #undef HAVE_MKFIFO */
|
||||||
|
|
||||||
/* Define to 1 if you have the mktemp function. */
|
/* Define to 1 if you have the mktemp function. */
|
||||||
#define HAVE_MKTEMP 1
|
#define HAVE_MKTEMP 1
|
||||||
|
|
||||||
@@ -301,6 +292,9 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
|
|||||||
/* Define to 1 if you have the strsignal function. */
|
/* Define to 1 if you have the strsignal function. */
|
||||||
/* #undef HAVE_STRSIGNAL */
|
/* #undef HAVE_STRSIGNAL */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the `strtoll' function. */
|
||||||
|
#define HAVE_STRTOLL 1
|
||||||
|
|
||||||
/* Define to 1 if you have the wait3 function. */
|
/* Define to 1 if you have the wait3 function. */
|
||||||
/* #undef HAVE_WAIT3 */
|
/* #undef HAVE_WAIT3 */
|
||||||
|
|
||||||
@@ -324,6 +318,9 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
|
|||||||
/* Define to 1 if you have the <memory.h> header file. */
|
/* Define to 1 if you have the <memory.h> header file. */
|
||||||
/* #undef HAVE_MEMORY_H */
|
/* #undef HAVE_MEMORY_H */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the `mempcpy' function. */
|
||||||
|
/* #undef HAVE_MEMPCPY */
|
||||||
|
|
||||||
/* Define to 1 if you have the <ndir.h> header file. */
|
/* Define to 1 if you have the <ndir.h> header file. */
|
||||||
/* #undef HAVE_NDIR_H */
|
/* #undef HAVE_NDIR_H */
|
||||||
|
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
/* config.h.W32 -- hand-massaged config.h file for Windows builds -*-C-*-
|
/* config.h.W32 -- hand-massaged config.h file for Windows builds -*-C-*-
|
||||||
|
|
||||||
Copyright (C) 1996-2019 Free Software Foundation, Inc.
|
Copyright (C) 1996-2022 Free Software Foundation, Inc.
|
||||||
This file is part of GNU Make.
|
This file is part of GNU Make.
|
||||||
|
|
||||||
GNU Make is free software; you can redistribute it and/or modify it under the
|
GNU Make is free software; you can redistribute it and/or modify it under the
|
||||||
@@ -13,34 +13,32 @@ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|||||||
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
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
|
You should have received a copy of the GNU General Public License along with
|
||||||
this program. If not, see <http://www.gnu.org/licenses/>. */
|
this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||||
|
|
||||||
|
#include "mkconfig.h"
|
||||||
|
|
||||||
|
#define MK_W32 1
|
||||||
|
|
||||||
|
/* Build for the WINDOWS32 API. */
|
||||||
|
#define WINDOWS32 1
|
||||||
|
|
||||||
/* Suppress some Visual C++ warnings.
|
/* Suppress some Visual C++ warnings.
|
||||||
Maybe after the code cleanup for ISO C we can remove some/all of these. */
|
Maybe after the code cleanup for ISO C we can remove some/all of these. */
|
||||||
#if _MSC_VER > 1000
|
#if _MSC_VER > 1000
|
||||||
# pragma warning(disable:4100) /* unreferenced formal parameter */
|
# pragma warning(disable:4100) /* unreferenced formal parameter */
|
||||||
# pragma warning(disable:4102) /* unreferenced label */
|
# pragma warning(disable:4130) /* logical operation on address of string constant */
|
||||||
# pragma warning(disable:4127) /* conditional expression is constant */
|
|
||||||
# pragma warning(disable:4131) /* uses old-style declarator */
|
# pragma warning(disable:4131) /* uses old-style declarator */
|
||||||
# pragma warning(disable:4702) /* unreachable code */
|
# pragma warning(disable:4702) /* unreachable code */
|
||||||
# define _CRT_SECURE_NO_WARNINGS /* function or variable may be unsafe */
|
# define _CRT_SECURE_NO_WARNINGS 1 /* function or variable may be unsafe */
|
||||||
# define _CRT_NONSTDC_NO_WARNINGS /* functions w/o a leading underscore */
|
# define _CRT_NONSTDC_NO_WARNINGS 1 /* functions w/o a leading underscore */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Define to 1 if the 'closedir' function returns void instead of 'int'. */
|
/* Define to 1 if the 'closedir' function returns void instead of 'int'. */
|
||||||
/* #undef CLOSEDIR_VOID */
|
/* #undef CLOSEDIR_VOID */
|
||||||
|
|
||||||
/* 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 to 1 if using 'alloca.c'. */
|
/* Define to 1 if using 'alloca.c'. */
|
||||||
/* #undef C_ALLOCA */
|
/* #undef C_ALLOCA */
|
||||||
|
|
||||||
/* Define to 1 if using 'getloadavg.c'. */
|
|
||||||
#define C_GETLOADAVG 1
|
|
||||||
|
|
||||||
/* Define to 1 for DGUX with <sys/dg_sys_info.h>. */
|
/* Define to 1 for DGUX with <sys/dg_sys_info.h>. */
|
||||||
/* #undef DGUX */
|
/* #undef DGUX */
|
||||||
|
|
||||||
@@ -51,15 +49,11 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
|
|||||||
/* Use high resolution file timestamps if nonzero. */
|
/* Use high resolution file timestamps if nonzero. */
|
||||||
#define FILE_TIMESTAMP_HI_RES 0
|
#define FILE_TIMESTAMP_HI_RES 0
|
||||||
|
|
||||||
/* Define to 1 if the 'getloadavg' function needs to be run setuid or setgid.
|
/* Define to 1 if you have 'alloca' after including <alloca.h>, a header that
|
||||||
*/
|
may be supplied by this distribution. */
|
||||||
/* #undef GETLOADAVG_PRIVILEGED */
|
|
||||||
|
|
||||||
/* Define to 1 if you have 'alloca', as a function or macro. */
|
|
||||||
#define HAVE_ALLOCA 1
|
#define HAVE_ALLOCA 1
|
||||||
|
|
||||||
/* Define to 1 if you have <alloca.h> and it should be used (not on Ultrix).
|
/* Define to 1 if <alloca.h> works. */
|
||||||
*/
|
|
||||||
/* #undef HAVE_ALLOCA_H */
|
/* #undef HAVE_ALLOCA_H */
|
||||||
|
|
||||||
/* Define to 1 if you have the 'atexit' function. */
|
/* Define to 1 if you have the 'atexit' function. */
|
||||||
@@ -71,10 +65,6 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
|
|||||||
/* Define to 1 if you have the clock_gettime function. */
|
/* Define to 1 if you have the clock_gettime function. */
|
||||||
/* #undef HAVE_CLOCK_GETTIME */
|
/* #undef HAVE_CLOCK_GETTIME */
|
||||||
|
|
||||||
/* Embed GNU Guile support. Windows build sets this on the
|
|
||||||
compilation command line. */
|
|
||||||
/* #undef HAVE_GUILE */
|
|
||||||
|
|
||||||
/* Define if the GNU dcgettext() function is already present or preinstalled.
|
/* Define if the GNU dcgettext() function is already present or preinstalled.
|
||||||
*/
|
*/
|
||||||
/* #undef HAVE_DCGETTEXT */
|
/* #undef HAVE_DCGETTEXT */
|
||||||
@@ -83,6 +73,21 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
|
|||||||
don't. */
|
don't. */
|
||||||
#define HAVE_DECL_BSD_SIGNAL 0
|
#define HAVE_DECL_BSD_SIGNAL 0
|
||||||
|
|
||||||
|
/* Define to 1 if you have the declaration of `dlerror', and to 0 if you
|
||||||
|
don't. */
|
||||||
|
#define HAVE_DECL_DLERROR 0
|
||||||
|
|
||||||
|
/* Define to 1 if you have the declaration of `dlopen', and to 0 if you don't.
|
||||||
|
*/
|
||||||
|
#define HAVE_DECL_DLOPEN 0
|
||||||
|
|
||||||
|
/* Define to 1 if you have the declaration of `dlsym', and to 0 if you don't.
|
||||||
|
*/
|
||||||
|
#define HAVE_DECL_DLSYM 0
|
||||||
|
|
||||||
|
/* Define to 1 if you have the declaration of 'getloadavg'. */
|
||||||
|
/* #undef HAVE_DECL_GETLOADAVG */
|
||||||
|
|
||||||
/* Define to 1 if you have the declaration of 'sys_siglist', and to 0 if you
|
/* Define to 1 if you have the declaration of 'sys_siglist', and to 0 if you
|
||||||
don't. */
|
don't. */
|
||||||
#define HAVE_DECL_SYS_SIGLIST 0
|
#define HAVE_DECL_SYS_SIGLIST 0
|
||||||
@@ -102,13 +107,16 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
|
|||||||
/* Define to 1 if you have the <direct.h> header file, and it defines getcwd()
|
/* Define to 1 if you have the <direct.h> header file, and it defines getcwd()
|
||||||
and chdir().
|
and chdir().
|
||||||
*/
|
*/
|
||||||
#if (defined(_MSC_VER) || defined(__BORLANDC__)) && !defined(__INTERIX)
|
#if (defined(_MSC_VER) || defined(__BORLANDC__) || defined(__TINYC__)) && !defined(__INTERIX)
|
||||||
# define HAVE_DIRECT_H 1
|
# define HAVE_DIRECT_H 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Use platform specific coding */
|
/* Support DOS-style pathnames. */
|
||||||
#define HAVE_DOS_PATHS 1
|
#define HAVE_DOS_PATHS 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the 'dup' function. */
|
||||||
|
#define HAVE_DUP 1
|
||||||
|
|
||||||
/* Define to 1 if you have the 'dup2' function. */
|
/* Define to 1 if you have the 'dup2' function. */
|
||||||
#define HAVE_DUP2 1
|
#define HAVE_DUP2 1
|
||||||
|
|
||||||
@@ -120,8 +128,8 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
|
|||||||
#define HAVE_FDOPEN 1
|
#define HAVE_FDOPEN 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Define to 1 if you have the 'fileno' function. */
|
/* Define to 1 if you have the `fork' function. */
|
||||||
#define HAVE_FILENO 1
|
/* #undef HAVE_FORK */
|
||||||
|
|
||||||
/* Define to 1 if you have the 'getcwd' function. */
|
/* Define to 1 if you have the 'getcwd' function. */
|
||||||
#define HAVE_GETCWD 1
|
#define HAVE_GETCWD 1
|
||||||
@@ -135,9 +143,6 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
|
|||||||
/* Define to 1 if you have the 'gethostname' function. */
|
/* Define to 1 if you have the 'gethostname' function. */
|
||||||
/* #undef HAVE_GETHOSTNAME */
|
/* #undef HAVE_GETHOSTNAME */
|
||||||
|
|
||||||
/* Define to 1 if you have the 'getloadavg' function. */
|
|
||||||
/* #undef HAVE_GETLOADAVG */
|
|
||||||
|
|
||||||
/* Define to 1 if you have the 'getrlimit' function. */
|
/* Define to 1 if you have the 'getrlimit' function. */
|
||||||
/* #undef HAVE_GETRLIMIT */
|
/* #undef HAVE_GETRLIMIT */
|
||||||
|
|
||||||
@@ -149,6 +154,10 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
|
|||||||
#define HAVE_GETTIMEOFDAY 1
|
#define HAVE_GETTIMEOFDAY 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* Embed GNU Guile support. Windows build sets this on the
|
||||||
|
compilation command line. */
|
||||||
|
/* #undef HAVE_GUILE */
|
||||||
|
|
||||||
/* Define if you have the iconv() function. */
|
/* Define if you have the iconv() function. */
|
||||||
/* #undef HAVE_ICONV */
|
/* #undef HAVE_ICONV */
|
||||||
|
|
||||||
@@ -157,17 +166,26 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
|
|||||||
#define HAVE_INTTYPES_H 1
|
#define HAVE_INTTYPES_H 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* Define to 1 if you have the `isatty' function. */
|
||||||
|
#define HAVE_ISATTY 1
|
||||||
|
|
||||||
/* Define to 1 if you have the 'dgc' library (-ldgc). */
|
/* Define to 1 if you have the 'dgc' library (-ldgc). */
|
||||||
/* #undef HAVE_LIBDGC */
|
/* #undef HAVE_LIBDGC */
|
||||||
|
|
||||||
/* Define to 1 if you have the 'kstat' library (-lkstat). */
|
/* Define to 1 if you have the 'kstat' library (-lkstat). */
|
||||||
/* #undef HAVE_LIBKSTAT */
|
/* #undef HAVE_LIBKSTAT */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the `perfstat' library (-lperfstat). */
|
||||||
|
/* #undef HAVE_LIBPERFSTAT */
|
||||||
|
|
||||||
/* Define to 1 if you have the <limits.h> header file. */
|
/* Define to 1 if you have the <limits.h> header file. */
|
||||||
#define HAVE_LIMITS_H 1
|
#define HAVE_LIMITS_H 1
|
||||||
|
|
||||||
/* Define to 1 if you have the <locale.h> header file. */
|
/* Define to 1 if you have the <locale.h> header file. */
|
||||||
/*#define HAVE_LOCALE_H 1*/
|
/* #undef HAVE_LOCALE_H */
|
||||||
|
|
||||||
|
/* Define to 1 if the system has the type 'long long int'. */
|
||||||
|
#define HAVE_LONG_LONG_INT 1
|
||||||
|
|
||||||
/* Define to 1 if you have the 'lstat' function. */
|
/* Define to 1 if you have the 'lstat' function. */
|
||||||
/* #undef HAVE_LSTAT */
|
/* #undef HAVE_LSTAT */
|
||||||
@@ -178,9 +196,24 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
|
|||||||
/* Define to 1 if you have the <memory.h> header file. */
|
/* Define to 1 if you have the <memory.h> header file. */
|
||||||
#define HAVE_MEMORY_H 1
|
#define HAVE_MEMORY_H 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the `mempcpy' function. */
|
||||||
|
/* #undef HAVE_MEMPCPY */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the `memrchr' function. */
|
||||||
|
/* #undef HAVE_MEMRCHR */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <minix/config.h> header file. */
|
||||||
|
/* #undef HAVE_MINIX_CONFIG_H */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the 'mkfifo' function. */
|
||||||
|
/* #undef HAVE_MKFIFO */
|
||||||
|
|
||||||
/* Define to 1 if you have the 'mkstemp' function. */
|
/* Define to 1 if you have the 'mkstemp' function. */
|
||||||
/* #undef HAVE_MKSTEMP */
|
/* #undef HAVE_MKSTEMP */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the `mkstemp' function. */
|
||||||
|
/* #undef HAVE_MKSTEMP */
|
||||||
|
|
||||||
/* Define to 1 if you have the 'mktemp' function. */
|
/* Define to 1 if you have the 'mktemp' function. */
|
||||||
#define HAVE_MKTEMP 1
|
#define HAVE_MKTEMP 1
|
||||||
|
|
||||||
@@ -193,6 +226,15 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
|
|||||||
/* Define to 1 if you have the 'pipe' function. */
|
/* Define to 1 if you have the 'pipe' function. */
|
||||||
/* #undef HAVE_PIPE */
|
/* #undef HAVE_PIPE */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the `posix_spawn' function. */
|
||||||
|
/* #undef HAVE_POSIX_SPAWN */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the `posix_spawnattr_setsigmask' function. */
|
||||||
|
/* #undef HAVE_POSIX_SPAWNATTR_SETSIGMASK */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the `pselect' function. */
|
||||||
|
/* #undef HAVE_PSELECT */
|
||||||
|
|
||||||
/* Define to 1 if you have the 'pstat_getdynamic' function. */
|
/* Define to 1 if you have the 'pstat_getdynamic' function. */
|
||||||
/* #undef HAVE_PSTAT_GETDYNAMIC */
|
/* #undef HAVE_PSTAT_GETDYNAMIC */
|
||||||
|
|
||||||
@@ -214,9 +256,6 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
|
|||||||
/* Define to 1 if you have the 'setlinebuf' function. */
|
/* Define to 1 if you have the 'setlinebuf' function. */
|
||||||
/* #undef HAVE_SETLINEBUF */
|
/* #undef HAVE_SETLINEBUF */
|
||||||
|
|
||||||
/* Define to 1 if you have the 'setlocale' function. */
|
|
||||||
/*#define HAVE_SETLOCALE 1*/
|
|
||||||
|
|
||||||
/* Define to 1 if you have the 'setregid' function. */
|
/* Define to 1 if you have the 'setregid' function. */
|
||||||
/* #undef HAVE_SETREGID */
|
/* #undef HAVE_SETREGID */
|
||||||
|
|
||||||
@@ -238,16 +277,25 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
|
|||||||
/* Define to 1 if you have the 'socket' function. */
|
/* Define to 1 if you have the 'socket' function. */
|
||||||
/* #undef HAVE_SOCKET */
|
/* #undef HAVE_SOCKET */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <spawn.h> header file. */
|
||||||
|
/* #undef HAVE_SPAWN_H */
|
||||||
|
|
||||||
/* Define to 1 if you have the <stdint.h> header file. */
|
/* Define to 1 if you have the <stdint.h> header file. */
|
||||||
#ifdef __MINGW32__
|
#ifdef __MINGW32__
|
||||||
#define HAVE_STDINT_H 1
|
#define HAVE_STDINT_H 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <stdio.h> header file. */
|
||||||
|
#define HAVE_STDIO_H 1
|
||||||
|
|
||||||
/* Define to 1 if you have the <stdlib.h> header file. */
|
/* Define to 1 if you have the <stdlib.h> header file. */
|
||||||
#define HAVE_STDLIB_H 1
|
#define HAVE_STDLIB_H 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the `stpcpy' function. */
|
||||||
|
/* #undef HAVE_STPCPY */
|
||||||
|
|
||||||
/* Define to 1 if you have the 'strcasecmp' function. */
|
/* Define to 1 if you have the 'strcasecmp' function. */
|
||||||
#ifdef __MINGW32__
|
#if defined(__MINGW32__) || defined(__TINYC__)
|
||||||
#define HAVE_STRCASECMP 1
|
#define HAVE_STRCASECMP 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -261,6 +309,9 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
|
|||||||
/* Define to 1 if you have the 'strdup' function. */
|
/* Define to 1 if you have the 'strdup' function. */
|
||||||
#define HAVE_STRDUP 1
|
#define HAVE_STRDUP 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the `strerror' function. */
|
||||||
|
#define HAVE_STRERROR 1
|
||||||
|
|
||||||
/* Define to 1 if you have the 'stricmp' function. */
|
/* Define to 1 if you have the 'stricmp' function. */
|
||||||
#define HAVE_STRICMP 1
|
#define HAVE_STRICMP 1
|
||||||
|
|
||||||
@@ -273,7 +324,7 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
|
|||||||
#define HAVE_STRING_H 1
|
#define HAVE_STRING_H 1
|
||||||
|
|
||||||
/* Define to 1 if you have the 'strncasecmp' function. */
|
/* Define to 1 if you have the 'strncasecmp' function. */
|
||||||
#ifdef __MINGW32__
|
#if defined(__MINGW32__) || defined(__TINYC__)
|
||||||
#define HAVE_STRNCASECMP 1
|
#define HAVE_STRNCASECMP 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -291,19 +342,13 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
|
|||||||
/* Define to 1 if you have the 'strsignal' function. */
|
/* Define to 1 if you have the 'strsignal' function. */
|
||||||
/* #undef HAVE_STRSIGNAL */
|
/* #undef HAVE_STRSIGNAL */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the `strtoll' function. */
|
||||||
|
#define HAVE_STRTOLL 1
|
||||||
|
|
||||||
/* Define to 1 if `d_type' is a member of `struct dirent'. */
|
/* Define to 1 if `d_type' is a member of `struct dirent'. */
|
||||||
#define HAVE_STRUCT_DIRENT_D_TYPE 1
|
/* SV 57152: MinGW64 version of dirent doesn't support d_type. */
|
||||||
|
#ifndef __MINGW64__
|
||||||
/* Define to 1 if you have the `isatty' function. */
|
# define HAVE_STRUCT_DIRENT_D_TYPE 1
|
||||||
#define HAVE_ISATTY 1
|
|
||||||
|
|
||||||
/* Define to 1 if you have the `ttyname' function. */
|
|
||||||
#define HAVE_TTYNAME 1
|
|
||||||
char *ttyname (int);
|
|
||||||
|
|
||||||
/* Define to 1 if you have the `umask' function. */
|
|
||||||
#ifdef __MINGW32__
|
|
||||||
# define HAVE_UMASK 1
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Define to 1 if 'n_un.n_name' is a member of 'struct nlist'. */
|
/* Define to 1 if 'n_un.n_name' is a member of 'struct nlist'. */
|
||||||
@@ -313,6 +358,12 @@ char *ttyname (int);
|
|||||||
*/
|
*/
|
||||||
/* #undef HAVE_SYS_DIR_H */
|
/* #undef HAVE_SYS_DIR_H */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <sys/file.h> header file. */
|
||||||
|
/* #undef HAVE_SYS_FILE_H */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <sys/loadavg.h> header file. */
|
||||||
|
/* #undef HAVE_SYS_LOADAVG_H */
|
||||||
|
|
||||||
/* Define to 1 if you have the <sys/ndir.h> header file, and it defines 'DIR'.
|
/* Define to 1 if you have the <sys/ndir.h> header file, and it defines 'DIR'.
|
||||||
*/
|
*/
|
||||||
/* #undef HAVE_SYS_NDIR_H */
|
/* #undef HAVE_SYS_NDIR_H */
|
||||||
@@ -325,6 +376,9 @@ char *ttyname (int);
|
|||||||
/* Define to 1 if you have the <sys/resource.h> header file. */
|
/* Define to 1 if you have the <sys/resource.h> header file. */
|
||||||
/* #undef HAVE_SYS_RESOURCE_H */
|
/* #undef HAVE_SYS_RESOURCE_H */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <sys/select.h> header file. */
|
||||||
|
/* #undef HAVE_SYS_SELECT_H */
|
||||||
|
|
||||||
/* Define to 1 if you have the <sys/stat.h> header file. */
|
/* Define to 1 if you have the <sys/stat.h> header file. */
|
||||||
#define HAVE_SYS_STAT_H 1
|
#define HAVE_SYS_STAT_H 1
|
||||||
|
|
||||||
@@ -342,6 +396,21 @@ char *ttyname (int);
|
|||||||
/* Define to 1 if you have the <sys/wait.h> header file. */
|
/* Define to 1 if you have the <sys/wait.h> header file. */
|
||||||
/* #undef HAVE_SYS_WAIT_H */
|
/* #undef HAVE_SYS_WAIT_H */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the `ttyname' function. */
|
||||||
|
#define HAVE_TTYNAME 1
|
||||||
|
char *ttyname (int);
|
||||||
|
|
||||||
|
/* Define to 1 if the system has the type `intmax_t'. */
|
||||||
|
#define HAVE_INTMAX_T 1
|
||||||
|
|
||||||
|
/* Define to 1 if the system has the type `uintmax_t'. */
|
||||||
|
#define HAVE_UINTMAX_T 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the `umask' function. */
|
||||||
|
#if defined(__MINGW32__) || defined(__TINYC__)
|
||||||
|
# define HAVE_UMASK 1
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Define to 1 if you have the \'union wait' type in <sys/wait.h>. */
|
/* Define to 1 if you have the \'union wait' type in <sys/wait.h>. */
|
||||||
/* #undef HAVE_UNION_WAIT */
|
/* #undef HAVE_UNION_WAIT */
|
||||||
|
|
||||||
@@ -350,12 +419,33 @@ char *ttyname (int);
|
|||||||
#define HAVE_UNISTD_H 1
|
#define HAVE_UNISTD_H 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* Define to 1 if the system has the type 'unsigned long long int'. */
|
||||||
|
#define HAVE_UNSIGNED_LONG_LONG_INT 1
|
||||||
|
|
||||||
|
/* Define to 1 if you have the `vfork' function. */
|
||||||
|
/* #undef HAVE_VFORK */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <vfork.h> header file. */
|
||||||
|
/* #undef HAVE_VFORK_H */
|
||||||
|
|
||||||
/* Define to 1 if you have the 'wait3' function. */
|
/* Define to 1 if you have the 'wait3' function. */
|
||||||
/* #undef HAVE_WAIT3 */
|
/* #undef HAVE_WAIT3 */
|
||||||
|
|
||||||
/* Define to 1 if you have the 'waitpid' function. */
|
/* Define to 1 if you have the 'waitpid' function. */
|
||||||
/* #undef HAVE_WAITPID */
|
/* #undef HAVE_WAITPID */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <wchar.h> header file. */
|
||||||
|
/* #undef HAVE_WCHAR_H */
|
||||||
|
|
||||||
|
/* Define to 1 if `fork' works. */
|
||||||
|
/* #undef HAVE_WORKING_FORK */
|
||||||
|
|
||||||
|
/* Define to 1 if `vfork' works. */
|
||||||
|
/* #undef HAVE_WORKING_VFORK */
|
||||||
|
|
||||||
|
/* Define to 1 if the system has the type `_Bool'. */
|
||||||
|
/* #undef HAVE__BOOL */
|
||||||
|
|
||||||
/* Build host information. */
|
/* Build host information. */
|
||||||
#define MAKE_HOST "Windows32"
|
#define MAKE_HOST "Windows32"
|
||||||
|
|
||||||
@@ -378,38 +468,15 @@ char *ttyname (int);
|
|||||||
/* Define to 1 if your C compiler doesn't accept -c and -o together. */
|
/* Define to 1 if your C compiler doesn't accept -c and -o together. */
|
||||||
/* #undef NO_MINUS_C_MINUS_O */
|
/* #undef NO_MINUS_C_MINUS_O */
|
||||||
|
|
||||||
/* Name of this package (needed by automake) */
|
|
||||||
#define PACKAGE "%PACKAGE%"
|
|
||||||
|
|
||||||
/* Define to the address where bug reports for this package should be sent. */
|
|
||||||
#define PACKAGE_BUGREPORT "bug-make@gnu.org"
|
|
||||||
|
|
||||||
/* Define to the full name of this package. */
|
|
||||||
#define PACKAGE_NAME "GNU make"
|
|
||||||
|
|
||||||
/* Define to the home page for this package. */
|
|
||||||
#define PACKAGE_URL "http://www.gnu.org/software/make/"
|
|
||||||
|
|
||||||
/* Define to the version of this package. */
|
|
||||||
#define PACKAGE_VERSION "%VERSION%"
|
|
||||||
|
|
||||||
/* Define to the character that separates directories in PATH. */
|
/* Define to the character that separates directories in PATH. */
|
||||||
#define PATH_SEPARATOR_CHAR ';'
|
#define PATH_SEPARATOR_CHAR ';'
|
||||||
|
|
||||||
/* Define as the return type of signal handlers ('int' or 'void'). */
|
|
||||||
#define RETSIGTYPE void
|
|
||||||
|
|
||||||
/* Define to the name of the SCCS 'get' command. */
|
/* Define to the name of the SCCS 'get' command. */
|
||||||
#define SCCS_GET "echo no sccs get"
|
#define SCCS_GET "echo no sccs get"
|
||||||
|
|
||||||
/* Define this if the SCCS 'get' command understands the '-G<file>' option. */
|
/* Define this if the SCCS 'get' command understands the '-G<file>' option. */
|
||||||
/* #undef SCCS_GET_MINUS_G */
|
/* #undef SCCS_GET_MINUS_G */
|
||||||
|
|
||||||
/* Define to 1 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
|
/* If using the C implementation of alloca, define if you know the
|
||||||
direction of stack growth for your system; otherwise it will be
|
direction of stack growth for your system; otherwise it will be
|
||||||
automatically deduced at run time.
|
automatically deduced at run time.
|
||||||
@@ -430,11 +497,6 @@ char *ttyname (int);
|
|||||||
/* Define to 1 on System V Release 4. */
|
/* Define to 1 on System V Release 4. */
|
||||||
/* #undef SVR4 */
|
/* #undef SVR4 */
|
||||||
|
|
||||||
/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
|
|
||||||
#ifdef __MINGW32__
|
|
||||||
#define TIME_WITH_SYS_TIME 1
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Define to 1 for Encore UMAX. */
|
/* Define to 1 for Encore UMAX. */
|
||||||
/* #undef UMAX */
|
/* #undef UMAX */
|
||||||
|
|
||||||
@@ -442,9 +504,6 @@ char *ttyname (int);
|
|||||||
<sys/cpustats.h>. */
|
<sys/cpustats.h>. */
|
||||||
/* #undef UMAX4_3 */
|
/* #undef UMAX4_3 */
|
||||||
|
|
||||||
/* Version number of package */
|
|
||||||
#define VERSION "%VERSION%"
|
|
||||||
|
|
||||||
/* Define if using the dmalloc debugging malloc package */
|
/* Define if using the dmalloc debugging malloc package */
|
||||||
/* #undef WITH_DMALLOC */
|
/* #undef WITH_DMALLOC */
|
||||||
|
|
||||||
@@ -483,6 +542,14 @@ char *ttyname (int);
|
|||||||
# define __USE_MINGW_ANSI_STDIO 1
|
# define __USE_MINGW_ANSI_STDIO 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* Number of bits in a timestamp, on hosts where this is settable. */
|
||||||
|
/* #undef _TIME_BITS */
|
||||||
|
|
||||||
|
/* For 64-bit time_t on 32-bit mingw. */
|
||||||
|
#ifdef __MINGW32__
|
||||||
|
# define __MINGW_USE_VC2005_COMPAT 1
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
|
||||||
/* Define to 'int' if <sys/types.h> doesn't define. */
|
/* Define to 'int' if <sys/types.h> doesn't define. */
|
||||||
@@ -504,9 +571,10 @@ char *ttyname (int);
|
|||||||
/* Define to 'int' if <sys/types.h> doesn't define. */
|
/* Define to 'int' if <sys/types.h> doesn't define. */
|
||||||
#define uid_t int
|
#define uid_t int
|
||||||
|
|
||||||
/* Define uintmax_t if not defined in <stdint.h> or <inttypes.h>. */
|
/* Define {u,}intmax_t if not defined in <stdint.h> or <inttypes.h>. */
|
||||||
#if !HAVE_STDINT_H && !HAVE_INTTYPES_H
|
#if !HAVE_STDINT_H && !HAVE_INTTYPES_H
|
||||||
#define uintmax_t unsigned long
|
#define intmax_t long long
|
||||||
|
#define uintmax_t unsigned long long
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Define if you have <sys/wait.h> that is POSIX.1 compatible. */
|
/* Define if you have <sys/wait.h> that is POSIX.1 compatible. */
|
||||||
@@ -522,10 +590,14 @@ char *ttyname (int);
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* If you have a shell that does not grok 'sh -c quoted-command-line'
|
* If you have a shell that does not grok 'sh -c quoted-command-line'
|
||||||
* correctly, you need this setting. Please see below for specific
|
* correctly, you need this setting; it is the default for tcc.
|
||||||
* shell support.
|
* Please see below for specific shell support.
|
||||||
*/
|
*/
|
||||||
|
#if defined(__TINYC__)
|
||||||
|
#define BATCH_MODE_ONLY_SHELL 1
|
||||||
|
#else
|
||||||
/*#define BATCH_MODE_ONLY_SHELL 1 */
|
/*#define BATCH_MODE_ONLY_SHELL 1 */
|
||||||
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Define if you have the Cygnus "Cygwin" GNU Windows32 tool set.
|
* Define if you have the Cygnus "Cygwin" GNU Windows32 tool set.
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
/* configh.dos -- hand-massaged config.h file for MS-DOS builds -*-C-*-
|
/* configh.dos -- hand-massaged config.h file for MS-DOS builds -*-C-*-
|
||||||
|
|
||||||
Copyright (C) 1994-2019 Free Software Foundation, Inc.
|
Copyright (C) 1994-2022 Free Software Foundation, Inc.
|
||||||
This file is part of GNU Make.
|
This file is part of GNU Make.
|
||||||
|
|
||||||
GNU Make is free software; you can redistribute it and/or modify it under the
|
GNU Make is free software; you can redistribute it and/or modify it under the
|
||||||
@@ -13,7 +13,11 @@ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|||||||
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
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
|
You should have received a copy of the GNU General Public License along with
|
||||||
this program. If not, see <http://www.gnu.org/licenses/>. */
|
this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||||
|
|
||||||
|
#include "mkconfig.h"
|
||||||
|
|
||||||
|
#define MK_DJGPP 1
|
||||||
|
|
||||||
/* Include this header to make __DJGPP_MINOR__ available because DJGPP ports
|
/* Include this header to make __DJGPP_MINOR__ available because DJGPP ports
|
||||||
of GCC 4.3.0 and later no longer do it automatically. */
|
of GCC 4.3.0 and later no longer do it automatically. */
|
||||||
@@ -49,6 +53,9 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
|
|||||||
/* Define to 1 if you have the 'getgroups' function. */
|
/* Define to 1 if you have the 'getgroups' function. */
|
||||||
#define HAVE_GETGROUPS 1
|
#define HAVE_GETGROUPS 1
|
||||||
|
|
||||||
|
/* Define to 1 if the system has the type 'long long int'. */
|
||||||
|
#define HAVE_LONG_LONG_INT 1
|
||||||
|
|
||||||
/* Define to 1 if you have the <memory.h> header file. */
|
/* Define to 1 if you have the <memory.h> header file. */
|
||||||
#define HAVE_MEMORY_H 1
|
#define HAVE_MEMORY_H 1
|
||||||
|
|
||||||
@@ -66,13 +73,6 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
|
|||||||
|
|
||||||
#define SCCS_GET "get"
|
#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 to 1 if you have the select function. */
|
/* Define to 1 if you have the select function. */
|
||||||
#define HAVE_SELECT 1
|
#define HAVE_SELECT 1
|
||||||
|
|
||||||
@@ -82,35 +82,30 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
|
|||||||
/* Define to 1 if you have the 'strncasecmp' function. */
|
/* Define to 1 if you have the 'strncasecmp' function. */
|
||||||
#define HAVE_STRNCASECMP 1
|
#define HAVE_STRNCASECMP 1
|
||||||
|
|
||||||
/* Name of the package */
|
/* Define to 1 if you have the `strtoll' function. */
|
||||||
#define PACKAGE "%PACKAGE%"
|
#define HAVE_STRTOLL 1
|
||||||
|
|
||||||
/* Define to the address where bug reports for this package should be sent. */
|
/* Output sync support */
|
||||||
#define PACKAGE_BUGREPORT "bug-%PACKAGE%@gnu.org"
|
#define NO_OUTPUT_SYNC 1
|
||||||
|
|
||||||
/* Define to the full name of this package. */
|
|
||||||
#define PACKAGE_NAME "GNU %PACKAGE%"
|
|
||||||
|
|
||||||
/* Define to the full name and version of this package. */
|
|
||||||
#define PACKAGE_STRING "GNU %PACKAGE% %VERSION%"
|
|
||||||
|
|
||||||
/* Define to the one symbol short name of this package. */
|
|
||||||
#define PACKAGE_TARNAME "%PACKAGE%"
|
|
||||||
|
|
||||||
/* Define to the version of this package. */
|
|
||||||
#define PACKAGE_VERSION "%VERSION%"
|
|
||||||
|
|
||||||
/* Output sync sypport */
|
|
||||||
#define NO_OUTPUT_SYNC
|
|
||||||
|
|
||||||
/* Version number of package */
|
|
||||||
#define VERSION "%VERSION%"
|
|
||||||
|
|
||||||
/* Build host information. */
|
/* Build host information. */
|
||||||
#define MAKE_HOST "i386-pc-msdosdjgpp"
|
#define MAKE_HOST "i386-pc-msdosdjgpp"
|
||||||
|
|
||||||
/* Grok DOS paths (drive specs and backslash path element separators) */
|
/* Grok DOS paths (drive specs and backslash path element separators) */
|
||||||
#define HAVE_DOS_PATHS
|
#define HAVE_DOS_PATHS 1
|
||||||
|
|
||||||
|
/* Define the type of the first arg to select(). */
|
||||||
|
#define fd_set_size_t int
|
||||||
|
|
||||||
|
/* Define to the widest signed integer type if <stdint.h> and <inttypes.h> do
|
||||||
|
not define. */
|
||||||
|
#define intmax_t long long
|
||||||
|
|
||||||
/* Define to `int' if <sys/types.h> does not define. */
|
/* Define to `int' if <sys/types.h> does not define. */
|
||||||
|
#if __DJGPP__ == 2 && __DJGPP_MINOR__ < 5
|
||||||
#define ssize_t int
|
#define ssize_t int
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Define to 'unsigned long' or 'unsigned long long'
|
||||||
|
if <inttypes.h> doesn't define. */
|
||||||
|
#define uintmax_t unsigned long long
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
/* Debugging macros and interface.
|
/* Debugging macros and interface.
|
||||||
Copyright (C) 1999-2019 Free Software Foundation, Inc.
|
Copyright (C) 1999-2022 Free Software Foundation, Inc.
|
||||||
This file is part of GNU Make.
|
This file is part of GNU Make.
|
||||||
|
|
||||||
GNU Make is free software; you can redistribute it and/or modify it under the
|
GNU Make is free software; you can redistribute it and/or modify it under the
|
||||||
@@ -12,13 +12,15 @@ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|||||||
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
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
|
You should have received a copy of the GNU General Public License along with
|
||||||
this program. If not, see <http://www.gnu.org/licenses/>. */
|
this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||||
|
|
||||||
#define DB_NONE (0x000)
|
#define DB_NONE (0x000)
|
||||||
#define DB_BASIC (0x001)
|
#define DB_BASIC (0x001)
|
||||||
#define DB_VERBOSE (0x002)
|
#define DB_VERBOSE (0x002)
|
||||||
#define DB_JOBS (0x004)
|
#define DB_JOBS (0x004)
|
||||||
#define DB_IMPLICIT (0x008)
|
#define DB_IMPLICIT (0x008)
|
||||||
|
#define DB_PRINT (0x010)
|
||||||
|
#define DB_WHY (0x020)
|
||||||
#define DB_MAKEFILES (0x100)
|
#define DB_MAKEFILES (0x100)
|
||||||
|
|
||||||
#define DB_ALL (0xfff)
|
#define DB_ALL (0xfff)
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/* Data base of default implicit rules for GNU Make.
|
/* Data base of default implicit rules for GNU Make.
|
||||||
Copyright (C) 1988-2019 Free Software Foundation, Inc.
|
Copyright (C) 1988-2022 Free Software Foundation, Inc.
|
||||||
This file is part of GNU Make.
|
This file is part of GNU Make.
|
||||||
|
|
||||||
GNU Make is free software; you can redistribute it and/or modify it under the
|
GNU Make is free software; you can redistribute it and/or modify it under the
|
||||||
@@ -12,7 +12,7 @@ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|||||||
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
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
|
You should have received a copy of the GNU General Public License along with
|
||||||
this program. If not, see <http://www.gnu.org/licenses/>. */
|
this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||||
|
|
||||||
#include "makeint.h"
|
#include "makeint.h"
|
||||||
|
|
||||||
@@ -506,7 +506,7 @@ static const char *default_variables[] =
|
|||||||
"COMPILE.s", "$(AS) $(ASFLAGS) $(TARGET_MACH)",
|
"COMPILE.s", "$(AS) $(ASFLAGS) $(TARGET_MACH)",
|
||||||
"LINK.S", "$(CC) $(ASFLAGS) $(CPPFLAGS) $(LDFLAGS) $(TARGET_MACH)",
|
"LINK.S", "$(CC) $(ASFLAGS) $(CPPFLAGS) $(LDFLAGS) $(TARGET_MACH)",
|
||||||
"COMPILE.S", "$(CC) $(ASFLAGS) $(CPPFLAGS) $(TARGET_MACH) -c",
|
"COMPILE.S", "$(CC) $(ASFLAGS) $(CPPFLAGS) $(TARGET_MACH) -c",
|
||||||
"PREPROCESS.S", "$(CC) -E $(CPPFLAGS)",
|
"PREPROCESS.S", "$(CPP) $(CPPFLAGS)",
|
||||||
"PREPROCESS.F", "$(FC) $(FFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -F",
|
"PREPROCESS.F", "$(FC) $(FFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -F",
|
||||||
"PREPROCESS.r", "$(FC) $(FFLAGS) $(RFLAGS) $(TARGET_ARCH) -F",
|
"PREPROCESS.r", "$(FC) $(FFLAGS) $(RFLAGS) $(TARGET_ARCH) -F",
|
||||||
"LINT.c", "$(LINT) $(LINTFLAGS) $(CPPFLAGS) $(TARGET_ARCH)",
|
"LINT.c", "$(LINT) $(LINTFLAGS) $(CPPFLAGS) $(TARGET_ARCH)",
|
||||||
@@ -518,7 +518,12 @@ static const char *default_variables[] =
|
|||||||
#else /* !VMS */
|
#else /* !VMS */
|
||||||
|
|
||||||
"AR", "ar",
|
"AR", "ar",
|
||||||
"ARFLAGS", "rv",
|
#ifdef _AIX
|
||||||
|
/* AIX requires object file format specification: choose -Xany. */
|
||||||
|
"ARFLAGS", "-Xany -rv",
|
||||||
|
#else
|
||||||
|
"ARFLAGS", "-rv",
|
||||||
|
#endif
|
||||||
"AS", "as",
|
"AS", "as",
|
||||||
#ifdef GCC_IS_NATIVE
|
#ifdef GCC_IS_NATIVE
|
||||||
"CC", "gcc",
|
"CC", "gcc",
|
||||||
@@ -636,7 +641,7 @@ static const char *default_variables[] =
|
|||||||
"COMPILE.s", "$(AS) $(ASFLAGS) $(TARGET_MACH)",
|
"COMPILE.s", "$(AS) $(ASFLAGS) $(TARGET_MACH)",
|
||||||
"LINK.S", "$(CC) $(ASFLAGS) $(CPPFLAGS) $(LDFLAGS) $(TARGET_MACH)",
|
"LINK.S", "$(CC) $(ASFLAGS) $(CPPFLAGS) $(LDFLAGS) $(TARGET_MACH)",
|
||||||
"COMPILE.S", "$(CC) $(ASFLAGS) $(CPPFLAGS) $(TARGET_MACH) -c",
|
"COMPILE.S", "$(CC) $(ASFLAGS) $(CPPFLAGS) $(TARGET_MACH) -c",
|
||||||
"PREPROCESS.S", "$(CC) -E $(CPPFLAGS)",
|
"PREPROCESS.S", "$(CPP) $(CPPFLAGS)",
|
||||||
"PREPROCESS.F", "$(FC) $(FFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -F",
|
"PREPROCESS.F", "$(FC) $(FFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -F",
|
||||||
"PREPROCESS.r", "$(FC) $(FFLAGS) $(RFLAGS) $(TARGET_ARCH) -F",
|
"PREPROCESS.r", "$(FC) $(FFLAGS) $(RFLAGS) $(TARGET_ARCH) -F",
|
||||||
"LINT.c", "$(LINT) $(LINTFLAGS) $(CPPFLAGS) $(TARGET_ARCH)",
|
"LINT.c", "$(LINT) $(LINTFLAGS) $(CPPFLAGS) $(TARGET_ARCH)",
|
||||||
@@ -663,7 +668,7 @@ static const char *default_variables[] =
|
|||||||
|
|
||||||
#endif /* !VMS */
|
#endif /* !VMS */
|
||||||
/* Make this assignment to avoid undefined variable warnings. */
|
/* Make this assignment to avoid undefined variable warnings. */
|
||||||
"GNUMAKEFLAGS", "",
|
GNUMAKEFLAGS_NAME, "",
|
||||||
0, 0
|
0, 0
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
42
src/dep.h
42
src/dep.h
@@ -1,5 +1,5 @@
|
|||||||
/* Definitions of dependency data structures for GNU Make.
|
/* Definitions of dependency data structures for GNU Make.
|
||||||
Copyright (C) 1988-2019 Free Software Foundation, Inc.
|
Copyright (C) 1988-2022 Free Software Foundation, Inc.
|
||||||
This file is part of GNU Make.
|
This file is part of GNU Make.
|
||||||
|
|
||||||
GNU Make is free software; you can redistribute it and/or modify it under the
|
GNU Make is free software; you can redistribute it and/or modify it under the
|
||||||
@@ -12,7 +12,7 @@ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|||||||
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
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
|
You should have received a copy of the GNU General Public License along with
|
||||||
this program. If not, see <http://www.gnu.org/licenses/>. */
|
this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||||
|
|
||||||
|
|
||||||
/* Structure used in chains of names, for parsing and globbing. */
|
/* Structure used in chains of names, for parsing and globbing. */
|
||||||
@@ -30,25 +30,32 @@ struct nameseq
|
|||||||
These flags are saved in the 'flags' field of each
|
These flags are saved in the 'flags' field of each
|
||||||
'struct goaldep' in the chain returned by 'read_all_makefiles'. */
|
'struct goaldep' in the chain returned by 'read_all_makefiles'. */
|
||||||
|
|
||||||
|
#define RM_NOFLAG 0
|
||||||
#define RM_NO_DEFAULT_GOAL (1 << 0) /* Do not set default goal. */
|
#define RM_NO_DEFAULT_GOAL (1 << 0) /* Do not set default goal. */
|
||||||
#define RM_INCLUDED (1 << 1) /* Search makefile search path. */
|
#define RM_INCLUDED (1 << 1) /* Search makefile search path. */
|
||||||
#define RM_DONTCARE (1 << 2) /* No error if it doesn't exist. */
|
#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_NO_TILDE (1 << 3) /* Don't expand ~ in file name. */
|
||||||
#define RM_NOFLAG 0
|
|
||||||
|
|
||||||
/* Structure representing one dependency of a file.
|
/* Structure representing one dependency of a file.
|
||||||
Each struct file's 'deps' points to a chain of these, through 'next'.
|
Each struct file's 'deps' points to a chain of these, through 'next'.
|
||||||
'stem' is the stem for this dep line of static pattern rule or NULL. */
|
'stem' is the stem for this dep line of static pattern rule or NULL.
|
||||||
|
explicit is set when implicit rule search is performed and the prerequisite
|
||||||
|
does not contain %. When explicit is set the file is not intermediate. */
|
||||||
|
|
||||||
|
|
||||||
#define DEP(_t) \
|
#define DEP(_t) \
|
||||||
NAMESEQ (_t); \
|
NAMESEQ (_t); \
|
||||||
struct file *file; \
|
struct file *file; \
|
||||||
|
_t *shuf; \
|
||||||
const char *stem; \
|
const char *stem; \
|
||||||
unsigned int flags : 8; \
|
unsigned int flags : 8; \
|
||||||
unsigned int changed : 1; \
|
unsigned int changed : 1; \
|
||||||
unsigned int ignore_mtime : 1; \
|
unsigned int ignore_mtime : 1; \
|
||||||
unsigned int staticpattern : 1; \
|
unsigned int staticpattern : 1; \
|
||||||
unsigned int need_2nd_expansion : 1
|
unsigned int need_2nd_expansion : 1; \
|
||||||
|
unsigned int ignore_automatic_vars : 1; \
|
||||||
|
unsigned int is_explicit : 1; \
|
||||||
|
unsigned int wait_here : 1
|
||||||
|
|
||||||
struct dep
|
struct dep
|
||||||
{
|
{
|
||||||
@@ -74,6 +81,8 @@ struct goaldep
|
|||||||
#define PARSEFS_NOGLOB 0x0004
|
#define PARSEFS_NOGLOB 0x0004
|
||||||
#define PARSEFS_EXISTS 0x0008
|
#define PARSEFS_EXISTS 0x0008
|
||||||
#define PARSEFS_NOCACHE 0x0010
|
#define PARSEFS_NOCACHE 0x0010
|
||||||
|
#define PARSEFS_ONEWORD 0x0020
|
||||||
|
#define PARSEFS_WAIT 0x0040
|
||||||
|
|
||||||
#define PARSE_FILE_SEQ(_s,_t,_c,_p,_f) \
|
#define PARSE_FILE_SEQ(_s,_t,_c,_p,_f) \
|
||||||
(_t *)parse_file_seq ((_s),sizeof (_t),(_c),(_p),(_f))
|
(_t *)parse_file_seq ((_s),sizeof (_t),(_c),(_p),(_f))
|
||||||
@@ -93,24 +102,23 @@ char *tilde_expand (const char *name);
|
|||||||
struct nameseq *ar_glob (const char *arname, const char *member_pattern, size_t size);
|
struct nameseq *ar_glob (const char *arname, const char *member_pattern, size_t size);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define dep_name(d) ((d)->name ? (d)->name : (d)->file->name)
|
#define dep_name(d) ((d)->name ? (d)->name : (d)->file->name)
|
||||||
|
|
||||||
#define alloc_seq_elt(_t) xcalloc (sizeof (_t))
|
#define alloc_seq_elt(_t) xcalloc (sizeof (_t))
|
||||||
void free_ns_chain (struct nameseq *n);
|
void free_ns_chain (struct nameseq *n);
|
||||||
|
|
||||||
#if defined(MAKE_MAINTAINER_MODE) && defined(__GNUC__)
|
#if defined(MAKE_MAINTAINER_MODE) && defined(__GNUC__) && !defined(__STRICT_ANSI__)
|
||||||
/* Use inline to get real type-checking. */
|
/* Use inline to get real type-checking. */
|
||||||
#define SI static inline
|
#define SI static inline
|
||||||
SI struct nameseq *alloc_ns() { return alloc_seq_elt (struct nameseq); }
|
SI struct nameseq *alloc_ns (void) { return alloc_seq_elt (struct nameseq); }
|
||||||
SI struct dep *alloc_dep() { return alloc_seq_elt (struct dep); }
|
SI struct dep *alloc_dep (void) { return alloc_seq_elt (struct dep); }
|
||||||
SI struct goaldep *alloc_goaldep() { return alloc_seq_elt (struct goaldep); }
|
SI struct goaldep *alloc_goaldep (void) { return alloc_seq_elt (struct goaldep); }
|
||||||
|
|
||||||
SI void free_ns(struct nameseq *n) { free (n); }
|
SI void free_ns (struct nameseq *n) { free (n); }
|
||||||
SI void free_dep(struct dep *d) { free_ns ((struct nameseq *)d); }
|
SI void free_dep (struct dep *d) { free_ns ((struct nameseq *)d); }
|
||||||
SI void free_goaldep(struct goaldep *g) { free_dep ((struct dep *)g); }
|
SI void free_goaldep (struct goaldep *g) { free_dep ((struct dep *)g); }
|
||||||
|
SI void free_dep_chain (struct dep *d) { free_ns_chain((struct nameseq *)d); }
|
||||||
SI void free_dep_chain(struct dep *d) { free_ns_chain((struct nameseq *)d); }
|
SI void free_goal_chain (struct goaldep *g) { free_dep_chain((struct dep *)g); }
|
||||||
SI void free_goal_chain(struct goaldep *g) { free_dep_chain((struct dep *)g); }
|
|
||||||
#else
|
#else
|
||||||
# define alloc_ns() alloc_seq_elt (struct nameseq)
|
# define alloc_ns() alloc_seq_elt (struct nameseq)
|
||||||
# define alloc_dep() alloc_seq_elt (struct dep)
|
# define alloc_dep() alloc_seq_elt (struct dep)
|
||||||
|
|||||||
339
src/dir.c
339
src/dir.c
@@ -1,5 +1,5 @@
|
|||||||
/* Directory hashing for GNU Make.
|
/* Directory hashing for GNU Make.
|
||||||
Copyright (C) 1988-2019 Free Software Foundation, Inc.
|
Copyright (C) 1988-2022 Free Software Foundation, Inc.
|
||||||
This file is part of GNU Make.
|
This file is part of GNU Make.
|
||||||
|
|
||||||
GNU Make is free software; you can redistribute it and/or modify it under the
|
GNU Make is free software; you can redistribute it and/or modify it under the
|
||||||
@@ -12,12 +12,13 @@ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|||||||
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
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
|
You should have received a copy of the GNU General Public License along with
|
||||||
this program. If not, see <http://www.gnu.org/licenses/>. */
|
this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||||
|
|
||||||
#include "makeint.h"
|
#include "makeint.h"
|
||||||
#include "hash.h"
|
#include "hash.h"
|
||||||
#include "filedef.h"
|
#include "filedef.h"
|
||||||
#include "dep.h"
|
#include "dep.h"
|
||||||
|
#include "debug.h"
|
||||||
|
|
||||||
#ifdef HAVE_DIRENT_H
|
#ifdef HAVE_DIRENT_H
|
||||||
# include <dirent.h>
|
# include <dirent.h>
|
||||||
@@ -175,7 +176,7 @@ vms_hash (const char *name)
|
|||||||
|
|
||||||
while (*name)
|
while (*name)
|
||||||
{
|
{
|
||||||
unsigned char uc = *name;
|
unsigned char uc = (unsigned char) *name;
|
||||||
int g;
|
int g;
|
||||||
#ifdef HAVE_CASE_INSENSITIVE_FS
|
#ifdef HAVE_CASE_INSENSITIVE_FS
|
||||||
h = (h << 4) + (isupper (uc) ? tolower (uc) : uc);
|
h = (h << 4) + (isupper (uc) ? tolower (uc) : uc);
|
||||||
@@ -232,6 +233,12 @@ vmsstat_dir (const char *name, struct stat *st)
|
|||||||
#endif /* _USE_STD_STAT */
|
#endif /* _USE_STD_STAT */
|
||||||
#endif /* VMS */
|
#endif /* VMS */
|
||||||
|
|
||||||
|
/* Never have more than this many directories open at once. */
|
||||||
|
|
||||||
|
#define MAX_OPEN_DIRECTORIES 10
|
||||||
|
|
||||||
|
static unsigned int open_directories = 0;
|
||||||
|
|
||||||
/* Hash table of directories. */
|
/* Hash table of directories. */
|
||||||
|
|
||||||
#ifndef DIRECTORY_BUCKETS
|
#ifndef DIRECTORY_BUCKETS
|
||||||
@@ -262,9 +269,25 @@ struct directory_contents
|
|||||||
# endif
|
# endif
|
||||||
#endif /* WINDOWS32 */
|
#endif /* WINDOWS32 */
|
||||||
struct hash_table dirfiles; /* Files in this directory. */
|
struct hash_table dirfiles; /* Files in this directory. */
|
||||||
|
unsigned long counter; /* command_count value when last read. */
|
||||||
DIR *dirstream; /* Stream reading this directory. */
|
DIR *dirstream; /* Stream reading this directory. */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static struct directory_contents *
|
||||||
|
clear_directory_contents (struct directory_contents *dc)
|
||||||
|
{
|
||||||
|
dc->counter = 0;
|
||||||
|
if (dc->dirstream)
|
||||||
|
{
|
||||||
|
--open_directories;
|
||||||
|
closedir (dc->dirstream);
|
||||||
|
dc->dirstream = 0;
|
||||||
|
}
|
||||||
|
hash_free (&dc->dirfiles, 1);
|
||||||
|
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
static unsigned long
|
static unsigned long
|
||||||
directory_contents_hash_1 (const void *key_0)
|
directory_contents_hash_1 (const void *key_0)
|
||||||
{
|
{
|
||||||
@@ -363,7 +386,9 @@ static struct hash_table directory_contents;
|
|||||||
|
|
||||||
struct directory
|
struct directory
|
||||||
{
|
{
|
||||||
const char *name; /* Name of the directory. */
|
const char *name; /* Name of the directory. */
|
||||||
|
unsigned long counter; /* command_count value when last read.
|
||||||
|
Used for non-existent directories. */
|
||||||
|
|
||||||
/* The directory's contents. This data may be shared by several
|
/* The directory's contents. This data may be shared by several
|
||||||
entries in the hash table, which refer to the same directory
|
entries in the hash table, which refer to the same directory
|
||||||
@@ -393,12 +418,6 @@ directory_hash_cmp (const void *x, const void *y)
|
|||||||
/* Table of directories hashed by name. */
|
/* Table of directories hashed by name. */
|
||||||
static struct hash_table directories;
|
static struct hash_table directories;
|
||||||
|
|
||||||
/* Never have more than this many directories open at once. */
|
|
||||||
|
|
||||||
#define MAX_OPEN_DIRECTORIES 10
|
|
||||||
|
|
||||||
static unsigned int open_directories = 0;
|
|
||||||
|
|
||||||
|
|
||||||
/* Hash table of files in each directory. */
|
/* Hash table of files in each directory. */
|
||||||
|
|
||||||
@@ -449,150 +468,162 @@ find_directory (const char *name)
|
|||||||
struct directory *dir;
|
struct directory *dir;
|
||||||
struct directory **dir_slot;
|
struct directory **dir_slot;
|
||||||
struct directory dir_key;
|
struct directory dir_key;
|
||||||
|
struct directory_contents *dc;
|
||||||
|
struct directory_contents **dc_slot;
|
||||||
|
struct directory_contents dc_key;
|
||||||
|
|
||||||
|
struct stat st;
|
||||||
|
int r;
|
||||||
|
#ifdef WINDOWS32
|
||||||
|
char *w32_path;
|
||||||
|
#endif
|
||||||
|
|
||||||
dir_key.name = name;
|
dir_key.name = name;
|
||||||
dir_slot = (struct directory **) hash_find_slot (&directories, &dir_key);
|
dir_slot = (struct directory **) hash_find_slot (&directories, &dir_key);
|
||||||
dir = *dir_slot;
|
dir = *dir_slot;
|
||||||
|
|
||||||
if (HASH_VACANT (dir))
|
if (!HASH_VACANT (dir))
|
||||||
|
{
|
||||||
|
unsigned long ctr = dir->contents ? dir->contents->counter : dir->counter;
|
||||||
|
|
||||||
|
/* No commands have run since we parsed this directory so it's good. */
|
||||||
|
if (ctr == command_count)
|
||||||
|
return dir;
|
||||||
|
|
||||||
|
DB (DB_VERBOSE, ("Directory %s cache invalidated (count %lu != command %lu)\n",
|
||||||
|
name, ctr, command_count));
|
||||||
|
|
||||||
|
if (dir->contents)
|
||||||
|
clear_directory_contents (dir->contents);
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
/* The directory was not found. Create a new entry for it. */
|
/* The directory was not found. Create a new entry for it. */
|
||||||
const char *p = name + strlen (name);
|
size_t len = strlen (name);
|
||||||
struct stat st;
|
|
||||||
int r;
|
|
||||||
|
|
||||||
dir = xmalloc (sizeof (struct directory));
|
dir = xmalloc (sizeof (struct directory));
|
||||||
#if defined(HAVE_CASE_INSENSITIVE_FS) && defined(VMS)
|
#if defined(HAVE_CASE_INSENSITIVE_FS) && defined(VMS)
|
||||||
/* Todo: Why is this only needed on VMS? */
|
/* Todo: Why is this only needed on VMS? */
|
||||||
{
|
{
|
||||||
char *lname = downcase_inplace (xstrdup (name));
|
char *lname = downcase_inplace (xstrdup (name));
|
||||||
dir->name = strcache_add_len (lname, p - name);
|
dir->name = strcache_add_len (lname, len);
|
||||||
free (lname);
|
free (lname);
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
dir->name = strcache_add_len (name, p - name);
|
dir->name = strcache_add_len (name, len);
|
||||||
#endif
|
#endif
|
||||||
hash_insert_at (&directories, dir, dir_slot);
|
hash_insert_at (&directories, dir, dir_slot);
|
||||||
/* The directory is not in the name hash table.
|
}
|
||||||
Find its device and inode numbers, and look it up by them. */
|
|
||||||
|
|
||||||
|
dir->contents = NULL;
|
||||||
|
dir->counter = command_count;
|
||||||
|
|
||||||
|
/* See if the directory exists. */
|
||||||
#if defined(WINDOWS32)
|
#if defined(WINDOWS32)
|
||||||
{
|
{
|
||||||
char tem[MAXPATHLEN], *tstart, *tend;
|
char tem[MAX_PATH+1], *tstart, *tend;
|
||||||
|
size_t len = strlen (name);
|
||||||
|
|
||||||
/* Remove any trailing slashes. Windows32 stat fails even on
|
/* Remove any trailing slashes. Windows32 stat fails even on
|
||||||
valid directories if they end in a slash. */
|
valid directories if they end in a slash. */
|
||||||
memcpy (tem, name, p - name + 1);
|
memcpy (tem, name, len + 1);
|
||||||
tstart = tem;
|
tstart = tem;
|
||||||
if (tstart[1] == ':')
|
if (tstart[1] == ':')
|
||||||
tstart += 2;
|
tstart += 2;
|
||||||
for (tend = tem + (p - name - 1);
|
for (tend = tem + (len - 1); tend > tstart && ISDIRSEP (*tend); tend--)
|
||||||
tend > tstart && (*tend == '/' || *tend == '\\');
|
*tend = '\0';
|
||||||
tend--)
|
|
||||||
*tend = '\0';
|
|
||||||
|
|
||||||
r = stat (tem, &st);
|
r = stat (tem, &st);
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
EINTRLOOP (r, stat (name, &st));
|
EINTRLOOP (r, stat (name, &st));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (r < 0)
|
if (r < 0)
|
||||||
{
|
/* Couldn't stat the directory; nothing else to do. */
|
||||||
/* Couldn't stat the directory. Mark this by
|
return dir;
|
||||||
setting the 'contents' member to a nil pointer. */
|
|
||||||
dir->contents = 0;
|
/* Search the contents hash table; device and inode are the key. */
|
||||||
}
|
|
||||||
|
memset (&dc_key, '\0', sizeof (dc_key));
|
||||||
|
dc_key.dev = st.st_dev;
|
||||||
|
#ifdef WINDOWS32
|
||||||
|
dc_key.path_key = w32_path = w32ify (name, 1);
|
||||||
|
dc_key.ctime = st.st_ctime;
|
||||||
|
#else
|
||||||
|
# ifdef VMS_INO_T
|
||||||
|
dc_key.ino[0] = st.st_ino[0];
|
||||||
|
dc_key.ino[1] = st.st_ino[1];
|
||||||
|
dc_key.ino[2] = st.st_ino[2];
|
||||||
|
# else
|
||||||
|
dc_key.ino = st.st_ino;
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
dc_slot = (struct directory_contents **) hash_find_slot (&directory_contents, &dc_key);
|
||||||
|
dc = *dc_slot;
|
||||||
|
|
||||||
|
if (HASH_VACANT (dc))
|
||||||
|
{
|
||||||
|
/* Nope; this really is a directory we haven't seen before. */
|
||||||
|
#ifdef WINDOWS32
|
||||||
|
char fs_label[BUFSIZ];
|
||||||
|
char fs_type[BUFSIZ];
|
||||||
|
unsigned long fs_serno;
|
||||||
|
unsigned long fs_flags;
|
||||||
|
unsigned long fs_len;
|
||||||
|
#endif
|
||||||
|
/* Enter it in the contents hash table. */
|
||||||
|
dc = xcalloc (sizeof (struct directory_contents));
|
||||||
|
*dc = dc_key;
|
||||||
|
|
||||||
|
#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;
|
||||||
|
#endif /* WINDOWS32 */
|
||||||
|
|
||||||
|
hash_insert_at (&directory_contents, dc, dc_slot);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Point the name-hashed entry for DIR at its contents data. */
|
||||||
|
dir->contents = dc;
|
||||||
|
|
||||||
|
/* If the contents have changed, we need to reseed. */
|
||||||
|
if (dc->counter != command_count)
|
||||||
|
{
|
||||||
|
if (dc->counter)
|
||||||
|
clear_directory_contents (dc);
|
||||||
|
|
||||||
|
dc->counter = command_count;
|
||||||
|
|
||||||
|
ENULLLOOP (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->dirfiles.ht_vec = 0;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* Search the contents hash table; device and inode are the key. */
|
hash_init (&dc->dirfiles, DIRFILE_BUCKETS,
|
||||||
|
dirfile_hash_1, dirfile_hash_2, dirfile_hash_cmp);
|
||||||
#ifdef WINDOWS32
|
/* Keep track of how many directories are open. */
|
||||||
char *w32_path;
|
++open_directories;
|
||||||
#endif
|
if (open_directories == MAX_OPEN_DIRECTORIES)
|
||||||
struct directory_contents *dc;
|
/* We have too many directories open already.
|
||||||
struct directory_contents **dc_slot;
|
Read the entire directory and then close it. */
|
||||||
struct directory_contents dc_key;
|
dir_contents_file_exists_p (dc, 0);
|
||||||
|
|
||||||
dc_key.dev = st.st_dev;
|
|
||||||
#ifdef WINDOWS32
|
|
||||||
dc_key.path_key = w32_path = w32ify (name, 1);
|
|
||||||
dc_key.ctime = st.st_ctime;
|
|
||||||
#else
|
|
||||||
# ifdef VMS_INO_T
|
|
||||||
dc_key.ino[0] = st.st_ino[0];
|
|
||||||
dc_key.ino[1] = st.st_ino[1];
|
|
||||||
dc_key.ino[2] = st.st_ino[2];
|
|
||||||
# else
|
|
||||||
dc_key.ino = st.st_ino;
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
dc_slot = (struct directory_contents **) hash_find_slot (&directory_contents, &dc_key);
|
|
||||||
dc = *dc_slot;
|
|
||||||
|
|
||||||
if (HASH_VACANT (dc))
|
|
||||||
{
|
|
||||||
/* Nope; this really is a directory we haven't seen before. */
|
|
||||||
#ifdef WINDOWS32
|
|
||||||
char fs_label[BUFSIZ];
|
|
||||||
char fs_type[BUFSIZ];
|
|
||||||
unsigned long fs_serno;
|
|
||||||
unsigned long fs_flags;
|
|
||||||
unsigned long fs_len;
|
|
||||||
#endif
|
|
||||||
dc = (struct directory_contents *)
|
|
||||||
xmalloc (sizeof (struct directory_contents));
|
|
||||||
|
|
||||||
/* Enter it in the contents hash table. */
|
|
||||||
dc->dev = st.st_dev;
|
|
||||||
#ifdef WINDOWS32
|
|
||||||
dc->path_key = xstrdup (w32_path);
|
|
||||||
dc->ctime = st.st_ctime;
|
|
||||||
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_INO_T
|
|
||||||
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 */
|
|
||||||
hash_insert_at (&directory_contents, dc, dc_slot);
|
|
||||||
ENULLLOOP (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->dirfiles.ht_vec = 0;
|
|
||||||
else
|
|
||||||
{
|
|
||||||
hash_init (&dc->dirfiles, DIRFILE_BUCKETS,
|
|
||||||
dirfile_hash_1, dirfile_hash_2, dirfile_hash_cmp);
|
|
||||||
/* Keep track of how many directories are open. */
|
|
||||||
++open_directories;
|
|
||||||
if (open_directories == MAX_OPEN_DIRECTORIES)
|
|
||||||
/* We have too many directories open already.
|
|
||||||
Read the entire directory and then close it. */
|
|
||||||
dir_contents_file_exists_p (dc, 0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Point the name-hashed entry for DIR at its contents data. */
|
|
||||||
dir->contents = dc;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -834,7 +865,7 @@ file_exists_p (const char *name)
|
|||||||
#ifdef HAVE_DOS_PATHS
|
#ifdef HAVE_DOS_PATHS
|
||||||
/* d:/ and d: are *very* different... */
|
/* d:/ and d: are *very* different... */
|
||||||
if (dirend < name + 3 && name[1] == ':' &&
|
if (dirend < name + 3 && name[1] == ':' &&
|
||||||
(*dirend == '/' || *dirend == '\\' || *dirend == ':'))
|
(ISDIRSEP (*dirend) || *dirend == ':'))
|
||||||
dirend++;
|
dirend++;
|
||||||
#endif
|
#endif
|
||||||
p = alloca (dirend - name + 1);
|
p = alloca (dirend - name + 1);
|
||||||
@@ -910,7 +941,7 @@ file_impossible (const char *filename)
|
|||||||
#ifdef HAVE_DOS_PATHS
|
#ifdef HAVE_DOS_PATHS
|
||||||
/* d:/ and d: are *very* different... */
|
/* d:/ and d: are *very* different... */
|
||||||
if (dirend < p + 3 && p[1] == ':' &&
|
if (dirend < p + 3 && p[1] == ':' &&
|
||||||
(*dirend == '/' || *dirend == '\\' || *dirend == ':'))
|
(ISDIRSEP (*dirend) || *dirend == ':'))
|
||||||
dirend++;
|
dirend++;
|
||||||
#endif
|
#endif
|
||||||
cp = alloca (dirend - p + 1);
|
cp = alloca (dirend - p + 1);
|
||||||
@@ -1008,7 +1039,7 @@ file_impossible_p (const char *filename)
|
|||||||
#ifdef HAVE_DOS_PATHS
|
#ifdef HAVE_DOS_PATHS
|
||||||
/* d:/ and d: are *very* different... */
|
/* d:/ and d: are *very* different... */
|
||||||
if (dirend < filename + 3 && filename[1] == ':' &&
|
if (dirend < filename + 3 && filename[1] == ':' &&
|
||||||
(*dirend == '/' || *dirend == '\\' || *dirend == ':'))
|
(ISDIRSEP (*dirend) || *dirend == ':'))
|
||||||
dirend++;
|
dirend++;
|
||||||
#endif
|
#endif
|
||||||
cp = alloca (dirend - filename + 1);
|
cp = alloca (dirend - filename + 1);
|
||||||
@@ -1069,6 +1100,9 @@ print_dir_data_base (void)
|
|||||||
unsigned int impossible;
|
unsigned int impossible;
|
||||||
struct directory **dir_slot;
|
struct directory **dir_slot;
|
||||||
struct directory **dir_end;
|
struct directory **dir_end;
|
||||||
|
#ifdef WINDOWS32
|
||||||
|
char buf[INTSTR_LENGTH + 1];
|
||||||
|
#endif
|
||||||
|
|
||||||
puts (_("\n# Directories\n"));
|
puts (_("\n# Directories\n"));
|
||||||
|
|
||||||
@@ -1084,24 +1118,19 @@ print_dir_data_base (void)
|
|||||||
if (dir->contents == 0)
|
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->dirfiles.ht_vec == 0)
|
else if (dir->contents->dirfiles.ht_vec == 0)
|
||||||
{
|
|
||||||
#ifdef WINDOWS32
|
#ifdef WINDOWS32
|
||||||
printf (_("# %s (key %s, mtime %I64u): could not be opened.\n"),
|
printf (_("# %s (key %s, mtime %s): could not be opened.\n"),
|
||||||
dir->name, dir->contents->path_key,
|
dir->name, dir->contents->path_key,
|
||||||
(unsigned long long)dir->contents->mtime);
|
make_ulltoa ((unsigned long long)dir->contents->mtime, buf));
|
||||||
#else /* WINDOWS32 */
|
#elif defined(VMS_INO_T)
|
||||||
#ifdef VMS_INO_T
|
printf (_("# %s (device %d, inode [%d,%d,%d]): could not be opened.\n"),
|
||||||
printf (_("# %s (device %d, inode [%d,%d,%d]): could not be opened.\n"),
|
dir->name, dir->contents->dev,
|
||||||
dir->name, dir->contents->dev,
|
dir->contents->ino[0], dir->contents->ino[1],
|
||||||
dir->contents->ino[0], dir->contents->ino[1],
|
dir->contents->ino[2]);
|
||||||
dir->contents->ino[2]);
|
|
||||||
#else
|
#else
|
||||||
printf (_("# %s (device %ld, inode %ld): could not be opened.\n"),
|
printf (_("# %s (device %ld, inode %ld): could not be opened.\n"),
|
||||||
dir->name, (long int) dir->contents->dev,
|
dir->name, (long) dir->contents->dev, (long) dir->contents->ino);
|
||||||
(long int) dir->contents->ino);
|
|
||||||
#endif
|
#endif
|
||||||
#endif /* WINDOWS32 */
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
unsigned int f = 0;
|
unsigned int f = 0;
|
||||||
@@ -1123,21 +1152,18 @@ print_dir_data_base (void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
#ifdef WINDOWS32
|
#ifdef WINDOWS32
|
||||||
printf (_("# %s (key %s, mtime %I64u): "),
|
printf (_("# %s (key %s, mtime %s): "),
|
||||||
dir->name, dir->contents->path_key,
|
dir->name, dir->contents->path_key,
|
||||||
(unsigned long long)dir->contents->mtime);
|
make_ulltoa ((unsigned long long)dir->contents->mtime, buf));
|
||||||
#else /* WINDOWS32 */
|
#elif defined(VMS_INO_T)
|
||||||
#ifdef VMS_INO_T
|
|
||||||
printf (_("# %s (device %d, inode [%d,%d,%d]): "),
|
printf (_("# %s (device %d, inode [%d,%d,%d]): "),
|
||||||
dir->name, dir->contents->dev,
|
dir->name, dir->contents->dev,
|
||||||
dir->contents->ino[0], dir->contents->ino[1],
|
dir->contents->ino[0], dir->contents->ino[1],
|
||||||
dir->contents->ino[2]);
|
dir->contents->ino[2]);
|
||||||
#else
|
#else
|
||||||
printf (_("# %s (device %ld, inode %ld): "),
|
printf (_("# %s (device %ld, inode %ld): "), dir->name,
|
||||||
dir->name,
|
|
||||||
(long)dir->contents->dev, (long)dir->contents->ino);
|
(long)dir->contents->dev, (long)dir->contents->ino);
|
||||||
#endif
|
#endif
|
||||||
#endif /* WINDOWS32 */
|
|
||||||
if (f == 0)
|
if (f == 0)
|
||||||
fputs (_("No"), stdout);
|
fputs (_("No"), stdout);
|
||||||
else
|
else
|
||||||
@@ -1286,13 +1312,12 @@ local_stat (const char *path, struct stat *buf)
|
|||||||
/* Make sure the parent of "." exists and is a directory, not a
|
/* Make sure the parent of "." exists and is a directory, not a
|
||||||
file. This is because 'stat' on Windows normalizes the argument
|
file. This is because 'stat' on Windows normalizes the argument
|
||||||
foo/. => foo without checking first that foo is a directory. */
|
foo/. => foo without checking first that foo is a directory. */
|
||||||
if (plen > 1 && path[plen - 1] == '.'
|
if (plen > 2 && path[plen - 1] == '.' && ISDIRSEP (path[plen - 2]))
|
||||||
&& (path[plen - 2] == '/' || path[plen - 2] == '\\'))
|
|
||||||
{
|
{
|
||||||
char parent[MAXPATHLEN];
|
char parent[MAX_PATH+1];
|
||||||
|
|
||||||
strncpy (parent, path, plen - 2);
|
strncpy (parent, path, MAX_PATH);
|
||||||
parent[plen - 2] = '\0';
|
parent[MIN(plen - 2, MAX_PATH)] = '\0';
|
||||||
if (stat (parent, buf) < 0 || !_S_ISDIR (buf->st_mode))
|
if (stat (parent, buf) < 0 || !_S_ISDIR (buf->st_mode))
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|||||||
42
src/expand.c
42
src/expand.c
@@ -1,5 +1,5 @@
|
|||||||
/* Variable expansion functions for GNU Make.
|
/* Variable expansion functions for GNU Make.
|
||||||
Copyright (C) 1988-2019 Free Software Foundation, Inc.
|
Copyright (C) 1988-2022 Free Software Foundation, Inc.
|
||||||
This file is part of GNU Make.
|
This file is part of GNU Make.
|
||||||
|
|
||||||
GNU Make is free software; you can redistribute it and/or modify it under the
|
GNU Make is free software; you can redistribute it and/or modify it under the
|
||||||
@@ -12,15 +12,16 @@ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|||||||
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
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
|
You should have received a copy of the GNU General Public License along with
|
||||||
this program. If not, see <http://www.gnu.org/licenses/>. */
|
this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||||
|
|
||||||
#include "makeint.h"
|
#include "makeint.h"
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
|
||||||
|
#include "commands.h"
|
||||||
|
#include "debug.h"
|
||||||
#include "filedef.h"
|
#include "filedef.h"
|
||||||
#include "job.h"
|
#include "job.h"
|
||||||
#include "commands.h"
|
|
||||||
#include "variable.h"
|
#include "variable.h"
|
||||||
#include "rule.h"
|
#include "rule.h"
|
||||||
|
|
||||||
@@ -67,14 +68,14 @@ variable_buffer_output (char *ptr, const char *string, size_t length)
|
|||||||
ptr = variable_buffer + offset;
|
ptr = variable_buffer + offset;
|
||||||
}
|
}
|
||||||
|
|
||||||
memcpy (ptr, string, length);
|
return mempcpy (ptr, string, length);
|
||||||
return ptr + length;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Return a pointer to the beginning of the variable buffer. */
|
/* Return a pointer to the beginning of the variable buffer.
|
||||||
|
This is called from main() and it should never be null afterward. */
|
||||||
|
|
||||||
static char *
|
char *
|
||||||
initialize_variable_output (void)
|
initialize_variable_output ()
|
||||||
{
|
{
|
||||||
/* If we don't have a variable output buffer yet, get one. */
|
/* If we don't have a variable output buffer yet, get one. */
|
||||||
|
|
||||||
@@ -101,6 +102,29 @@ recursively_expand_for_file (struct variable *v, struct file *file)
|
|||||||
struct variable_set_list *save = 0;
|
struct variable_set_list *save = 0;
|
||||||
int set_reading = 0;
|
int set_reading = 0;
|
||||||
|
|
||||||
|
/* If we're expanding to put into the environment of a shell function then
|
||||||
|
ignore any recursion issues: for backward-compatibility we will use
|
||||||
|
the value of the environment variable we were started with. */
|
||||||
|
if (v->expanding && env_recursion)
|
||||||
|
{
|
||||||
|
size_t nl = strlen (v->name);
|
||||||
|
char **ep;
|
||||||
|
DB (DB_VERBOSE,
|
||||||
|
(_("%s:%lu: not recursively expanding %s to export to shell function\n"),
|
||||||
|
v->fileinfo.filenm, v->fileinfo.lineno, v->name));
|
||||||
|
|
||||||
|
/* We could create a hash for the original environment for speed, but a
|
||||||
|
reasonably written makefile shouldn't hit this situation... */
|
||||||
|
for (ep = environ; *ep != 0; ++ep)
|
||||||
|
if ((*ep)[nl] == '=' && strncmp (*ep, v->name, nl) == 0)
|
||||||
|
return xstrdup ((*ep) + nl + 1);
|
||||||
|
|
||||||
|
/* If there's nothing in the parent environment, use the empty string.
|
||||||
|
This isn't quite correct since the variable should not exist at all,
|
||||||
|
but getting that to work would be involved. */
|
||||||
|
return xstrdup ("");
|
||||||
|
}
|
||||||
|
|
||||||
/* Don't install a new location if this location is empty.
|
/* Don't install a new location if this location is empty.
|
||||||
This can happen for command-line variables, builtin variables, etc. */
|
This can happen for command-line variables, builtin variables, etc. */
|
||||||
saved_varp = expanding_var;
|
saved_varp = expanding_var;
|
||||||
@@ -207,7 +231,7 @@ variable_expand_string (char *line, const char *string, size_t length)
|
|||||||
if (length == 0)
|
if (length == 0)
|
||||||
{
|
{
|
||||||
variable_buffer_output (o, "", 1);
|
variable_buffer_output (o, "", 1);
|
||||||
return (variable_buffer);
|
return variable_buffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* We need a copy of STRING: due to eval, it's possible that it will get
|
/* We need a copy of STRING: due to eval, it's possible that it will get
|
||||||
|
|||||||
369
src/file.c
369
src/file.c
@@ -1,5 +1,5 @@
|
|||||||
/* Target file management for GNU Make.
|
/* Target file management for GNU Make.
|
||||||
Copyright (C) 1988-2019 Free Software Foundation, Inc.
|
Copyright (C) 1988-2022 Free Software Foundation, Inc.
|
||||||
This file is part of GNU Make.
|
This file is part of GNU Make.
|
||||||
|
|
||||||
GNU Make is free software; you can redistribute it and/or modify it under the
|
GNU Make is free software; you can redistribute it and/or modify it under the
|
||||||
@@ -12,7 +12,7 @@ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|||||||
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
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
|
You should have received a copy of the GNU General Public License along with
|
||||||
this program. If not, see <http://www.gnu.org/licenses/>. */
|
this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||||
|
|
||||||
#include "makeint.h"
|
#include "makeint.h"
|
||||||
|
|
||||||
@@ -25,6 +25,7 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
|
|||||||
#include "variable.h"
|
#include "variable.h"
|
||||||
#include "debug.h"
|
#include "debug.h"
|
||||||
#include "hash.h"
|
#include "hash.h"
|
||||||
|
#include "shuffle.h"
|
||||||
|
|
||||||
|
|
||||||
/* Remember whether snap_deps has been invoked: we need this to be sure we
|
/* Remember whether snap_deps has been invoked: we need this to be sure we
|
||||||
@@ -62,6 +63,9 @@ static struct hash_table files;
|
|||||||
/* Whether or not .SECONDARY with no prerequisites was given. */
|
/* Whether or not .SECONDARY with no prerequisites was given. */
|
||||||
static int all_secondary = 0;
|
static int all_secondary = 0;
|
||||||
|
|
||||||
|
/* Whether or not .NOTINTERMEDIATE with no prerequisites was given. */
|
||||||
|
static int no_intermediates = 0;
|
||||||
|
|
||||||
/* Access the hash table of all file records.
|
/* Access the hash table of all file records.
|
||||||
lookup_file given a name, return the struct file * for that name,
|
lookup_file given a name, return the struct file * for that name,
|
||||||
or nil if there is none.
|
or nil if there is none.
|
||||||
@@ -104,20 +108,10 @@ lookup_file (const char *name)
|
|||||||
while (name[0] == '<' && name[1] == '>' && name[2] != '\0')
|
while (name[0] == '<' && name[1] == '>' && name[2] != '\0')
|
||||||
name += 2;
|
name += 2;
|
||||||
#endif
|
#endif
|
||||||
while (name[0] == '.'
|
while (name[0] == '.' && ISDIRSEP (name[1]) && name[2] != '\0')
|
||||||
#ifdef HAVE_DOS_PATHS
|
|
||||||
&& (name[1] == '/' || name[1] == '\\')
|
|
||||||
#else
|
|
||||||
&& name[1] == '/'
|
|
||||||
#endif
|
|
||||||
&& name[2] != '\0')
|
|
||||||
{
|
{
|
||||||
name += 2;
|
name += 2;
|
||||||
while (*name == '/'
|
while (ISDIRSEP (*name))
|
||||||
#ifdef HAVE_DOS_PATHS
|
|
||||||
|| *name == '\\'
|
|
||||||
#endif
|
|
||||||
)
|
|
||||||
/* Skip following slashes: ".//foo" is "foo", not "/foo". */
|
/* Skip following slashes: ".//foo" is "foo", not "/foo". */
|
||||||
++name;
|
++name;
|
||||||
}
|
}
|
||||||
@@ -270,14 +264,14 @@ rehash_file (struct file *from_file, const char *to_hname)
|
|||||||
{
|
{
|
||||||
size_t l = strlen (from_file->name);
|
size_t l = strlen (from_file->name);
|
||||||
/* We have two sets of commands. We will go with the
|
/* We have two sets of commands. We will go with the
|
||||||
one given in the rule explicitly mentioning this name,
|
one given in the rule found through directory search,
|
||||||
but give a message to let the user know what's going on. */
|
but give a message to let the user know what's going on. */
|
||||||
if (to_file->cmds->fileinfo.filenm != 0)
|
if (to_file->cmds->fileinfo.filenm != 0)
|
||||||
error (&from_file->cmds->fileinfo,
|
error (&from_file->cmds->fileinfo,
|
||||||
l + strlen (to_file->cmds->fileinfo.filenm) + INTSTR_LENGTH,
|
l + strlen (to_file->cmds->fileinfo.filenm) + INTSTR_LENGTH,
|
||||||
_("Recipe was specified for file '%s' at %s:%lu,"),
|
_("Recipe was specified for file '%s' at %s:%lu,"),
|
||||||
from_file->name, to_file->cmds->fileinfo.filenm,
|
from_file->name, from_file->cmds->fileinfo.filenm,
|
||||||
to_file->cmds->fileinfo.lineno);
|
from_file->cmds->fileinfo.lineno);
|
||||||
else
|
else
|
||||||
error (&from_file->cmds->fileinfo, l,
|
error (&from_file->cmds->fileinfo, l,
|
||||||
_("Recipe for file '%s' was found by implicit rule search,"),
|
_("Recipe for file '%s' was found by implicit rule search,"),
|
||||||
@@ -288,7 +282,7 @@ rehash_file (struct file *from_file, const char *to_hname)
|
|||||||
from_file->name, to_hname);
|
from_file->name, to_hname);
|
||||||
error (&from_file->cmds->fileinfo, l,
|
error (&from_file->cmds->fileinfo, l,
|
||||||
_("Recipe for '%s' will be ignored in favor of the one for '%s'."),
|
_("Recipe for '%s' will be ignored in favor of the one for '%s'."),
|
||||||
to_hname, from_file->name);
|
from_file->name, to_hname);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -327,14 +321,19 @@ rehash_file (struct file *from_file, const char *to_hname)
|
|||||||
|
|
||||||
#define MERGE(field) to_file->field |= from_file->field
|
#define MERGE(field) to_file->field |= from_file->field
|
||||||
MERGE (precious);
|
MERGE (precious);
|
||||||
|
MERGE (loaded);
|
||||||
MERGE (tried_implicit);
|
MERGE (tried_implicit);
|
||||||
MERGE (updating);
|
MERGE (updating);
|
||||||
MERGE (updated);
|
MERGE (updated);
|
||||||
MERGE (is_target);
|
MERGE (is_target);
|
||||||
MERGE (cmd_target);
|
MERGE (cmd_target);
|
||||||
MERGE (phony);
|
MERGE (phony);
|
||||||
MERGE (loaded);
|
/* Don't merge intermediate because this file might be pre-existing */
|
||||||
|
MERGE (is_explicit);
|
||||||
|
MERGE (secondary);
|
||||||
|
MERGE (notintermediate);
|
||||||
MERGE (ignore_vpath);
|
MERGE (ignore_vpath);
|
||||||
|
MERGE (snapped);
|
||||||
#undef MERGE
|
#undef MERGE
|
||||||
|
|
||||||
to_file->builtin = 0;
|
to_file->builtin = 0;
|
||||||
@@ -386,7 +385,7 @@ remove_intermediates (int sig)
|
|||||||
given on the command line, and it's either a -include makefile or
|
given on the command line, and it's either a -include makefile or
|
||||||
it's not precious. */
|
it's not precious. */
|
||||||
if (f->intermediate && (f->dontcare || !f->precious)
|
if (f->intermediate && (f->dontcare || !f->precious)
|
||||||
&& !f->secondary && !f->cmd_target)
|
&& !f->secondary && !f->notintermediate && !f->cmd_target)
|
||||||
{
|
{
|
||||||
int status;
|
int status;
|
||||||
if (f->update_status == us_none)
|
if (f->update_status == us_none)
|
||||||
@@ -424,7 +423,11 @@ remove_intermediates (int sig)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (status < 0)
|
if (status < 0)
|
||||||
perror_with_name ("unlink: ", f->name);
|
{
|
||||||
|
perror_with_name ("\nunlink: ", f->name);
|
||||||
|
/* Start printing over. */
|
||||||
|
doneany = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -442,8 +445,7 @@ remove_intermediates (int sig)
|
|||||||
struct dep *
|
struct dep *
|
||||||
split_prereqs (char *p)
|
split_prereqs (char *p)
|
||||||
{
|
{
|
||||||
struct dep *new = PARSE_FILE_SEQ (&p, struct dep, MAP_PIPE, NULL,
|
struct dep *new = PARSE_FILE_SEQ (&p, struct dep, MAP_PIPE, NULL, PARSEFS_WAIT);
|
||||||
PARSEFS_NONE);
|
|
||||||
|
|
||||||
if (*p)
|
if (*p)
|
||||||
{
|
{
|
||||||
@@ -452,7 +454,7 @@ split_prereqs (char *p)
|
|||||||
struct dep *ood;
|
struct dep *ood;
|
||||||
|
|
||||||
++p;
|
++p;
|
||||||
ood = PARSE_SIMPLE_SEQ (&p, struct dep);
|
ood = PARSE_FILE_SEQ (&p, struct dep, MAP_NUL, NULL, PARSEFS_WAIT);
|
||||||
|
|
||||||
if (! new)
|
if (! new)
|
||||||
new = ood;
|
new = ood;
|
||||||
@@ -486,7 +488,6 @@ enter_prereqs (struct dep *deps, const char *stem)
|
|||||||
if (stem)
|
if (stem)
|
||||||
{
|
{
|
||||||
const char *pattern = "%";
|
const char *pattern = "%";
|
||||||
char *buffer = variable_expand ("");
|
|
||||||
struct dep *dp = deps, *dl = 0;
|
struct dep *dp = deps, *dl = 0;
|
||||||
|
|
||||||
while (dp != 0)
|
while (dp != 0)
|
||||||
@@ -506,14 +507,15 @@ enter_prereqs (struct dep *deps, const char *stem)
|
|||||||
if (stem[0] == '\0')
|
if (stem[0] == '\0')
|
||||||
{
|
{
|
||||||
memmove (percent, percent+1, strlen (percent));
|
memmove (percent, percent+1, strlen (percent));
|
||||||
o = variable_buffer_output (buffer, nm, strlen (nm) + 1);
|
o = variable_buffer_output (variable_buffer, nm,
|
||||||
|
strlen (nm) + 1);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
o = patsubst_expand_pat (buffer, stem, pattern, nm,
|
o = patsubst_expand_pat (variable_buffer, stem, pattern, nm,
|
||||||
pattern+1, percent+1);
|
pattern+1, percent+1);
|
||||||
|
|
||||||
/* If the name expanded to the empty string, ignore it. */
|
/* If the name expanded to the empty string, ignore it. */
|
||||||
if (buffer[0] == '\0')
|
if (variable_buffer[0] == '\0')
|
||||||
{
|
{
|
||||||
struct dep *df = dp;
|
struct dep *df = dp;
|
||||||
if (dp == deps)
|
if (dp == deps)
|
||||||
@@ -525,7 +527,8 @@ enter_prereqs (struct dep *deps, const char *stem)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Save the name. */
|
/* Save the name. */
|
||||||
dp->name = strcache_add_len (buffer, o - buffer);
|
dp->name = strcache_add_len (variable_buffer,
|
||||||
|
o - variable_buffer);
|
||||||
}
|
}
|
||||||
dp->stem = stem;
|
dp->stem = stem;
|
||||||
dp->staticpattern = 1;
|
dp->staticpattern = 1;
|
||||||
@@ -545,30 +548,29 @@ enter_prereqs (struct dep *deps, const char *stem)
|
|||||||
d1->file = enter_file (d1->name);
|
d1->file = enter_file (d1->name);
|
||||||
d1->staticpattern = 0;
|
d1->staticpattern = 0;
|
||||||
d1->name = 0;
|
d1->name = 0;
|
||||||
|
if (!stem)
|
||||||
|
/* This file is explicitly mentioned as a prereq. */
|
||||||
|
d1->file->is_explicit = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
return deps;
|
return deps;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Set the intermediate flag. */
|
/* Expand and parse each dependency line.
|
||||||
|
For each dependency of the file, make the 'struct dep' point
|
||||||
static void
|
at the appropriate 'struct file' (which may have to be created). */
|
||||||
set_intermediate (const void *item)
|
void
|
||||||
{
|
|
||||||
struct file *f = (struct file *) item;
|
|
||||||
f->intermediate = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Expand and parse each dependency line. */
|
|
||||||
static void
|
|
||||||
expand_deps (struct file *f)
|
expand_deps (struct file *f)
|
||||||
{
|
{
|
||||||
struct dep *d;
|
struct dep *d;
|
||||||
struct dep **dp;
|
struct dep **dp;
|
||||||
const char *file_stem = f->stem;
|
const char *fstem;
|
||||||
int initialized = 0;
|
int initialized = 0;
|
||||||
|
int changed_dep = 0;
|
||||||
|
|
||||||
f->updating = 0;
|
if (f->snapped)
|
||||||
|
return;
|
||||||
|
f->snapped = 1;
|
||||||
|
|
||||||
/* Walk through the dependencies. For any dependency that needs 2nd
|
/* Walk through the dependencies. For any dependency that needs 2nd
|
||||||
expansion, expand it then insert the result into the list. */
|
expansion, expand it then insert the result into the list. */
|
||||||
@@ -578,7 +580,6 @@ expand_deps (struct file *f)
|
|||||||
{
|
{
|
||||||
char *p;
|
char *p;
|
||||||
struct dep *new, *next;
|
struct dep *new, *next;
|
||||||
char *name = (char *)d->name;
|
|
||||||
|
|
||||||
if (! d->name || ! d->need_2nd_expansion)
|
if (! d->name || ! d->need_2nd_expansion)
|
||||||
{
|
{
|
||||||
@@ -588,16 +589,46 @@ expand_deps (struct file *f)
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* If it's from a static pattern rule, convert the patterns into
|
/* If it's from a static pattern rule, convert the initial pattern in
|
||||||
"$*" so they'll expand properly. */
|
each word to "$*" so they'll expand properly. */
|
||||||
if (d->staticpattern)
|
if (d->staticpattern)
|
||||||
{
|
{
|
||||||
char *o = variable_expand ("");
|
const char *cs = d->name;
|
||||||
o = subst_expand (o, name, "%", "$*", 1, 2, 0);
|
size_t nperc = 0;
|
||||||
*o = '\0';
|
|
||||||
free (name);
|
/* Count the number of % in the string. */
|
||||||
d->name = name = xstrdup (variable_buffer);
|
while ((cs = strchr (cs, '%')) != NULL)
|
||||||
d->staticpattern = 0;
|
{
|
||||||
|
++nperc;
|
||||||
|
++cs;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (nperc)
|
||||||
|
{
|
||||||
|
/* Allocate enough space to replace all % with $*. */
|
||||||
|
size_t slen = strlen (d->name) + nperc + 1;
|
||||||
|
const char *pcs = d->name;
|
||||||
|
char *name = xmalloc (slen);
|
||||||
|
char *s = name;
|
||||||
|
|
||||||
|
/* Substitute the first % in each word. */
|
||||||
|
cs = strchr (pcs, '%');
|
||||||
|
|
||||||
|
while (cs)
|
||||||
|
{
|
||||||
|
s = mempcpy (s, pcs, cs - pcs);
|
||||||
|
*(s++) = '$';
|
||||||
|
*(s++) = '*';
|
||||||
|
pcs = ++cs;
|
||||||
|
|
||||||
|
/* Find the first % after the next whitespace. */
|
||||||
|
cs = strchr (end_of_token (cs), '%');
|
||||||
|
}
|
||||||
|
strcpy (s, pcs);
|
||||||
|
|
||||||
|
free ((char*)d->name);
|
||||||
|
d->name = name;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* We're going to do second expansion so initialize file variables for
|
/* We're going to do second expansion so initialize file variables for
|
||||||
@@ -609,54 +640,130 @@ expand_deps (struct file *f)
|
|||||||
initialized = 1;
|
initialized = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (d->stem != 0)
|
set_file_variables (f, d->stem ? d->stem : f->stem);
|
||||||
f->stem = d->stem;
|
|
||||||
|
|
||||||
set_file_variables (f);
|
|
||||||
|
|
||||||
|
/* Perform second expansion. */
|
||||||
p = variable_expand_for_file (d->name, f);
|
p = variable_expand_for_file (d->name, f);
|
||||||
|
|
||||||
if (d->stem != 0)
|
/* Free the un-expanded name. */
|
||||||
f->stem = file_stem;
|
free ((char*)d->name);
|
||||||
|
|
||||||
/* At this point we don't need the name anymore: free it. */
|
|
||||||
free (name);
|
|
||||||
|
|
||||||
/* Parse the prerequisites and enter them into the file database. */
|
/* Parse the prerequisites and enter them into the file database. */
|
||||||
new = enter_prereqs (split_prereqs (p), d->stem);
|
new = split_prereqs (p);
|
||||||
|
|
||||||
/* If there were no prereqs here (blank!) then throw this one out. */
|
/* If there were no prereqs here (blank!) then throw this one out. */
|
||||||
if (new == 0)
|
if (new == 0)
|
||||||
{
|
{
|
||||||
*dp = d->next;
|
*dp = d->next;
|
||||||
|
changed_dep = 1;
|
||||||
free_dep (d);
|
free_dep (d);
|
||||||
d = *dp;
|
d = *dp;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Add newly parsed prerequisites. */
|
/* Add newly parsed prerequisites. */
|
||||||
|
fstem = d->stem;
|
||||||
next = d->next;
|
next = d->next;
|
||||||
|
changed_dep = 1;
|
||||||
|
free_dep (d);
|
||||||
*dp = new;
|
*dp = new;
|
||||||
for (dp = &new->next, d = new->next; d != 0; dp = &d->next, d = d->next)
|
for (dp = &new, d = new; d != 0; dp = &d->next, d = d->next)
|
||||||
;
|
{
|
||||||
|
d->file = lookup_file (d->name);
|
||||||
|
if (d->file == 0)
|
||||||
|
d->file = enter_file (d->name);
|
||||||
|
d->name = 0;
|
||||||
|
d->stem = fstem;
|
||||||
|
if (!fstem)
|
||||||
|
/* This file is explicitly mentioned as a prereq. */
|
||||||
|
d->file->is_explicit = 1;
|
||||||
|
}
|
||||||
*dp = next;
|
*dp = next;
|
||||||
d = *dp;
|
d = *dp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Shuffle mode assumes '->next' and '->shuf' links both traverse the same
|
||||||
|
dependencies (in different sequences). Regenerate '->shuf' so we don't
|
||||||
|
refer to stale data. */
|
||||||
|
if (changed_dep)
|
||||||
|
shuffle_deps_recursive (f->deps);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Reset the updating flag. */
|
/* Add extra prereqs to the file in question. */
|
||||||
|
|
||||||
|
struct dep *
|
||||||
|
expand_extra_prereqs (const struct variable *extra)
|
||||||
|
{
|
||||||
|
struct dep *d;
|
||||||
|
struct dep *prereqs = extra ? split_prereqs (variable_expand (extra->value)) : NULL;
|
||||||
|
|
||||||
|
for (d = prereqs; d; d = d->next)
|
||||||
|
{
|
||||||
|
d->file = lookup_file (d->name);
|
||||||
|
if (!d->file)
|
||||||
|
d->file = enter_file (d->name);
|
||||||
|
d->name = NULL;
|
||||||
|
d->ignore_automatic_vars = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
return prereqs;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Perform per-file snap operations. */
|
||||||
|
|
||||||
static void
|
static void
|
||||||
reset_updating (const void *item)
|
snap_file (const void *item, void *arg)
|
||||||
{
|
{
|
||||||
struct file *f = (struct file *) item;
|
struct file *f = (struct file*)item;
|
||||||
f->updating = 0;
|
struct dep *prereqs = NULL;
|
||||||
|
|
||||||
|
/* If we're not doing second expansion then reset updating. */
|
||||||
|
if (!second_expansion)
|
||||||
|
f->updating = 0;
|
||||||
|
|
||||||
|
/* More specific setting has priority. */
|
||||||
|
|
||||||
|
/* If .SECONDARY is set with no deps, mark all targets as intermediate,
|
||||||
|
unless the target is a prereq of .NOTINTERMEDIATE. */
|
||||||
|
if (all_secondary && !f->notintermediate)
|
||||||
|
f->intermediate = 1;
|
||||||
|
|
||||||
|
/* If .NOTINTERMEDIATE is set with no deps, mark all targets as
|
||||||
|
notintermediate, unless the target is a prereq of .INTERMEDIATE. */
|
||||||
|
if (no_intermediates && !f->intermediate && !f->secondary)
|
||||||
|
f->notintermediate = 1;
|
||||||
|
|
||||||
|
/* If .EXTRA_PREREQS is set, add them as ignored by automatic variables. */
|
||||||
|
if (f->variables)
|
||||||
|
prereqs = expand_extra_prereqs (lookup_variable_in_set (STRING_SIZE_TUPLE(".EXTRA_PREREQS"), f->variables->set));
|
||||||
|
|
||||||
|
else if (f->is_target)
|
||||||
|
prereqs = copy_dep_chain (arg);
|
||||||
|
|
||||||
|
if (prereqs)
|
||||||
|
{
|
||||||
|
struct dep *d;
|
||||||
|
for (d = prereqs; d; d = d->next)
|
||||||
|
if (streq (f->name, dep_name (d)))
|
||||||
|
/* Skip circular dependencies. */
|
||||||
|
break;
|
||||||
|
|
||||||
|
if (d)
|
||||||
|
/* We broke early: must have found a circular dependency. */
|
||||||
|
free_dep_chain (prereqs);
|
||||||
|
else if (!f->deps)
|
||||||
|
f->deps = prereqs;
|
||||||
|
else
|
||||||
|
{
|
||||||
|
d = f->deps;
|
||||||
|
while (d->next)
|
||||||
|
d = d->next;
|
||||||
|
d->next = prereqs;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* For each dependency of each file, make the 'struct dep' point
|
/* Mark the files depended on by .PRECIOUS, .PHONY, .SILENT,
|
||||||
at the appropriate 'struct file' (which may have to be created).
|
|
||||||
|
|
||||||
Also mark the files depended on by .PRECIOUS, .PHONY, .SILENT,
|
|
||||||
and various other special targets. */
|
and various other special targets. */
|
||||||
|
|
||||||
void
|
void
|
||||||
@@ -670,40 +777,6 @@ snap_deps (void)
|
|||||||
longer define new targets. */
|
longer define new targets. */
|
||||||
snapped_deps = 1;
|
snapped_deps = 1;
|
||||||
|
|
||||||
/* Perform second expansion and enter each dependency name as a file. We
|
|
||||||
must use hash_dump() here because within these loops we likely add new
|
|
||||||
files to the table, possibly causing an in-situ table expansion.
|
|
||||||
|
|
||||||
We only need to do this if second_expansion has been defined; if it
|
|
||||||
hasn't then all deps were expanded as the makefile was read in. If we
|
|
||||||
ever change make to be able to unset .SECONDARY_EXPANSION this will have
|
|
||||||
to change. */
|
|
||||||
|
|
||||||
if (second_expansion)
|
|
||||||
{
|
|
||||||
struct file **file_slot_0 = (struct file **) hash_dump (&files, 0, 0);
|
|
||||||
struct file **file_end = file_slot_0 + files.ht_fill;
|
|
||||||
struct file **file_slot;
|
|
||||||
const char *suffixes;
|
|
||||||
|
|
||||||
/* Expand .SUFFIXES: its prerequisites are used for $$* calc. */
|
|
||||||
f = lookup_file (".SUFFIXES");
|
|
||||||
suffixes = f ? f->name : 0;
|
|
||||||
for (; f != 0; f = f->prev)
|
|
||||||
expand_deps (f);
|
|
||||||
|
|
||||||
/* For every target that's not .SUFFIXES, expand its prerequisites. */
|
|
||||||
|
|
||||||
for (file_slot = file_slot_0; file_slot < file_end; file_slot++)
|
|
||||||
for (f = *file_slot; f != 0; f = f->prev)
|
|
||||||
if (f->name != suffixes)
|
|
||||||
expand_deps (f);
|
|
||||||
free (file_slot_0);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
/* We're not doing second expansion, so reset updating. */
|
|
||||||
hash_map (&files, reset_updating);
|
|
||||||
|
|
||||||
/* Now manage all the special targets. */
|
/* Now manage all the special targets. */
|
||||||
|
|
||||||
for (f = lookup_file (".PRECIOUS"); f != 0; f = f->prev)
|
for (f = lookup_file (".PRECIOUS"); f != 0; f = f->prev)
|
||||||
@@ -727,11 +800,32 @@ snap_deps (void)
|
|||||||
f2->mtime_before_update = NONEXISTENT_MTIME;
|
f2->mtime_before_update = NONEXISTENT_MTIME;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (f = lookup_file (".NOTINTERMEDIATE"); f != 0; f = f->prev)
|
||||||
|
/* Mark .NOTINTERMEDIATE deps as notintermediate files. */
|
||||||
|
if (f->deps)
|
||||||
|
for (d = f->deps; d != 0; d = d->next)
|
||||||
|
for (f2 = d->file; f2 != 0; f2 = f2->prev)
|
||||||
|
f2->notintermediate = 1;
|
||||||
|
/* .NOTINTERMEDIATE with no deps marks all files as notintermediate. */
|
||||||
|
else
|
||||||
|
no_intermediates = 1;
|
||||||
|
|
||||||
|
/* The same file connot be both .INTERMEDIATE and .NOTINTERMEDIATE.
|
||||||
|
However, it is possible for a file to be .INTERMEDIATE and also match a
|
||||||
|
.NOTINTERMEDIATE pattern. In that case, the intermediate file has
|
||||||
|
priority over the notintermediate pattern. This priority is enforced by
|
||||||
|
pattern_search. */
|
||||||
|
|
||||||
for (f = lookup_file (".INTERMEDIATE"); f != 0; f = f->prev)
|
for (f = lookup_file (".INTERMEDIATE"); f != 0; f = f->prev)
|
||||||
/* Mark .INTERMEDIATE deps as intermediate files. */
|
/* Mark .INTERMEDIATE deps as intermediate files. */
|
||||||
for (d = f->deps; d != 0; d = d->next)
|
for (d = f->deps; d != 0; d = d->next)
|
||||||
for (f2 = d->file; f2 != 0; f2 = f2->prev)
|
for (f2 = d->file; f2 != 0; f2 = f2->prev)
|
||||||
f2->intermediate = 1;
|
if (f2->notintermediate)
|
||||||
|
OS (fatal, NILF,
|
||||||
|
_("%s cannot be both .NOTINTERMEDIATE and .INTERMEDIATE"),
|
||||||
|
f2->name);
|
||||||
|
else
|
||||||
|
f2->intermediate = 1;
|
||||||
/* .INTERMEDIATE with no deps does nothing.
|
/* .INTERMEDIATE with no deps does nothing.
|
||||||
Marking all files as intermediates is useless since the goal targets
|
Marking all files as intermediates is useless since the goal targets
|
||||||
would be deleted after they are built. */
|
would be deleted after they are built. */
|
||||||
@@ -741,13 +835,19 @@ snap_deps (void)
|
|||||||
if (f->deps)
|
if (f->deps)
|
||||||
for (d = f->deps; d != 0; d = d->next)
|
for (d = f->deps; d != 0; d = d->next)
|
||||||
for (f2 = d->file; f2 != 0; f2 = f2->prev)
|
for (f2 = d->file; f2 != 0; f2 = f2->prev)
|
||||||
|
if (f2->notintermediate)
|
||||||
|
OS (fatal, NILF,
|
||||||
|
_("%s cannot be both .NOTINTERMEDIATE and .SECONDARY"),
|
||||||
|
f2->name);
|
||||||
|
else
|
||||||
f2->intermediate = f2->secondary = 1;
|
f2->intermediate = f2->secondary = 1;
|
||||||
/* .SECONDARY with no deps listed marks *all* files that way. */
|
/* .SECONDARY with no deps listed marks *all* files that way. */
|
||||||
else
|
else
|
||||||
{
|
all_secondary = 1;
|
||||||
all_secondary = 1;
|
|
||||||
hash_map (&files, set_intermediate);
|
if (no_intermediates && all_secondary)
|
||||||
}
|
O (fatal, NILF,
|
||||||
|
_(".NOTINTERMEDIATE and .SECONDARY are mutually exclusive"));
|
||||||
|
|
||||||
f = lookup_file (".EXPORT_ALL_VARIABLES");
|
f = lookup_file (".EXPORT_ALL_VARIABLES");
|
||||||
if (f != 0 && f->is_target)
|
if (f != 0 && f->is_target)
|
||||||
@@ -777,7 +877,28 @@ snap_deps (void)
|
|||||||
|
|
||||||
f = lookup_file (".NOTPARALLEL");
|
f = lookup_file (".NOTPARALLEL");
|
||||||
if (f != 0 && f->is_target)
|
if (f != 0 && f->is_target)
|
||||||
not_parallel = 1;
|
{
|
||||||
|
struct dep *d2;
|
||||||
|
|
||||||
|
if (!f->deps)
|
||||||
|
not_parallel = 1;
|
||||||
|
else
|
||||||
|
/* Set a wait point between every prerequisite of each target. */
|
||||||
|
for (d = f->deps; d != NULL; d = d->next)
|
||||||
|
for (f2 = d->file; f2 != NULL; f2 = f2->prev)
|
||||||
|
if (f2->deps)
|
||||||
|
for (d2 = f2->deps->next; d2 != NULL; d2 = d2->next)
|
||||||
|
d2->wait_here = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
struct dep *prereqs = expand_extra_prereqs (lookup_variable (STRING_SIZE_TUPLE(".EXTRA_PREREQS")));
|
||||||
|
|
||||||
|
/* Perform per-file snap operations. */
|
||||||
|
hash_map_arg(&files, snap_file, prereqs);
|
||||||
|
|
||||||
|
free_dep_chain (prereqs);
|
||||||
|
}
|
||||||
|
|
||||||
#ifndef NO_MINUS_C_MINUS_O
|
#ifndef NO_MINUS_C_MINUS_O
|
||||||
/* If .POSIX was defined, remove OUTPUT_OPTION to comply. */
|
/* If .POSIX was defined, remove OUTPUT_OPTION to comply. */
|
||||||
@@ -887,13 +1008,16 @@ file_timestamp_sprintf (char *p, FILE_TIMESTAMP ts)
|
|||||||
struct tm *tm = localtime (&t);
|
struct tm *tm = localtime (&t);
|
||||||
|
|
||||||
if (tm)
|
if (tm)
|
||||||
sprintf (p, "%04d-%02d-%02d %02d:%02d:%02d",
|
{
|
||||||
tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday,
|
intmax_t year = tm->tm_year;
|
||||||
tm->tm_hour, tm->tm_min, tm->tm_sec);
|
sprintf (p, "%04" PRIdMAX "-%02d-%02d %02d:%02d:%02d",
|
||||||
|
year + 1900, tm->tm_mon + 1, tm->tm_mday,
|
||||||
|
tm->tm_hour, tm->tm_min, tm->tm_sec);
|
||||||
|
}
|
||||||
else if (t < 0)
|
else if (t < 0)
|
||||||
sprintf (p, "%ld", (long) t);
|
sprintf (p, "%" PRIdMAX, (intmax_t) t);
|
||||||
else
|
else
|
||||||
sprintf (p, "%lu", (unsigned long) t);
|
sprintf (p, "%" PRIuMAX, (uintmax_t) t);
|
||||||
p += strlen (p);
|
p += strlen (p);
|
||||||
|
|
||||||
/* Append nanoseconds as a fraction, but remove trailing zeros. We don't
|
/* Append nanoseconds as a fraction, but remove trailing zeros. We don't
|
||||||
@@ -919,17 +1043,17 @@ print_prereqs (const struct dep *deps)
|
|||||||
/* Print all normal dependencies; note any order-only deps. */
|
/* Print all normal dependencies; note any order-only deps. */
|
||||||
for (; deps != 0; deps = deps->next)
|
for (; deps != 0; deps = deps->next)
|
||||||
if (! deps->ignore_mtime)
|
if (! deps->ignore_mtime)
|
||||||
printf (" %s", dep_name (deps));
|
printf (" %s%s", deps->wait_here ? ".WAIT " : "", dep_name (deps));
|
||||||
else if (! ood)
|
else if (! ood)
|
||||||
ood = deps;
|
ood = deps;
|
||||||
|
|
||||||
/* Print order-only deps, if we have any. */
|
/* Print order-only deps, if we have any. */
|
||||||
if (ood)
|
if (ood)
|
||||||
{
|
{
|
||||||
printf (" | %s", dep_name (ood));
|
printf (" | %s%s", ood->wait_here ? ".WAIT " : "", dep_name (ood));
|
||||||
for (ood = ood->next; ood != 0; ood = ood->next)
|
for (ood = ood->next; ood != 0; ood = ood->next)
|
||||||
if (ood->ignore_mtime)
|
if (ood->ignore_mtime)
|
||||||
printf (" %s", dep_name (ood));
|
printf (" %s%s", ood->wait_here ? ".WAIT " : "", dep_name (ood));
|
||||||
}
|
}
|
||||||
|
|
||||||
putchar ('\n');
|
putchar ('\n');
|
||||||
@@ -983,6 +1107,10 @@ print_file (const void *item)
|
|||||||
printf (_("# Implicit/static pattern stem: '%s'\n"), f->stem);
|
printf (_("# Implicit/static pattern stem: '%s'\n"), f->stem);
|
||||||
if (f->intermediate)
|
if (f->intermediate)
|
||||||
puts (_("# File is an intermediate prerequisite."));
|
puts (_("# File is an intermediate prerequisite."));
|
||||||
|
if (f->notintermediate)
|
||||||
|
puts (_("# File is a prerequisite of .NOTINTERMEDIATE."));
|
||||||
|
if (f->secondary)
|
||||||
|
puts (_("# File is secondary (prerequisite of .SECONDARY)."));
|
||||||
if (f->also_make != 0)
|
if (f->also_make != 0)
|
||||||
{
|
{
|
||||||
const struct dep *d;
|
const struct dep *d;
|
||||||
@@ -1130,8 +1258,7 @@ build_target_list (char *value)
|
|||||||
p = &value[off];
|
p = &value[off];
|
||||||
}
|
}
|
||||||
|
|
||||||
memcpy (p, f->name, l);
|
p = mempcpy (p, f->name, l);
|
||||||
p += l;
|
|
||||||
*(p++) = ' ';
|
*(p++) = ' ';
|
||||||
}
|
}
|
||||||
*(p-1) = '\0';
|
*(p-1) = '\0';
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/* Definition of target file data structures for GNU Make.
|
/* Definition of target file data structures for GNU Make.
|
||||||
Copyright (C) 1988-2019 Free Software Foundation, Inc.
|
Copyright (C) 1988-2022 Free Software Foundation, Inc.
|
||||||
This file is part of GNU Make.
|
This file is part of GNU Make.
|
||||||
|
|
||||||
GNU Make is free software; you can redistribute it and/or modify it under the
|
GNU Make is free software; you can redistribute it and/or modify it under the
|
||||||
@@ -12,7 +12,7 @@ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|||||||
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
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
|
You should have received a copy of the GNU General Public License along with
|
||||||
this program. If not, see <http://www.gnu.org/licenses/>. */
|
this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||||
|
|
||||||
|
|
||||||
/* Structure that represents the info on one file
|
/* Structure that represents the info on one file
|
||||||
@@ -21,6 +21,11 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
|
|||||||
|
|
||||||
#include "hash.h"
|
#include "hash.h"
|
||||||
|
|
||||||
|
struct commands;
|
||||||
|
struct dep;
|
||||||
|
struct variable;
|
||||||
|
struct variable_set_list;
|
||||||
|
|
||||||
struct file
|
struct file
|
||||||
{
|
{
|
||||||
const char *name;
|
const char *name;
|
||||||
@@ -79,6 +84,7 @@ struct file
|
|||||||
unsigned int builtin:1; /* True if the file is a builtin rule. */
|
unsigned int builtin:1; /* True if the file is a builtin rule. */
|
||||||
unsigned int precious:1; /* Non-0 means don't delete file on quit */
|
unsigned int precious:1; /* Non-0 means don't delete file on quit */
|
||||||
unsigned int loaded:1; /* True if the file is a loaded object. */
|
unsigned int loaded:1; /* True if the file is a loaded object. */
|
||||||
|
unsigned int unloaded:1; /* True if this loaded object was unloaded. */
|
||||||
unsigned int low_resolution_time:1; /* Nonzero if this file's time stamp
|
unsigned int low_resolution_time:1; /* Nonzero if this file's time stamp
|
||||||
has only one-second resolution. */
|
has only one-second resolution. */
|
||||||
unsigned int tried_implicit:1; /* Nonzero if have searched
|
unsigned int tried_implicit:1; /* Nonzero if have searched
|
||||||
@@ -91,8 +97,11 @@ struct file
|
|||||||
unsigned int phony:1; /* Nonzero if this is a phony file
|
unsigned int phony:1; /* Nonzero if this is a phony file
|
||||||
i.e., a prerequisite of .PHONY. */
|
i.e., a prerequisite of .PHONY. */
|
||||||
unsigned int intermediate:1;/* Nonzero if this is an intermediate file. */
|
unsigned int intermediate:1;/* Nonzero if this is an intermediate file. */
|
||||||
|
unsigned int is_explicit:1; /* Nonzero if explicitly mentioned. */
|
||||||
unsigned int secondary:1; /* Nonzero means remove_intermediates should
|
unsigned int secondary:1; /* Nonzero means remove_intermediates should
|
||||||
not delete it. */
|
not delete it. */
|
||||||
|
unsigned int notintermediate:1; /* Nonzero means a file is a prereq to
|
||||||
|
.NOTINTERMEDIATE. */
|
||||||
unsigned int dontcare:1; /* Nonzero if no complaint is to be made if
|
unsigned int dontcare:1; /* Nonzero if no complaint is to be made if
|
||||||
this target cannot be remade. */
|
this target cannot be remade. */
|
||||||
unsigned int ignore_vpath:1;/* Nonzero if we threw out VPATH name. */
|
unsigned int ignore_vpath:1;/* Nonzero if we threw out VPATH name. */
|
||||||
@@ -100,6 +109,10 @@ struct file
|
|||||||
pattern-specific variables. */
|
pattern-specific variables. */
|
||||||
unsigned int no_diag:1; /* True if the file failed to update and no
|
unsigned int no_diag:1; /* True if the file failed to update and no
|
||||||
diagnostics has been issued (dontcare). */
|
diagnostics has been issued (dontcare). */
|
||||||
|
unsigned int was_shuffled:1; /* Did we already shuffle 'deps'? used when
|
||||||
|
--shuffle passes through the graph. */
|
||||||
|
unsigned int snapped:1; /* True if the deps of this file have been
|
||||||
|
secondary expanded. */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -110,6 +123,8 @@ struct file *lookup_file (const char *name);
|
|||||||
struct file *enter_file (const char *name);
|
struct file *enter_file (const char *name);
|
||||||
struct dep *split_prereqs (char *prereqstr);
|
struct dep *split_prereqs (char *prereqstr);
|
||||||
struct dep *enter_prereqs (struct dep *prereqs, const char *stem);
|
struct dep *enter_prereqs (struct dep *prereqs, const char *stem);
|
||||||
|
void expand_deps (struct file *f);
|
||||||
|
struct dep *expand_extra_prereqs (const struct variable *extra);
|
||||||
void remove_intermediates (int sig);
|
void remove_intermediates (int sig);
|
||||||
void snap_deps (void);
|
void snap_deps (void);
|
||||||
void rename_file (struct file *file, const char *name);
|
void rename_file (struct file *file, const char *name);
|
||||||
@@ -197,6 +212,8 @@ FILE_TIMESTAMP f_mtime (struct file *file, int search);
|
|||||||
<< FILE_TIMESTAMP_LO_BITS) \
|
<< FILE_TIMESTAMP_LO_BITS) \
|
||||||
+ ORDINARY_MTIME_MIN + FILE_TIMESTAMPS_PER_S - 1)
|
+ ORDINARY_MTIME_MIN + FILE_TIMESTAMPS_PER_S - 1)
|
||||||
|
|
||||||
|
#define is_ordinary_mtime(_t) ((_t) >= ORDINARY_MTIME_MIN && (_t) <= ORDINARY_MTIME_MAX)
|
||||||
|
|
||||||
/* Modtime value to use for 'infinitely new'. We used to get the current time
|
/* 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
|
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
|
trouble when the machine running make and the machine holding a file have
|
||||||
|
|||||||
610
src/function.c
610
src/function.c
File diff suppressed because it is too large
Load Diff
@@ -3,7 +3,7 @@ NOTE: getopt is now part of the C library, so if you don't know what
|
|||||||
"Keep this file name-space clean" means, talk to drepper@gnu.org
|
"Keep this file name-space clean" means, talk to drepper@gnu.org
|
||||||
before changing it!
|
before changing it!
|
||||||
|
|
||||||
Copyright (C) 1987-2019 Free Software Foundation, Inc.
|
Copyright (C) 1987-2022 Free Software Foundation, Inc.
|
||||||
|
|
||||||
NOTE: The canonical source of this file is maintained with the GNU C Library.
|
NOTE: The canonical source of this file is maintained with the GNU C Library.
|
||||||
Bugs can be reported to bug-glibc@gnu.org.
|
Bugs can be reported to bug-glibc@gnu.org.
|
||||||
@@ -18,7 +18,7 @@ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|||||||
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
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
|
You should have received a copy of the GNU General Public License along with
|
||||||
this program. If not, see <http://www.gnu.org/licenses/>. */
|
this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||||
|
|
||||||
/* This tells Alpha OSF/1 not to define a getopt prototype in <stdio.h>.
|
/* This tells Alpha OSF/1 not to define a getopt prototype in <stdio.h>.
|
||||||
Ditto for AIX 3.2 and <stdlib.h>. */
|
Ditto for AIX 3.2 and <stdlib.h>. */
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/* Declarations for getopt.
|
/* Declarations for getopt.
|
||||||
Copyright (C) 1989-2019 Free Software Foundation, Inc.
|
Copyright (C) 1989-2022 Free Software Foundation, Inc.
|
||||||
|
|
||||||
NOTE: The canonical source of this file is maintained with the GNU C Library.
|
NOTE: The canonical source of this file is maintained with the GNU C Library.
|
||||||
Bugs can be reported to bug-glibc@gnu.org.
|
Bugs can be reported to bug-glibc@gnu.org.
|
||||||
@@ -14,7 +14,7 @@ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|||||||
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
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
|
You should have received a copy of the GNU General Public License along with
|
||||||
this program. If not, see <http://www.gnu.org/licenses/>. */
|
this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||||
|
|
||||||
#ifndef _GETOPT_H
|
#ifndef _GETOPT_H
|
||||||
#define _GETOPT_H 1
|
#define _GETOPT_H 1
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/* getopt_long and getopt_long_only entry points for GNU getopt.
|
/* getopt_long and getopt_long_only entry points for GNU getopt.
|
||||||
Copyright (C) 1987-1994, 1996-2019 Free Software Foundation, Inc.
|
Copyright (C) 1987-1994, 1996-2022 Free Software Foundation, Inc.
|
||||||
|
|
||||||
NOTE: The canonical source of this file is maintained with the GNU C Library.
|
NOTE: The canonical source of this file is maintained with the GNU C Library.
|
||||||
Bugs can be reported to bug-glibc@gnu.org.
|
Bugs can be reported to bug-glibc@gnu.org.
|
||||||
@@ -14,7 +14,7 @@ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|||||||
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
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
|
You should have received a copy of the GNU General Public License along with
|
||||||
this program. If not, see <http://www.gnu.org/licenses/>. */
|
this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
#ifdef HAVE_CONFIG_H
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/* Convenience header for conditional use of GNU <libintl.h>.
|
/* Convenience header for conditional use of GNU <libintl.h>.
|
||||||
Copyright (C) 1995-2019 Free Software Foundation, Inc.
|
Copyright (C) 1995-2022 Free Software Foundation, Inc.
|
||||||
This file is part of GNU Make.
|
This file is part of GNU Make.
|
||||||
|
|
||||||
GNU Make is free software; you can redistribute it and/or modify it under the
|
GNU Make is free software; you can redistribute it and/or modify it under the
|
||||||
@@ -12,7 +12,7 @@ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|||||||
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
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
|
You should have received a copy of the GNU General Public License along with
|
||||||
this program. If not, see <http://www.gnu.org/licenses/>. */
|
this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||||
|
|
||||||
#ifndef _LIBGETTEXT_H
|
#ifndef _LIBGETTEXT_H
|
||||||
#define _LIBGETTEXT_H 1
|
#define _LIBGETTEXT_H 1
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
;; Contents of the (gnu make) Guile module
|
;; Contents of the (gnu make) Guile module
|
||||||
;; Copyright (C) 2011-2019 Free Software Foundation, Inc.
|
;; Copyright (C) 2011-2022 Free Software Foundation, Inc.
|
||||||
;; This file is part of GNU Make.
|
;; This file is part of GNU Make.
|
||||||
;;
|
;;
|
||||||
;; GNU Make is free software; you can redistribute it and/or modify it under
|
;; GNU Make is free software; you can redistribute it and/or modify it under
|
||||||
@@ -13,7 +13,7 @@
|
|||||||
;; details.
|
;; details.
|
||||||
;;
|
;;
|
||||||
;; You should have received a copy of the GNU General Public License along
|
;; You should have received a copy of the GNU General Public License along
|
||||||
;; with this program. If not, see <http://www.gnu.org/licenses/>.
|
;; with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
(define (to-string-maybe x)
|
(define (to-string-maybe x)
|
||||||
(cond
|
(cond
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/* External interfaces usable by dynamic objects loaded into GNU Make.
|
/* External interfaces usable by dynamic objects loaded into GNU Make.
|
||||||
--THIS API IS A "TECHNOLOGY PREVIEW" ONLY. IT IS NOT A STABLE INTERFACE--
|
--THIS API IS A "TECHNOLOGY PREVIEW" ONLY. IT IS NOT A STABLE INTERFACE--
|
||||||
|
|
||||||
Copyright (C) 2013-2019 Free Software Foundation, Inc.
|
Copyright (C) 2013-2022 Free Software Foundation, Inc.
|
||||||
This file is part of GNU Make.
|
This file is part of GNU Make.
|
||||||
|
|
||||||
GNU Make is free software; you can redistribute it and/or modify it under the
|
GNU Make is free software; you can redistribute it and/or modify it under the
|
||||||
@@ -14,7 +14,7 @@ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|||||||
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
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
|
You should have received a copy of the GNU General Public License along with
|
||||||
this program. If not, see <http://www.gnu.org/licenses/>. */
|
this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||||
|
|
||||||
#ifndef _GNUMAKE_H_
|
#ifndef _GNUMAKE_H_
|
||||||
#define _GNUMAKE_H_
|
#define _GNUMAKE_H_
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/* GNU Guile interface for GNU Make.
|
/* GNU Guile interface for GNU Make.
|
||||||
Copyright (C) 2011-2019 Free Software Foundation, Inc.
|
Copyright (C) 2011-2022 Free Software Foundation, Inc.
|
||||||
This file is part of GNU Make.
|
This file is part of GNU Make.
|
||||||
|
|
||||||
GNU Make is free software; you can redistribute it and/or modify it under the
|
GNU Make is free software; you can redistribute it and/or modify it under the
|
||||||
@@ -12,7 +12,7 @@ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|||||||
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
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
|
You should have received a copy of the GNU General Public License along with
|
||||||
this program. If not, see <http://www.gnu.org/licenses/>. */
|
this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||||
|
|
||||||
#include "makeint.h"
|
#include "makeint.h"
|
||||||
|
|
||||||
|
|||||||
83
src/hash.c
83
src/hash.c
@@ -12,10 +12,11 @@ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|||||||
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
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
|
You should have received a copy of the GNU General Public License along with
|
||||||
this program. If not, see <http://www.gnu.org/licenses/>. */
|
this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||||
|
|
||||||
#include "makeint.h"
|
#include "makeint.h"
|
||||||
#include "hash.h"
|
#include "hash.h"
|
||||||
|
#include <assert.h>
|
||||||
|
|
||||||
#define CALLOC(t, n) ((t *) xcalloc (sizeof (t) * (n)))
|
#define CALLOC(t, n) ((t *) xcalloc (sizeof (t) * (n)))
|
||||||
#define MALLOC(t, n) ((t *) xmalloc (sizeof (t) * (n)))
|
#define MALLOC(t, n) ((t *) xmalloc (sizeof (t) * (n)))
|
||||||
@@ -43,11 +44,11 @@ hash_init (struct hash_table *ht, unsigned long size,
|
|||||||
{
|
{
|
||||||
ht->ht_size = round_up_2 (size);
|
ht->ht_size = round_up_2 (size);
|
||||||
ht->ht_empty_slots = ht->ht_size;
|
ht->ht_empty_slots = ht->ht_size;
|
||||||
ht->ht_vec = (void**) CALLOC (struct token *, ht->ht_size);
|
ht->ht_vec = CALLOC (void *, ht->ht_size);
|
||||||
if (ht->ht_vec == 0)
|
if (ht->ht_vec == 0)
|
||||||
{
|
{
|
||||||
fprintf (stderr, _("can't allocate %lu bytes for hash table: memory exhausted"),
|
fprintf (stderr, _("can't allocate %lu bytes for hash table: memory exhausted"),
|
||||||
ht->ht_size * (unsigned long) sizeof (struct token *));
|
ht->ht_size * (unsigned long) sizeof (void *));
|
||||||
exit (MAKE_TROUBLE);
|
exit (MAKE_TROUBLE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -259,7 +260,7 @@ hash_rehash (struct hash_table *ht)
|
|||||||
ht->ht_capacity = ht->ht_size - (ht->ht_size >> 4);
|
ht->ht_capacity = ht->ht_size - (ht->ht_size >> 4);
|
||||||
}
|
}
|
||||||
ht->ht_rehashes++;
|
ht->ht_rehashes++;
|
||||||
ht->ht_vec = (void **) CALLOC (struct token *, ht->ht_size);
|
ht->ht_vec = CALLOC (void *, ht->ht_size);
|
||||||
|
|
||||||
for (ovp = old_vec; ovp < &old_vec[old_ht_size]; ovp++)
|
for (ovp = old_vec; ovp < &old_vec[old_ht_size]; ovp++)
|
||||||
{
|
{
|
||||||
@@ -364,7 +365,8 @@ round_up_2 (unsigned long n)
|
|||||||
r += val; \
|
r += val; \
|
||||||
} while(0);
|
} while(0);
|
||||||
|
|
||||||
unsigned jhash(unsigned const char *k, int length)
|
unsigned int
|
||||||
|
jhash(unsigned const char *k, int length)
|
||||||
{
|
{
|
||||||
unsigned int a, b, c;
|
unsigned int a, b, c;
|
||||||
|
|
||||||
@@ -408,12 +410,16 @@ unsigned jhash(unsigned const char *k, int length)
|
|||||||
return c;
|
return c;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define UINTSZ sizeof (unsigned int)
|
||||||
|
|
||||||
#ifdef WORDS_BIGENDIAN
|
#ifdef WORDS_BIGENDIAN
|
||||||
/* The ifs are ordered from the first byte in memory to the last. */
|
/* The ifs are ordered from the first byte in memory to the last. */
|
||||||
#define sum_up_to_nul(r, p, flag) \
|
#define sum_up_to_nul(r, p, plen, flag) \
|
||||||
do { \
|
do { \
|
||||||
unsigned int val; \
|
unsigned int val = 0; \
|
||||||
memcpy(&val, (p), 4); \
|
size_t pn = (plen); \
|
||||||
|
size_t n = pn < UINTSZ ? pn : UINTSZ; \
|
||||||
|
memcpy (&val, (p), n); \
|
||||||
if ((val & 0xFF000000) == 0) \
|
if ((val & 0xFF000000) == 0) \
|
||||||
flag = 1; \
|
flag = 1; \
|
||||||
else if ((val & 0xFF0000) == 0) \
|
else if ((val & 0xFF0000) == 0) \
|
||||||
@@ -427,51 +433,60 @@ unsigned jhash(unsigned const char *k, int length)
|
|||||||
/* First detect the presence of zeroes. If there is none, we can
|
/* First detect the presence of zeroes. If there is none, we can
|
||||||
sum the 4 bytes directly. Otherwise, the ifs are ordered as in the
|
sum the 4 bytes directly. Otherwise, the ifs are ordered as in the
|
||||||
big endian case, from the first byte in memory to the last. */
|
big endian case, from the first byte in memory to the last. */
|
||||||
#define sum_up_to_nul(r, p, flag) \
|
#define sum_up_to_nul(r, p, plen, flag) \
|
||||||
do { \
|
do { \
|
||||||
unsigned int val; \
|
unsigned int val = 0; \
|
||||||
unsigned int zeroes; \
|
size_t pn = (plen); \
|
||||||
memcpy(&val, (p), 4); \
|
size_t n = pn < UINTSZ ? pn : UINTSZ; \
|
||||||
zeroes = ((val - 0x01010101) & ~val); \
|
memcpy (&val, (p), n); \
|
||||||
if (!(zeroes & 0x80808080)) \
|
flag = ((val - 0x01010101) & ~val) & 0x80808080; \
|
||||||
r += val; \
|
if (!flag) \
|
||||||
else if ((val & 0xFF) == 0) \
|
r += val; \
|
||||||
flag = 1; \
|
else if (val & 0xFF) \
|
||||||
else if ((val & 0xFF00) == 0) \
|
{ \
|
||||||
r += val & 0xFF, flag = 1; \
|
if ((val & 0xFF00) == 0) \
|
||||||
else if ((val & 0xFF0000) == 0) \
|
r += val & 0xFF; \
|
||||||
r += val & 0xFFFF, flag = 1; \
|
else if ((val & 0xFF0000) == 0) \
|
||||||
else \
|
r += val & 0xFFFF; \
|
||||||
r += val, flag = 1; \
|
else \
|
||||||
|
r += val; \
|
||||||
|
} \
|
||||||
} while (0)
|
} while (0)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* This function performs magic which is correct but causes ASAN heartburn
|
unsigned int
|
||||||
when we pass in a global constant string (at least). */
|
jhash_string(unsigned const char *k)
|
||||||
__attribute__((no_sanitize_address))
|
|
||||||
unsigned jhash_string(unsigned const char *k)
|
|
||||||
{
|
{
|
||||||
unsigned int a, b, c;
|
unsigned int a, b, c;
|
||||||
unsigned int have_nul = 0;
|
unsigned int have_nul = 0;
|
||||||
unsigned const char *start = k;
|
unsigned const char *start = k;
|
||||||
|
size_t klen = strlen ((const char*)k);
|
||||||
|
|
||||||
/* Set up the internal state */
|
/* Set up the internal state */
|
||||||
a = b = c = JHASH_INITVAL;
|
a = b = c = JHASH_INITVAL;
|
||||||
|
|
||||||
/* All but the last block: affect some 32 bits of (a,b,c) */
|
/* All but the last block: affect some 32 bits of (a,b,c) */
|
||||||
for (;;) {
|
for (;;) {
|
||||||
sum_up_to_nul(a, k, have_nul);
|
sum_up_to_nul(a, k, klen, have_nul);
|
||||||
if (have_nul)
|
if (have_nul)
|
||||||
break;
|
break;
|
||||||
k += 4;
|
k += UINTSZ;
|
||||||
sum_up_to_nul(b, k, have_nul);
|
assert (klen >= UINTSZ);
|
||||||
|
klen -= UINTSZ;
|
||||||
|
|
||||||
|
sum_up_to_nul(b, k, klen, have_nul);
|
||||||
if (have_nul)
|
if (have_nul)
|
||||||
break;
|
break;
|
||||||
k += 4;
|
k += UINTSZ;
|
||||||
sum_up_to_nul(c, k, have_nul);
|
assert (klen >= UINTSZ);
|
||||||
|
klen -= UINTSZ;
|
||||||
|
|
||||||
|
sum_up_to_nul(c, k, klen, have_nul);
|
||||||
if (have_nul)
|
if (have_nul)
|
||||||
break;
|
break;
|
||||||
k += 4;
|
k += UINTSZ;
|
||||||
|
assert (klen >= UINTSZ);
|
||||||
|
klen -= UINTSZ;
|
||||||
jhash_mix(a, b, c);
|
jhash_mix(a, b, c);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
10
src/hash.h
10
src/hash.h
@@ -12,7 +12,7 @@ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|||||||
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
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
|
You should have received a copy of the GNU General Public License along with
|
||||||
this program. If not, see <http://www.gnu.org/licenses/>. */
|
this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||||
|
|
||||||
#ifndef _hash_h_
|
#ifndef _hash_h_
|
||||||
#define _hash_h_
|
#define _hash_h_
|
||||||
@@ -56,9 +56,9 @@ struct hash_table
|
|||||||
typedef int (*qsort_cmp_t) __P((void const *, void const *));
|
typedef int (*qsort_cmp_t) __P((void const *, void const *));
|
||||||
|
|
||||||
void hash_init __P((struct hash_table *ht, unsigned long size,
|
void hash_init __P((struct hash_table *ht, unsigned long size,
|
||||||
hash_func_t hash_1, hash_func_t hash_2, hash_cmp_func_t hash_cmp));
|
hash_func_t hash_1, hash_func_t hash_2, hash_cmp_func_t hash_cmp));
|
||||||
void hash_load __P((struct hash_table *ht, void *item_table,
|
void hash_load __P((struct hash_table *ht, void *item_table,
|
||||||
unsigned long cardinality, unsigned long size));
|
unsigned long cardinality, unsigned long size));
|
||||||
void **hash_find_slot __P((struct hash_table *ht, void const *key));
|
void **hash_find_slot __P((struct hash_table *ht, void const *key));
|
||||||
void *hash_find_item __P((struct hash_table *ht, void const *key));
|
void *hash_find_item __P((struct hash_table *ht, void const *key));
|
||||||
void *hash_insert __P((struct hash_table *ht, const void *item));
|
void *hash_insert __P((struct hash_table *ht, const void *item));
|
||||||
@@ -154,7 +154,7 @@ extern void *hash_deleted_item;
|
|||||||
#define ISTRING_HASH_1(KEY, RESULT) do { \
|
#define ISTRING_HASH_1(KEY, RESULT) do { \
|
||||||
unsigned char const *_key_ = (unsigned char const *) (KEY) - 1; \
|
unsigned char const *_key_ = (unsigned char const *) (KEY) - 1; \
|
||||||
while (*++_key_) \
|
while (*++_key_) \
|
||||||
(RESULT) += ((isupper (*_key_) ? tolower (*_key_) : *_key_) << (_key_[1] & 0xf)); \
|
(RESULT) += (tolower (*_key_) << (_key_[1] & 0xf)); \
|
||||||
} while (0)
|
} while (0)
|
||||||
#define return_ISTRING_HASH_1(KEY) do { \
|
#define return_ISTRING_HASH_1(KEY) do { \
|
||||||
unsigned long _result_ = 0; \
|
unsigned long _result_ = 0; \
|
||||||
@@ -165,7 +165,7 @@ extern void *hash_deleted_item;
|
|||||||
#define ISTRING_HASH_2(KEY, RESULT) do { \
|
#define ISTRING_HASH_2(KEY, RESULT) do { \
|
||||||
unsigned char const *_key_ = (unsigned char const *) (KEY) - 1; \
|
unsigned char const *_key_ = (unsigned char const *) (KEY) - 1; \
|
||||||
while (*++_key_) \
|
while (*++_key_) \
|
||||||
(RESULT) += ((isupper (*_key_) ? tolower (*_key_) : *_key_) << (_key_[1] & 0x7)); \
|
(RESULT) += (tolower (*_key_) << (_key_[1] & 0x7)); \
|
||||||
} while (0)
|
} while (0)
|
||||||
#define return_ISTRING_HASH_2(KEY) do { \
|
#define return_ISTRING_HASH_2(KEY) do { \
|
||||||
unsigned long _result_ = 0; \
|
unsigned long _result_ = 0; \
|
||||||
|
|||||||
398
src/implicit.c
398
src/implicit.c
@@ -1,5 +1,5 @@
|
|||||||
/* Implicit rule searching for GNU Make.
|
/* Implicit rule searching for GNU Make.
|
||||||
Copyright (C) 1988-2019 Free Software Foundation, Inc.
|
Copyright (C) 1988-2022 Free Software Foundation, Inc.
|
||||||
This file is part of GNU Make.
|
This file is part of GNU Make.
|
||||||
|
|
||||||
GNU Make is free software; you can redistribute it and/or modify it under the
|
GNU Make is free software; you can redistribute it and/or modify it under the
|
||||||
@@ -12,7 +12,7 @@ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|||||||
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
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
|
You should have received a copy of the GNU General Public License along with
|
||||||
this program. If not, see <http://www.gnu.org/licenses/>. */
|
this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||||
|
|
||||||
#include "makeint.h"
|
#include "makeint.h"
|
||||||
#include "filedef.h"
|
#include "filedef.h"
|
||||||
@@ -22,9 +22,12 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
|
|||||||
#include "variable.h"
|
#include "variable.h"
|
||||||
#include "job.h" /* struct child, used inside commands.h */
|
#include "job.h" /* struct child, used inside commands.h */
|
||||||
#include "commands.h" /* set_file_variables */
|
#include "commands.h" /* set_file_variables */
|
||||||
|
#include "shuffle.h"
|
||||||
|
#include <assert.h>
|
||||||
|
|
||||||
static int pattern_search (struct file *file, int archive,
|
static int pattern_search (struct file *file, int archive,
|
||||||
unsigned int depth, unsigned int recursions);
|
unsigned int depth, unsigned int recursions,
|
||||||
|
int allow_compat_rules);
|
||||||
|
|
||||||
/* For a FILE which has no commands specified, try to figure out some
|
/* For a FILE which has no commands specified, try to figure out some
|
||||||
from the implicit pattern rules.
|
from the implicit pattern rules.
|
||||||
@@ -42,7 +45,7 @@ try_implicit_rule (struct file *file, unsigned int depth)
|
|||||||
(the archive search omits the archive name), it is more specific and
|
(the archive search omits the archive name), it is more specific and
|
||||||
should come first. */
|
should come first. */
|
||||||
|
|
||||||
if (pattern_search (file, 0, depth, 0))
|
if (pattern_search (file, 0, depth, 0, 0))
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
#ifndef NO_ARCHIVES
|
#ifndef NO_ARCHIVES
|
||||||
@@ -52,8 +55,11 @@ try_implicit_rule (struct file *file, unsigned int depth)
|
|||||||
{
|
{
|
||||||
DBF (DB_IMPLICIT,
|
DBF (DB_IMPLICIT,
|
||||||
_("Looking for archive-member implicit rule for '%s'.\n"));
|
_("Looking for archive-member implicit rule for '%s'.\n"));
|
||||||
if (pattern_search (file, 1, depth, 0))
|
if (pattern_search (file, 1, depth, 0, 0))
|
||||||
return 1;
|
return 1;
|
||||||
|
DBS (DB_IMPLICIT,
|
||||||
|
(_("No archive-member implicit rule found for '%s'.\n"),
|
||||||
|
file->name));
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -152,6 +158,9 @@ struct patdeps
|
|||||||
const char *pattern;
|
const char *pattern;
|
||||||
struct file *file;
|
struct file *file;
|
||||||
unsigned int ignore_mtime : 1;
|
unsigned int ignore_mtime : 1;
|
||||||
|
unsigned int ignore_automatic_vars : 1;
|
||||||
|
unsigned int is_explicit : 1;
|
||||||
|
unsigned int wait_here : 1;
|
||||||
};
|
};
|
||||||
|
|
||||||
/* This structure stores information about pattern rules that we need
|
/* This structure stores information about pattern rules that we need
|
||||||
@@ -199,7 +208,8 @@ stemlen_compare (const void *v1, const void *v2)
|
|||||||
|
|
||||||
static int
|
static int
|
||||||
pattern_search (struct file *file, int archive,
|
pattern_search (struct file *file, int archive,
|
||||||
unsigned int depth, unsigned int recursions)
|
unsigned int depth, unsigned int recursions,
|
||||||
|
int allow_compat_rules)
|
||||||
{
|
{
|
||||||
/* Filename we are searching for a rule for. */
|
/* Filename we are searching for a rule for. */
|
||||||
const char *filename = archive ? strchr (file->name, '(') : file->name;
|
const char *filename = archive ? strchr (file->name, '(') : file->name;
|
||||||
@@ -220,8 +230,13 @@ pattern_search (struct file *file, int archive,
|
|||||||
struct patdeps *deplist = xmalloc (max_deps * sizeof (struct patdeps));
|
struct patdeps *deplist = xmalloc (max_deps * sizeof (struct patdeps));
|
||||||
struct patdeps *pat = deplist;
|
struct patdeps *pat = deplist;
|
||||||
|
|
||||||
/* Names of possible dependencies are constructed in this buffer. */
|
/* Names of possible dependencies are constructed in this buffer.
|
||||||
char *depname = alloca (namelen + max_pattern_dep_length);
|
We may replace % by $(*F) for second expansion, increasing the length. */
|
||||||
|
size_t deplen = namelen + max_pattern_dep_length + 4;
|
||||||
|
char *depname = alloca (deplen);
|
||||||
|
#ifndef NDEBUG
|
||||||
|
char *dend = depname + deplen;
|
||||||
|
#endif
|
||||||
|
|
||||||
/* The start and length of the stem of FILENAME for the current rule. */
|
/* The start and length of the stem of FILENAME for the current rule. */
|
||||||
const char *stem = 0;
|
const char *stem = 0;
|
||||||
@@ -249,6 +264,7 @@ pattern_search (struct file *file, int archive,
|
|||||||
int specific_rule_matched = 0;
|
int specific_rule_matched = 0;
|
||||||
|
|
||||||
unsigned int ri; /* uninit checks OK */
|
unsigned int ri; /* uninit checks OK */
|
||||||
|
int found_compat_rule = 0;
|
||||||
struct rule *rule;
|
struct rule *rule;
|
||||||
|
|
||||||
char *pathdir = NULL;
|
char *pathdir = NULL;
|
||||||
@@ -265,7 +281,7 @@ pattern_search (struct file *file, int archive,
|
|||||||
/* Set LASTSLASH to point at the last slash in FILENAME
|
/* Set LASTSLASH to point at the last slash in FILENAME
|
||||||
but not counting any slash at the end. (foo/bar/ counts as
|
but not counting any slash at the end. (foo/bar/ counts as
|
||||||
bar/ in directory foo/, not empty in directory foo/bar/.) */
|
bar/ in directory foo/, not empty in directory foo/bar/.) */
|
||||||
lastslash = strrchr (filename, '/');
|
lastslash = memrchr (filename, '/', namelen - 1);
|
||||||
#ifdef VMS
|
#ifdef VMS
|
||||||
if (lastslash == NULL)
|
if (lastslash == NULL)
|
||||||
lastslash = strrchr (filename, ']');
|
lastslash = strrchr (filename, ']');
|
||||||
@@ -278,18 +294,16 @@ pattern_search (struct file *file, int archive,
|
|||||||
/* Handle backslashes (possibly mixed with forward slashes)
|
/* Handle backslashes (possibly mixed with forward slashes)
|
||||||
and the case of "d:file". */
|
and the case of "d:file". */
|
||||||
{
|
{
|
||||||
char *bslash = strrchr (filename, '\\');
|
char *bslash = memrchr (filename, '\\', namelen - 1);
|
||||||
if (lastslash == 0 || bslash > lastslash)
|
if (lastslash == 0 || bslash > lastslash)
|
||||||
lastslash = bslash;
|
lastslash = bslash;
|
||||||
if (lastslash == 0 && filename[0] && filename[1] == ':')
|
if (lastslash == 0 && filename[0] && filename[1] == ':')
|
||||||
lastslash = filename + 1;
|
lastslash = filename + 1;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
if (lastslash != 0 && lastslash[1] == '\0')
|
|
||||||
lastslash = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pathlen = lastslash - filename + 1;
|
pathlen = lastslash ? lastslash - filename + 1 : 0;
|
||||||
|
|
||||||
/* First see which pattern rules match this target and may be considered.
|
/* First see which pattern rules match this target and may be considered.
|
||||||
Put them in TRYRULES. */
|
Put them in TRYRULES. */
|
||||||
@@ -308,7 +322,9 @@ pattern_search (struct file *file, int archive,
|
|||||||
don't use it here. */
|
don't use it here. */
|
||||||
if (rule->in_use)
|
if (rule->in_use)
|
||||||
{
|
{
|
||||||
DBS (DB_IMPLICIT, (_("Avoiding implicit rule recursion.\n")));
|
DBS (DB_IMPLICIT,
|
||||||
|
(_("Avoiding implicit rule recursion for rule '%s'.\n"),
|
||||||
|
get_rule_defn (rule)));
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -431,6 +447,8 @@ pattern_search (struct file *file, int archive,
|
|||||||
for (intermed_ok = 0; intermed_ok < 2; ++intermed_ok)
|
for (intermed_ok = 0; intermed_ok < 2; ++intermed_ok)
|
||||||
{
|
{
|
||||||
pat = deplist;
|
pat = deplist;
|
||||||
|
if (intermed_ok)
|
||||||
|
DBS (DB_IMPLICIT, (_("Trying harder.\n")));
|
||||||
|
|
||||||
/* Try each pattern rule till we find one that applies. If it does,
|
/* Try each pattern rule till we find one that applies. If it does,
|
||||||
expand its dependencies (as substituted) and chain them in DEPS. */
|
expand its dependencies (as substituted) and chain them in DEPS. */
|
||||||
@@ -443,7 +461,6 @@ pattern_search (struct file *file, int archive,
|
|||||||
unsigned int deps_found = 0;
|
unsigned int deps_found = 0;
|
||||||
/* NPTR points to the part of the prereq we haven't processed. */
|
/* NPTR points to the part of the prereq we haven't processed. */
|
||||||
const char *nptr = 0;
|
const char *nptr = 0;
|
||||||
const char *dir = NULL;
|
|
||||||
int order_only = 0;
|
int order_only = 0;
|
||||||
unsigned int matches;
|
unsigned int matches;
|
||||||
|
|
||||||
@@ -478,30 +495,38 @@ pattern_search (struct file *file, int archive,
|
|||||||
memcpy (pathdir, filename, pathlen);
|
memcpy (pathdir, filename, pathlen);
|
||||||
pathdir[pathlen] = '\0';
|
pathdir[pathlen] = '\0';
|
||||||
}
|
}
|
||||||
dir = pathdir;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (stemlen > GET_PATH_MAX)
|
DBS (DB_IMPLICIT,
|
||||||
|
(_("Trying pattern rule '%s' with stem '%.*s'.\n"),
|
||||||
|
get_rule_defn (rule), (int) stemlen, stem));
|
||||||
|
|
||||||
|
if (stemlen + (check_lastslash ? pathlen : 0) > GET_PATH_MAX)
|
||||||
{
|
{
|
||||||
DBS (DB_IMPLICIT, (_("Stem too long: '%.*s'.\n"),
|
DBS (DB_IMPLICIT, (_("Stem too long: '%s%.*s'.\n"),
|
||||||
|
check_lastslash ? pathdir : "",
|
||||||
(int) stemlen, stem));
|
(int) stemlen, stem));
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
DBS (DB_IMPLICIT, (_("Trying pattern rule with stem '%.*s'.\n"),
|
if (!check_lastslash)
|
||||||
(int) stemlen, stem));
|
{
|
||||||
|
memcpy (stem_str, stem, stemlen);
|
||||||
strncpy (stem_str, stem, stemlen);
|
stem_str[stemlen] = '\0';
|
||||||
stem_str[stemlen] = '\0';
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/* We want to prepend the directory from
|
||||||
|
the original FILENAME onto the stem. */
|
||||||
|
memcpy (stem_str, filename, pathlen);
|
||||||
|
memcpy (stem_str + pathlen, stem, stemlen);
|
||||||
|
stem_str[pathlen + stemlen] = '\0';
|
||||||
|
}
|
||||||
|
|
||||||
/* If there are no prerequisites, then this rule matches. */
|
/* If there are no prerequisites, then this rule matches. */
|
||||||
if (rule->deps == 0)
|
if (rule->deps == 0)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
/* Temporary assign STEM to file->stem (needed to set file
|
|
||||||
variables below). */
|
|
||||||
file->stem = stem_str;
|
|
||||||
|
|
||||||
/* Mark this rule as in use so a recursive pattern_search won't try
|
/* Mark this rule as in use so a recursive pattern_search won't try
|
||||||
to use it. */
|
to use it. */
|
||||||
rule->in_use = 1;
|
rule->in_use = 1;
|
||||||
@@ -516,7 +541,6 @@ pattern_search (struct file *file, int archive,
|
|||||||
while (1)
|
while (1)
|
||||||
{
|
{
|
||||||
struct dep *dl, *d;
|
struct dep *dl, *d;
|
||||||
char *p;
|
|
||||||
|
|
||||||
/* If we're out of name to parse, start the next prereq. */
|
/* If we're out of name to parse, start the next prereq. */
|
||||||
if (! nptr)
|
if (! nptr)
|
||||||
@@ -530,31 +554,33 @@ pattern_search (struct file *file, int archive,
|
|||||||
/* If we don't need a second expansion, just replace the %. */
|
/* If we don't need a second expansion, just replace the %. */
|
||||||
if (! dep->need_2nd_expansion)
|
if (! dep->need_2nd_expansion)
|
||||||
{
|
{
|
||||||
p = strchr (nptr, '%');
|
char *p;
|
||||||
if (p == 0)
|
int is_explicit = 1;
|
||||||
|
const char *cp = strchr (nptr, '%');
|
||||||
|
if (cp == 0)
|
||||||
strcpy (depname, nptr);
|
strcpy (depname, nptr);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
char *o = depname;
|
char *o = depname;
|
||||||
if (check_lastslash)
|
if (check_lastslash)
|
||||||
{
|
o = mempcpy (o, filename, pathlen);
|
||||||
memcpy (o, filename, pathlen);
|
o = mempcpy (o, nptr, cp - nptr);
|
||||||
o += pathlen;
|
o = mempcpy (o, stem, stemlen);
|
||||||
}
|
strcpy (o, cp + 1);
|
||||||
memcpy (o, nptr, p - nptr);
|
is_explicit = 0;
|
||||||
o += p - nptr;
|
|
||||||
memcpy (o, stem_str, stemlen);
|
|
||||||
o += stemlen;
|
|
||||||
strcpy (o, p + 1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Parse the expanded string. It might have wildcards. */
|
/* Parse the expanded string. It might have wildcards. */
|
||||||
p = depname;
|
p = depname;
|
||||||
dl = PARSE_SIMPLE_SEQ (&p, struct dep);
|
dl = PARSE_FILE_SEQ (&p, struct dep, MAP_NUL, NULL,
|
||||||
|
PARSEFS_ONEWORD|PARSEFS_WAIT);
|
||||||
for (d = dl; d != NULL; d = d->next)
|
for (d = dl; d != NULL; d = d->next)
|
||||||
{
|
{
|
||||||
++deps_found;
|
++deps_found;
|
||||||
d->ignore_mtime = dep->ignore_mtime;
|
d->ignore_mtime = dep->ignore_mtime;
|
||||||
|
d->ignore_automatic_vars = dep->ignore_automatic_vars;
|
||||||
|
d->wait_here |= dep->wait_here;
|
||||||
|
d->is_explicit = is_explicit;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* We've used up this dep, so next time get a new one. */
|
/* We've used up this dep, so next time get a new one. */
|
||||||
@@ -574,17 +600,22 @@ pattern_search (struct file *file, int archive,
|
|||||||
{
|
{
|
||||||
int add_dir = 0;
|
int add_dir = 0;
|
||||||
size_t len;
|
size_t len;
|
||||||
|
const char *end;
|
||||||
struct dep **dptr;
|
struct dep **dptr;
|
||||||
|
int is_explicit;
|
||||||
|
const char *cp;
|
||||||
|
char *p;
|
||||||
|
|
||||||
nptr = get_next_word (nptr, &len);
|
nptr = get_next_word (nptr, &len);
|
||||||
if (nptr == 0)
|
if (nptr == 0)
|
||||||
continue;
|
continue;
|
||||||
|
end = nptr + len;
|
||||||
|
|
||||||
/* See this is a transition to order-only prereqs. */
|
/* See if this is a transition to order-only prereqs. */
|
||||||
if (! order_only && len == 1 && nptr[0] == '|')
|
if (! order_only && len == 1 && nptr[0] == '|')
|
||||||
{
|
{
|
||||||
order_only = 1;
|
order_only = 1;
|
||||||
nptr += len;
|
nptr = end;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -594,45 +625,81 @@ pattern_search (struct file *file, int archive,
|
|||||||
again. This is not good if you have certain characters
|
again. This is not good if you have certain characters
|
||||||
in your stem (like $).
|
in your stem (like $).
|
||||||
|
|
||||||
Instead, we will replace % with $* and allow the second
|
Instead, we will replace % with $* or $(*F) and allow the
|
||||||
expansion to take care of it for us. This way (since $*
|
second expansion to take care of it for us. This way
|
||||||
is a simple variable) there won't be additional
|
(since $* and $(*F) are simple variables) there won't be
|
||||||
re-expansion of the stem. */
|
additional re-expansion of the stem. */
|
||||||
|
|
||||||
p = lindex (nptr, nptr + len, '%');
|
cp = lindex (nptr, end, '%');
|
||||||
if (p == 0)
|
if (cp == 0)
|
||||||
{
|
{
|
||||||
memcpy (depname, nptr, len);
|
memcpy (depname, nptr, len);
|
||||||
depname[len] = '\0';
|
depname[len] = '\0';
|
||||||
|
is_explicit = 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
size_t i = p - nptr;
|
/* Go through all % between NPTR and END.
|
||||||
memcpy (depname, nptr, i);
|
Copy contents of [NPTR, END) to depname, with the
|
||||||
memcpy (depname + i, "$*", 2);
|
first % after NPTR and then each first % after white
|
||||||
memcpy (depname + i + 2, p + 1, len - i - 1);
|
space replaced with $* or $(*F). depname has enough
|
||||||
depname[len + 2 - 1] = '\0';
|
room to substitute each % with $(*F). */
|
||||||
|
char *o = depname;
|
||||||
|
|
||||||
if (check_lastslash)
|
is_explicit = 0;
|
||||||
add_dir = 1;
|
for (;;)
|
||||||
|
{
|
||||||
|
size_t i = cp - nptr;
|
||||||
|
assert (o + i < dend);
|
||||||
|
o = mempcpy (o, nptr, i);
|
||||||
|
if (check_lastslash)
|
||||||
|
{
|
||||||
|
add_dir = 1;
|
||||||
|
assert (o + 5 < dend);
|
||||||
|
o = mempcpy (o, "$(*F)", 5);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
assert (o + 2 < dend);
|
||||||
|
o = mempcpy (o, "$*", 2);
|
||||||
|
}
|
||||||
|
assert (o < dend);
|
||||||
|
++cp;
|
||||||
|
assert (cp <= end);
|
||||||
|
nptr = cp;
|
||||||
|
if (nptr == end)
|
||||||
|
break;
|
||||||
|
|
||||||
|
/* Skip the rest of this word then find the next %.
|
||||||
|
No need to worry about order-only, or nested
|
||||||
|
functions: NPTR went though get_next_word. */
|
||||||
|
while (cp < end && ! END_OF_TOKEN (*cp))
|
||||||
|
++cp;
|
||||||
|
cp = lindex (cp, end, '%');
|
||||||
|
if (cp == 0)
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
len = end - nptr;
|
||||||
|
memcpy (o, nptr, len);
|
||||||
|
o[len] = '\0';
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Set up for the next word. */
|
/* Set up for the next word. */
|
||||||
nptr += len;
|
nptr = end;
|
||||||
|
|
||||||
/* Initialize and set file variables if we haven't already
|
/* Initialize and set file variables if we haven't already
|
||||||
done so. */
|
done so. */
|
||||||
if (!file_vars_initialized)
|
if (!file_vars_initialized)
|
||||||
{
|
{
|
||||||
initialize_file_variables (file, 0);
|
initialize_file_variables (file, 0);
|
||||||
set_file_variables (file);
|
set_file_variables (file, stem_str);
|
||||||
file_vars_initialized = 1;
|
file_vars_initialized = 1;
|
||||||
}
|
}
|
||||||
/* Update the stem value in $* for this rule. */
|
/* Update the stem value in $* for this rule. */
|
||||||
else if (!file_variables_set)
|
else if (!file_variables_set)
|
||||||
{
|
{
|
||||||
define_variable_for_file (
|
define_variable_for_file (
|
||||||
"*", 1, file->stem, o_automatic, 0, file);
|
"*", 1, stem_str, o_automatic, 0, file);
|
||||||
file_variables_set = 1;
|
file_variables_set = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -646,7 +713,8 @@ pattern_search (struct file *file, int archive,
|
|||||||
/* Parse the expanded string. */
|
/* Parse the expanded string. */
|
||||||
struct dep *dp = PARSE_FILE_SEQ (&p, struct dep,
|
struct dep *dp = PARSE_FILE_SEQ (&p, struct dep,
|
||||||
order_only ? MAP_NUL : MAP_PIPE,
|
order_only ? MAP_NUL : MAP_PIPE,
|
||||||
add_dir ? dir : NULL, PARSEFS_NONE);
|
add_dir ? pathdir : NULL,
|
||||||
|
PARSEFS_WAIT);
|
||||||
*dptr = dp;
|
*dptr = dp;
|
||||||
|
|
||||||
for (d = dp; d != NULL; d = d->next)
|
for (d = dp; d != NULL; d = d->next)
|
||||||
@@ -654,6 +722,7 @@ pattern_search (struct file *file, int archive,
|
|||||||
++deps_found;
|
++deps_found;
|
||||||
if (order_only)
|
if (order_only)
|
||||||
d->ignore_mtime = 1;
|
d->ignore_mtime = 1;
|
||||||
|
d->is_explicit = is_explicit;
|
||||||
dptr = &d->next;
|
dptr = &d->next;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -684,8 +753,10 @@ pattern_search (struct file *file, int archive,
|
|||||||
/* Go through the nameseq and handle each as a prereq name. */
|
/* Go through the nameseq and handle each as a prereq name. */
|
||||||
for (d = dl; d != 0; d = d->next)
|
for (d = dl; d != 0; d = d->next)
|
||||||
{
|
{
|
||||||
struct dep *expl_d;
|
struct file *df;
|
||||||
int is_rule = d->name == dep_name (dep);
|
int is_rule = d->name == dep_name (dep);
|
||||||
|
int explicit = 0;
|
||||||
|
struct dep *dp = 0;
|
||||||
|
|
||||||
if (file_impossible_p (d->name))
|
if (file_impossible_p (d->name))
|
||||||
{
|
{
|
||||||
@@ -694,9 +765,11 @@ pattern_search (struct file *file, int archive,
|
|||||||
second pass either since we know that will fail. */
|
second pass either since we know that will fail. */
|
||||||
DBS (DB_IMPLICIT,
|
DBS (DB_IMPLICIT,
|
||||||
(is_rule
|
(is_rule
|
||||||
? _("Rejecting impossible rule prerequisite '%s'.\n")
|
? _("Rejecting rule '%s' due to impossible rule"
|
||||||
: _("Rejecting impossible implicit prerequisite '%s'.\n"),
|
" prerequisite '%s'.\n")
|
||||||
d->name));
|
: _("Rejecting rule '%s' due to impossible implicit"
|
||||||
|
" prerequisite '%s'.\n"),
|
||||||
|
get_rule_defn (rule), d->name));
|
||||||
tryrules[ri].rule = 0;
|
tryrules[ri].rule = 0;
|
||||||
|
|
||||||
failed = 1;
|
failed = 1;
|
||||||
@@ -705,41 +778,87 @@ pattern_search (struct file *file, int archive,
|
|||||||
|
|
||||||
memset (pat, '\0', sizeof (struct patdeps));
|
memset (pat, '\0', sizeof (struct patdeps));
|
||||||
pat->ignore_mtime = d->ignore_mtime;
|
pat->ignore_mtime = d->ignore_mtime;
|
||||||
|
pat->ignore_automatic_vars = d->ignore_automatic_vars;
|
||||||
|
pat->wait_here = d->wait_here;
|
||||||
|
pat->is_explicit = d->is_explicit;
|
||||||
|
|
||||||
DBS (DB_IMPLICIT,
|
DBS (DB_IMPLICIT,
|
||||||
(is_rule
|
(is_rule
|
||||||
? _("Trying rule prerequisite '%s'.\n")
|
? _("Trying rule prerequisite '%s'.\n")
|
||||||
: _("Trying implicit prerequisite '%s'.\n"), d->name));
|
: _("Trying implicit prerequisite '%s'.\n"), d->name));
|
||||||
|
|
||||||
/* If this prereq is also explicitly mentioned for FILE,
|
df = lookup_file (d->name);
|
||||||
skip all tests below since it must be built no matter
|
|
||||||
which implicit rule we choose. */
|
|
||||||
|
|
||||||
for (expl_d = file->deps; expl_d != 0; expl_d = expl_d->next)
|
if (df && df->is_explicit)
|
||||||
if (streq (dep_name (expl_d), d->name))
|
pat->is_explicit = 1;
|
||||||
break;
|
|
||||||
if (expl_d != 0)
|
/* If we found a file for the dep, set its intermediate flag.
|
||||||
|
df->is_explicit is set when the dep file is mentioned
|
||||||
|
explicitly on some other rule. d->is_explicit is set when
|
||||||
|
the dep file is mentioned explicitly on this rule. E.g.:
|
||||||
|
%.x : %.y ; ...
|
||||||
|
then:
|
||||||
|
one.x:
|
||||||
|
one.y: # df->is_explicit
|
||||||
|
vs.
|
||||||
|
one.x: one.y # d->is_explicit
|
||||||
|
*/
|
||||||
|
if (df && !df->is_explicit && !d->is_explicit)
|
||||||
|
df->intermediate = 1;
|
||||||
|
|
||||||
|
/* If the pattern prereq is also explicitly mentioned for
|
||||||
|
FILE, skip all tests below since it must be built no
|
||||||
|
matter which implicit rule we choose. */
|
||||||
|
if (df && df->is_target)
|
||||||
|
/* This prerequisite is mentioned explicitly as a target of
|
||||||
|
some rule. */
|
||||||
|
explicit = 1;
|
||||||
|
else
|
||||||
|
for (dp = file->deps; dp != 0; dp = dp->next)
|
||||||
|
if (streq (d->name, dep_name (dp)))
|
||||||
|
break;
|
||||||
|
|
||||||
|
/* If dp is set, this prerequisite is mentioned explicitly as
|
||||||
|
a prerequisite of the current target. */
|
||||||
|
|
||||||
|
if (explicit || dp)
|
||||||
{
|
{
|
||||||
(pat++)->name = d->name;
|
(pat++)->name = d->name;
|
||||||
|
DBS (DB_IMPLICIT, (_("'%s' ought to exist.\n"), d->name));
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* The DEP->changed flag says that this dependency resides
|
if (file_exists_p (d->name))
|
||||||
in a nonexistent directory. So we normally can skip
|
|
||||||
looking for the file. However, if CHECK_LASTSLASH is
|
|
||||||
set, then the 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. */
|
|
||||||
|
|
||||||
/* @@ dep->changed check is disabled. */
|
|
||||||
if (lookup_file (d->name) != 0
|
|
||||||
/*|| ((!dep->changed || check_lastslash) && */
|
|
||||||
|| file_exists_p (d->name))
|
|
||||||
{
|
{
|
||||||
(pat++)->name = d->name;
|
(pat++)->name = d->name;
|
||||||
|
DBS (DB_IMPLICIT, (_("Found '%s'.\n"), d->name));
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (df && allow_compat_rules)
|
||||||
|
{
|
||||||
|
(pat++)->name = d->name;
|
||||||
|
DBS (DB_IMPLICIT,
|
||||||
|
(_("Using compatibility rule '%s' due to '%s'.\n"),
|
||||||
|
get_rule_defn (rule), d->name));
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (df)
|
||||||
|
{
|
||||||
|
/* This prerequisite is mentioned explicitly as a
|
||||||
|
prerequisite on some rule, but it is not a
|
||||||
|
prerequisite of the current target. Therefore, this
|
||||||
|
prerequisite does not qualify as ought-to-exist. Keep
|
||||||
|
note of this rule and continue the search. If a more
|
||||||
|
suitable rule is not found, then use this rule. */
|
||||||
|
DBS (DB_IMPLICIT,
|
||||||
|
(_("Prerequisite '%s' of rule '%s' does not qualify"
|
||||||
|
" as ought to exist.\n"),
|
||||||
|
d->name, get_rule_defn (rule)));
|
||||||
|
found_compat_rule = 1;
|
||||||
|
}
|
||||||
|
|
||||||
/* This code, given FILENAME = "lib/foo.o", dependency name
|
/* This code, given FILENAME = "lib/foo.o", dependency name
|
||||||
"lib/foo.c", and VPATH=src, searches for
|
"lib/foo.c", and VPATH=src, searches for
|
||||||
"src/lib/foo.c". */
|
"src/lib/foo.c". */
|
||||||
@@ -748,7 +867,7 @@ pattern_search (struct file *file, int archive,
|
|||||||
if (vname)
|
if (vname)
|
||||||
{
|
{
|
||||||
DBS (DB_IMPLICIT,
|
DBS (DB_IMPLICIT,
|
||||||
(_("Found prerequisite '%s' as VPATH '%s'\n"),
|
(_("Found prerequisite '%s' as VPATH '%s'.\n"),
|
||||||
d->name, vname));
|
d->name, vname));
|
||||||
(pat++)->name = d->name;
|
(pat++)->name = d->name;
|
||||||
continue;
|
continue;
|
||||||
@@ -756,13 +875,15 @@ pattern_search (struct file *file, int archive,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* We could not find the file in any place we should look.
|
/* We could not find the file in any place we should look.
|
||||||
Try to make this dependency as an intermediate file, but
|
Look for an implicit rule to make this dependency, but
|
||||||
only on the second pass. */
|
only on the second pass. */
|
||||||
|
|
||||||
if (intermed_ok)
|
if (intermed_ok)
|
||||||
{
|
{
|
||||||
DBS (DB_IMPLICIT,
|
DBS (DB_IMPLICIT,
|
||||||
(_("Looking for a rule with intermediate file '%s'.\n"),
|
(d->is_explicit || (df && df->is_explicit)
|
||||||
|
? _("Looking for a rule with explicit file '%s'.\n")
|
||||||
|
: _("Looking for a rule with intermediate file '%s'.\n"),
|
||||||
d->name));
|
d->name));
|
||||||
|
|
||||||
if (int_file == 0)
|
if (int_file == 0)
|
||||||
@@ -773,7 +894,8 @@ pattern_search (struct file *file, int archive,
|
|||||||
if (pattern_search (int_file,
|
if (pattern_search (int_file,
|
||||||
0,
|
0,
|
||||||
depth + 1,
|
depth + 1,
|
||||||
recursions + 1))
|
recursions + 1,
|
||||||
|
allow_compat_rules))
|
||||||
{
|
{
|
||||||
pat->pattern = int_file->name;
|
pat->pattern = int_file->name;
|
||||||
int_file->name = d->name;
|
int_file->name = d->name;
|
||||||
@@ -790,11 +912,24 @@ pattern_search (struct file *file, int archive,
|
|||||||
free_variable_set (int_file->variables);
|
free_variable_set (int_file->variables);
|
||||||
if (int_file->pat_variables)
|
if (int_file->pat_variables)
|
||||||
free_variable_set (int_file->pat_variables);
|
free_variable_set (int_file->pat_variables);
|
||||||
file_impossible (d->name);
|
|
||||||
|
/* Keep prerequisites explicitly mentioned on unrelated
|
||||||
|
rules as "possible" to let compatibility search find
|
||||||
|
such prerequisites. */
|
||||||
|
if (df == 0)
|
||||||
|
file_impossible (d->name);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* A dependency of this rule does not exist. Therefore, this
|
/* A dependency of this rule does not exist. Therefore, this
|
||||||
rule fails. */
|
rule fails. */
|
||||||
|
if (intermed_ok)
|
||||||
|
DBS (DB_IMPLICIT,
|
||||||
|
(_("Rejecting rule '%s' "
|
||||||
|
"due to impossible prerequisite '%s'.\n"),
|
||||||
|
get_rule_defn (rule), d->name));
|
||||||
|
else
|
||||||
|
DBS (DB_IMPLICIT, (_("Not found '%s'.\n"), d->name));
|
||||||
|
|
||||||
failed = 1;
|
failed = 1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -806,10 +941,6 @@ pattern_search (struct file *file, int archive,
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Reset the stem in FILE. */
|
|
||||||
|
|
||||||
file->stem = 0;
|
|
||||||
|
|
||||||
/* This rule is no longer 'in use' for recursive searches. */
|
/* This rule is no longer 'in use' for recursive searches. */
|
||||||
rule->in_use = 0;
|
rule->in_use = 0;
|
||||||
|
|
||||||
@@ -861,24 +992,24 @@ pattern_search (struct file *file, int archive,
|
|||||||
struct file *imf = pat->file;
|
struct file *imf = pat->file;
|
||||||
struct file *f = lookup_file (imf->name);
|
struct file *f = lookup_file (imf->name);
|
||||||
|
|
||||||
/* We don't want to delete an intermediate file that happened
|
if (!f)
|
||||||
to be a prerequisite of some (other) target. Mark it as
|
|
||||||
secondary. We don't want it to be precious as that disables
|
|
||||||
DELETE_ON_ERROR etc. */
|
|
||||||
if (f != 0)
|
|
||||||
f->secondary = 1;
|
|
||||||
else
|
|
||||||
f = enter_file (imf->name);
|
f = enter_file (imf->name);
|
||||||
|
|
||||||
f->deps = imf->deps;
|
f->deps = imf->deps;
|
||||||
f->cmds = imf->cmds;
|
f->cmds = imf->cmds;
|
||||||
f->stem = imf->stem;
|
f->stem = imf->stem;
|
||||||
f->variables = imf->variables;
|
/* Setting target specific variables for a file causes the file to be
|
||||||
|
entered to the database as a prerequisite. Implicit search then
|
||||||
|
treats this file as explicitly mentioned. Preserve target specific
|
||||||
|
variables of this file. */
|
||||||
|
merge_variable_set_lists(&f->variables, imf->variables);
|
||||||
f->pat_variables = imf->pat_variables;
|
f->pat_variables = imf->pat_variables;
|
||||||
f->pat_searched = imf->pat_searched;
|
f->pat_searched = imf->pat_searched;
|
||||||
f->also_make = imf->also_make;
|
f->also_make = imf->also_make;
|
||||||
f->is_target = 1;
|
f->is_target = 1;
|
||||||
f->intermediate = 1;
|
f->is_explicit |= imf->is_explicit || pat->is_explicit;
|
||||||
|
f->notintermediate |= imf->notintermediate;
|
||||||
|
f->intermediate |= !f->is_explicit && !f->notintermediate;
|
||||||
f->tried_implicit = 1;
|
f->tried_implicit = 1;
|
||||||
|
|
||||||
imf = lookup_file (pat->pattern);
|
imf = lookup_file (pat->pattern);
|
||||||
@@ -895,6 +1026,9 @@ pattern_search (struct file *file, int archive,
|
|||||||
|
|
||||||
dep = alloc_dep ();
|
dep = alloc_dep ();
|
||||||
dep->ignore_mtime = pat->ignore_mtime;
|
dep->ignore_mtime = pat->ignore_mtime;
|
||||||
|
dep->is_explicit = pat->is_explicit;
|
||||||
|
dep->ignore_automatic_vars = pat->ignore_automatic_vars;
|
||||||
|
dep->wait_here = pat->wait_here;
|
||||||
s = strcache_add (pat->name);
|
s = strcache_add (pat->name);
|
||||||
if (recursions)
|
if (recursions)
|
||||||
dep->name = s;
|
dep->name = s;
|
||||||
@@ -920,8 +1054,14 @@ pattern_search (struct file *file, int archive,
|
|||||||
|
|
||||||
dep->next = file->deps;
|
dep->next = file->deps;
|
||||||
file->deps = dep;
|
file->deps = dep;
|
||||||
|
|
||||||
|
/* The file changed its dependencies; schedule the shuffle. */
|
||||||
|
file->was_shuffled = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!file->was_shuffled)
|
||||||
|
shuffle_deps_recursive (file->deps);
|
||||||
|
|
||||||
if (!tryrules[foundrule].checked_lastslash)
|
if (!tryrules[foundrule].checked_lastslash)
|
||||||
{
|
{
|
||||||
/* Always allocate new storage, since STEM might be on the stack for an
|
/* Always allocate new storage, since STEM might be on the stack for an
|
||||||
@@ -931,27 +1071,28 @@ pattern_search (struct file *file, int archive,
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
size_t dirlen = (lastslash + 1) - filename;
|
|
||||||
char *sp;
|
|
||||||
|
|
||||||
/* We want to prepend the directory from
|
/* We want to prepend the directory from
|
||||||
the original FILENAME onto the stem. */
|
the original FILENAME onto the stem. */
|
||||||
fullstemlen = dirlen + stemlen;
|
fullstemlen = pathlen + stemlen;
|
||||||
sp = alloca (fullstemlen + 1);
|
memcpy (stem_str, filename, pathlen);
|
||||||
memcpy (sp, filename, dirlen);
|
memcpy (stem_str + pathlen, stem, stemlen);
|
||||||
memcpy (sp + dirlen, stem, stemlen);
|
stem_str[fullstemlen] = '\0';
|
||||||
sp[fullstemlen] = '\0';
|
file->stem = strcache_add (stem_str);
|
||||||
file->stem = strcache_add (sp);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
file->cmds = rule->cmds;
|
file->cmds = rule->cmds;
|
||||||
file->is_target = 1;
|
file->is_target = 1;
|
||||||
|
|
||||||
/* Set precious flag. */
|
/* Set precious and notintermediate flags. */
|
||||||
{
|
{
|
||||||
struct file *f = lookup_file (rule->targets[tryrules[foundrule].matches]);
|
struct file *f = lookup_file (rule->targets[tryrules[foundrule].matches]);
|
||||||
if (f && f->precious)
|
if (f)
|
||||||
file->precious = 1;
|
{
|
||||||
|
if (f->precious)
|
||||||
|
file->precious = 1;
|
||||||
|
if (f->notintermediate)
|
||||||
|
file->notintermediate = 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* If this rule builds other targets, too, put the others into FILE's
|
/* If this rule builds other targets, too, put the others into FILE's
|
||||||
@@ -967,11 +1108,9 @@ pattern_search (struct file *file, int archive,
|
|||||||
struct dep *new = alloc_dep ();
|
struct dep *new = alloc_dep ();
|
||||||
|
|
||||||
/* GKM FIMXE: handle '|' here too */
|
/* GKM FIMXE: handle '|' here too */
|
||||||
memcpy (p, rule->targets[ri],
|
p = mempcpy (p, rule->targets[ri],
|
||||||
rule->suffixes[ri] - rule->targets[ri] - 1);
|
rule->suffixes[ri] - rule->targets[ri] - 1);
|
||||||
p += rule->suffixes[ri] - rule->targets[ri] - 1;
|
p = mempcpy (p, file->stem, fullstemlen);
|
||||||
memcpy (p, file->stem, fullstemlen);
|
|
||||||
p += fullstemlen;
|
|
||||||
memcpy (p, rule->suffixes[ri],
|
memcpy (p, rule->suffixes[ri],
|
||||||
rule->lens[ri] - (rule->suffixes[ri] - rule->targets[ri])+1);
|
rule->lens[ri] - (rule->suffixes[ri] - rule->targets[ri])+1);
|
||||||
new->name = strcache_add (nm);
|
new->name = strcache_add (nm);
|
||||||
@@ -980,8 +1119,13 @@ pattern_search (struct file *file, int archive,
|
|||||||
|
|
||||||
/* Set precious flag. */
|
/* Set precious flag. */
|
||||||
f = lookup_file (rule->targets[ri]);
|
f = lookup_file (rule->targets[ri]);
|
||||||
if (f && f->precious)
|
if (f)
|
||||||
new->file->precious = 1;
|
{
|
||||||
|
if (f->precious)
|
||||||
|
new->file->precious = 1;
|
||||||
|
if (f->notintermediate)
|
||||||
|
new->file->notintermediate = 1;
|
||||||
|
}
|
||||||
|
|
||||||
/* Set the is_target flag so that this file is not treated as
|
/* Set the is_target flag so that this file is not treated as
|
||||||
intermediate by the pattern rule search algorithm and
|
intermediate by the pattern rule search algorithm and
|
||||||
@@ -995,5 +1139,21 @@ pattern_search (struct file *file, int archive,
|
|||||||
free (tryrules);
|
free (tryrules);
|
||||||
free (deplist);
|
free (deplist);
|
||||||
|
|
||||||
return rule != 0;
|
if (rule)
|
||||||
|
{
|
||||||
|
DBS (DB_IMPLICIT, (_("Found implicit rule '%s' for '%s'.\n"),
|
||||||
|
get_rule_defn (rule), filename));
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (found_compat_rule)
|
||||||
|
{
|
||||||
|
DBS (DB_IMPLICIT, (_("Searching for a compatibility rule for '%s'.\n"),
|
||||||
|
filename));
|
||||||
|
assert (allow_compat_rules == 0);
|
||||||
|
return pattern_search (file, archive, depth, recursions, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
DBS (DB_IMPLICIT, (_("No implicit rule found for '%s'.\n"), filename));
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
343
src/job.c
343
src/job.c
@@ -1,5 +1,5 @@
|
|||||||
/* Job execution and handling for GNU Make.
|
/* Job execution and handling for GNU Make.
|
||||||
Copyright (C) 1988-2019 Free Software Foundation, Inc.
|
Copyright (C) 1988-2022 Free Software Foundation, Inc.
|
||||||
This file is part of GNU Make.
|
This file is part of GNU Make.
|
||||||
|
|
||||||
GNU Make is free software; you can redistribute it and/or modify it under the
|
GNU Make is free software; you can redistribute it and/or modify it under the
|
||||||
@@ -12,7 +12,7 @@ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|||||||
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
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
|
You should have received a copy of the GNU General Public License along with
|
||||||
this program. If not, see <http://www.gnu.org/licenses/>. */
|
this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||||
|
|
||||||
#include "makeint.h"
|
#include "makeint.h"
|
||||||
|
|
||||||
@@ -25,11 +25,13 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
|
|||||||
#include "commands.h"
|
#include "commands.h"
|
||||||
#include "variable.h"
|
#include "variable.h"
|
||||||
#include "os.h"
|
#include "os.h"
|
||||||
|
#include "dep.h"
|
||||||
|
#include "shuffle.h"
|
||||||
|
|
||||||
/* Default shell to use. */
|
/* Default shell to use. */
|
||||||
#ifdef WINDOWS32
|
#ifdef WINDOWS32
|
||||||
# ifdef HAVE_STRINGS_H
|
# ifdef HAVE_STRINGS_H
|
||||||
# include <strings.h> /* for strcasecmp, strncasecmp */
|
# include <strings.h> /* for strcasecmp, strncasecmp */
|
||||||
# endif
|
# endif
|
||||||
# include <windows.h>
|
# include <windows.h>
|
||||||
|
|
||||||
@@ -121,6 +123,10 @@ static void vmsWaitForChildren (int *);
|
|||||||
# include <process.h>
|
# include <process.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined (HAVE_FCNTL_H)
|
||||||
|
# include <fcntl.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined (HAVE_SYS_WAIT_H) || defined (HAVE_UNION_WAIT)
|
#if defined (HAVE_SYS_WAIT_H) || defined (HAVE_UNION_WAIT)
|
||||||
# include <sys/wait.h>
|
# include <sys/wait.h>
|
||||||
#endif
|
#endif
|
||||||
@@ -198,6 +204,14 @@ int getgid ();
|
|||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if HAVE_SYS_LOADAVG_H
|
||||||
|
# include <sys/loadavg.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if HAVE_DECL_GETLOADAVG == 0
|
||||||
|
int getloadavg (double loadavg[], int nelem);
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Different systems have different requirements for pid_t.
|
/* Different systems have different requirements for pid_t.
|
||||||
Plus we have to support gettext string translation... Argh. */
|
Plus we have to support gettext string translation... Argh. */
|
||||||
static const char *
|
static const char *
|
||||||
@@ -214,10 +228,6 @@ pid2str (pid_t pid)
|
|||||||
return pidstring;
|
return pidstring;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef HAVE_GETLOADAVG
|
|
||||||
int getloadavg (double loadavg[], int nelem);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static void free_child (struct child *);
|
static void free_child (struct child *);
|
||||||
static void start_job_command (struct child *child);
|
static void start_job_command (struct child *child);
|
||||||
static int load_too_high (void);
|
static int load_too_high (void);
|
||||||
@@ -272,7 +282,7 @@ create_batch_file (char const *base, int unixy, int *fd)
|
|||||||
{
|
{
|
||||||
const char *const ext = unixy ? "sh" : "bat";
|
const char *const ext = unixy ? "sh" : "bat";
|
||||||
const char *error_string = NULL;
|
const char *error_string = NULL;
|
||||||
char temp_path[MAXPATHLEN]; /* need to know its length */
|
char temp_path[MAX_PATH+1]; /* need to know its length */
|
||||||
unsigned path_size = GetTempPath (sizeof temp_path, temp_path);
|
unsigned path_size = GetTempPath (sizeof temp_path, temp_path);
|
||||||
int path_is_dot = 0;
|
int path_is_dot = 0;
|
||||||
/* The following variable is static so we won't try to reuse a name
|
/* The following variable is static so we won't try to reuse a name
|
||||||
@@ -367,7 +377,7 @@ create_batch_file (char const *base, int unixy, int *fd)
|
|||||||
|
|
||||||
*fd = -1;
|
*fd = -1;
|
||||||
if (error_string == NULL)
|
if (error_string == NULL)
|
||||||
error_string = _("Cannot create a temporary file\n");
|
error_string = _("Cannot create a temporary file");
|
||||||
O (fatal, NILF, error_string);
|
O (fatal, NILF, error_string);
|
||||||
|
|
||||||
/* not reached */
|
/* not reached */
|
||||||
@@ -405,7 +415,8 @@ _is_unixy_shell (const char *path)
|
|||||||
else if (!name) /* name and p must be 0 */
|
else if (!name) /* name and p must be 0 */
|
||||||
name = path;
|
name = path;
|
||||||
|
|
||||||
if (*name == '/' || *name == '\\') name++;
|
if (ISDIRSEP (*name))
|
||||||
|
name++;
|
||||||
|
|
||||||
i = 0;
|
i = 0;
|
||||||
while (known_os2shells[i] != NULL)
|
while (known_os2shells[i] != NULL)
|
||||||
@@ -428,38 +439,30 @@ is_bourne_compatible_shell (const char *path)
|
|||||||
static const char *unix_shells[] = {
|
static const char *unix_shells[] = {
|
||||||
"sh",
|
"sh",
|
||||||
"bash",
|
"bash",
|
||||||
|
"dash",
|
||||||
"ksh",
|
"ksh",
|
||||||
"rksh",
|
"rksh",
|
||||||
"zsh",
|
"zsh",
|
||||||
"ash",
|
"ash",
|
||||||
"dash",
|
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
const char **s;
|
const char **s;
|
||||||
|
|
||||||
/* find the rightmost '/' or '\\' */
|
/* find the last directory separator, or the beginning of the string. */
|
||||||
const char *name = strrchr (path, '/');
|
const char *cp = path + strlen (path);
|
||||||
char *p = strrchr (path, '\\');
|
|
||||||
|
|
||||||
if (name && p) /* take the max */
|
while (cp > path && !ISDIRSEP (cp[-1]))
|
||||||
name = (name > p) ? name : p;
|
--cp;
|
||||||
else if (p) /* name must be 0 */
|
|
||||||
name = p;
|
|
||||||
else if (!name) /* name and p must be 0 */
|
|
||||||
name = path;
|
|
||||||
|
|
||||||
if (*name == '/' || *name == '\\')
|
|
||||||
++name;
|
|
||||||
|
|
||||||
/* this should be able to deal with extensions on Windows-like systems */
|
/* this should be able to deal with extensions on Windows-like systems */
|
||||||
for (s = unix_shells; *s != NULL; ++s)
|
for (s = unix_shells; *s != NULL; ++s)
|
||||||
{
|
{
|
||||||
#if defined(WINDOWS32) || defined(__MSDOS__)
|
#if defined(WINDOWS32) || defined(__MSDOS__)
|
||||||
size_t len = strlen (*s);
|
size_t len = strlen (*s);
|
||||||
if ((strlen (name) >= len && STOP_SET (name[len], MAP_DOT|MAP_NUL))
|
if ((strlen (cp) >= len && STOP_SET (cp[len], MAP_DOT|MAP_NUL))
|
||||||
&& strncasecmp (name, *s, len) == 0)
|
&& strncasecmp (cp, *s, len) == 0)
|
||||||
#else
|
#else
|
||||||
if (strcmp (name, *s) == 0)
|
if (strcmp (cp, *s) == 0)
|
||||||
#endif
|
#endif
|
||||||
return 1; /* a known unix-style shell */
|
return 1; /* a known unix-style shell */
|
||||||
}
|
}
|
||||||
@@ -504,7 +507,7 @@ block_sigs ()
|
|||||||
static void
|
static void
|
||||||
unblock_sigs ()
|
unblock_sigs ()
|
||||||
{
|
{
|
||||||
sigsetmask (siggetmask (0) & ~fatal_signal_mask)
|
sigsetmask (siggetmask () & ~fatal_signal_mask);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@@ -539,6 +542,7 @@ child_error (struct child *child,
|
|||||||
const struct file *f = child->file;
|
const struct file *f = child->file;
|
||||||
const floc *flocp = &f->cmds->fileinfo;
|
const floc *flocp = &f->cmds->fileinfo;
|
||||||
const char *nm;
|
const char *nm;
|
||||||
|
const char *smode;
|
||||||
size_t l;
|
size_t l;
|
||||||
|
|
||||||
if (ignored && run_silent)
|
if (ignored && run_silent)
|
||||||
@@ -557,28 +561,36 @@ child_error (struct child *child,
|
|||||||
nm = _("<builtin>");
|
nm = _("<builtin>");
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* We can't use the standard <FILE>:<LINENO> syntax here because
|
|
||||||
Emacs misinterprets it and matches a bogus filename in the compile
|
|
||||||
buffer. */
|
|
||||||
char *a = alloca (strlen (flocp->filenm) + 6 + INTSTR_LENGTH + 1);
|
char *a = alloca (strlen (flocp->filenm) + 6 + INTSTR_LENGTH + 1);
|
||||||
sprintf (a, "%s;%lu", flocp->filenm, flocp->lineno + flocp->offset);
|
sprintf (a, "%s:%lu", flocp->filenm, flocp->lineno + flocp->offset);
|
||||||
nm = a;
|
nm = a;
|
||||||
}
|
}
|
||||||
|
|
||||||
l = strlen (pre) + strlen (nm) + strlen (f->name) + strlen (post);
|
l = strlen (pre) + strlen (nm) + strlen (f->name) + strlen (post);
|
||||||
|
|
||||||
|
smode = shuffle_get_mode ();
|
||||||
|
if (smode)
|
||||||
|
{
|
||||||
|
#define SHUFFLE_PREFIX " shuffle="
|
||||||
|
char *a = alloca (CSTRLEN(SHUFFLE_PREFIX) + strlen (smode) + 1);
|
||||||
|
sprintf (a, SHUFFLE_PREFIX "%s", smode);
|
||||||
|
smode = a;
|
||||||
|
l += strlen (smode);
|
||||||
|
#undef SHUFFLE_PREFIX
|
||||||
|
}
|
||||||
|
|
||||||
OUTPUT_SET (&child->output);
|
OUTPUT_SET (&child->output);
|
||||||
|
|
||||||
show_goal_error ();
|
show_goal_error ();
|
||||||
|
|
||||||
if (exit_sig == 0)
|
if (exit_sig == 0)
|
||||||
error (NILF, l + INTSTR_LENGTH,
|
error (NILF, l + INTSTR_LENGTH, _("%s[%s: %s] Error %d%s%s"),
|
||||||
_("%s[%s: %s] Error %d%s"), pre, nm, f->name, exit_code, post);
|
pre, nm, f->name, exit_code, post, smode ? smode : "");
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
const char *s = strsignal (exit_sig);
|
const char *s = strsignal (exit_sig);
|
||||||
error (NILF, l + strlen (s) + strlen (dump),
|
error (NILF, l + strlen (s) + strlen (dump), "%s[%s: %s] %s%s%s%s",
|
||||||
"%s[%s: %s] %s%s%s", pre, nm, f->name, s, dump, post);
|
pre, nm, f->name, s, dump, post, smode ? smode : "");
|
||||||
}
|
}
|
||||||
|
|
||||||
OUTPUT_UNSET ();
|
OUTPUT_UNSET ();
|
||||||
@@ -598,7 +610,7 @@ child_error (struct child *child,
|
|||||||
|
|
||||||
static unsigned int dead_children = 0;
|
static unsigned int dead_children = 0;
|
||||||
|
|
||||||
RETSIGTYPE
|
void
|
||||||
child_handler (int sig UNUSED)
|
child_handler (int sig UNUSED)
|
||||||
{
|
{
|
||||||
++dead_children;
|
++dead_children;
|
||||||
@@ -724,9 +736,6 @@ reap_children (int block, int err)
|
|||||||
else if (pid < 0)
|
else if (pid < 0)
|
||||||
{
|
{
|
||||||
/* A remote status command failed miserably. Punt. */
|
/* A remote status command failed miserably. Punt. */
|
||||||
#if !defined(__MSDOS__) && !defined(_AMIGA) && !defined(WINDOWS32)
|
|
||||||
remote_status_lose:
|
|
||||||
#endif
|
|
||||||
pfatal_with_name ("remote_status");
|
pfatal_with_name ("remote_status");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -782,8 +791,9 @@ reap_children (int block, int err)
|
|||||||
/* Now try a blocking wait for a remote child. */
|
/* Now try a blocking wait for a remote child. */
|
||||||
pid = remote_status (&exit_code, &exit_sig, &coredump, 1);
|
pid = remote_status (&exit_code, &exit_sig, &coredump, 1);
|
||||||
if (pid < 0)
|
if (pid < 0)
|
||||||
goto remote_status_lose;
|
pfatal_with_name ("remote_status");
|
||||||
else if (pid == 0)
|
|
||||||
|
if (pid == 0)
|
||||||
/* No remote children either. Finally give up. */
|
/* No remote children either. Finally give up. */
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -879,6 +889,9 @@ reap_children (int block, int err)
|
|||||||
#endif /* WINDOWS32 */
|
#endif /* WINDOWS32 */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Some child finished: increment the command count. */
|
||||||
|
++command_count;
|
||||||
|
|
||||||
/* Check if this is the child of the 'shell' function. */
|
/* Check if this is the child of the 'shell' function. */
|
||||||
if (!remote && pid == shell_function_pid)
|
if (!remote && pid == shell_function_pid)
|
||||||
{
|
{
|
||||||
@@ -924,7 +937,7 @@ reap_children (int block, int err)
|
|||||||
to fork/exec but I don't want to bother with that. Just do the
|
to fork/exec but I don't want to bother with that. Just do the
|
||||||
best we can. */
|
best we can. */
|
||||||
|
|
||||||
EINTRLOOP(r, stat(c->cmd_name, &st));
|
EINTRLOOP(r, stat (c->cmd_name, &st));
|
||||||
if (r < 0)
|
if (r < 0)
|
||||||
e = strerror (errno);
|
e = strerror (errno);
|
||||||
else if (S_ISDIR(st.st_mode) || !(st.st_mode & S_IXUSR))
|
else if (S_ISDIR(st.st_mode) || !(st.st_mode & S_IXUSR))
|
||||||
@@ -1010,12 +1023,10 @@ reap_children (int block, int err)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
#ifndef NO_OUTPUT_SYNC
|
|
||||||
/* If we're sync'ing per line, write the previous line's
|
/* If we're sync'ing per line, write the previous line's
|
||||||
output before starting the next one. */
|
output before starting the next one. */
|
||||||
if (output_sync == OUTPUT_SYNC_LINE)
|
if (output_sync == OUTPUT_SYNC_LINE)
|
||||||
output_dump (&c->output);
|
output_dump (&c->output);
|
||||||
#endif
|
|
||||||
/* Check again whether to start remotely.
|
/* Check again whether to start remotely.
|
||||||
Whether or not we want to changes over time.
|
Whether or not we want to changes over time.
|
||||||
Also, start_remote_job may need state set up
|
Also, start_remote_job may need state set up
|
||||||
@@ -1046,10 +1057,8 @@ reap_children (int block, int err)
|
|||||||
|
|
||||||
/* When we get here, all the commands for c->file are finished. */
|
/* When we get here, all the commands for c->file are finished. */
|
||||||
|
|
||||||
#ifndef NO_OUTPUT_SYNC
|
|
||||||
/* Synchronize any remaining parallel output. */
|
/* Synchronize any remaining parallel output. */
|
||||||
output_dump (&c->output);
|
output_dump (&c->output);
|
||||||
#endif
|
|
||||||
|
|
||||||
/* At this point c->file->update_status is success or failed. But
|
/* At this point c->file->update_status is success or failed. But
|
||||||
c->file->command_state is still cs_running if all the commands
|
c->file->command_state is still cs_running if all the commands
|
||||||
@@ -1073,12 +1082,12 @@ reap_children (int block, int err)
|
|||||||
{
|
{
|
||||||
DB (DB_JOBS, (_("Removing child %p PID %s%s from chain.\n"),
|
DB (DB_JOBS, (_("Removing child %p PID %s%s from chain.\n"),
|
||||||
c, pid2str (c->pid), c->remote ? _(" (remote)") : ""));
|
c, pid2str (c->pid), c->remote ? _(" (remote)") : ""));
|
||||||
|
|
||||||
/* There is now another slot open. */
|
|
||||||
if (job_slots_used > 0)
|
|
||||||
--job_slots_used;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* There is now another slot open. */
|
||||||
|
if (job_slots_used > 0)
|
||||||
|
job_slots_used -= c->jobslot;
|
||||||
|
|
||||||
/* Remove the child from the chain and free it. */
|
/* Remove the child from the chain and free it. */
|
||||||
if (lastc == 0)
|
if (lastc == 0)
|
||||||
children = c->next;
|
children = c->next;
|
||||||
@@ -1105,13 +1114,27 @@ reap_children (int block, int err)
|
|||||||
|
|
||||||
/* Free the storage allocated for CHILD. */
|
/* Free the storage allocated for CHILD. */
|
||||||
|
|
||||||
|
void
|
||||||
|
free_childbase (struct childbase *child)
|
||||||
|
{
|
||||||
|
if (child->environment != 0)
|
||||||
|
{
|
||||||
|
char **ep = child->environment;
|
||||||
|
while (*ep != 0)
|
||||||
|
free (*ep++);
|
||||||
|
free (child->environment);
|
||||||
|
}
|
||||||
|
|
||||||
|
free (child->cmd_name);
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
free_child (struct child *child)
|
free_child (struct child *child)
|
||||||
{
|
{
|
||||||
output_close (&child->output);
|
output_close (&child->output);
|
||||||
|
|
||||||
if (!jobserver_tokens)
|
if (!jobserver_tokens)
|
||||||
ONS (fatal, NILF, "INTERNAL: Freeing child %p (%s) but no tokens left!\n",
|
ONS (fatal, NILF, "INTERNAL: Freeing child %p (%s) but no tokens left",
|
||||||
child, child->file->name);
|
child, child->file->name);
|
||||||
|
|
||||||
/* If we're using the jobserver and this child is not the only outstanding
|
/* If we're using the jobserver and this child is not the only outstanding
|
||||||
@@ -1137,15 +1160,8 @@ free_child (struct child *child)
|
|||||||
free (child->command_lines);
|
free (child->command_lines);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (child->environment != 0)
|
free_childbase ((struct childbase*)child);
|
||||||
{
|
|
||||||
char **ep = child->environment;
|
|
||||||
while (*ep != 0)
|
|
||||||
free (*ep++);
|
|
||||||
free (child->environment);
|
|
||||||
}
|
|
||||||
|
|
||||||
free (child->cmd_name);
|
|
||||||
free (child);
|
free (child);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1335,15 +1351,13 @@ start_job_command (struct child *child)
|
|||||||
|
|
||||||
OUTPUT_SET (&child->output);
|
OUTPUT_SET (&child->output);
|
||||||
|
|
||||||
#ifndef NO_OUTPUT_SYNC
|
|
||||||
if (! child->output.syncout)
|
if (! child->output.syncout)
|
||||||
/* We don't want to sync this command: to avoid misordered
|
/* We don't want to sync this command: to avoid misordered
|
||||||
output ensure any already-synced content is written. */
|
output ensure any already-synced content is written. */
|
||||||
output_dump (&child->output);
|
output_dump (&child->output);
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Print the command if appropriate. */
|
/* Print the command if appropriate. */
|
||||||
if (just_print_flag || trace_flag
|
if (just_print_flag || ISDB (DB_PRINT)
|
||||||
|| (!(flags & COMMANDS_SILENT) && !run_silent))
|
|| (!(flags & COMMANDS_SILENT) && !run_silent))
|
||||||
OS (message, 0, "%s", p);
|
OS (message, 0, "%s", p);
|
||||||
|
|
||||||
@@ -1411,7 +1425,7 @@ start_job_command (struct child *child)
|
|||||||
#ifndef _AMIGA
|
#ifndef _AMIGA
|
||||||
/* Set up the environment for the child. */
|
/* Set up the environment for the child. */
|
||||||
if (child->environment == 0)
|
if (child->environment == 0)
|
||||||
child->environment = target_environment (child->file);
|
child->environment = target_environment (child->file, child->recursive);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(__MSDOS__) && !defined(_AMIGA) && !defined(WINDOWS32)
|
#if !defined(__MSDOS__) && !defined(_AMIGA) && !defined(WINDOWS32)
|
||||||
@@ -1443,9 +1457,6 @@ start_job_command (struct child *child)
|
|||||||
#endif /* !VMS */
|
#endif /* !VMS */
|
||||||
{
|
{
|
||||||
/* Fork the child process. */
|
/* Fork the child process. */
|
||||||
|
|
||||||
char **parent_environ;
|
|
||||||
|
|
||||||
run_local:
|
run_local:
|
||||||
block_sigs ();
|
block_sigs ();
|
||||||
|
|
||||||
@@ -1456,14 +1467,11 @@ start_job_command (struct child *child)
|
|||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
parent_environ = environ;
|
|
||||||
|
|
||||||
jobserver_pre_child (flags & COMMANDS_RECURSE);
|
jobserver_pre_child (flags & COMMANDS_RECURSE);
|
||||||
|
|
||||||
child->pid = child_execute_job ((struct childbase *)child,
|
child->pid = child_execute_job ((struct childbase *)child,
|
||||||
child->good_stdin, argv);
|
child->good_stdin, argv);
|
||||||
|
|
||||||
environ = parent_environ; /* Restore value child may have clobbered. */
|
|
||||||
jobserver_post_child (flags & COMMANDS_RECURSE);
|
jobserver_post_child (flags & COMMANDS_RECURSE);
|
||||||
|
|
||||||
#endif /* !VMS */
|
#endif /* !VMS */
|
||||||
@@ -1486,7 +1494,7 @@ start_job_command (struct child *child)
|
|||||||
char *cmdline = argv[0];
|
char *cmdline = argv[0];
|
||||||
/* We don't have a way to pass environment to 'system',
|
/* We don't have a way to pass environment to 'system',
|
||||||
so we need to save and restore ours, sigh... */
|
so we need to save and restore ours, sigh... */
|
||||||
char **parent_environ = environ;
|
char **parent_env = environ;
|
||||||
|
|
||||||
environ = child->environment;
|
environ = child->environment;
|
||||||
|
|
||||||
@@ -1501,7 +1509,7 @@ start_job_command (struct child *child)
|
|||||||
|
|
||||||
dos_command_running = 1;
|
dos_command_running = 1;
|
||||||
proc_return = system (cmdline);
|
proc_return = system (cmdline);
|
||||||
environ = parent_environ;
|
environ = parent_env;
|
||||||
execute_by_shell = 0; /* for the next time */
|
execute_by_shell = 0; /* for the next time */
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -1541,8 +1549,8 @@ start_job_command (struct child *child)
|
|||||||
{
|
{
|
||||||
HANDLE hPID;
|
HANDLE hPID;
|
||||||
char* arg0;
|
char* arg0;
|
||||||
int outfd = FD_STDOUT;
|
int outfd = -1;
|
||||||
int errfd = FD_STDERR;
|
int errfd = -1;
|
||||||
|
|
||||||
/* make UNC paths safe for CreateProcess -- backslash format */
|
/* make UNC paths safe for CreateProcess -- backslash format */
|
||||||
arg0 = argv[0];
|
arg0 = argv[0];
|
||||||
@@ -1554,7 +1562,6 @@ start_job_command (struct child *child)
|
|||||||
/* make sure CreateProcess() has Path it needs */
|
/* make sure CreateProcess() has Path it needs */
|
||||||
sync_Path_environment ();
|
sync_Path_environment ();
|
||||||
|
|
||||||
#ifndef NO_OUTPUT_SYNC
|
|
||||||
/* Divert child output if output_sync in use. */
|
/* Divert child output if output_sync in use. */
|
||||||
if (child->output.syncout)
|
if (child->output.syncout)
|
||||||
{
|
{
|
||||||
@@ -1563,9 +1570,7 @@ start_job_command (struct child *child)
|
|||||||
if (child->output.err >= 0)
|
if (child->output.err >= 0)
|
||||||
errfd = child->output.err;
|
errfd = child->output.err;
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
outfd = errfd = -1;
|
|
||||||
#endif
|
|
||||||
hPID = process_easy (argv, child->environment, outfd, errfd);
|
hPID = process_easy (argv, child->environment, outfd, errfd);
|
||||||
|
|
||||||
if (hPID != INVALID_HANDLE_VALUE)
|
if (hPID != INVALID_HANDLE_VALUE)
|
||||||
@@ -1647,6 +1652,8 @@ start_waiting_job (struct child *c)
|
|||||||
c->remote ? _(" (remote)") : ""));
|
c->remote ? _(" (remote)") : ""));
|
||||||
/* One more job slot is in use. */
|
/* One more job slot is in use. */
|
||||||
++job_slots_used;
|
++job_slots_used;
|
||||||
|
assert (c->jobslot == 0);
|
||||||
|
c->jobslot = 1;
|
||||||
}
|
}
|
||||||
children = c;
|
children = c;
|
||||||
unblock_sigs ();
|
unblock_sigs ();
|
||||||
@@ -1865,7 +1872,7 @@ new_job (struct file *file)
|
|||||||
/* There must be at least one child already, or we have no business
|
/* There must be at least one child already, or we have no business
|
||||||
waiting for a token. */
|
waiting for a token. */
|
||||||
if (!children)
|
if (!children)
|
||||||
O (fatal, NILF, "INTERNAL: no children as we go to sleep on read\n");
|
O (fatal, NILF, "INTERNAL: no children as we go to sleep on read");
|
||||||
|
|
||||||
/* Get a token. */
|
/* Get a token. */
|
||||||
got_token = jobserver_acquire (waiting_jobs != NULL);
|
got_token = jobserver_acquire (waiting_jobs != NULL);
|
||||||
@@ -1884,7 +1891,7 @@ new_job (struct file *file)
|
|||||||
|
|
||||||
/* Trace the build.
|
/* Trace the build.
|
||||||
Use message here so that changes to working directories are logged. */
|
Use message here so that changes to working directories are logged. */
|
||||||
if (trace_flag)
|
if (ISDB (DB_WHY))
|
||||||
{
|
{
|
||||||
char *newer = allocated_variable_expand_for_file ("$?", c->file);
|
char *newer = allocated_variable_expand_for_file ("$?", c->file);
|
||||||
const char *nm;
|
const char *nm;
|
||||||
@@ -1898,12 +1905,9 @@ new_job (struct file *file)
|
|||||||
nm = n;
|
nm = n;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (newer[0] == '\0')
|
OSSS (message, 0,
|
||||||
OSS (message, 0,
|
_("%s: update target '%s' due to: %s"), nm, c->file->name,
|
||||||
_("%s: target '%s' does not exist"), nm, c->file->name);
|
newer[0] == '\0' ? _("target does not exist") : newer);
|
||||||
else
|
|
||||||
OSSS (message, 0,
|
|
||||||
_("%s: update target '%s' due to: %s"), nm, c->file->name, newer);
|
|
||||||
|
|
||||||
free (newer);
|
free (newer);
|
||||||
}
|
}
|
||||||
@@ -1951,12 +1955,13 @@ job_next_command (struct child *child)
|
|||||||
|
|
||||||
On systems which provide /proc/loadavg (e.g., Linux), we use an idea
|
On systems which provide /proc/loadavg (e.g., Linux), we use an idea
|
||||||
provided by Sven C. Dack <sven.c.dack@sky.com>: retrieve the current number
|
provided by Sven C. Dack <sven.c.dack@sky.com>: retrieve the current number
|
||||||
of processes the kernel is running and, if it's greater than the requested
|
of runnable processes, if it's greater than the requested load we don't
|
||||||
load we don't allow another job to start. We allow a job to start with
|
allow another job to start. We allow a job to start with equal processes
|
||||||
equal processes since one of those will be for make itself, which will then
|
since one of those will be for make itself, which will then pause waiting
|
||||||
pause waiting for jobs to clear.
|
for jobs to clear.
|
||||||
|
|
||||||
Otherwise, we obtain the system load average and compare that.
|
If /proc/loadavg is not available for some reason, we obtain the system
|
||||||
|
load average and compare that.
|
||||||
|
|
||||||
The system load average is only recomputed once every N (N>=1) seconds.
|
The system load average is only recomputed once every N (N>=1) seconds.
|
||||||
However, a very parallel make can easily start tens or even hundreds of
|
However, a very parallel make can easily start tens or even hundreds of
|
||||||
@@ -2010,6 +2015,7 @@ load_too_high (void)
|
|||||||
static double last_sec;
|
static double last_sec;
|
||||||
static time_t last_now;
|
static time_t last_now;
|
||||||
static int proc_fd = -2;
|
static int proc_fd = -2;
|
||||||
|
|
||||||
double load, guess;
|
double load, guess;
|
||||||
time_t now;
|
time_t now;
|
||||||
|
|
||||||
@@ -2066,8 +2072,8 @@ load_too_high (void)
|
|||||||
|
|
||||||
if (p && ISDIGIT(p[1]))
|
if (p && ISDIGIT(p[1]))
|
||||||
{
|
{
|
||||||
int cnt = atoi (p+1);
|
unsigned int cnt = make_toui (p+1, NULL);
|
||||||
DB (DB_JOBS, ("Running: system = %d / make = %u (max requested = %f)\n",
|
DB (DB_JOBS, ("Running: system = %u / make = %u (max requested = %f)\n",
|
||||||
cnt, job_slots_used, max_load_average));
|
cnt, job_slots_used, max_load_average));
|
||||||
return (double)cnt > max_load_average;
|
return (double)cnt > max_load_average;
|
||||||
}
|
}
|
||||||
@@ -2085,7 +2091,7 @@ load_too_high (void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Find the real system load average. */
|
/* Find the real system load average. */
|
||||||
make_access ();
|
errno = 0;
|
||||||
if (getloadavg (&load, 1) != 1)
|
if (getloadavg (&load, 1) != 1)
|
||||||
{
|
{
|
||||||
static int lossage = -1;
|
static int lossage = -1;
|
||||||
@@ -2102,7 +2108,6 @@ load_too_high (void)
|
|||||||
lossage = errno;
|
lossage = errno;
|
||||||
load = 0;
|
load = 0;
|
||||||
}
|
}
|
||||||
user_access ();
|
|
||||||
|
|
||||||
/* If we're in a new second zero the counter and correct the backlog
|
/* If we're in a new second zero the counter and correct the backlog
|
||||||
value. Only keep the backlog for one extra second; after that it's 0. */
|
value. Only keep the backlog for one extra second; after that it's 0. */
|
||||||
@@ -2187,7 +2192,7 @@ child_execute_job (struct childbase *child, int good_stdin, char **argv)
|
|||||||
{
|
{
|
||||||
save_fdin = dup (FD_STDIN);
|
save_fdin = dup (FD_STDIN);
|
||||||
if (save_fdin < 0)
|
if (save_fdin < 0)
|
||||||
O (fatal, NILF, _("no more file handles: could not duplicate stdin\n"));
|
O (fatal, NILF, _("no more file handles: could not duplicate stdin"));
|
||||||
fd_noinherit (save_fdin);
|
fd_noinherit (save_fdin);
|
||||||
|
|
||||||
dup2 (fdin, FD_STDIN);
|
dup2 (fdin, FD_STDIN);
|
||||||
@@ -2199,7 +2204,7 @@ child_execute_job (struct childbase *child, int good_stdin, char **argv)
|
|||||||
save_fdout = dup (FD_STDOUT);
|
save_fdout = dup (FD_STDOUT);
|
||||||
if (save_fdout < 0)
|
if (save_fdout < 0)
|
||||||
O (fatal, NILF,
|
O (fatal, NILF,
|
||||||
_("no more file handles: could not duplicate stdout\n"));
|
_("no more file handles: could not duplicate stdout"));
|
||||||
fd_noinherit (save_fdout);
|
fd_noinherit (save_fdout);
|
||||||
|
|
||||||
dup2 (fdout, FD_STDOUT);
|
dup2 (fdout, FD_STDOUT);
|
||||||
@@ -2213,7 +2218,7 @@ child_execute_job (struct childbase *child, int good_stdin, char **argv)
|
|||||||
save_fderr = dup (FD_STDERR);
|
save_fderr = dup (FD_STDERR);
|
||||||
if (save_fderr < 0)
|
if (save_fderr < 0)
|
||||||
O (fatal, NILF,
|
O (fatal, NILF,
|
||||||
_("no more file handles: could not duplicate stderr\n"));
|
_("no more file handles: could not duplicate stderr"));
|
||||||
fd_noinherit (save_fderr);
|
fd_noinherit (save_fderr);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2228,7 +2233,7 @@ child_execute_job (struct childbase *child, int good_stdin, char **argv)
|
|||||||
if (save_fdin >= 0)
|
if (save_fdin >= 0)
|
||||||
{
|
{
|
||||||
if (dup2 (save_fdin, FD_STDIN) != FD_STDIN)
|
if (dup2 (save_fdin, FD_STDIN) != FD_STDIN)
|
||||||
O (fatal, NILF, _("Could not restore stdin\n"));
|
O (fatal, NILF, _("Could not restore stdin"));
|
||||||
else
|
else
|
||||||
close (save_fdin);
|
close (save_fdin);
|
||||||
}
|
}
|
||||||
@@ -2236,7 +2241,7 @@ child_execute_job (struct childbase *child, int good_stdin, char **argv)
|
|||||||
if (save_fdout >= 0)
|
if (save_fdout >= 0)
|
||||||
{
|
{
|
||||||
if (dup2 (save_fdout, FD_STDOUT) != FD_STDOUT)
|
if (dup2 (save_fdout, FD_STDOUT) != FD_STDOUT)
|
||||||
O (fatal, NILF, _("Could not restore stdout\n"));
|
O (fatal, NILF, _("Could not restore stdout"));
|
||||||
else
|
else
|
||||||
close (save_fdout);
|
close (save_fdout);
|
||||||
}
|
}
|
||||||
@@ -2244,7 +2249,7 @@ child_execute_job (struct childbase *child, int good_stdin, char **argv)
|
|||||||
if (save_fderr >= 0)
|
if (save_fderr >= 0)
|
||||||
{
|
{
|
||||||
if (dup2 (save_fderr, FD_STDERR) != FD_STDERR)
|
if (dup2 (save_fderr, FD_STDERR) != FD_STDERR)
|
||||||
O (fatal, NILF, _("Could not restore stderr\n"));
|
O (fatal, NILF, _("Could not restore stderr"));
|
||||||
else
|
else
|
||||||
close (save_fderr);
|
close (save_fderr);
|
||||||
}
|
}
|
||||||
@@ -2266,7 +2271,7 @@ child_execute_job (struct childbase *child, int good_stdin, char **argv)
|
|||||||
const int fdin = good_stdin ? FD_STDIN : get_bad_stdin ();
|
const int fdin = good_stdin ? FD_STDIN : get_bad_stdin ();
|
||||||
int fdout = FD_STDOUT;
|
int fdout = FD_STDOUT;
|
||||||
int fderr = FD_STDERR;
|
int fderr = FD_STDERR;
|
||||||
pid_t pid;
|
pid_t pid = -1;
|
||||||
int r;
|
int r;
|
||||||
#if defined(USE_POSIX_SPAWN)
|
#if defined(USE_POSIX_SPAWN)
|
||||||
char *cmd;
|
char *cmd;
|
||||||
@@ -2286,9 +2291,16 @@ child_execute_job (struct childbase *child, int good_stdin, char **argv)
|
|||||||
|
|
||||||
#if !defined(USE_POSIX_SPAWN)
|
#if !defined(USE_POSIX_SPAWN)
|
||||||
|
|
||||||
pid = vfork();
|
{
|
||||||
if (pid != 0)
|
/* The child may clobber environ so remember ours and restore it. */
|
||||||
return pid;
|
char **parent_env = environ;
|
||||||
|
pid = vfork ();
|
||||||
|
if (pid != 0)
|
||||||
|
{
|
||||||
|
environ = parent_env;
|
||||||
|
return pid;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* We are the child. */
|
/* We are the child. */
|
||||||
unblock_all_sigs ();
|
unblock_all_sigs ();
|
||||||
@@ -2310,6 +2322,7 @@ child_execute_job (struct childbase *child, int good_stdin, char **argv)
|
|||||||
|
|
||||||
/* Run the command. */
|
/* Run the command. */
|
||||||
exec_command (argv, child->environment);
|
exec_command (argv, child->environment);
|
||||||
|
_exit (127);
|
||||||
|
|
||||||
#else /* USE_POSIX_SPAWN */
|
#else /* USE_POSIX_SPAWN */
|
||||||
|
|
||||||
@@ -2351,8 +2364,8 @@ child_execute_job (struct childbase *child, int good_stdin, char **argv)
|
|||||||
if ((r = posix_spawn_file_actions_adddup2 (&fa, fderr, FD_STDERR)) != 0)
|
if ((r = posix_spawn_file_actions_adddup2 (&fa, fderr, FD_STDERR)) != 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
/* Be the user, permanently. */
|
/* We can't use the POSIX_SPAWN_RESETIDS flag: when make is invoked under
|
||||||
flags |= POSIX_SPAWN_RESETIDS;
|
restrictive environments like unshare it will fail with EINVAL. */
|
||||||
|
|
||||||
/* Apply the spawn flags. */
|
/* Apply the spawn flags. */
|
||||||
if ((r = posix_spawnattr_setflags (&attr, flags)) != 0)
|
if ((r = posix_spawnattr_setflags (&attr, flags)) != 0)
|
||||||
@@ -2371,7 +2384,19 @@ child_execute_job (struct childbase *child, int good_stdin, char **argv)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
cmd = (char *)find_in_given_path (argv[0], p, 0);
|
/* execvp() will use a default PATH if none is set; emulate that. */
|
||||||
|
if (p == NULL)
|
||||||
|
{
|
||||||
|
size_t l = confstr (_CS_PATH, NULL, 0);
|
||||||
|
if (l)
|
||||||
|
{
|
||||||
|
char *dp = alloca (l);
|
||||||
|
confstr (_CS_PATH, dp, l);
|
||||||
|
p = dp;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
cmd = (char *)find_in_given_path (argv[0], p, NULL, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!cmd)
|
if (!cmd)
|
||||||
@@ -2397,7 +2422,7 @@ child_execute_job (struct childbase *child, int good_stdin, char **argv)
|
|||||||
for (pp = argv; *pp != NULL; ++pp)
|
for (pp = argv; *pp != NULL; ++pp)
|
||||||
++l;
|
++l;
|
||||||
|
|
||||||
nargv = xmalloc (sizeof (char *) * (l + 2));
|
nargv = xmalloc (sizeof (char *) * (l + 3));
|
||||||
nargv[0] = (char *)default_shell;
|
nargv[0] = (char *)default_shell;
|
||||||
nargv[1] = cmd;
|
nargv[1] = cmd;
|
||||||
memcpy (&nargv[2], &argv[1], sizeof (char *) * l);
|
memcpy (&nargv[2], &argv[1], sizeof (char *) * l);
|
||||||
@@ -2441,12 +2466,7 @@ child_execute_job (struct childbase *child, int good_stdin, char **argv)
|
|||||||
/* Replace the current process with one running the command in ARGV,
|
/* Replace the current process with one running the command in ARGV,
|
||||||
with environment ENVP. This function does not return. */
|
with environment ENVP. This function does not return. */
|
||||||
|
|
||||||
/* EMX: This function returns the pid of the child process. */
|
|
||||||
# ifdef __EMX__
|
|
||||||
pid_t
|
pid_t
|
||||||
# else
|
|
||||||
void
|
|
||||||
# endif
|
|
||||||
exec_command (char **argv, char **envp)
|
exec_command (char **argv, char **envp)
|
||||||
{
|
{
|
||||||
#ifdef VMS
|
#ifdef VMS
|
||||||
@@ -2513,17 +2533,12 @@ exec_command (char **argv, char **envp)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* return child's exit code as our exit code */
|
/* Use the child's exit code as our exit code */
|
||||||
exit (exit_code);
|
exit (exit_code);
|
||||||
|
|
||||||
#else /* !WINDOWS32 */
|
#else /* !WINDOWS32 */
|
||||||
|
|
||||||
# ifdef __EMX__
|
pid_t pid = -1;
|
||||||
pid_t pid;
|
|
||||||
# endif
|
|
||||||
|
|
||||||
/* Be the user, permanently. */
|
|
||||||
child_access ();
|
|
||||||
|
|
||||||
# ifdef __EMX__
|
# ifdef __EMX__
|
||||||
/* Run the program. */
|
/* Run the program. */
|
||||||
@@ -2536,7 +2551,9 @@ exec_command (char **argv, char **envp)
|
|||||||
errno = ENOEXEC;
|
errno = ENOEXEC;
|
||||||
|
|
||||||
# else
|
# else
|
||||||
/* Run the program. */
|
|
||||||
|
/* Run the program. Don't use execvpe() as we want the search for argv[0]
|
||||||
|
to use the new PATH, but execvpe() searches before resetting PATH. */
|
||||||
environ = envp;
|
environ = envp;
|
||||||
execvp (argv[0], argv);
|
execvp (argv[0], argv);
|
||||||
|
|
||||||
@@ -2619,11 +2636,7 @@ exec_command (char **argv, char **envp)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
# ifdef __EMX__
|
|
||||||
return pid;
|
return pid;
|
||||||
# else
|
|
||||||
_exit (127);
|
|
||||||
# endif
|
|
||||||
#endif /* !WINDOWS32 */
|
#endif /* !WINDOWS32 */
|
||||||
#endif /* !VMS */
|
#endif /* !VMS */
|
||||||
}
|
}
|
||||||
@@ -2646,8 +2659,8 @@ void clean_tmp (void)
|
|||||||
avoid using a shell. This routine handles only ' quoting, and " quoting
|
avoid using a shell. This routine handles only ' quoting, and " quoting
|
||||||
when no backslash, $ or ' characters are seen in the quotes. Starting
|
when no backslash, $ or ' characters are seen in the quotes. Starting
|
||||||
quotes may be escaped with a backslash. If any of the characters in
|
quotes may be escaped with a backslash. If any of the characters in
|
||||||
sh_chars is seen, or any of the builtin commands listed in sh_cmds
|
sh_chars is seen, or any of the builtin commands listed in sh_cmds is the
|
||||||
is the first word of a line, the shell is used.
|
first word of a line, the shell is used.
|
||||||
|
|
||||||
If RESTP is not NULL, *RESTP is set to point to the first newline in LINE.
|
If RESTP is not NULL, *RESTP is set to point to the first newline in LINE.
|
||||||
If *RESTP is NULL, newlines will be ignored.
|
If *RESTP is NULL, newlines will be ignored.
|
||||||
@@ -2655,10 +2668,14 @@ void clean_tmp (void)
|
|||||||
SHELL is the shell to use, or nil to use the default shell.
|
SHELL is the shell to use, or nil to use the default shell.
|
||||||
IFS is the value of $IFS, or nil (meaning the default).
|
IFS is the value of $IFS, or nil (meaning the default).
|
||||||
|
|
||||||
FLAGS is the value of lines_flags for this command line. It is
|
FLAGS is the value of lines_flags for this command line. It is used in the
|
||||||
used in the WINDOWS32 port to check whether + or $(MAKE) were found
|
WINDOWS32 port to check whether + or $(MAKE) were found in this command
|
||||||
in this command line, in which case the effect of just_print_flag
|
line, in which case the effect of just_print_flag is overridden.
|
||||||
is overridden. */
|
|
||||||
|
The returned value is either NULL if the line was empty, or else a pointer
|
||||||
|
to an array of strings. The fist pointer points to the memory used by all
|
||||||
|
the strings, so to free you free the 0'th element then the returned pointer
|
||||||
|
(see the FREE_ARGV macro). */
|
||||||
|
|
||||||
static char **
|
static char **
|
||||||
construct_command_argv_internal (char *line, char **restp, const char *shell,
|
construct_command_argv_internal (char *line, char **restp, const char *shell,
|
||||||
@@ -2744,7 +2761,7 @@ construct_command_argv_internal (char *line, char **restp, const char *shell,
|
|||||||
/* We used to have a double quote (") in sh_chars_dos[] below, but
|
/* We used to have a double quote (") in sh_chars_dos[] below, but
|
||||||
that caused any command line with quoted file names be run
|
that caused any command line with quoted file names be run
|
||||||
through a temporary batch file, which introduces command-line
|
through a temporary batch file, which introduces command-line
|
||||||
limit of 4K charcaters imposed by cmd.exe. Since CreateProcess
|
limit of 4K characters imposed by cmd.exe. Since CreateProcess
|
||||||
can handle quoted file names just fine, removing the quote lifts
|
can handle quoted file names just fine, removing the quote lifts
|
||||||
the limit from a very frequent use case, because using quoted
|
the limit from a very frequent use case, because using quoted
|
||||||
file names is commonplace on MS-Windows. */
|
file names is commonplace on MS-Windows. */
|
||||||
@@ -2775,9 +2792,10 @@ construct_command_argv_internal (char *line, char **restp, const char *shell,
|
|||||||
#else /* must be UNIX-ish */
|
#else /* must be UNIX-ish */
|
||||||
static const char *sh_chars = "#;\"*?[]&|<>(){}$`^~!";
|
static const char *sh_chars = "#;\"*?[]&|<>(){}$`^~!";
|
||||||
static const char *sh_cmds[] =
|
static const char *sh_cmds[] =
|
||||||
{ ".", ":", "break", "case", "cd", "command", "continue", "eval", "exec",
|
{ ".", ":", "alias", "bg", "break", "case", "cd", "command", "continue",
|
||||||
"exit", "export", "for", "if", "login", "logout", "read", "readonly",
|
"eval", "exec", "exit", "export", "fc", "fg", "for", "getopts", "hash",
|
||||||
"set", "shift", "switch", "test", "times", "trap", "ulimit", "umask",
|
"if", "jobs", "login", "logout", "read", "readonly", "return", "set",
|
||||||
|
"shift", "test", "times", "trap", "type", "ulimit", "umask", "unalias",
|
||||||
"unset", "wait", "while", 0 };
|
"unset", "wait", "while", 0 };
|
||||||
|
|
||||||
# ifdef HAVE_DOS_PATHS
|
# ifdef HAVE_DOS_PATHS
|
||||||
@@ -3028,8 +3046,7 @@ construct_command_argv_internal (char *line, char **restp, const char *shell,
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
if (p[1] != '\\' && p[1] != '\''
|
if (p[1] != '\\' && p[1] != '\'' && !ISSPACE (p[1])
|
||||||
&& !ISSPACE (p[1])
|
|
||||||
&& strchr (sh_chars_sh, p[1]) == 0)
|
&& strchr (sh_chars_sh, p[1]) == 0)
|
||||||
/* back up one notch, to copy the backslash */
|
/* back up one notch, to copy the backslash */
|
||||||
--p;
|
--p;
|
||||||
@@ -3347,25 +3364,44 @@ construct_command_argv_internal (char *line, char **restp, const char *shell,
|
|||||||
#endif /* WINDOWS32 */
|
#endif /* WINDOWS32 */
|
||||||
/* Create an argv list for the shell command line. */
|
/* Create an argv list for the shell command line. */
|
||||||
{
|
{
|
||||||
int n = 0;
|
int n = 1;
|
||||||
|
char *nextp;
|
||||||
|
|
||||||
new_argv = xmalloc ((4 + sflags_len/2) * sizeof (char *));
|
new_argv = xmalloc ((4 + sflags_len/2) * sizeof (char *));
|
||||||
new_argv[n++] = xstrdup (shell);
|
|
||||||
|
nextp = new_argv[0] = xmalloc (shell_len + sflags_len + line_len + 3);
|
||||||
|
nextp = mempcpy (nextp, shell, shell_len + 1);
|
||||||
|
|
||||||
/* Chop up the shellflags (if any) and assign them. */
|
/* Chop up the shellflags (if any) and assign them. */
|
||||||
if (! shellflags)
|
if (! shellflags)
|
||||||
new_argv[n++] = xstrdup ("");
|
{
|
||||||
|
new_argv[n++] = nextp;
|
||||||
|
*(nextp++) = '\0';
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
const char *s = shellflags;
|
/* Parse shellflags using construct_command_argv_internal to
|
||||||
char *t;
|
handle quotes. */
|
||||||
size_t len;
|
char **argv;
|
||||||
while ((t = find_next_token (&s, &len)) != 0)
|
char *f = alloca (sflags_len + 1);
|
||||||
new_argv[n++] = xstrndup (t, len);
|
memcpy (f, shellflags, sflags_len + 1);
|
||||||
|
argv = construct_command_argv_internal (f, 0, 0, 0, 0, flags, 0);
|
||||||
|
if (argv)
|
||||||
|
{
|
||||||
|
char **a;
|
||||||
|
for (a = argv; *a; ++a)
|
||||||
|
{
|
||||||
|
new_argv[n++] = nextp;
|
||||||
|
nextp = stpcpy (nextp, *a) + 1;
|
||||||
|
}
|
||||||
|
free (argv[0]);
|
||||||
|
free (argv);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Set the command to invoke. */
|
/* Set the command to invoke. */
|
||||||
new_argv[n++] = line;
|
new_argv[n++] = nextp;
|
||||||
|
memcpy(nextp, line, line_len + 1);
|
||||||
new_argv[n++] = NULL;
|
new_argv[n++] = NULL;
|
||||||
}
|
}
|
||||||
return new_argv;
|
return new_argv;
|
||||||
@@ -3386,9 +3422,10 @@ construct_command_argv_internal (char *line, char **restp, const char *shell,
|
|||||||
}
|
}
|
||||||
*(ap++) = ' ';
|
*(ap++) = ' ';
|
||||||
if (shellflags)
|
if (shellflags)
|
||||||
memcpy (ap, shellflags, sflags_len);
|
{
|
||||||
ap += sflags_len;
|
ap = mempcpy (ap, shellflags, sflags_len);
|
||||||
*(ap++) = ' ';
|
*(ap++) = ' ';
|
||||||
|
}
|
||||||
#ifdef WINDOWS32
|
#ifdef WINDOWS32
|
||||||
command_ptr = ap;
|
command_ptr = ap;
|
||||||
#endif
|
#endif
|
||||||
@@ -3433,8 +3470,7 @@ construct_command_argv_internal (char *line, char **restp, const char *shell,
|
|||||||
else if (unixy_shell && strneq (p, "...", 3))
|
else if (unixy_shell && strneq (p, "...", 3))
|
||||||
{
|
{
|
||||||
/* The case of '...' wildcard again. */
|
/* The case of '...' wildcard again. */
|
||||||
strcpy (ap, "\\.\\.\\");
|
ap = stpcpy (ap, "\\.\\.\\");
|
||||||
ap += 5;
|
|
||||||
p += 2;
|
p += 2;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@@ -3450,7 +3486,7 @@ construct_command_argv_internal (char *line, char **restp, const char *shell,
|
|||||||
|
|
||||||
#ifdef WINDOWS32
|
#ifdef WINDOWS32
|
||||||
/* Some shells do not work well when invoked as 'sh -c xxx' to run a
|
/* Some shells do not work well when invoked as 'sh -c xxx' to run a
|
||||||
command line (e.g. Cygnus GNUWIN32 sh.exe on WIN32 systems). In these
|
command line (e.g. Cygnus GNUWIN32 sh.exe on W32 systems). In these
|
||||||
cases, run commands via a script file. */
|
cases, run commands via a script file. */
|
||||||
if (just_print_flag && !(flags & COMMANDS_RECURSE))
|
if (just_print_flag && !(flags & COMMANDS_RECURSE))
|
||||||
{
|
{
|
||||||
@@ -3658,8 +3694,7 @@ construct_command_argv (char *line, char **restp, struct file *file,
|
|||||||
performed) and if shell is an absolute path without drive letter,
|
performed) and if shell is an absolute path without drive letter,
|
||||||
try whether it exists e.g.: if "/bin/sh" does not exist use
|
try whether it exists e.g.: if "/bin/sh" does not exist use
|
||||||
"$UNIXROOT/bin/sh" instead. */
|
"$UNIXROOT/bin/sh" instead. */
|
||||||
if (unixroot && shell && strcmp (shell, last_shell) != 0
|
if (unixroot && shell && ISDIRSEP (shell[0]) && !streq (shell, last_shell))
|
||||||
&& (shell[0] == '/' || shell[0] == '\\'))
|
|
||||||
{
|
{
|
||||||
/* trying a new shell, check whether it exists */
|
/* trying a new shell, check whether it exists */
|
||||||
size_t size = strlen (shell);
|
size_t size = strlen (shell);
|
||||||
|
|||||||
16
src/job.h
16
src/job.h
@@ -1,5 +1,5 @@
|
|||||||
/* Definitions for managing subprocesses in GNU Make.
|
/* Definitions for managing subprocesses in GNU Make.
|
||||||
Copyright (C) 1992-2019 Free Software Foundation, Inc.
|
Copyright (C) 1992-2022 Free Software Foundation, Inc.
|
||||||
This file is part of GNU Make.
|
This file is part of GNU Make.
|
||||||
|
|
||||||
GNU Make is free software; you can redistribute it and/or modify it under the
|
GNU Make is free software; you can redistribute it and/or modify it under the
|
||||||
@@ -12,7 +12,7 @@ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|||||||
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
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
|
You should have received a copy of the GNU General Public License along with
|
||||||
this program. If not, see <http://www.gnu.org/licenses/>. */
|
this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||||
|
|
||||||
#include "output.h"
|
#include "output.h"
|
||||||
|
|
||||||
@@ -29,7 +29,7 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define CHILDBASE \
|
#define CHILDBASE \
|
||||||
char *cmd_name; /* Alloced copy of command run. */ \
|
char *cmd_name; /* Allocated copy of command run. */ \
|
||||||
char **environment; /* Environment for commands. */ \
|
char **environment; /* Environment for commands. */ \
|
||||||
VMSCHILD \
|
VMSCHILD \
|
||||||
struct output output /* Output for this child. */
|
struct output output /* Output for this child. */
|
||||||
@@ -61,17 +61,19 @@ struct child
|
|||||||
unsigned int good_stdin:1; /* Nonzero if this child has a good stdin. */
|
unsigned int good_stdin:1; /* Nonzero if this child has a good stdin. */
|
||||||
unsigned int deleted:1; /* Nonzero if targets have been deleted. */
|
unsigned int deleted:1; /* Nonzero if targets have been deleted. */
|
||||||
unsigned int recursive:1; /* Nonzero for recursive command ('+' etc.) */
|
unsigned int recursive:1; /* Nonzero for recursive command ('+' etc.) */
|
||||||
|
unsigned int jobslot:1; /* Nonzero if it's reserved a job slot. */
|
||||||
unsigned int dontcare:1; /* Saved dontcare flag. */
|
unsigned int dontcare:1; /* Saved dontcare flag. */
|
||||||
};
|
};
|
||||||
|
|
||||||
extern struct child *children;
|
extern struct child *children;
|
||||||
|
|
||||||
/* A signal handler for SIGCHLD, if needed. */
|
/* A signal handler for SIGCHLD, if needed. */
|
||||||
RETSIGTYPE child_handler (int sig);
|
void child_handler (int sig);
|
||||||
int is_bourne_compatible_shell(const char *path);
|
int is_bourne_compatible_shell(const char *path);
|
||||||
void new_job (struct file *file);
|
void new_job (struct file *file);
|
||||||
void reap_children (int block, int err);
|
void reap_children (int block, int err);
|
||||||
void start_waiting_jobs (void);
|
void start_waiting_jobs (void);
|
||||||
|
void free_childbase (struct childbase* child);
|
||||||
|
|
||||||
char **construct_command_argv (char *line, char **restp, struct file *file,
|
char **construct_command_argv (char *line, char **restp, struct file *file,
|
||||||
int cmd_flags, char** batch_file);
|
int cmd_flags, char** batch_file);
|
||||||
@@ -79,11 +81,9 @@ char **construct_command_argv (char *line, char **restp, struct file *file,
|
|||||||
pid_t child_execute_job (struct childbase *child, int good_stdin, char **argv);
|
pid_t child_execute_job (struct childbase *child, int good_stdin, char **argv);
|
||||||
|
|
||||||
#ifdef _AMIGA
|
#ifdef _AMIGA
|
||||||
void exec_command (char **argv) __attribute__ ((noreturn));
|
void exec_command (char **argv) NORETURN;
|
||||||
#elif defined(__EMX__)
|
|
||||||
int exec_command (char **argv, char **envp);
|
|
||||||
#else
|
#else
|
||||||
void exec_command (char **argv, char **envp) __attribute__ ((noreturn));
|
pid_t exec_command (char **argv, char **envp);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void unblock_all_sigs (void);
|
void unblock_all_sigs (void);
|
||||||
|
|||||||
91
src/load.c
91
src/load.c
@@ -1,5 +1,5 @@
|
|||||||
/* Loading dynamic objects for GNU Make.
|
/* Loading dynamic objects for GNU Make.
|
||||||
Copyright (C) 2012-2019 Free Software Foundation, Inc.
|
Copyright (C) 2012-2022 Free Software Foundation, Inc.
|
||||||
This file is part of GNU Make.
|
This file is part of GNU Make.
|
||||||
|
|
||||||
GNU Make is free software; you can redistribute it and/or modify it under the
|
GNU Make is free software; you can redistribute it and/or modify it under the
|
||||||
@@ -12,7 +12,7 @@ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|||||||
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
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
|
You should have received a copy of the GNU General Public License along with
|
||||||
this program. If not, see <http://www.gnu.org/licenses/>. */
|
this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||||
|
|
||||||
#include "makeint.h"
|
#include "makeint.h"
|
||||||
|
|
||||||
@@ -84,12 +84,14 @@ load_object (const floc *flocp, int noerror, const char *ldname,
|
|||||||
{
|
{
|
||||||
const char *err = dlerror ();
|
const char *err = dlerror ();
|
||||||
if (noerror)
|
if (noerror)
|
||||||
DB (DB_BASIC, ("%s", err));
|
DB (DB_BASIC, ("%s\n", err));
|
||||||
else
|
else
|
||||||
OS (error, flocp, "%s", err);
|
OS (error, flocp, "%s", err);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DB (DB_VERBOSE, (_("Loaded shared object %s\n"), ldname));
|
||||||
|
|
||||||
/* Assert that the GPL license symbol is defined. */
|
/* Assert that the GPL license symbol is defined. */
|
||||||
symp = (load_func_t) dlsym (dlp, "plugin_is_GPL_compatible");
|
symp = (load_func_t) dlsym (dlp, "plugin_is_GPL_compatible");
|
||||||
if (! symp)
|
if (! symp)
|
||||||
@@ -119,19 +121,19 @@ load_object (const floc *flocp, int noerror, const char *ldname,
|
|||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
load_file (const floc *flocp, const char **ldname, int noerror)
|
load_file (const floc *flocp, struct file *file, int noerror)
|
||||||
{
|
{
|
||||||
size_t nmlen = strlen (*ldname);
|
const char *ldname = file->name;
|
||||||
|
size_t nmlen = strlen (ldname);
|
||||||
char *new = alloca (nmlen + CSTRLEN (SYMBOL_EXTENSION) + 1);
|
char *new = alloca (nmlen + CSTRLEN (SYMBOL_EXTENSION) + 1);
|
||||||
char *symname = NULL;
|
char *symname = NULL;
|
||||||
char *loaded;
|
|
||||||
const char *fp;
|
const char *fp;
|
||||||
int r;
|
int r;
|
||||||
load_func_t symp;
|
load_func_t symp;
|
||||||
|
|
||||||
/* Break the input into an object file name and a symbol name. If no symbol
|
/* Break the input into an object file name and a symbol name. If no symbol
|
||||||
name was provided, compute one from the object file name. */
|
name was provided, compute one from the object file name. */
|
||||||
fp = strchr (*ldname, '(');
|
fp = strchr (ldname, '(');
|
||||||
if (fp)
|
if (fp)
|
||||||
{
|
{
|
||||||
const char *ep;
|
const char *ep;
|
||||||
@@ -142,16 +144,16 @@ load_file (const floc *flocp, const char **ldname, int noerror)
|
|||||||
ep = strchr (fp+1, ')');
|
ep = strchr (fp+1, ')');
|
||||||
if (ep && ep[1] == '\0')
|
if (ep && ep[1] == '\0')
|
||||||
{
|
{
|
||||||
size_t l = fp - *ldname;;
|
size_t l = fp - ldname;
|
||||||
|
|
||||||
++fp;
|
++fp;
|
||||||
if (fp == ep)
|
if (fp == ep)
|
||||||
OS (fatal, flocp, _("Empty symbol name for load: %s"), *ldname);
|
OS (fatal, flocp, _("Empty symbol name for load: %s"), ldname);
|
||||||
|
|
||||||
/* Make a copy of the ldname part. */
|
/* Make a copy of the ldname part. */
|
||||||
memcpy (new, *ldname, l);
|
memcpy (new, ldname, l);
|
||||||
new[l] = '\0';
|
new[l] = '\0';
|
||||||
*ldname = new;
|
ldname = new;
|
||||||
nmlen = l;
|
nmlen = l;
|
||||||
|
|
||||||
/* Make a copy of the symbol name part. */
|
/* Make a copy of the symbol name part. */
|
||||||
@@ -161,22 +163,22 @@ load_file (const floc *flocp, const char **ldname, int noerror)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Add this name to the string cache so it can be reused later. */
|
/* Make sure this name is in the string cache. */
|
||||||
*ldname = strcache_add (*ldname);
|
ldname = file->name = strcache_add (ldname);
|
||||||
|
|
||||||
/* If this object has been loaded, we're done. */
|
/* If this object has been loaded, we're done: return -1 to ensure make does
|
||||||
loaded = allocated_variable_expand ("$(.LOADED)");
|
not rebuild again. If a rebuild is allowed it was set up when this
|
||||||
fp = strstr (loaded, *ldname);
|
object was initially loaded. */
|
||||||
r = fp && (fp==loaded || fp[-1]==' ') && (fp[nmlen]=='\0' || fp[nmlen]==' ');
|
file = lookup_file (ldname);
|
||||||
if (r)
|
if (file && file->loaded)
|
||||||
goto exit;
|
return -1;
|
||||||
|
|
||||||
/* If we didn't find a symbol name yet, construct it from the ldname. */
|
/* If we didn't find a symbol name yet, construct it from the ldname. */
|
||||||
if (! symname)
|
if (! symname)
|
||||||
{
|
{
|
||||||
char *p = new;
|
char *p = new;
|
||||||
|
|
||||||
fp = strrchr (*ldname, '/');
|
fp = strrchr (ldname, '/');
|
||||||
#ifdef HAVE_DOS_PATHS
|
#ifdef HAVE_DOS_PATHS
|
||||||
if (fp)
|
if (fp)
|
||||||
{
|
{
|
||||||
@@ -186,82 +188,75 @@ load_file (const floc *flocp, const char **ldname, int noerror)
|
|||||||
fp = fp2;
|
fp = fp2;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
fp = strrchr (*ldname, '\\');
|
fp = strrchr (ldname, '\\');
|
||||||
/* The (improbable) case of d:foo. */
|
/* The (improbable) case of d:foo. */
|
||||||
if (fp && *fp && fp[1] == ':')
|
if (fp && *fp && fp[1] == ':')
|
||||||
fp++;
|
fp++;
|
||||||
#endif
|
#endif
|
||||||
if (!fp)
|
if (!fp)
|
||||||
fp = *ldname;
|
fp = ldname;
|
||||||
else
|
else
|
||||||
++fp;
|
++fp;
|
||||||
while (isalnum (*fp) || *fp == '_')
|
while (isalnum ((unsigned char) *fp) || *fp == '_')
|
||||||
*(p++) = *(fp++);
|
*(p++) = *(fp++);
|
||||||
strcpy (p, SYMBOL_EXTENSION);
|
strcpy (p, SYMBOL_EXTENSION);
|
||||||
symname = new;
|
symname = new;
|
||||||
}
|
}
|
||||||
|
|
||||||
DB (DB_VERBOSE, (_("Loading symbol %s from %s\n"), symname, *ldname));
|
DB (DB_VERBOSE, (_("Loading symbol %s from %s\n"), symname, ldname));
|
||||||
|
|
||||||
/* Load it! */
|
/* Load it! */
|
||||||
symp = load_object (flocp, noerror, *ldname, symname);
|
symp = load_object (flocp, noerror, ldname, symname);
|
||||||
if (! symp)
|
if (! symp)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
/* Invoke the symbol. */
|
/* Invoke the symbol. */
|
||||||
r = (*symp) (flocp);
|
r = (*symp) (flocp);
|
||||||
|
|
||||||
/* If it succeeded, add the load file to the loaded variable. */
|
/* If the load didn't fail, add the file to the .LOADED variable. */
|
||||||
if (r > 0)
|
if (r)
|
||||||
{
|
do_variable_definition(flocp, ".LOADED", ldname, o_file, f_append_value, 0);
|
||||||
size_t loadlen = strlen (loaded);
|
|
||||||
char *newval = alloca (loadlen + strlen (*ldname) + 2);
|
|
||||||
/* Don't add a space if it's empty. */
|
|
||||||
if (loadlen)
|
|
||||||
{
|
|
||||||
memcpy (newval, loaded, loadlen);
|
|
||||||
newval[loadlen++] = ' ';
|
|
||||||
}
|
|
||||||
strcpy (&newval[loadlen], *ldname);
|
|
||||||
do_variable_definition (flocp, ".LOADED", newval, o_default, f_simple, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
exit:
|
|
||||||
free (loaded);
|
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
int
|
||||||
unload_file (const char *name)
|
unload_file (const char *name)
|
||||||
{
|
{
|
||||||
|
int rc = 0;
|
||||||
struct load_list *d;
|
struct load_list *d;
|
||||||
|
|
||||||
for (d = loaded_syms; d != NULL; d = d->next)
|
for (d = loaded_syms; d != NULL; d = d->next)
|
||||||
if (streq (d->name, name) && d->dlp)
|
if (streq (d->name, name) && d->dlp)
|
||||||
{
|
{
|
||||||
if (dlclose (d->dlp))
|
DB (DB_VERBOSE, (_("Unloading shared object %s\n"), name));
|
||||||
|
rc = dlclose (d->dlp);
|
||||||
|
if (rc)
|
||||||
perror_with_name ("dlclose: ", d->name);
|
perror_with_name ("dlclose: ", d->name);
|
||||||
d->dlp = NULL;
|
else
|
||||||
|
d->dlp = NULL;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
int
|
int
|
||||||
load_file (const floc *flocp, const char **ldname UNUSED, int noerror)
|
load_file (const floc *flocp, struct file *file UNUSED, int noerror)
|
||||||
{
|
{
|
||||||
if (! noerror)
|
if (! noerror)
|
||||||
O (fatal, flocp,
|
O (fatal, flocp,
|
||||||
_("The 'load' operation is not supported on this platform."));
|
_("The 'load' operation is not supported on this platform"));
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
int
|
||||||
unload_file (const char *name UNUSED)
|
unload_file (const char *name UNUSED)
|
||||||
{
|
{
|
||||||
O (fatal, NILF, "INTERNAL: Cannot unload when load is not supported!");
|
O (fatal, NILF, "INTERNAL: Cannot unload when load is not supported");
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* MAKE_LOAD */
|
#endif /* MAKE_LOAD */
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/* API for GNU Make dynamic objects.
|
/* API for GNU Make dynamic objects.
|
||||||
Copyright (C) 2013-2019 Free Software Foundation, Inc.
|
Copyright (C) 2013-2022 Free Software Foundation, Inc.
|
||||||
This file is part of GNU Make.
|
This file is part of GNU Make.
|
||||||
|
|
||||||
GNU Make is free software; you can redistribute it and/or modify it under the
|
GNU Make is free software; you can redistribute it and/or modify it under the
|
||||||
@@ -12,7 +12,7 @@ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|||||||
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
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
|
You should have received a copy of the GNU General Public License along with
|
||||||
this program. If not, see <http://www.gnu.org/licenses/>. */
|
this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||||
|
|
||||||
#include "makeint.h"
|
#include "makeint.h"
|
||||||
|
|
||||||
|
|||||||
1398
src/main.c
1398
src/main.c
File diff suppressed because it is too large
Load Diff
206
src/makeint.h
206
src/makeint.h
@@ -1,5 +1,5 @@
|
|||||||
/* Miscellaneous global declarations and portability cruft for GNU Make.
|
/* Miscellaneous global declarations and portability cruft for GNU Make.
|
||||||
Copyright (C) 1988-2019 Free Software Foundation, Inc.
|
Copyright (C) 1988-2022 Free Software Foundation, Inc.
|
||||||
This file is part of GNU Make.
|
This file is part of GNU Make.
|
||||||
|
|
||||||
GNU Make is free software; you can redistribute it and/or modify it under the
|
GNU Make is free software; you can redistribute it and/or modify it under the
|
||||||
@@ -12,7 +12,7 @@ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|||||||
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
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
|
You should have received a copy of the GNU General Public License along with
|
||||||
this program. If not, see <http://www.gnu.org/licenses/>. */
|
this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||||
|
|
||||||
/* We use <config.h> instead of "config.h" so that a compilation
|
/* 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
|
using -I. -I$srcdir will use ./config.h rather than $srcdir/config.h
|
||||||
@@ -41,6 +41,21 @@ char *alloca ();
|
|||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* Some versions of GCC (e.g., 10.x) set the warn_unused_result attribute on
|
||||||
|
__builtin_alloca. This causes alloca(0) to fail and is not easily worked
|
||||||
|
around so avoid it via the preprocessor.
|
||||||
|
See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98055 */
|
||||||
|
|
||||||
|
#if defined (__has_builtin)
|
||||||
|
# if __has_builtin (__builtin_alloca)
|
||||||
|
# define free_alloca()
|
||||||
|
# else
|
||||||
|
# define free_alloca() alloca (0)
|
||||||
|
# endif
|
||||||
|
#else
|
||||||
|
# define free_alloca() alloca (0)
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Disable assert() unless we're a maintainer.
|
/* Disable assert() unless we're a maintainer.
|
||||||
Some asserts are compute-intensive. */
|
Some asserts are compute-intensive. */
|
||||||
#ifndef MAKE_MAINTAINER_MODE
|
#ifndef MAKE_MAINTAINER_MODE
|
||||||
@@ -79,16 +94,10 @@ char *alloca ();
|
|||||||
unless <sys/timeb.h> has been included first. */
|
unless <sys/timeb.h> has been included first. */
|
||||||
# include <sys/timeb.h>
|
# include <sys/timeb.h>
|
||||||
#endif
|
#endif
|
||||||
#if TIME_WITH_SYS_TIME
|
#if HAVE_SYS_TIME_H
|
||||||
# include <sys/time.h>
|
# include <sys/time.h>
|
||||||
# include <time.h>
|
|
||||||
#else
|
|
||||||
# if HAVE_SYS_TIME_H
|
|
||||||
# include <sys/time.h>
|
|
||||||
# else
|
|
||||||
# include <time.h>
|
|
||||||
# endif
|
|
||||||
#endif
|
#endif
|
||||||
|
#include <time.h>
|
||||||
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
|
||||||
@@ -115,7 +124,7 @@ extern int errno;
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Some systems define _POSIX_VERSION but are not really POSIX.1. */
|
/* Some systems define _POSIX_VERSION but are not really POSIX.1. */
|
||||||
#if (defined (butterfly) || defined (__arm) || (defined (__mips) && defined (_SYSTYPE_SVR3)) || (defined (sequent) && defined (i386)))
|
#if (defined (butterfly) || (defined (__mips) && defined (_SYSTYPE_SVR3)) || (defined (sequent) && defined (i386)))
|
||||||
# undef POSIX
|
# undef POSIX
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -123,10 +132,6 @@ extern int errno;
|
|||||||
# define POSIX 1
|
# define POSIX 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef RETSIGTYPE
|
|
||||||
# define RETSIGTYPE void
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef sigmask
|
#ifndef sigmask
|
||||||
# define sigmask(sig) (1 << ((sig) - 1))
|
# define sigmask(sig) (1 << ((sig) - 1))
|
||||||
#endif
|
#endif
|
||||||
@@ -147,13 +152,14 @@ extern int errno;
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef PATH_MAX
|
#ifndef PATH_MAX
|
||||||
# ifndef POSIX
|
# ifdef MAXPATHLEN
|
||||||
# define PATH_MAX MAXPATHLEN
|
# define PATH_MAX MAXPATHLEN
|
||||||
|
# else
|
||||||
|
/* Some systems (HURD) have fully dynamic pathnames with no maximum.
|
||||||
|
Ideally we'd support this but it will take some work. */
|
||||||
|
# define PATH_MAX 4096
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
#ifndef MAXPATHLEN
|
|
||||||
# define MAXPATHLEN 1024
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef PATH_MAX
|
#ifdef PATH_MAX
|
||||||
# define GET_PATH_MAX PATH_MAX
|
# define GET_PATH_MAX PATH_MAX
|
||||||
@@ -220,19 +226,22 @@ extern int vms_legacy_behavior;
|
|||||||
extern int vms_unix_simulation;
|
extern int vms_unix_simulation;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef __attribute__
|
#if !defined(__attribute__) && (__GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) || __STRICT_ANSI__)
|
||||||
/* This feature is available in gcc versions 2.5 and later. */
|
/* Don't use __attribute__ if it's not supported. */
|
||||||
# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) || __STRICT_ANSI__
|
# define ATTRIBUTE(x)
|
||||||
# define __attribute__(x)
|
#else
|
||||||
# endif
|
# define ATTRIBUTE(x) __attribute__ (x)
|
||||||
|
#endif
|
||||||
|
|
||||||
/* The __-protected variants of 'format' and 'printf' attributes
|
/* The __-protected variants of 'format' and 'printf' attributes
|
||||||
are accepted by gcc versions 2.6.4 (effectively 2.7) and later. */
|
are accepted by gcc versions 2.6.4 (effectively 2.7) and later. */
|
||||||
# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7)
|
#if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7)
|
||||||
# define __format__ format
|
# define __format__ format
|
||||||
# define __printf__ printf
|
# define __printf__ printf
|
||||||
# endif
|
|
||||||
#endif
|
#endif
|
||||||
#define UNUSED __attribute__ ((unused))
|
|
||||||
|
#define UNUSED ATTRIBUTE ((unused))
|
||||||
|
#define NORETURN ATTRIBUTE ((noreturn))
|
||||||
|
|
||||||
#if defined (STDC_HEADERS) || defined (__GNU_LIBRARY__)
|
#if defined (STDC_HEADERS) || defined (__GNU_LIBRARY__)
|
||||||
# include <stdlib.h>
|
# include <stdlib.h>
|
||||||
@@ -255,8 +264,8 @@ void *malloc (int);
|
|||||||
void *realloc (void *, int);
|
void *realloc (void *, int);
|
||||||
void free (void *);
|
void free (void *);
|
||||||
|
|
||||||
void abort (void) __attribute__ ((noreturn));
|
void abort (void) NORETURN;
|
||||||
void exit (int) __attribute__ ((noreturn));
|
void exit (int) NORETURN;
|
||||||
# endif /* HAVE_STDLIB_H. */
|
# endif /* HAVE_STDLIB_H. */
|
||||||
|
|
||||||
#endif /* Standard headers. */
|
#endif /* Standard headers. */
|
||||||
@@ -286,6 +295,21 @@ char *strerror (int errnum);
|
|||||||
#if HAVE_STDINT_H
|
#if HAVE_STDINT_H
|
||||||
# include <stdint.h>
|
# include <stdint.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined _MSC_VER || defined __MINGW32__
|
||||||
|
# define MK_PRI64_PREFIX "I64"
|
||||||
|
#else
|
||||||
|
# define MK_PRI64_PREFIX "ll"
|
||||||
|
#endif
|
||||||
|
#ifndef PRIdMAX
|
||||||
|
# define PRIdMAX MK_PRI64_PREFIX "d"
|
||||||
|
#endif
|
||||||
|
#ifndef PRIuMAX
|
||||||
|
# define PRIuMAX MK_PRI64_PREFIX "u"
|
||||||
|
#endif
|
||||||
|
#ifndef SCNdMAX
|
||||||
|
# define SCNdMAX PRIdMAX
|
||||||
|
#endif
|
||||||
#define FILE_TIMESTAMP uintmax_t
|
#define FILE_TIMESTAMP uintmax_t
|
||||||
|
|
||||||
#if !defined(HAVE_STRSIGNAL)
|
#if !defined(HAVE_STRSIGNAL)
|
||||||
@@ -327,7 +351,7 @@ extern mode_t umask (mode_t);
|
|||||||
|
|
||||||
#define strneq(a, b, l) (strncmp ((a), (b), (l)) == 0)
|
#define strneq(a, b, l) (strncmp ((a), (b), (l)) == 0)
|
||||||
|
|
||||||
#if defined(__GNUC__) || defined(ENUM_BITFIELDS)
|
#if defined(ENUM_BITFIELDS) || (defined(__GNUC__) && !defined(__STRICT_ANSI__))
|
||||||
# define ENUM_BITFIELD(bits) :bits
|
# define ENUM_BITFIELD(bits) :bits
|
||||||
#else
|
#else
|
||||||
# define ENUM_BITFIELD(bits)
|
# define ENUM_BITFIELD(bits)
|
||||||
@@ -385,11 +409,13 @@ extern int unixy_shell;
|
|||||||
# define WIN32_LEAN_AND_MEAN
|
# define WIN32_LEAN_AND_MEAN
|
||||||
#endif /* WINDOWS32 */
|
#endif /* WINDOWS32 */
|
||||||
|
|
||||||
|
/* ALL_SET() evaluates the second argument twice. */
|
||||||
#define ANY_SET(_v,_m) (((_v)&(_m)) != 0)
|
#define ANY_SET(_v,_m) (((_v)&(_m)) != 0)
|
||||||
#define NONE_SET(_v,_m) (! ANY_SET ((_v),(_m)))
|
#define NONE_SET(_v,_m) (! ANY_SET ((_v),(_m)))
|
||||||
|
#define ALL_SET(_v,_m) (((_v)&(_m)) == (_m))
|
||||||
|
|
||||||
#define MAP_NUL 0x0001
|
#define MAP_NUL 0x0001
|
||||||
#define MAP_BLANK 0x0002
|
#define MAP_BLANK 0x0002 /* space, TAB */
|
||||||
#define MAP_NEWLINE 0x0004
|
#define MAP_NEWLINE 0x0004
|
||||||
#define MAP_COMMENT 0x0008
|
#define MAP_COMMENT 0x0008
|
||||||
#define MAP_SEMI 0x0010
|
#define MAP_SEMI 0x0010
|
||||||
@@ -443,10 +469,16 @@ extern int unixy_shell;
|
|||||||
|
|
||||||
#define STOP_SET(_v,_m) ANY_SET(stopchar_map[(unsigned char)(_v)],(_m))
|
#define STOP_SET(_v,_m) ANY_SET(stopchar_map[(unsigned char)(_v)],(_m))
|
||||||
|
|
||||||
|
/* True if C is a directory separator on the current system. */
|
||||||
|
#define ISDIRSEP(c) STOP_SET((c),MAP_DIRSEP)
|
||||||
|
/* True if C is whitespace but not newline. */
|
||||||
#define ISBLANK(c) STOP_SET((c),MAP_BLANK)
|
#define ISBLANK(c) STOP_SET((c),MAP_BLANK)
|
||||||
|
/* True if C is whitespace including newlines. */
|
||||||
#define ISSPACE(c) STOP_SET((c),MAP_SPACE)
|
#define ISSPACE(c) STOP_SET((c),MAP_SPACE)
|
||||||
|
/* True if C is nul or whitespace (including newline). */
|
||||||
|
#define END_OF_TOKEN(c) STOP_SET((c),MAP_SPACE|MAP_NUL)
|
||||||
|
/* Move S past all whitespace (including newlines). */
|
||||||
#define NEXT_TOKEN(s) while (ISSPACE (*(s))) ++(s)
|
#define NEXT_TOKEN(s) while (ISSPACE (*(s))) ++(s)
|
||||||
#define END_OF_TOKEN(s) while (! STOP_SET (*(s), MAP_SPACE|MAP_NUL)) ++(s)
|
|
||||||
|
|
||||||
/* We can't run setrlimit when using posix_spawn. */
|
/* We can't run setrlimit when using posix_spawn. */
|
||||||
#if defined(HAVE_SYS_RESOURCE_H) && defined(HAVE_GETRLIMIT) && defined(HAVE_SETRLIMIT) && !defined(USE_POSIX_SPAWN)
|
#if defined(HAVE_SYS_RESOURCE_H) && defined(HAVE_GETRLIMIT) && defined(HAVE_SETRLIMIT) && !defined(USE_POSIX_SPAWN)
|
||||||
@@ -461,11 +493,17 @@ extern struct rlimit stack_limit;
|
|||||||
|
|
||||||
#define NILF ((floc *)0)
|
#define NILF ((floc *)0)
|
||||||
|
|
||||||
|
/* Number of characters in a string constant. Does NOT include the \0 byte. */
|
||||||
#define CSTRLEN(_s) (sizeof (_s)-1)
|
#define CSTRLEN(_s) (sizeof (_s)-1)
|
||||||
|
|
||||||
|
/* Only usable when NOT calling a macro: only use it for local functions. */
|
||||||
#define STRING_SIZE_TUPLE(_s) (_s), CSTRLEN(_s)
|
#define STRING_SIZE_TUPLE(_s) (_s), CSTRLEN(_s)
|
||||||
|
|
||||||
/* The number of bytes needed to represent the largest integer as a string. */
|
/* The number of bytes needed to represent the largest signed and unsigned
|
||||||
#define INTSTR_LENGTH CSTRLEN ("18446744073709551616")
|
integers as a string.
|
||||||
|
Does NOT include space for \0 so be sure to add it if needed.
|
||||||
|
Math suggested by Edward Welbourne <edward.welbourne@qt.io> */
|
||||||
|
#define INTSTR_LENGTH (53 * sizeof(uintmax_t) / 22 + 3)
|
||||||
|
|
||||||
#define DEFAULT_TTYNAME "true"
|
#define DEFAULT_TTYNAME "true"
|
||||||
#ifdef HAVE_TTYNAME
|
#ifdef HAVE_TTYNAME
|
||||||
@@ -474,8 +512,19 @@ extern struct rlimit stack_limit;
|
|||||||
# define TTYNAME(_f) DEFAULT_TTYNAME
|
# define TTYNAME(_f) DEFAULT_TTYNAME
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef VMS
|
||||||
|
# define DEFAULT_TMPDIR "/sys$scratch/"
|
||||||
|
#elif defined(P_tmpdir)
|
||||||
|
# define DEFAULT_TMPDIR P_tmpdir
|
||||||
|
#else
|
||||||
|
# define DEFAULT_TMPDIR "/tmp"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
struct file;
|
||||||
|
|
||||||
/* Specify the location of elements read from makefiles. */
|
/* Specify the location of elements read from makefiles. */
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
@@ -486,12 +535,12 @@ typedef struct
|
|||||||
|
|
||||||
const char *concat (unsigned int, ...);
|
const char *concat (unsigned int, ...);
|
||||||
void message (int prefix, size_t length, const char *fmt, ...)
|
void message (int prefix, size_t length, const char *fmt, ...)
|
||||||
__attribute__ ((__format__ (__printf__, 3, 4)));
|
ATTRIBUTE ((__format__ (__printf__, 3, 4)));
|
||||||
void error (const floc *flocp, size_t length, const char *fmt, ...)
|
void error (const floc *flocp, size_t length, const char *fmt, ...)
|
||||||
__attribute__ ((__format__ (__printf__, 3, 4)));
|
ATTRIBUTE ((__format__ (__printf__, 3, 4)));
|
||||||
void fatal (const floc *flocp, size_t length, const char *fmt, ...)
|
void fatal (const floc *flocp, size_t length, const char *fmt, ...)
|
||||||
__attribute__ ((noreturn, __format__ (__printf__, 3, 4)));
|
ATTRIBUTE ((noreturn, __format__ (__printf__, 3, 4)));
|
||||||
void out_of_memory () __attribute__((noreturn));
|
void out_of_memory (void) NORETURN;
|
||||||
|
|
||||||
/* When adding macros to this list be sure to update the value of
|
/* When adding macros to this list be sure to update the value of
|
||||||
XGETTEXT_OPTIONS in the po/Makevars file. */
|
XGETTEXT_OPTIONS in the po/Makevars file. */
|
||||||
@@ -509,10 +558,18 @@ void out_of_memory () __attribute__((noreturn));
|
|||||||
#define ONS(_t,_a,_f,_n,_s) _t((_a), INTSTR_LENGTH + strlen (_s), \
|
#define ONS(_t,_a,_f,_n,_s) _t((_a), INTSTR_LENGTH + strlen (_s), \
|
||||||
(_f), (_n), (_s))
|
(_f), (_n), (_s))
|
||||||
|
|
||||||
void die (int) __attribute__ ((noreturn));
|
void decode_env_switches (const char*, size_t line);
|
||||||
void pfatal_with_name (const char *) __attribute__ ((noreturn));
|
void temp_stdin_unlink (void);
|
||||||
|
void die (int) NORETURN;
|
||||||
|
void pfatal_with_name (const char *) NORETURN;
|
||||||
void perror_with_name (const char *, const char *);
|
void perror_with_name (const char *, const char *);
|
||||||
#define xstrlen(_s) ((_s)==NULL ? 0 : strlen (_s))
|
#define xstrlen(_s) ((_s)==NULL ? 0 : strlen (_s))
|
||||||
|
unsigned int make_toui (const char*, const char**);
|
||||||
|
char *make_lltoa (long long, char *);
|
||||||
|
char *make_ulltoa (unsigned long long, char *);
|
||||||
|
void make_seed (unsigned int);
|
||||||
|
unsigned int make_rand (void);
|
||||||
|
pid_t make_pid (void);
|
||||||
void *xmalloc (size_t);
|
void *xmalloc (size_t);
|
||||||
void *xcalloc (size_t);
|
void *xcalloc (size_t);
|
||||||
void *xrealloc (void *, size_t);
|
void *xrealloc (void *, size_t);
|
||||||
@@ -527,9 +584,15 @@ int alpha_compare (const void *, const void *);
|
|||||||
void print_spaces (unsigned int);
|
void print_spaces (unsigned int);
|
||||||
char *find_percent (char *);
|
char *find_percent (char *);
|
||||||
const char *find_percent_cached (const char **);
|
const char *find_percent_cached (const char **);
|
||||||
FILE *get_tmpfile (char **, const char *);
|
const char *get_tmpdir (void);
|
||||||
ssize_t writebuf (int, const void*, size_t);
|
int get_tmpfd (char **);
|
||||||
ssize_t readbuf (int, void*, size_t);
|
FILE *get_tmpfile (char **);
|
||||||
|
ssize_t writebuf (int, const void *, size_t);
|
||||||
|
ssize_t readbuf (int, void *, size_t);
|
||||||
|
|
||||||
|
#ifndef HAVE_MEMRCHR
|
||||||
|
void *memrchr(const void *, int, size_t);
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef NO_ARCHIVES
|
#ifndef NO_ARCHIVES
|
||||||
int ar_name (const char *);
|
int ar_name (const char *);
|
||||||
@@ -537,13 +600,14 @@ void ar_parse_name (const char *, char **, char **);
|
|||||||
int ar_touch (const char *);
|
int ar_touch (const char *);
|
||||||
time_t ar_member_date (const char *);
|
time_t ar_member_date (const char *);
|
||||||
|
|
||||||
typedef long int (*ar_member_func_t) (int desc, const char *mem, int truncated,
|
typedef intmax_t (*ar_member_func_t) (int desc, const char *mem, int truncated,
|
||||||
long int hdrpos, long int datapos,
|
long int hdrpos, long int datapos,
|
||||||
long int size, long int date, int uid,
|
long int size, intmax_t date, int uid,
|
||||||
int gid, unsigned int mode,
|
int gid, unsigned int mode,
|
||||||
const void *arg);
|
const void *arg);
|
||||||
|
|
||||||
long int ar_scan (const char *archive, ar_member_func_t function, const void *arg);
|
intmax_t ar_scan (const char *archive, ar_member_func_t function,
|
||||||
|
const void *arg);
|
||||||
int ar_name_equal (const char *name, const char *mem, int truncated);
|
int ar_name_equal (const char *name, const char *mem, int truncated);
|
||||||
#ifndef VMS
|
#ifndef VMS
|
||||||
int ar_member_touch (const char *arname, const char *memname);
|
int ar_member_touch (const char *arname, const char *memname);
|
||||||
@@ -573,10 +637,6 @@ int gpath_search (const char *file, size_t len);
|
|||||||
|
|
||||||
void construct_include_path (const char **arg_dirs);
|
void construct_include_path (const char **arg_dirs);
|
||||||
|
|
||||||
void user_access (void);
|
|
||||||
void make_access (void);
|
|
||||||
void child_access (void);
|
|
||||||
|
|
||||||
char *strip_whitespace (const char **begpp, const char **endpp);
|
char *strip_whitespace (const char **begpp, const char **endpp);
|
||||||
|
|
||||||
void show_goal_error (void);
|
void show_goal_error (void);
|
||||||
@@ -593,15 +653,19 @@ int guile_gmake_setup (const floc *flocp);
|
|||||||
|
|
||||||
/* Loadable object support. Sets to the strcached name of the loaded file. */
|
/* Loadable object support. Sets to the strcached name of the loaded file. */
|
||||||
typedef int (*load_func_t)(const floc *flocp);
|
typedef int (*load_func_t)(const floc *flocp);
|
||||||
int load_file (const floc *flocp, const char **filename, int noerror);
|
int load_file (const floc *flocp, struct file *file, int noerror);
|
||||||
void unload_file (const char *name);
|
int unload_file (const char *name);
|
||||||
|
|
||||||
/* Maintainer mode support */
|
/* Maintainer mode support */
|
||||||
#ifdef MAKE_MAINTAINER_MODE
|
#ifdef MAKE_MAINTAINER_MODE
|
||||||
# define SPIN(_s) spin (_s)
|
# define SPIN(_s) spin (_s)
|
||||||
void spin (const char* suffix);
|
void spin (const char* suffix);
|
||||||
|
# define DBG(_f) dbg _f
|
||||||
|
void dbg (const char *fmt, ...);
|
||||||
#else
|
#else
|
||||||
# define SPIN(_s)
|
# define SPIN(_s)
|
||||||
|
/* Never put this code into Git or a release. */
|
||||||
|
# define DBG(_f) compile-error
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* We omit these declarations on non-POSIX systems which define _POSIX_VERSION,
|
/* We omit these declarations on non-POSIX systems which define _POSIX_VERSION,
|
||||||
@@ -609,17 +673,16 @@ void spin (const char* suffix);
|
|||||||
|
|
||||||
#if !defined (__GNU_LIBRARY__) && !defined (POSIX) && !defined (_POSIX_VERSION) && !defined(WINDOWS32)
|
#if !defined (__GNU_LIBRARY__) && !defined (POSIX) && !defined (_POSIX_VERSION) && !defined(WINDOWS32)
|
||||||
|
|
||||||
long int atol ();
|
|
||||||
# ifndef VMS
|
# ifndef VMS
|
||||||
long int lseek ();
|
long int lseek ();
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
# ifdef HAVE_GETCWD
|
# ifdef HAVE_GETCWD
|
||||||
# if !defined(VMS) && !defined(__DECC)
|
# if !defined(VMS) && !defined(__DECC)
|
||||||
char *getcwd ();
|
char *getcwd (void);
|
||||||
# endif
|
# endif
|
||||||
# else
|
# else
|
||||||
char *getwd ();
|
char *getwd (void);
|
||||||
# define getcwd(buf, len) getwd (buf)
|
# define getcwd(buf, len) getwd (buf)
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
@@ -643,10 +706,20 @@ int strcasecmp (const char *s1, const char *s2);
|
|||||||
# define strncasecmp strncmpi
|
# define strncasecmp strncmpi
|
||||||
# else
|
# else
|
||||||
/* Create our own, in misc.c */
|
/* Create our own, in misc.c */
|
||||||
int strncasecmp (const char *s1, const char *s2, int n);
|
int strncasecmp (const char *s1, const char *s2, size_t n);
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if !HAVE_MEMPCPY
|
||||||
|
/* Create our own, in misc.c */
|
||||||
|
void *mempcpy (void *dest, const void *src, size_t n);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if !HAVE_STPCPY
|
||||||
|
/* Create our own, in misc.c */
|
||||||
|
char *stpcpy (char *dest, const char *src);
|
||||||
|
#endif
|
||||||
|
|
||||||
#define OUTPUT_SYNC_NONE 0
|
#define OUTPUT_SYNC_NONE 0
|
||||||
#define OUTPUT_SYNC_LINE 1
|
#define OUTPUT_SYNC_LINE 1
|
||||||
#define OUTPUT_SYNC_TARGET 2
|
#define OUTPUT_SYNC_TARGET 2
|
||||||
@@ -663,21 +736,28 @@ extern unsigned short stopchar_map[];
|
|||||||
extern int just_print_flag, run_silent, ignore_errors_flag, keep_going_flag;
|
extern int just_print_flag, run_silent, ignore_errors_flag, keep_going_flag;
|
||||||
extern int print_data_base_flag, question_flag, touch_flag, always_make_flag;
|
extern int print_data_base_flag, question_flag, touch_flag, always_make_flag;
|
||||||
extern int env_overrides, no_builtin_rules_flag, no_builtin_variables_flag;
|
extern int env_overrides, no_builtin_rules_flag, no_builtin_variables_flag;
|
||||||
extern int print_version_flag, print_directory_flag, check_symlink_flag;
|
extern int print_version_flag, print_directory, check_symlink_flag;
|
||||||
extern int warn_undefined_variables_flag, trace_flag, posix_pedantic;
|
extern int warn_undefined_variables_flag, posix_pedantic;
|
||||||
extern int not_parallel, second_expansion, clock_skew_detected;
|
extern int not_parallel, second_expansion, clock_skew_detected;
|
||||||
extern int rebuilding_makefiles, one_shell, output_sync, verify_flag;
|
extern int rebuilding_makefiles, one_shell, output_sync, verify_flag;
|
||||||
|
extern unsigned long command_count;
|
||||||
|
|
||||||
extern const char *default_shell;
|
extern const char *default_shell;
|
||||||
|
|
||||||
/* can we run commands via 'sh -c xxx' or must we use batch files? */
|
/* can we run commands via 'sh -c xxx' or must we use batch files? */
|
||||||
extern int batch_mode_shell;
|
extern int batch_mode_shell;
|
||||||
|
|
||||||
|
#define GNUMAKEFLAGS_NAME "GNUMAKEFLAGS"
|
||||||
|
#define MAKEFLAGS_NAME "MAKEFLAGS"
|
||||||
|
|
||||||
/* Resetting the command script introduction prefix character. */
|
/* Resetting the command script introduction prefix character. */
|
||||||
#define RECIPEPREFIX_NAME ".RECIPEPREFIX"
|
#define RECIPEPREFIX_NAME ".RECIPEPREFIX"
|
||||||
#define RECIPEPREFIX_DEFAULT '\t'
|
#define RECIPEPREFIX_DEFAULT '\t'
|
||||||
extern char cmd_prefix;
|
extern char cmd_prefix;
|
||||||
|
|
||||||
|
#define JOBSERVER_AUTH_OPT "jobserver-auth"
|
||||||
|
|
||||||
|
extern char *jobserver_auth;
|
||||||
extern unsigned int job_slots;
|
extern unsigned int job_slots;
|
||||||
extern double max_load_average;
|
extern double max_load_average;
|
||||||
|
|
||||||
@@ -730,7 +810,7 @@ extern char *version_string, *remote_description, *make_host;
|
|||||||
|
|
||||||
extern unsigned int commands_started;
|
extern unsigned int commands_started;
|
||||||
|
|
||||||
extern int handling_fatal_signal;
|
extern volatile sig_atomic_t handling_fatal_signal;
|
||||||
|
|
||||||
#ifndef MIN
|
#ifndef MIN
|
||||||
#define MIN(_a,_b) ((_a)<(_b)?(_a):(_b))
|
#define MIN(_a,_b) ((_a)<(_b)?(_a):(_b))
|
||||||
|
|||||||
747
src/misc.c
747
src/misc.c
@@ -1,5 +1,5 @@
|
|||||||
/* Miscellaneous generic support functions for GNU Make.
|
/* Miscellaneous generic support functions for GNU Make.
|
||||||
Copyright (C) 1988-2019 Free Software Foundation, Inc.
|
Copyright (C) 1988-2022 Free Software Foundation, Inc.
|
||||||
This file is part of GNU Make.
|
This file is part of GNU Make.
|
||||||
|
|
||||||
GNU Make is free software; you can redistribute it and/or modify it under the
|
GNU Make is free software; you can redistribute it and/or modify it under the
|
||||||
@@ -12,11 +12,12 @@ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|||||||
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
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
|
You should have received a copy of the GNU General Public License along with
|
||||||
this program. If not, see <http://www.gnu.org/licenses/>. */
|
this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||||
|
|
||||||
#include "makeint.h"
|
#include "makeint.h"
|
||||||
#include "filedef.h"
|
#include "filedef.h"
|
||||||
#include "dep.h"
|
#include "dep.h"
|
||||||
|
#include "os.h"
|
||||||
#include "debug.h"
|
#include "debug.h"
|
||||||
|
|
||||||
/* GNU make no longer supports pre-ANSI89 environments. */
|
/* GNU make no longer supports pre-ANSI89 environments. */
|
||||||
@@ -24,6 +25,7 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
|
|||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
|
|
||||||
#ifdef WINDOWS32
|
#ifdef WINDOWS32
|
||||||
|
# include <windows.h>
|
||||||
# include <io.h>
|
# include <io.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -33,6 +35,71 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
|
|||||||
# include <sys/file.h>
|
# include <sys/file.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
unsigned int
|
||||||
|
make_toui (const char *str, const char **error)
|
||||||
|
{
|
||||||
|
char *end;
|
||||||
|
unsigned long val = strtoul (str, &end, 10);
|
||||||
|
|
||||||
|
if (error)
|
||||||
|
{
|
||||||
|
if (str[0] == '\0')
|
||||||
|
*error = "Missing value";
|
||||||
|
else if (*end != '\0')
|
||||||
|
*error = "Invalid value";
|
||||||
|
else
|
||||||
|
*error = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
return val;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Convert val into a string, written to buf. buf must be large enough
|
||||||
|
to hold the largest possible value, plus a nul byte. Returns buf.
|
||||||
|
We can't use standard PRI* here: those are based on intNN_t types. */
|
||||||
|
|
||||||
|
char *
|
||||||
|
make_lltoa (long long val, char *buf)
|
||||||
|
{
|
||||||
|
sprintf (buf, "%" MK_PRI64_PREFIX "d", val);
|
||||||
|
return buf;
|
||||||
|
}
|
||||||
|
|
||||||
|
char *
|
||||||
|
make_ulltoa (unsigned long long val, char *buf)
|
||||||
|
{
|
||||||
|
sprintf (buf, "%" MK_PRI64_PREFIX "u", val);
|
||||||
|
return buf;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Simple random number generator, for use with shuffle.
|
||||||
|
This doesn't need to be truly random, just pretty random. Use our own
|
||||||
|
implementation rather than relying on the C runtime's rand() so we always
|
||||||
|
get the same results for a given seed, regardless of C runtime. */
|
||||||
|
|
||||||
|
static unsigned int mk_state = 0;
|
||||||
|
|
||||||
|
void
|
||||||
|
make_seed (unsigned int seed)
|
||||||
|
{
|
||||||
|
mk_state = seed;
|
||||||
|
}
|
||||||
|
|
||||||
|
unsigned int
|
||||||
|
make_rand ()
|
||||||
|
{
|
||||||
|
/* mk_state must never be 0. */
|
||||||
|
if (mk_state == 0)
|
||||||
|
mk_state = (unsigned int)(time (NULL) ^ make_pid ()) + 1;
|
||||||
|
|
||||||
|
/* A simple xorshift RNG. */
|
||||||
|
mk_state ^= mk_state << 13;
|
||||||
|
mk_state ^= mk_state >> 17;
|
||||||
|
mk_state ^= mk_state << 5;
|
||||||
|
|
||||||
|
return mk_state;
|
||||||
|
}
|
||||||
|
|
||||||
/* Compare strings *S1 and *S2.
|
/* Compare strings *S1 and *S2.
|
||||||
Return negative if the first is less, positive if it is greater,
|
Return negative if the first is less, positive if it is greater,
|
||||||
zero if they are equal. */
|
zero if they are equal. */
|
||||||
@@ -172,6 +239,16 @@ concat (unsigned int num, ...)
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef HAVE_UNISTD_H
|
||||||
|
pid_t getpid ();
|
||||||
|
#endif
|
||||||
|
|
||||||
|
pid_t make_pid ()
|
||||||
|
{
|
||||||
|
return getpid ();
|
||||||
|
}
|
||||||
|
|
||||||
/* Like malloc but get fatal error if memory is exhausted. */
|
/* Like malloc but get fatal error if memory is exhausted. */
|
||||||
/* Don't bother if we're using dmalloc; it provides these for us. */
|
/* Don't bother if we're using dmalloc; it provides these for us. */
|
||||||
|
|
||||||
@@ -260,6 +337,30 @@ xstrndup (const char *str, size_t length)
|
|||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef HAVE_MEMRCHR
|
||||||
|
void *
|
||||||
|
memrchr(const void* str, int ch, size_t len)
|
||||||
|
{
|
||||||
|
const char* sp = str;
|
||||||
|
const char* cp = sp;
|
||||||
|
|
||||||
|
if (len == 0)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
cp += len - 1;
|
||||||
|
|
||||||
|
while (cp[0] != ch)
|
||||||
|
{
|
||||||
|
if (cp == sp)
|
||||||
|
return NULL;
|
||||||
|
--cp;
|
||||||
|
}
|
||||||
|
|
||||||
|
return (void*)cp;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* Limited INDEX:
|
/* Limited INDEX:
|
||||||
@@ -283,7 +384,8 @@ lindex (const char *s, const char *limit, int c)
|
|||||||
char *
|
char *
|
||||||
end_of_token (const char *s)
|
end_of_token (const char *s)
|
||||||
{
|
{
|
||||||
END_OF_TOKEN (s);
|
while (! END_OF_TOKEN (*s))
|
||||||
|
++s;
|
||||||
return (char *)s;
|
return (char *)s;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -407,7 +509,8 @@ free_ns_chain (struct nameseq *ns)
|
|||||||
|
|
||||||
#ifdef MAKE_MAINTAINER_MODE
|
#ifdef MAKE_MAINTAINER_MODE
|
||||||
|
|
||||||
void spin(const char* type)
|
void
|
||||||
|
spin (const char* type)
|
||||||
{
|
{
|
||||||
char filenm[256];
|
char filenm[256];
|
||||||
struct stat dummy;
|
struct stat dummy;
|
||||||
@@ -418,11 +521,31 @@ void spin(const char* type)
|
|||||||
{
|
{
|
||||||
fprintf (stderr, "SPIN on %s\n", filenm);
|
fprintf (stderr, "SPIN on %s\n", filenm);
|
||||||
do
|
do
|
||||||
|
#ifdef WINDOWS32
|
||||||
|
Sleep (1000);
|
||||||
|
#else
|
||||||
sleep (1);
|
sleep (1);
|
||||||
|
#endif
|
||||||
while (stat (filenm, &dummy) == 0);
|
while (stat (filenm, &dummy) == 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
dbg (const char *fmt, ...)
|
||||||
|
{
|
||||||
|
FILE *fp = fopen ("/tmp/gmkdebug.log", "a+");
|
||||||
|
va_list args;
|
||||||
|
char buf[4096];
|
||||||
|
|
||||||
|
va_start (args, fmt);
|
||||||
|
vsprintf (buf, fmt, args);
|
||||||
|
va_end (args);
|
||||||
|
|
||||||
|
fprintf(fp, "%u: %s\n", (unsigned) make_pid (), buf);
|
||||||
|
fflush (fp);
|
||||||
|
fclose (fp);
|
||||||
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
@@ -445,53 +568,187 @@ umask (mode_t mask)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
FILE *
|
#ifdef VMS
|
||||||
get_tmpfile (char **name, const char *template)
|
# define DEFAULT_TMPFILE "sys$scratch:gnv$make_cmdXXXXXX.com"
|
||||||
|
#else
|
||||||
|
# define DEFAULT_TMPFILE "GmXXXXXX"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
const char *
|
||||||
|
get_tmpdir ()
|
||||||
{
|
{
|
||||||
FILE *file;
|
static const char *tmpdir = NULL;
|
||||||
#ifdef HAVE_FDOPEN
|
|
||||||
int fd;
|
if (!tmpdir)
|
||||||
|
{
|
||||||
|
#if defined (__MSDOS__) || defined (WINDOWS32) || defined (__EMX__)
|
||||||
|
# define TMP_EXTRAS "TMP", "TEMP",
|
||||||
|
#else
|
||||||
|
# define TMP_EXTRAS
|
||||||
|
#endif
|
||||||
|
const char *tlist[] = { "MAKE_TMPDIR", "TMPDIR", TMP_EXTRAS NULL };
|
||||||
|
const char **tp;
|
||||||
|
unsigned int found = 0;
|
||||||
|
|
||||||
|
for (tp = tlist; *tp; ++tp)
|
||||||
|
if ((tmpdir = getenv (*tp)) && *tmpdir != '\0')
|
||||||
|
{
|
||||||
|
struct stat st;
|
||||||
|
int r;
|
||||||
|
found = 1;
|
||||||
|
EINTRLOOP(r, stat (tmpdir, &st));
|
||||||
|
if (r < 0)
|
||||||
|
OSSS (error, NILF,
|
||||||
|
_("%s value %s: %s"), *tp, tmpdir, strerror (errno));
|
||||||
|
else if (! S_ISDIR (st.st_mode))
|
||||||
|
OSS (error, NILF,
|
||||||
|
_("%s value %s: not a directory"), *tp, tmpdir);
|
||||||
|
else
|
||||||
|
return tmpdir;
|
||||||
|
}
|
||||||
|
|
||||||
|
tmpdir = DEFAULT_TMPDIR;
|
||||||
|
|
||||||
|
if (found)
|
||||||
|
OS (error, NILF, _("using default temporary directory '%s'"), tmpdir);
|
||||||
|
}
|
||||||
|
|
||||||
|
return tmpdir;
|
||||||
|
}
|
||||||
|
|
||||||
|
static char *
|
||||||
|
get_tmptemplate ()
|
||||||
|
{
|
||||||
|
const char *tmpdir = get_tmpdir ();
|
||||||
|
char *template;
|
||||||
|
char *cp;
|
||||||
|
|
||||||
|
template = xmalloc (strlen (tmpdir) + CSTRLEN (DEFAULT_TMPFILE) + 2);
|
||||||
|
cp = stpcpy (template, tmpdir);
|
||||||
|
|
||||||
|
#if !defined VMS
|
||||||
|
/* It's not possible for tmpdir to be empty. */
|
||||||
|
if (! ISDIRSEP (cp[-1]))
|
||||||
|
*(cp++) = '/';
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Preserve the current umask, and set a restrictive one for temp files. */
|
strcpy (cp, DEFAULT_TMPFILE);
|
||||||
mode_t mask = umask (0077);
|
|
||||||
|
|
||||||
#if defined(HAVE_MKSTEMP) || defined(HAVE_MKTEMP)
|
return template;
|
||||||
# define TEMPLATE_LEN strlen (template)
|
}
|
||||||
#else
|
|
||||||
# define TEMPLATE_LEN L_tmpnam
|
#if !HAVE_MKSTEMP || !HAVE_FDOPEN
|
||||||
#endif
|
/* Generate a temporary filename. This is not safe as another program could
|
||||||
*name = xmalloc (TEMPLATE_LEN + 1);
|
snipe our filename after we've generated it: use this only on systems
|
||||||
strcpy (*name, template);
|
without more secure alternatives. */
|
||||||
|
|
||||||
|
static char *
|
||||||
|
get_tmppath ()
|
||||||
|
{
|
||||||
|
char *path;
|
||||||
|
|
||||||
#if defined(HAVE_MKSTEMP) && defined(HAVE_FDOPEN)
|
|
||||||
/* It's safest to use mkstemp(), if we can. */
|
|
||||||
EINTRLOOP (fd, mkstemp (*name));
|
|
||||||
if (fd == -1)
|
|
||||||
file = NULL;
|
|
||||||
else
|
|
||||||
file = fdopen (fd, "w");
|
|
||||||
#else
|
|
||||||
# ifdef HAVE_MKTEMP
|
# ifdef HAVE_MKTEMP
|
||||||
(void) mktemp (*name);
|
path = get_tmptemplate ();
|
||||||
|
if (*mktemp (path) == '\0')
|
||||||
|
pfatal_with_name ("mktemp");
|
||||||
# else
|
# else
|
||||||
(void) tmpnam (*name);
|
path = xmalloc (L_tmpnam + 1);
|
||||||
|
if (tmpnam (path) == NULL)
|
||||||
|
pfatal_with_name ("tmpnam");
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
# ifdef HAVE_FDOPEN
|
return path;
|
||||||
/* Can't use mkstemp(), but guard against a race condition. */
|
}
|
||||||
EINTRLOOP (fd, open (*name, O_CREAT|O_EXCL|O_WRONLY, 0600));
|
|
||||||
if (fd == -1)
|
|
||||||
return 0;
|
|
||||||
file = fdopen (fd, "w");
|
|
||||||
# else
|
|
||||||
/* Not secure, but what can we do? */
|
|
||||||
file = fopen (*name, "w");
|
|
||||||
# endif
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* Generate a temporary file and return an fd for it. If name is NULL then
|
||||||
|
the temp file is anonymous and will be deleted when the process exits. */
|
||||||
|
int
|
||||||
|
get_tmpfd (char **name)
|
||||||
|
{
|
||||||
|
int fd = -1;
|
||||||
|
char *tmpnm;
|
||||||
|
mode_t mask;
|
||||||
|
|
||||||
|
/* If there's an os-specific way to get an anoymous temp file use it. */
|
||||||
|
if (!name)
|
||||||
|
{
|
||||||
|
fd = os_anontmp ();
|
||||||
|
if (fd >= 0)
|
||||||
|
return fd;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Preserve the current umask, and set a restrictive one for temp files.
|
||||||
|
Only really needed for mkstemp() but won't hurt for the open method. */
|
||||||
|
mask = umask (0077);
|
||||||
|
|
||||||
|
#if defined(HAVE_MKSTEMP)
|
||||||
|
tmpnm = get_tmptemplate ();
|
||||||
|
|
||||||
|
/* It's safest to use mkstemp(), if we can. */
|
||||||
|
EINTRLOOP (fd, mkstemp (tmpnm));
|
||||||
|
#else
|
||||||
|
tmpnm = get_tmppath ();
|
||||||
|
|
||||||
|
/* Can't use mkstemp(), but try to guard against a race condition. */
|
||||||
|
EINTRLOOP (fd, open (tmpnm, O_CREAT|O_EXCL|O_RDWR, 0600));
|
||||||
|
#endif
|
||||||
|
if (fd < 0)
|
||||||
|
OSS (fatal, NILF,
|
||||||
|
_("create temporary file %s: %s"), tmpnm, strerror (errno));
|
||||||
|
|
||||||
|
if (name)
|
||||||
|
*name = tmpnm;
|
||||||
|
else
|
||||||
|
{
|
||||||
|
int r;
|
||||||
|
EINTRLOOP (r, unlink (tmpnm));
|
||||||
|
if (r < 0)
|
||||||
|
OSS (fatal, NILF,
|
||||||
|
_("unlink temporary file %s: %s"), tmpnm, strerror (errno));
|
||||||
|
free (tmpnm);
|
||||||
|
}
|
||||||
|
|
||||||
umask (mask);
|
umask (mask);
|
||||||
|
|
||||||
|
return fd;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Return a FILE* for a temporary file, opened in the safest way possible.
|
||||||
|
Set name to point to an allocated buffer containing the name of the file.
|
||||||
|
Note, this cannot be NULL! */
|
||||||
|
FILE *
|
||||||
|
get_tmpfile (char **name)
|
||||||
|
{
|
||||||
|
/* Be consistent with tmpfile, which opens as if by "wb+". */
|
||||||
|
const char *tmpfile_mode = "wb+";
|
||||||
|
FILE *file;
|
||||||
|
|
||||||
|
#if defined(HAVE_FDOPEN)
|
||||||
|
int fd = get_tmpfd (name);
|
||||||
|
|
||||||
|
ENULLLOOP (file, fdopen (fd, tmpfile_mode));
|
||||||
|
if (file == NULL)
|
||||||
|
OSS (fatal, NILF,
|
||||||
|
_("fdopen: temporary file %s: %s"), *name, strerror (errno));
|
||||||
|
#else
|
||||||
|
/* Preserve the current umask, and set a restrictive one for temp files. */
|
||||||
|
mode_t mask = umask (0077);
|
||||||
|
int err;
|
||||||
|
|
||||||
|
*name = get_tmppath ();
|
||||||
|
|
||||||
|
/* Although this fopen is insecure, it is executed only on non-fdopen
|
||||||
|
platforms, which should be a rarity nowadays. */
|
||||||
|
|
||||||
|
ENULLLOOP (file, fopen (*name, tmpfile_mode));
|
||||||
|
if (file == NULL)
|
||||||
|
OSS (fatal, NILF,
|
||||||
|
_("fopen: temporary file %s: %s"), *name, strerror (errno));
|
||||||
|
|
||||||
|
umask (mask);
|
||||||
|
#endif
|
||||||
|
|
||||||
return file;
|
return file;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -505,8 +762,8 @@ strcasecmp (const char *s1, const char *s2)
|
|||||||
{
|
{
|
||||||
while (1)
|
while (1)
|
||||||
{
|
{
|
||||||
int c1 = (int) *(s1++);
|
int c1 = (unsigned char) *(s1++);
|
||||||
int c2 = (int) *(s2++);
|
int c2 = (unsigned char) *(s2++);
|
||||||
|
|
||||||
if (isalpha (c1))
|
if (isalpha (c1))
|
||||||
c1 = tolower (c1);
|
c1 = tolower (c1);
|
||||||
@@ -526,12 +783,12 @@ strcasecmp (const char *s1, const char *s2)
|
|||||||
substitute for it, define our own version. */
|
substitute for it, define our own version. */
|
||||||
|
|
||||||
int
|
int
|
||||||
strncasecmp (const char *s1, const char *s2, int n)
|
strncasecmp (const char *s1, const char *s2, size_t n)
|
||||||
{
|
{
|
||||||
while (n-- > 0)
|
while (n-- > 0)
|
||||||
{
|
{
|
||||||
int c1 = (int) *(s1++);
|
int c1 = (unsigned char) *(s1++);
|
||||||
int c2 = (int) *(s2++);
|
int c2 = (unsigned char) *(s2++);
|
||||||
|
|
||||||
if (isalpha (c1))
|
if (isalpha (c1))
|
||||||
c1 = tolower (c1);
|
c1 = tolower (c1);
|
||||||
@@ -548,254 +805,6 @@ strncasecmp (const char *s1, const char *s2, int n)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef GETLOADAVG_PRIVILEGED
|
|
||||||
|
|
||||||
#ifdef POSIX
|
|
||||||
|
|
||||||
/* Hopefully if a system says it's POSIX.1 and has the setuid and setgid
|
|
||||||
functions, they work as POSIX.1 says. Some systems (Alpha OSF/1 1.2,
|
|
||||||
for example) which claim to be POSIX.1 also have the BSD setreuid and
|
|
||||||
setregid functions, but they don't work as in BSD and only the POSIX.1
|
|
||||||
way works. */
|
|
||||||
|
|
||||||
#undef HAVE_SETREUID
|
|
||||||
#undef HAVE_SETREGID
|
|
||||||
|
|
||||||
#else /* Not POSIX. */
|
|
||||||
|
|
||||||
/* Some POSIX.1 systems have the seteuid and setegid functions. In a
|
|
||||||
POSIX-like system, they are the best thing to use. However, some
|
|
||||||
non-POSIX systems have them too but they do not work in the POSIX style
|
|
||||||
and we must use setreuid and setregid instead. */
|
|
||||||
|
|
||||||
#undef HAVE_SETEUID
|
|
||||||
#undef HAVE_SETEGID
|
|
||||||
|
|
||||||
#endif /* POSIX. */
|
|
||||||
|
|
||||||
#ifndef HAVE_UNISTD_H
|
|
||||||
extern int getuid (), getgid (), geteuid (), getegid ();
|
|
||||||
extern int setuid (), setgid ();
|
|
||||||
#ifdef HAVE_SETEUID
|
|
||||||
extern int seteuid ();
|
|
||||||
#else
|
|
||||||
#ifdef HAVE_SETREUID
|
|
||||||
extern int setreuid ();
|
|
||||||
#endif /* Have setreuid. */
|
|
||||||
#endif /* Have seteuid. */
|
|
||||||
#ifdef HAVE_SETEGID
|
|
||||||
extern int setegid ();
|
|
||||||
#else
|
|
||||||
#ifdef HAVE_SETREGID
|
|
||||||
extern int setregid ();
|
|
||||||
#endif /* Have setregid. */
|
|
||||||
#endif /* Have setegid. */
|
|
||||||
#endif /* No <unistd.h>. */
|
|
||||||
|
|
||||||
/* Keep track of the user and group IDs for user- and make- access. */
|
|
||||||
static int user_uid = -1, user_gid = -1, make_uid = -1, make_gid = -1;
|
|
||||||
#define access_inited (user_uid != -1)
|
|
||||||
static enum { make, user } current_access;
|
|
||||||
|
|
||||||
|
|
||||||
/* Under -d, write a message describing the current IDs. */
|
|
||||||
|
|
||||||
static void
|
|
||||||
log_access (const char *flavor)
|
|
||||||
{
|
|
||||||
if (! ISDB (DB_JOBS))
|
|
||||||
return;
|
|
||||||
|
|
||||||
/* All the other debugging messages go to stdout,
|
|
||||||
but we write this one to stderr because it might be
|
|
||||||
run in a child fork whose stdout is piped. */
|
|
||||||
|
|
||||||
fprintf (stderr, _("%s: user %lu (real %lu), group %lu (real %lu)\n"),
|
|
||||||
flavor, (unsigned long) geteuid (), (unsigned long) getuid (),
|
|
||||||
(unsigned long) getegid (), (unsigned long) getgid ());
|
|
||||||
fflush (stderr);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static void
|
|
||||||
init_access (void)
|
|
||||||
{
|
|
||||||
#ifndef VMS
|
|
||||||
user_uid = getuid ();
|
|
||||||
user_gid = getgid ();
|
|
||||||
|
|
||||||
make_uid = geteuid ();
|
|
||||||
make_gid = getegid ();
|
|
||||||
|
|
||||||
/* Do these ever fail? */
|
|
||||||
if (user_uid == -1 || user_gid == -1 || make_uid == -1 || make_gid == -1)
|
|
||||||
pfatal_with_name ("get{e}[gu]id");
|
|
||||||
|
|
||||||
log_access (_("Initialized access"));
|
|
||||||
|
|
||||||
current_access = make;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif /* GETLOADAVG_PRIVILEGED */
|
|
||||||
|
|
||||||
/* Give the process appropriate permissions for access to
|
|
||||||
user data (i.e., to stat files, or to spawn a child process). */
|
|
||||||
void
|
|
||||||
user_access (void)
|
|
||||||
{
|
|
||||||
#ifdef GETLOADAVG_PRIVILEGED
|
|
||||||
|
|
||||||
if (!access_inited)
|
|
||||||
init_access ();
|
|
||||||
|
|
||||||
if (current_access == user)
|
|
||||||
return;
|
|
||||||
|
|
||||||
/* We are in "make access" mode. This means that the effective user and
|
|
||||||
group IDs are those of make (if it was installed setuid or setgid).
|
|
||||||
We now want to set the effective user and group IDs to the real IDs,
|
|
||||||
which are the IDs of the process that exec'd make. */
|
|
||||||
|
|
||||||
#ifdef HAVE_SETEUID
|
|
||||||
|
|
||||||
/* Modern systems have the seteuid/setegid calls which set only the
|
|
||||||
effective IDs, which is ideal. */
|
|
||||||
|
|
||||||
if (seteuid (user_uid) < 0)
|
|
||||||
pfatal_with_name ("user_access: seteuid");
|
|
||||||
|
|
||||||
#else /* Not HAVE_SETEUID. */
|
|
||||||
|
|
||||||
#ifndef HAVE_SETREUID
|
|
||||||
|
|
||||||
/* System V has only the setuid/setgid calls to set user/group IDs.
|
|
||||||
There is an effective ID, which can be set by setuid/setgid.
|
|
||||||
It can be set (unless you are root) only to either what it already is
|
|
||||||
(returned by geteuid/getegid, now in make_uid/make_gid),
|
|
||||||
the real ID (return by getuid/getgid, now in user_uid/user_gid),
|
|
||||||
or the saved set ID (what the effective ID was before this set-ID
|
|
||||||
executable (make) was exec'd). */
|
|
||||||
|
|
||||||
if (setuid (user_uid) < 0)
|
|
||||||
pfatal_with_name ("user_access: setuid");
|
|
||||||
|
|
||||||
#else /* HAVE_SETREUID. */
|
|
||||||
|
|
||||||
/* In 4BSD, the setreuid/setregid calls set both the real and effective IDs.
|
|
||||||
They may be set to themselves or each other. So you have two alternatives
|
|
||||||
at any one time. If you use setuid/setgid, the effective will be set to
|
|
||||||
the real, leaving only one alternative. Using setreuid/setregid, however,
|
|
||||||
you can toggle between your two alternatives by swapping the values in a
|
|
||||||
single setreuid or setregid call. */
|
|
||||||
|
|
||||||
if (setreuid (make_uid, user_uid) < 0)
|
|
||||||
pfatal_with_name ("user_access: setreuid");
|
|
||||||
|
|
||||||
#endif /* Not HAVE_SETREUID. */
|
|
||||||
#endif /* HAVE_SETEUID. */
|
|
||||||
|
|
||||||
#ifdef HAVE_SETEGID
|
|
||||||
if (setegid (user_gid) < 0)
|
|
||||||
pfatal_with_name ("user_access: setegid");
|
|
||||||
#else
|
|
||||||
#ifndef HAVE_SETREGID
|
|
||||||
if (setgid (user_gid) < 0)
|
|
||||||
pfatal_with_name ("user_access: setgid");
|
|
||||||
#else
|
|
||||||
if (setregid (make_gid, user_gid) < 0)
|
|
||||||
pfatal_with_name ("user_access: setregid");
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
current_access = user;
|
|
||||||
|
|
||||||
log_access (_("User access"));
|
|
||||||
|
|
||||||
#endif /* GETLOADAVG_PRIVILEGED */
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Give the process appropriate permissions for access to
|
|
||||||
make data (i.e., the load average). */
|
|
||||||
void
|
|
||||||
make_access (void)
|
|
||||||
{
|
|
||||||
#ifdef GETLOADAVG_PRIVILEGED
|
|
||||||
|
|
||||||
if (!access_inited)
|
|
||||||
init_access ();
|
|
||||||
|
|
||||||
if (current_access == make)
|
|
||||||
return;
|
|
||||||
|
|
||||||
/* See comments in user_access, above. */
|
|
||||||
|
|
||||||
#ifdef HAVE_SETEUID
|
|
||||||
if (seteuid (make_uid) < 0)
|
|
||||||
pfatal_with_name ("make_access: seteuid");
|
|
||||||
#else
|
|
||||||
#ifndef HAVE_SETREUID
|
|
||||||
if (setuid (make_uid) < 0)
|
|
||||||
pfatal_with_name ("make_access: setuid");
|
|
||||||
#else
|
|
||||||
if (setreuid (user_uid, make_uid) < 0)
|
|
||||||
pfatal_with_name ("make_access: setreuid");
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef HAVE_SETEGID
|
|
||||||
if (setegid (make_gid) < 0)
|
|
||||||
pfatal_with_name ("make_access: setegid");
|
|
||||||
#else
|
|
||||||
#ifndef HAVE_SETREGID
|
|
||||||
if (setgid (make_gid) < 0)
|
|
||||||
pfatal_with_name ("make_access: setgid");
|
|
||||||
#else
|
|
||||||
if (setregid (user_gid, make_gid) < 0)
|
|
||||||
pfatal_with_name ("make_access: setregid");
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
current_access = make;
|
|
||||||
|
|
||||||
log_access (_("Make access"));
|
|
||||||
|
|
||||||
#endif /* GETLOADAVG_PRIVILEGED */
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Give the process appropriate permissions for a child process.
|
|
||||||
This is like user_access, but you can't get back to make_access. */
|
|
||||||
void
|
|
||||||
child_access (void)
|
|
||||||
{
|
|
||||||
#ifdef GETLOADAVG_PRIVILEGED
|
|
||||||
|
|
||||||
if (!access_inited)
|
|
||||||
abort ();
|
|
||||||
|
|
||||||
/* Set both the real and effective UID and GID to the user's.
|
|
||||||
They cannot be changed back to make's. */
|
|
||||||
|
|
||||||
#ifndef HAVE_SETREUID
|
|
||||||
if (setuid (user_uid) < 0)
|
|
||||||
pfatal_with_name ("child_access: setuid");
|
|
||||||
#else
|
|
||||||
if (setreuid (user_uid, user_uid) < 0)
|
|
||||||
pfatal_with_name ("child_access: setreuid");
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef HAVE_SETREGID
|
|
||||||
if (setgid (user_gid) < 0)
|
|
||||||
pfatal_with_name ("child_access: setgid");
|
|
||||||
#else
|
|
||||||
if (setregid (user_gid, user_gid) < 0)
|
|
||||||
pfatal_with_name ("child_access: setregid");
|
|
||||||
#endif
|
|
||||||
|
|
||||||
log_access (_("Child access"));
|
|
||||||
|
|
||||||
#endif /* GETLOADAVG_PRIVILEGED */
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef NEED_GET_PATH_MAX
|
#ifdef NEED_GET_PATH_MAX
|
||||||
unsigned int
|
unsigned int
|
||||||
@@ -805,13 +814,163 @@ get_path_max (void)
|
|||||||
|
|
||||||
if (value == 0)
|
if (value == 0)
|
||||||
{
|
{
|
||||||
long int x = pathconf ("/", _PC_PATH_MAX);
|
long x = pathconf ("/", _PC_PATH_MAX);
|
||||||
if (x > 0)
|
if (x > 0)
|
||||||
value = x;
|
value = (unsigned int) x;
|
||||||
else
|
else
|
||||||
return MAXPATHLEN;
|
value = PATH_MAX;
|
||||||
}
|
}
|
||||||
|
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if !HAVE_MEMPCPY
|
||||||
|
void *
|
||||||
|
mempcpy (void *dest, const void *src, size_t n)
|
||||||
|
{
|
||||||
|
return (char *) memcpy (dest, src, n) + n;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if !HAVE_STPCPY
|
||||||
|
char *
|
||||||
|
stpcpy (char *dest, const char *src)
|
||||||
|
{
|
||||||
|
char *d = dest;
|
||||||
|
const char *s = src;
|
||||||
|
|
||||||
|
do
|
||||||
|
*d++ = *s;
|
||||||
|
while (*s++ != '\0');
|
||||||
|
|
||||||
|
return d - 1;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if !HAVE_STRTOLL
|
||||||
|
# undef UNSIGNED
|
||||||
|
# undef USE_NUMBER_GROUPING
|
||||||
|
# undef USE_WIDE_CHAR
|
||||||
|
# define QUAD 1
|
||||||
|
# include <strtol.c>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if !HAVE_STRERROR
|
||||||
|
char *
|
||||||
|
strerror (int errnum)
|
||||||
|
{
|
||||||
|
static char msg[256];
|
||||||
|
|
||||||
|
#define SETMSG(_e, _m) case _e: strcpy(msg, _m); break
|
||||||
|
|
||||||
|
switch (errnum)
|
||||||
|
{
|
||||||
|
#ifdef EPERM
|
||||||
|
SETMSG (EPERM , "Operation not permitted");
|
||||||
|
#endif
|
||||||
|
#ifdef ENOENT
|
||||||
|
SETMSG (ENOENT , "No such file or directory");
|
||||||
|
#endif
|
||||||
|
#ifdef ESRCH
|
||||||
|
SETMSG (ESRCH , "No such process");
|
||||||
|
#endif
|
||||||
|
#ifdef EINTR
|
||||||
|
SETMSG (EINTR , "Interrupted system call");
|
||||||
|
#endif
|
||||||
|
#ifdef EIO
|
||||||
|
SETMSG (EIO , "I/O error");
|
||||||
|
#endif
|
||||||
|
#ifdef ENXIO
|
||||||
|
SETMSG (ENXIO , "No such device or address");
|
||||||
|
#endif
|
||||||
|
#ifdef E2BIG
|
||||||
|
SETMSG (E2BIG , "Argument list too long");
|
||||||
|
#endif
|
||||||
|
#ifdef ENOEXEC
|
||||||
|
SETMSG (ENOEXEC, "Exec format error");
|
||||||
|
#endif
|
||||||
|
#ifdef EBADF
|
||||||
|
SETMSG (EBADF , "Bad file number");
|
||||||
|
#endif
|
||||||
|
#ifdef ECHILD
|
||||||
|
SETMSG (ECHILD , "No child processes");
|
||||||
|
#endif
|
||||||
|
#ifdef EAGAIN
|
||||||
|
SETMSG (EAGAIN , "Try again");
|
||||||
|
#endif
|
||||||
|
#ifdef ENOMEM
|
||||||
|
SETMSG (ENOMEM , "Out of memory");
|
||||||
|
#endif
|
||||||
|
#ifdef EACCES
|
||||||
|
SETMSG (EACCES , "Permission denied");
|
||||||
|
#endif
|
||||||
|
#ifdef EFAULT
|
||||||
|
SETMSG (EFAULT , "Bad address");
|
||||||
|
#endif
|
||||||
|
#ifdef ENOTBLK
|
||||||
|
SETMSG (ENOTBLK, "Block device required");
|
||||||
|
#endif
|
||||||
|
#ifdef EBUSY
|
||||||
|
SETMSG (EBUSY , "Device or resource busy");
|
||||||
|
#endif
|
||||||
|
#ifdef EEXIST
|
||||||
|
SETMSG (EEXIST , "File exists");
|
||||||
|
#endif
|
||||||
|
#ifdef EXDEV
|
||||||
|
SETMSG (EXDEV , "Cross-device link");
|
||||||
|
#endif
|
||||||
|
#ifdef ENODEV
|
||||||
|
SETMSG (ENODEV , "No such device");
|
||||||
|
#endif
|
||||||
|
#ifdef ENOTDIR
|
||||||
|
SETMSG (ENOTDIR, "Not a directory");
|
||||||
|
#endif
|
||||||
|
#ifdef EISDIR
|
||||||
|
SETMSG (EISDIR , "Is a directory");
|
||||||
|
#endif
|
||||||
|
#ifdef EINVAL
|
||||||
|
SETMSG (EINVAL , "Invalid argument");
|
||||||
|
#endif
|
||||||
|
#ifdef ENFILE
|
||||||
|
SETMSG (ENFILE , "File table overflow");
|
||||||
|
#endif
|
||||||
|
#ifdef EMFILE
|
||||||
|
SETMSG (EMFILE , "Too many open files");
|
||||||
|
#endif
|
||||||
|
#ifdef ENOTTY
|
||||||
|
SETMSG (ENOTTY , "Not a typewriter");
|
||||||
|
#endif
|
||||||
|
#ifdef ETXTBSY
|
||||||
|
SETMSG (ETXTBSY, "Text file busy");
|
||||||
|
#endif
|
||||||
|
#ifdef EFBIG
|
||||||
|
SETMSG (EFBIG , "File too large");
|
||||||
|
#endif
|
||||||
|
#ifdef ENOSPC
|
||||||
|
SETMSG (ENOSPC , "No space left on device");
|
||||||
|
#endif
|
||||||
|
#ifdef ESPIPE
|
||||||
|
SETMSG (ESPIPE , "Illegal seek");
|
||||||
|
#endif
|
||||||
|
#ifdef EROFS
|
||||||
|
SETMSG (EROFS , "Read-only file system");
|
||||||
|
#endif
|
||||||
|
#ifdef EMLINK
|
||||||
|
SETMSG (EMLINK , "Too many links");
|
||||||
|
#endif
|
||||||
|
#ifdef EPIPE
|
||||||
|
SETMSG (EPIPE , "Broken pipe");
|
||||||
|
#endif
|
||||||
|
#ifdef EDOM
|
||||||
|
SETMSG (EDOM , "Math argument out of domain of func");
|
||||||
|
#endif
|
||||||
|
#ifdef ERANGE
|
||||||
|
SETMSG (ERANGE , "Math result not representable");
|
||||||
|
#endif
|
||||||
|
default: sprintf (msg, "Unknown error %d", errnum); break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return msg;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|||||||
36
src/mkconfig.h.in
Normal file
36
src/mkconfig.h.in
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
/* Autoconf values for use on non-POSIX systems.
|
||||||
|
Copyright (C) 2022 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 3 of the License, 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
|
||||||
|
this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||||
|
|
||||||
|
/* Name of package */
|
||||||
|
#define PACKAGE "@PACKAGE@"
|
||||||
|
|
||||||
|
/* Define to the address where bug reports for this package should be sent. */
|
||||||
|
#define PACKAGE_BUGREPORT "@PACKAGE_BUGREPORT@"
|
||||||
|
|
||||||
|
/* Define to the full name of this package. */
|
||||||
|
#define PACKAGE_NAME "@PACKAGE_NAME@"
|
||||||
|
|
||||||
|
/* Define to the full name and version of this package. */
|
||||||
|
#define PACKAGE_STRING "@PACKAGE_NAME@ @PACKAGE_VERSION@"
|
||||||
|
|
||||||
|
/* Define to the one symbol short name of this package. */
|
||||||
|
#define PACKAGE_TARNAME "@PACKAGE_TARNAME@"
|
||||||
|
|
||||||
|
/* Define to the home page for this package. */
|
||||||
|
#define PACKAGE_URL "@PACKAGE_URL@"
|
||||||
|
|
||||||
|
/* Define to the version of this package. */
|
||||||
|
#define PACKAGE_VERSION "@PACKAGE_VERSION@"
|
||||||
123
src/os.h
123
src/os.h
@@ -1,5 +1,5 @@
|
|||||||
/* Declarations for operating system interfaces for GNU Make.
|
/* Declarations for operating system interfaces for GNU Make.
|
||||||
Copyright (C) 2016-2019 Free Software Foundation, Inc.
|
Copyright (C) 2016-2022 Free Software Foundation, Inc.
|
||||||
This file is part of GNU Make.
|
This file is part of GNU Make.
|
||||||
|
|
||||||
GNU Make is free software; you can redistribute it and/or modify it under the
|
GNU Make is free software; you can redistribute it and/or modify it under the
|
||||||
@@ -12,8 +12,35 @@ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|||||||
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
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
|
You should have received a copy of the GNU General Public License along with
|
||||||
this program. If not, see <http://www.gnu.org/licenses/>. */
|
this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||||
|
|
||||||
|
#define IO_UNKNOWN 0x0001
|
||||||
|
#define IO_COMBINED_OUTERR 0x0002
|
||||||
|
#define IO_STDIN_OK 0x0004
|
||||||
|
#define IO_STDOUT_OK 0x0008
|
||||||
|
#define IO_STDERR_OK 0x0010
|
||||||
|
|
||||||
|
#if defined(VMS) || defined(_AMIGA) || defined(__MSDOS__)
|
||||||
|
# define check_io_state() (IO_STDIN_OK|IO_STDOUT_OK|IO_STDERR_OK)
|
||||||
|
# define fd_inherit(_i) (0)
|
||||||
|
# define fd_noinherit(_i) (0)
|
||||||
|
# define fd_set_append(_i) (void)(0)
|
||||||
|
# define os_anontmp() (-1)
|
||||||
|
#else
|
||||||
|
|
||||||
|
/* Determine the state of stdin/stdout/stderr. */
|
||||||
|
unsigned int check_io_state (void);
|
||||||
|
|
||||||
|
/* Set a file descriptor to close/not close in a subprocess. */
|
||||||
|
void fd_inherit (int);
|
||||||
|
void fd_noinherit (int);
|
||||||
|
|
||||||
|
/* If the file descriptor is for a file put it into append mode. */
|
||||||
|
void fd_set_append (int);
|
||||||
|
|
||||||
|
/* Return a file descriptor for a new anonymous temp file, or -1. */
|
||||||
|
int os_anontmp (void);
|
||||||
|
#endif
|
||||||
|
|
||||||
/* This section provides OS-specific functions to support the jobserver. */
|
/* This section provides OS-specific functions to support the jobserver. */
|
||||||
|
|
||||||
@@ -22,19 +49,26 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
|
|||||||
/* Returns 1 if the jobserver is enabled, else 0. */
|
/* Returns 1 if the jobserver is enabled, else 0. */
|
||||||
unsigned int jobserver_enabled (void);
|
unsigned int jobserver_enabled (void);
|
||||||
|
|
||||||
/* Called in the master instance to set up the jobserver initially. */
|
/* Called in the parent make to set up the jobserver initially. */
|
||||||
unsigned int jobserver_setup (int job_slots);
|
unsigned int jobserver_setup (int job_slots, const char *style);
|
||||||
|
|
||||||
/* Called in a child instance to connect to the jobserver. */
|
/* Called in a child instance to connect to the jobserver.
|
||||||
|
Return 1 if we got a valid auth, else 0. */
|
||||||
unsigned int jobserver_parse_auth (const char* auth);
|
unsigned int jobserver_parse_auth (const char* auth);
|
||||||
|
|
||||||
/* Returns an allocated buffer used to pass to child instances. */
|
/* Returns an allocated buffer used to pass to child instances. */
|
||||||
char *jobserver_get_auth (void);
|
char *jobserver_get_auth (void);
|
||||||
|
|
||||||
/* Clear this instance's jobserver configuration. */
|
/* Returns a pointer to a static string used to indicate that the child
|
||||||
|
cannot access the jobserver, or NULL if it always can. */
|
||||||
|
const char *jobserver_get_invalid_auth (void);
|
||||||
|
|
||||||
|
/* Clear this instance's jobserver configuration.
|
||||||
|
This method might be invoked from a signal handler. */
|
||||||
void jobserver_clear (void);
|
void jobserver_clear (void);
|
||||||
|
|
||||||
/* Recover all the jobserver tokens and return the number we got. */
|
/* Recover all the jobserver tokens and return the number we got.
|
||||||
|
Will also run jobserver_clear() as a side-effect. */
|
||||||
unsigned int jobserver_acquire_all (void);
|
unsigned int jobserver_acquire_all (void);
|
||||||
|
|
||||||
/* Release a jobserver token. If it fails and is_fatal is 1, fatal. */
|
/* Release a jobserver token. If it fails and is_fatal is 1, fatal. */
|
||||||
@@ -61,20 +95,60 @@ unsigned int jobserver_acquire (int timeout);
|
|||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
#define jobserver_enabled() (0)
|
#define jobserver_enabled() (0)
|
||||||
#define jobserver_setup(_slots) (0)
|
#define jobserver_setup(_slots, _style) (0)
|
||||||
#define jobserver_parse_auth(_auth) (0)
|
#define jobserver_parse_auth(_auth) (0)
|
||||||
#define jobserver_get_auth() (NULL)
|
#define jobserver_get_auth() (NULL)
|
||||||
#define jobserver_clear() (void)(0)
|
#define jobserver_get_invalid_auth() (NULL)
|
||||||
#define jobserver_release(_fatal) (void)(0)
|
#define jobserver_clear() (void)(0)
|
||||||
#define jobserver_acquire_all() (0)
|
#define jobserver_release(_fatal) (void)(0)
|
||||||
#define jobserver_signal() (void)(0)
|
#define jobserver_acquire_all() (0)
|
||||||
#define jobserver_pre_child(_r) (void)(0)
|
#define jobserver_signal() (void)(0)
|
||||||
#define jobserver_post_child(_r) (void)(0)
|
#define jobserver_pre_child(_r) (void)(0)
|
||||||
#define jobserver_pre_acquire() (void)(0)
|
#define jobserver_post_child(_r) (void)(0)
|
||||||
#define jobserver_acquire(_tmout) (0)
|
#define jobserver_pre_acquire() (void)(0)
|
||||||
|
#define jobserver_acquire(_tmout) (0)
|
||||||
|
|
||||||
#endif
|
#endif /* MAKE_JOBSERVER */
|
||||||
|
|
||||||
|
#ifndef NO_OUTPUT_SYNC
|
||||||
|
|
||||||
|
/* Returns 1 if output sync is enabled, else 0. */
|
||||||
|
unsigned int osync_enabled (void);
|
||||||
|
|
||||||
|
/* Called in the parent make to set up output sync initially. */
|
||||||
|
void osync_setup (void);
|
||||||
|
|
||||||
|
/* Returns an allocated buffer containing output sync info to pass to child
|
||||||
|
instances, or NULL if not needed. */
|
||||||
|
char *osync_get_mutex (void);
|
||||||
|
|
||||||
|
/* Called in a child instance to obtain info on the output sync mutex.
|
||||||
|
Return 1 if we got a valid mutex, else 0. */
|
||||||
|
unsigned int osync_parse_mutex (const char *mutex);
|
||||||
|
|
||||||
|
/* Clean up this instance's output sync facilities.
|
||||||
|
This method might be invoked from a signal handler. */
|
||||||
|
void osync_clear (void);
|
||||||
|
|
||||||
|
/* Acquire the output sync lock. This will wait until available.
|
||||||
|
Returns 0 if there was an error getting the semaphore. */
|
||||||
|
unsigned int osync_acquire (void);
|
||||||
|
|
||||||
|
/* Release the output sync lock. */
|
||||||
|
void osync_release (void);
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
#define osync_enabled() (0)
|
||||||
|
#define osync_setup() (void)(0)
|
||||||
|
#define osync_get_mutex() (0)
|
||||||
|
#define osync_parse_mutex(_s) (0)
|
||||||
|
#define osync_clear() (void)(0)
|
||||||
|
#define osync_acquire() (1)
|
||||||
|
#define osync_release() (void)(0)
|
||||||
|
|
||||||
|
#endif /* NO_OUTPUT_SYNC */
|
||||||
|
|
||||||
/* Create a "bad" file descriptor for stdin when parallel jobs are run. */
|
/* Create a "bad" file descriptor for stdin when parallel jobs are run. */
|
||||||
#if defined(VMS) || defined(WINDOWS32) || defined(_AMIGA) || defined(__MSDOS__)
|
#if defined(VMS) || defined(WINDOWS32) || defined(_AMIGA) || defined(__MSDOS__)
|
||||||
@@ -82,12 +156,3 @@ unsigned int jobserver_acquire (int timeout);
|
|||||||
#else
|
#else
|
||||||
int get_bad_stdin (void);
|
int get_bad_stdin (void);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Set a file descriptor to close/not close in a subprocess. */
|
|
||||||
#if defined(VMS) || defined(_AMIGA) || defined(__MSDOS__)
|
|
||||||
# define fd_inherit(_i) 0
|
|
||||||
# define fd_noinherit(_i) 0
|
|
||||||
#else
|
|
||||||
void fd_inherit (int);
|
|
||||||
void fd_noinherit (int);
|
|
||||||
#endif
|
|
||||||
|
|||||||
288
src/output.c
288
src/output.c
@@ -1,5 +1,5 @@
|
|||||||
/* Output to stdout / stderr for GNU make
|
/* Output to stdout / stderr for GNU make
|
||||||
Copyright (C) 2013-2019 Free Software Foundation, Inc.
|
Copyright (C) 2013-2022 Free Software Foundation, Inc.
|
||||||
This file is part of GNU Make.
|
This file is part of GNU Make.
|
||||||
|
|
||||||
GNU Make is free software; you can redistribute it and/or modify it under the
|
GNU Make is free software; you can redistribute it and/or modify it under the
|
||||||
@@ -12,7 +12,7 @@ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|||||||
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
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
|
You should have received a copy of the GNU General Public License along with
|
||||||
this program. If not, see <http://www.gnu.org/licenses/>. */
|
this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||||
|
|
||||||
#include "makeint.h"
|
#include "makeint.h"
|
||||||
#include "os.h"
|
#include "os.h"
|
||||||
@@ -47,30 +47,28 @@ unsigned int stdio_traced = 0;
|
|||||||
|
|
||||||
#define OUTPUT_ISSET(_out) ((_out)->out >= 0 || (_out)->err >= 0)
|
#define OUTPUT_ISSET(_out) ((_out)->out >= 0 || (_out)->err >= 0)
|
||||||
|
|
||||||
#ifdef HAVE_FCNTL_H
|
|
||||||
# define STREAM_OK(_s) ((fcntl (fileno (_s), F_GETFD) != -1) || (errno != EBADF))
|
|
||||||
#else
|
|
||||||
# define STREAM_OK(_s) 1
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Write a string to the current STDOUT or STDERR. */
|
/* Write a string to the current STDOUT or STDERR. */
|
||||||
static void
|
static void
|
||||||
_outputs (struct output *out, int is_err, const char *msg)
|
_outputs (struct output *out, int is_err, const char *msg)
|
||||||
{
|
{
|
||||||
if (! out || ! out->syncout)
|
FILE *f;
|
||||||
{
|
|
||||||
FILE *f = is_err ? stderr : stdout;
|
if (out && out->syncout)
|
||||||
fputs (msg, f);
|
|
||||||
fflush (f);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
int fd = is_err ? out->err : out->out;
|
int fd = is_err ? out->err : out->out;
|
||||||
size_t len = strlen (msg);
|
if (fd != OUTPUT_NONE)
|
||||||
int r;
|
{
|
||||||
EINTRLOOP (r, lseek (fd, 0, SEEK_END));
|
size_t len = strlen (msg);
|
||||||
writebuf (fd, msg, len);
|
int r;
|
||||||
|
EINTRLOOP (r, lseek (fd, 0, SEEK_END));
|
||||||
|
writebuf (fd, msg, len);
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
f = is_err ? stderr : stdout;
|
||||||
|
fputs (msg, f);
|
||||||
|
fflush (f);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Write a message indicating that we've just entered or
|
/* Write a message indicating that we've just entered or
|
||||||
@@ -143,73 +141,10 @@ log_working_directory (int entering)
|
|||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Set a file descriptor to be in O_APPEND mode.
|
|
||||||
If it fails, just ignore it. */
|
|
||||||
|
|
||||||
static void
|
|
||||||
set_append_mode (int fd)
|
|
||||||
{
|
|
||||||
#if defined(F_GETFL) && defined(F_SETFL) && defined(O_APPEND)
|
|
||||||
int flags = fcntl (fd, F_GETFL, 0);
|
|
||||||
if (flags >= 0)
|
|
||||||
{
|
|
||||||
int r;
|
|
||||||
EINTRLOOP(r, fcntl (fd, F_SETFL, flags | O_APPEND));
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef NO_OUTPUT_SYNC
|
#ifndef NO_OUTPUT_SYNC
|
||||||
|
|
||||||
/* Semaphore for use in -j mode with output_sync. */
|
|
||||||
static sync_handle_t sync_handle = -1;
|
|
||||||
|
|
||||||
#define FD_NOT_EMPTY(_f) ((_f) != OUTPUT_NONE && lseek ((_f), 0, SEEK_END) > 0)
|
|
||||||
|
|
||||||
/* Set up the sync handle. Disables output_sync on error. */
|
|
||||||
static int
|
|
||||||
sync_init (void)
|
|
||||||
{
|
|
||||||
int combined_output = 0;
|
|
||||||
|
|
||||||
#ifdef WINDOWS32
|
|
||||||
if ((!STREAM_OK (stdout) && !STREAM_OK (stderr))
|
|
||||||
|| (sync_handle = create_mutex ()) == -1)
|
|
||||||
{
|
|
||||||
perror_with_name ("output-sync suppressed: ", "stderr");
|
|
||||||
output_sync = 0;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
combined_output = same_stream (stdout, stderr);
|
|
||||||
prepare_mutex_handle_string (sync_handle);
|
|
||||||
}
|
|
||||||
|
|
||||||
#else
|
|
||||||
if (STREAM_OK (stdout))
|
|
||||||
{
|
|
||||||
struct stat stbuf_o, stbuf_e;
|
|
||||||
|
|
||||||
sync_handle = fileno (stdout);
|
|
||||||
combined_output = (fstat (fileno (stdout), &stbuf_o) == 0
|
|
||||||
&& fstat (fileno (stderr), &stbuf_e) == 0
|
|
||||||
&& stbuf_o.st_dev == stbuf_e.st_dev
|
|
||||||
&& stbuf_o.st_ino == stbuf_e.st_ino);
|
|
||||||
}
|
|
||||||
else if (STREAM_OK (stderr))
|
|
||||||
sync_handle = fileno (stderr);
|
|
||||||
else
|
|
||||||
{
|
|
||||||
perror_with_name ("output-sync suppressed: ", "stderr");
|
|
||||||
output_sync = 0;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return combined_output;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Support routine for output_sync() */
|
/* Support routine for output_sync() */
|
||||||
static void
|
static void
|
||||||
pump_from_tmp (int from, FILE *to)
|
pump_from_tmp (int from, FILE *to)
|
||||||
@@ -250,55 +185,13 @@ pump_from_tmp (int from, FILE *to)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Obtain the lock for writing output. */
|
/* Returns a file descriptor to a temporary file, that will be automatically
|
||||||
static void *
|
deleted on exit. */
|
||||||
acquire_semaphore (void)
|
|
||||||
{
|
|
||||||
static struct flock fl;
|
|
||||||
|
|
||||||
fl.l_type = F_WRLCK;
|
|
||||||
fl.l_whence = SEEK_SET;
|
|
||||||
fl.l_start = 0;
|
|
||||||
fl.l_len = 1;
|
|
||||||
if (fcntl (sync_handle, F_SETLKW, &fl) != -1)
|
|
||||||
return &fl;
|
|
||||||
perror ("fcntl()");
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Release the lock for writing output. */
|
|
||||||
static void
|
|
||||||
release_semaphore (void *sem)
|
|
||||||
{
|
|
||||||
struct flock *flp = (struct flock *)sem;
|
|
||||||
flp->l_type = F_UNLCK;
|
|
||||||
if (fcntl (sync_handle, F_SETLKW, flp) == -1)
|
|
||||||
perror ("fcntl()");
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Returns a file descriptor to a temporary file. The file is automatically
|
|
||||||
closed/deleted on exit. Don't use a FILE* stream. */
|
|
||||||
int
|
int
|
||||||
output_tmpfd (void)
|
output_tmpfd (void)
|
||||||
{
|
{
|
||||||
mode_t mask = umask (0077);
|
int fd = get_tmpfd (NULL);
|
||||||
int fd = -1;
|
fd_set_append (fd);
|
||||||
FILE *tfile = tmpfile ();
|
|
||||||
|
|
||||||
if (! tfile)
|
|
||||||
pfatal_with_name ("tmpfile");
|
|
||||||
|
|
||||||
/* Create a duplicate so we can close the stream. */
|
|
||||||
fd = dup (fileno (tfile));
|
|
||||||
if (fd < 0)
|
|
||||||
pfatal_with_name ("dup");
|
|
||||||
|
|
||||||
fclose (tfile);
|
|
||||||
|
|
||||||
set_append_mode (fd);
|
|
||||||
|
|
||||||
umask (mask);
|
|
||||||
|
|
||||||
return fd;
|
return fd;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -309,13 +202,25 @@ output_tmpfd (void)
|
|||||||
static void
|
static void
|
||||||
setup_tmpfile (struct output *out)
|
setup_tmpfile (struct output *out)
|
||||||
{
|
{
|
||||||
/* Is make's stdout going to the same place as stderr? */
|
static unsigned int in_setup = 0;
|
||||||
static int combined_output = -1;
|
unsigned int io_state;
|
||||||
|
|
||||||
if (combined_output < 0)
|
/* If something fails during setup we might recurse back into this function
|
||||||
combined_output = sync_init ();
|
while writing errors. Make sure we don't do so infinitely. */
|
||||||
|
if (in_setup)
|
||||||
|
return;
|
||||||
|
in_setup = 1;
|
||||||
|
|
||||||
if (STREAM_OK (stdout))
|
io_state = check_io_state ();
|
||||||
|
|
||||||
|
if (NONE_SET (io_state, IO_STDOUT_OK|IO_STDERR_OK))
|
||||||
|
{
|
||||||
|
/* This is probably useless since stdout/stderr aren't working. */
|
||||||
|
perror_with_name ("output-sync suppressed: ", "stderr");
|
||||||
|
goto error;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ANY_SET (io_state, IO_STDOUT_OK))
|
||||||
{
|
{
|
||||||
int fd = output_tmpfd ();
|
int fd = output_tmpfd ();
|
||||||
if (fd < 0)
|
if (fd < 0)
|
||||||
@@ -324,9 +229,9 @@ setup_tmpfile (struct output *out)
|
|||||||
out->out = fd;
|
out->out = fd;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (STREAM_OK (stderr))
|
if (ANY_SET (io_state, IO_STDERR_OK))
|
||||||
{
|
{
|
||||||
if (out->out != OUTPUT_NONE && combined_output)
|
if (out->out != OUTPUT_NONE && ANY_SET (io_state, IO_COMBINED_OUTERR))
|
||||||
out->err = out->out;
|
out->err = out->out;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -338,12 +243,15 @@ setup_tmpfile (struct output *out)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
in_setup = 0;
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/* If we failed to create a temp file, disable output sync going forward. */
|
/* If we failed to create a temp file, disable output sync going forward. */
|
||||||
error:
|
error:
|
||||||
output_close (out);
|
output_close (out);
|
||||||
output_sync = OUTPUT_SYNC_NONE;
|
output_sync = OUTPUT_SYNC_NONE;
|
||||||
|
osync_clear ();
|
||||||
|
in_setup = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Synchronize the output of jobs in -j mode to keep the results of
|
/* Synchronize the output of jobs in -j mode to keep the results of
|
||||||
@@ -354,6 +262,8 @@ setup_tmpfile (struct output *out)
|
|||||||
void
|
void
|
||||||
output_dump (struct output *out)
|
output_dump (struct output *out)
|
||||||
{
|
{
|
||||||
|
#define FD_NOT_EMPTY(_f) ((_f) != OUTPUT_NONE && lseek ((_f), 0, SEEK_END) > 0)
|
||||||
|
|
||||||
int outfd_not_empty = FD_NOT_EMPTY (out->out);
|
int outfd_not_empty = FD_NOT_EMPTY (out->out);
|
||||||
int errfd_not_empty = FD_NOT_EMPTY (out->err);
|
int errfd_not_empty = FD_NOT_EMPTY (out->err);
|
||||||
|
|
||||||
@@ -364,10 +274,15 @@ output_dump (struct output *out)
|
|||||||
/* Try to acquire the semaphore. If it fails, dump the output
|
/* Try to acquire the semaphore. If it fails, dump the output
|
||||||
unsynchronized; still better than silently discarding it.
|
unsynchronized; still better than silently discarding it.
|
||||||
We want to keep this lock for as little time as possible. */
|
We want to keep this lock for as little time as possible. */
|
||||||
void *sem = acquire_semaphore ();
|
if (!osync_acquire ())
|
||||||
|
{
|
||||||
|
O (error, NILF,
|
||||||
|
_("warning: Cannot acquire output lock, disabling output sync."));
|
||||||
|
osync_clear ();
|
||||||
|
}
|
||||||
|
|
||||||
/* Log the working directory for this dump. */
|
/* Log the working directory for this dump. */
|
||||||
if (print_directory_flag && output_sync != OUTPUT_SYNC_RECURSE)
|
if (print_directory && output_sync != OUTPUT_SYNC_RECURSE)
|
||||||
traced = log_working_directory (1);
|
traced = log_working_directory (1);
|
||||||
|
|
||||||
if (outfd_not_empty)
|
if (outfd_not_empty)
|
||||||
@@ -379,8 +294,7 @@ output_dump (struct output *out)
|
|||||||
log_working_directory (0);
|
log_working_directory (0);
|
||||||
|
|
||||||
/* Exit the critical section. */
|
/* Exit the critical section. */
|
||||||
if (sem)
|
osync_release ();
|
||||||
release_semaphore (sem);
|
|
||||||
|
|
||||||
/* Truncate and reset the output, in case we use it again. */
|
/* Truncate and reset the output, in case we use it again. */
|
||||||
if (out->out != OUTPUT_NONE)
|
if (out->out != OUTPUT_NONE)
|
||||||
@@ -400,53 +314,6 @@ output_dump (struct output *out)
|
|||||||
#endif /* NO_OUTPUT_SYNC */
|
#endif /* NO_OUTPUT_SYNC */
|
||||||
|
|
||||||
|
|
||||||
/* This code is stolen from gnulib.
|
|
||||||
If/when we abandon the requirement to work with K&R compilers, we can
|
|
||||||
remove this (and perhaps other parts of GNU make!) and migrate to using
|
|
||||||
gnulib directly.
|
|
||||||
|
|
||||||
This is called only through atexit(), which means die() has already been
|
|
||||||
invoked. So, call exit() here directly. Apparently that works...?
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* Close standard output, exiting with status 'exit_failure' on failure.
|
|
||||||
If a program writes *anything* to stdout, that program should close
|
|
||||||
stdout and make sure that it succeeds before exiting. Otherwise,
|
|
||||||
suppose that you go to the extreme of checking the return status
|
|
||||||
of every function that does an explicit write to stdout. The last
|
|
||||||
printf can succeed in writing to the internal stream buffer, and yet
|
|
||||||
the fclose(stdout) could still fail (due e.g., to a disk full error)
|
|
||||||
when it tries to write out that buffered data. Thus, you would be
|
|
||||||
left with an incomplete output file and the offending program would
|
|
||||||
exit successfully. Even calling fflush is not always sufficient,
|
|
||||||
since some file systems (NFS and CODA) buffer written/flushed data
|
|
||||||
until an actual close call.
|
|
||||||
|
|
||||||
Besides, it's wasteful to check the return value from every call
|
|
||||||
that writes to stdout -- just let the internal stream state record
|
|
||||||
the failure. That's what the ferror test is checking below.
|
|
||||||
|
|
||||||
It's important to detect such failures and exit nonzero because many
|
|
||||||
tools (most notably 'make' and other build-management systems) depend
|
|
||||||
on being able to detect failure in other tools via their exit status. */
|
|
||||||
|
|
||||||
static void
|
|
||||||
close_stdout (void)
|
|
||||||
{
|
|
||||||
int prev_fail = ferror (stdout);
|
|
||||||
int fclose_fail = fclose (stdout);
|
|
||||||
|
|
||||||
if (prev_fail || fclose_fail)
|
|
||||||
{
|
|
||||||
if (fclose_fail)
|
|
||||||
perror_with_name (_("write error: stdout"), "");
|
|
||||||
else
|
|
||||||
O (error, NILF, _("write error: stdout"));
|
|
||||||
exit (MAKE_TROUBLE);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
output_init (struct output *out)
|
output_init (struct output *out)
|
||||||
{
|
{
|
||||||
@@ -457,28 +324,10 @@ output_init (struct output *out)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Configure this instance of make. Be sure stdout is line-buffered. */
|
/* Force stdout/stderr into append mode (if they are files) to ensure
|
||||||
|
parallel jobs won't lose output due to overlapping writes. */
|
||||||
#ifdef HAVE_SETVBUF
|
fd_set_append (fileno (stdout));
|
||||||
# ifdef SETVBUF_REVERSED
|
fd_set_append (fileno (stderr));
|
||||||
setvbuf (stdout, _IOLBF, xmalloc (BUFSIZ), BUFSIZ);
|
|
||||||
# else /* setvbuf not reversed. */
|
|
||||||
/* Some buggy systems lose if we pass 0 instead of allocating ourselves. */
|
|
||||||
setvbuf (stdout, 0, _IOLBF, BUFSIZ);
|
|
||||||
# endif /* setvbuf reversed. */
|
|
||||||
#elif HAVE_SETLINEBUF
|
|
||||||
setlinebuf (stdout);
|
|
||||||
#endif /* setlinebuf missing. */
|
|
||||||
|
|
||||||
/* Force stdout/stderr into append mode. This ensures parallel jobs won't
|
|
||||||
lose output due to overlapping writes. */
|
|
||||||
set_append_mode (fileno (stdout));
|
|
||||||
set_append_mode (fileno (stderr));
|
|
||||||
|
|
||||||
#ifdef HAVE_ATEXIT
|
|
||||||
if (STREAM_OK (stdout))
|
|
||||||
atexit (close_stdout);
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@@ -517,7 +366,7 @@ output_start (void)
|
|||||||
/* If we're not syncing this output per-line or per-target, make sure we emit
|
/* If we're not syncing this output per-line or per-target, make sure we emit
|
||||||
the "Entering..." message where appropriate. */
|
the "Entering..." message where appropriate. */
|
||||||
if (output_sync == OUTPUT_SYNC_NONE || output_sync == OUTPUT_SYNC_RECURSE)
|
if (output_sync == OUTPUT_SYNC_NONE || output_sync == OUTPUT_SYNC_RECURSE)
|
||||||
if (! stdio_traced && print_directory_flag)
|
if (! stdio_traced && print_directory)
|
||||||
stdio_traced = log_working_directory (1);
|
stdio_traced = log_working_directory (1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -560,10 +409,11 @@ void
|
|||||||
message (int prefix, size_t len, const char *fmt, ...)
|
message (int prefix, size_t len, const char *fmt, ...)
|
||||||
{
|
{
|
||||||
va_list args;
|
va_list args;
|
||||||
|
char *start;
|
||||||
char *p;
|
char *p;
|
||||||
|
|
||||||
len += strlen (fmt) + strlen (program) + INTSTR_LENGTH + 4 + 1 + 1;
|
len += strlen (fmt) + strlen (program) + INTSTR_LENGTH + 4 + 1 + 1;
|
||||||
p = get_buffer (len);
|
start = p = get_buffer (len);
|
||||||
|
|
||||||
if (prefix)
|
if (prefix)
|
||||||
{
|
{
|
||||||
@@ -580,8 +430,8 @@ message (int prefix, size_t len, const char *fmt, ...)
|
|||||||
|
|
||||||
strcat (p, "\n");
|
strcat (p, "\n");
|
||||||
|
|
||||||
assert (fmtbuf.buffer[len-1] == '\0');
|
assert (start[len-1] == '\0');
|
||||||
outputs (0, fmtbuf.buffer);
|
outputs (0, start);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Print an error message. */
|
/* Print an error message. */
|
||||||
@@ -590,12 +440,13 @@ void
|
|||||||
error (const floc *flocp, size_t len, const char *fmt, ...)
|
error (const floc *flocp, size_t len, const char *fmt, ...)
|
||||||
{
|
{
|
||||||
va_list args;
|
va_list args;
|
||||||
|
char *start;
|
||||||
char *p;
|
char *p;
|
||||||
|
|
||||||
len += (strlen (fmt) + strlen (program)
|
len += (strlen (fmt) + strlen (program)
|
||||||
+ (flocp && flocp->filenm ? strlen (flocp->filenm) : 0)
|
+ (flocp && flocp->filenm ? strlen (flocp->filenm) : 0)
|
||||||
+ INTSTR_LENGTH + 4 + 1 + 1);
|
+ INTSTR_LENGTH + 4 + 1 + 1);
|
||||||
p = get_buffer (len);
|
start = p = get_buffer (len);
|
||||||
|
|
||||||
if (flocp && flocp->filenm)
|
if (flocp && flocp->filenm)
|
||||||
sprintf (p, "%s:%lu: ", flocp->filenm, flocp->lineno + flocp->offset);
|
sprintf (p, "%s:%lu: ", flocp->filenm, flocp->lineno + flocp->offset);
|
||||||
@@ -611,8 +462,8 @@ error (const floc *flocp, size_t len, const char *fmt, ...)
|
|||||||
|
|
||||||
strcat (p, "\n");
|
strcat (p, "\n");
|
||||||
|
|
||||||
assert (fmtbuf.buffer[len-1] == '\0');
|
assert (start[len-1] == '\0');
|
||||||
outputs (1, fmtbuf.buffer);
|
outputs (1, start);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Print an error message and exit. */
|
/* Print an error message and exit. */
|
||||||
@@ -622,12 +473,13 @@ fatal (const floc *flocp, size_t len, const char *fmt, ...)
|
|||||||
{
|
{
|
||||||
va_list args;
|
va_list args;
|
||||||
const char *stop = _(". Stop.\n");
|
const char *stop = _(". Stop.\n");
|
||||||
|
char *start;
|
||||||
char *p;
|
char *p;
|
||||||
|
|
||||||
len += (strlen (fmt) + strlen (program)
|
len += (strlen (fmt) + strlen (program)
|
||||||
+ (flocp && flocp->filenm ? strlen (flocp->filenm) : 0)
|
+ (flocp && flocp->filenm ? strlen (flocp->filenm) : 0)
|
||||||
+ INTSTR_LENGTH + 8 + strlen (stop) + 1);
|
+ INTSTR_LENGTH + 8 + strlen (stop) + 1);
|
||||||
p = get_buffer (len);
|
start = p = get_buffer (len);
|
||||||
|
|
||||||
if (flocp && flocp->filenm)
|
if (flocp && flocp->filenm)
|
||||||
sprintf (p, "%s:%lu: *** ", flocp->filenm, flocp->lineno + flocp->offset);
|
sprintf (p, "%s:%lu: *** ", flocp->filenm, flocp->lineno + flocp->offset);
|
||||||
@@ -643,8 +495,8 @@ fatal (const floc *flocp, size_t len, const char *fmt, ...)
|
|||||||
|
|
||||||
strcat (p, stop);
|
strcat (p, stop);
|
||||||
|
|
||||||
assert (fmtbuf.buffer[len-1] == '\0');
|
assert (start[len-1] == '\0');
|
||||||
outputs (1, fmtbuf.buffer);
|
outputs (1, start);
|
||||||
|
|
||||||
die (MAKE_FAILURE);
|
die (MAKE_FAILURE);
|
||||||
}
|
}
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user