mirror of
https://github.com/mirror/make.git
synced 2026-08-19 16:33:28 +08:00
Compare commits
376 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
db351fe85b | ||
|
|
8a0d7fd4ef | ||
|
|
f51fc130cc | ||
|
|
b99b6cdf3c | ||
|
|
36f955b0e8 | ||
|
|
a275f4e9ab | ||
|
|
11444fb001 | ||
|
|
0de7a0d3bf | ||
|
|
1656cd051c | ||
|
|
31a1337c23 | ||
|
|
5ae02ff8c1 | ||
|
|
1ceeb8c64b | ||
|
|
8791d2b38e | ||
|
|
f91b8bbb34 | ||
|
|
8dc66b6c31 | ||
|
|
ccbaf3861d | ||
|
|
c4fbfe8b5e | ||
|
|
e7ce3a655e | ||
|
|
c580ebae8d | ||
|
|
56d2978141 | ||
|
|
c91b269f66 | ||
|
|
29f453739f | ||
|
|
937e9aa32d | ||
|
|
8e9c7db1e1 | ||
|
|
15dfad96d7 | ||
|
|
76d2e5d98d | ||
|
|
a581146562 | ||
|
|
b2c7446023 | ||
|
|
89427039c3 | ||
|
|
7d8756a4a3 | ||
|
|
8e805c7ba6 | ||
|
|
132528b266 | ||
|
|
8f9e7722ff | ||
|
|
95c2db7b8d | ||
|
|
5d1b757517 | ||
|
|
c0023150f1 | ||
|
|
a89eef87e6 | ||
|
|
6164608900 | ||
|
|
a99183ed2b | ||
|
|
dc2d963989 | ||
|
|
53b8f6a5da | ||
|
|
6c1a6dd77c | ||
|
|
1b51ba1f5d | ||
|
|
4c9d87f4ae | ||
|
|
bb5df35133 | ||
|
|
92ab2e642d | ||
|
|
deb4ff272a | ||
|
|
e80ce6fc90 | ||
|
|
d71c0bb0ce | ||
|
|
090d99dd2d | ||
|
|
6b45f89adb | ||
|
|
11f7198f64 | ||
|
|
4321c5e562 | ||
|
|
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 |
1
.ccls
1
.ccls
@@ -13,6 +13,7 @@ clang
|
||||
-Wall
|
||||
-Wextra
|
||||
-Werror
|
||||
-Wno-address
|
||||
-Wwrite-strings
|
||||
-Wshadow
|
||||
-Wdeclaration-after-statement
|
||||
|
||||
@@ -1,18 +1,21 @@
|
||||
(
|
||||
(nil . ((bug-reference-bug-regexp . "\\(\\)\\bSV[- ]\\([0-9]+\\)")
|
||||
(bug-reference-url-format . "https://savannah.gnu.org/bugs/?%s")
|
||||
(ccls-initialization-options . (:index (:threads 6
|
||||
:initialBlacklist ("/make-[0-9]" "tests/work/" "/\\.deps" "/\\..*cache" "/\\.git"))))
|
||||
(lsp-file-watch-ignored . ("/\\.git$"
|
||||
"/\\..*cache$"
|
||||
;; autotools content
|
||||
"/\\.deps$"
|
||||
"/autom4te\\.cache$"
|
||||
"/build-aux$"
|
||||
;; make-specific content
|
||||
"/doc/manual$"
|
||||
"/tests/work$"
|
||||
"/make-[0-9]"))
|
||||
(ccls-initialization-options
|
||||
. (:index (:threads 6
|
||||
:initialBlacklist ["/make-[0-9]" "tests/work/" "/\\.deps"
|
||||
"/\\..*cache" "/\\.git"])))
|
||||
(lsp-file-watch-ignored-directories
|
||||
. ("[/\\\\]\\.git$"
|
||||
"[/\\\\]\\..*cache$"
|
||||
;; autotools content
|
||||
"[/\\\\]\\.deps$"
|
||||
"[/\\\\]autom4te\\.cache$"
|
||||
"[/\\\\]build-aux$"
|
||||
;; make-specific content
|
||||
"[/\\\\]doc[/\\\\]manual$"
|
||||
"[/\\\\]tests[/\\\\]work$"
|
||||
"[/\\\\]make-[0-9]"))
|
||||
))
|
||||
(c-mode . ((c-file-style . "gnu")))
|
||||
)
|
||||
|
||||
22
.gitignore
vendored
22
.gitignore
vendored
@@ -11,8 +11,14 @@ GTAGS
|
||||
*~
|
||||
#*
|
||||
.#*
|
||||
*.diff
|
||||
*.patch
|
||||
*.orig
|
||||
*.rej
|
||||
|
||||
# Configure artifacts
|
||||
/lib/
|
||||
/m4/
|
||||
ABOUT-NLS
|
||||
INSTALL
|
||||
Makefile
|
||||
@@ -28,8 +34,10 @@ config.log
|
||||
config.status
|
||||
configure
|
||||
/mk/Posix.mk
|
||||
stamp-h1
|
||||
stamp-*
|
||||
.dirstamp
|
||||
gnulib
|
||||
*.sed
|
||||
|
||||
# Build artifacts
|
||||
.deps/
|
||||
@@ -52,19 +60,17 @@ WinRel/
|
||||
GccDebug/
|
||||
GccRel/
|
||||
|
||||
# Test artifacts
|
||||
makeerror-*
|
||||
test-suite.log
|
||||
|
||||
# Distribution artifacts
|
||||
.dep_segment
|
||||
.check-git-HEAD
|
||||
ChangeLog
|
||||
README
|
||||
README.DOS
|
||||
README.OS2
|
||||
README.W32
|
||||
build.cfg
|
||||
config.ami
|
||||
config.h-vms
|
||||
config.h.W32
|
||||
configh.dos
|
||||
mkconfig.h
|
||||
make-[0-9]*/
|
||||
make-[0-9]*.tar.*
|
||||
checkcfg.*.log
|
||||
|
||||
67
AUTHORS
67
AUTHORS
@@ -1,15 +1,16 @@
|
||||
-----------------------------------
|
||||
|
||||
GNU make development up to version 3.75 by:
|
||||
Roland McGrath <roland@gnu.org>
|
||||
|
||||
|
||||
Development starting with GNU make 3.76 by:
|
||||
GNU Make development starting with GNU Make 3.76 by:
|
||||
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>
|
||||
|
||||
GNU Make development up to version 3.75 by:
|
||||
Roland McGrath <roland@gnu.org>
|
||||
|
||||
GNU Make User's Manual
|
||||
Written by:
|
||||
@@ -22,7 +23,7 @@ GNU Make User's Manual
|
||||
Paul D. Smith <psmith@gnu.org>
|
||||
|
||||
-----------------------------------
|
||||
GNU make porting efforts:
|
||||
GNU Make porting efforts:
|
||||
|
||||
Port to VMS by:
|
||||
Klaus Kaempf <kkaempf@progis.de>
|
||||
@@ -34,6 +35,9 @@ GNU make porting efforts:
|
||||
Port to Amiga by:
|
||||
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:
|
||||
DJ Delorie <dj@delorie.com>
|
||||
Rob Tulloh <rob_tulloh@tivoli.com>
|
||||
@@ -42,39 +46,72 @@ GNU make porting efforts:
|
||||
Andreas Beuning <andreas.buening@nexgo.de>
|
||||
Earnie Boyd <earnie@uses.sf.net>
|
||||
Troy Runkel <Troy.Runkel@mathworks.com>
|
||||
Juan M. Guerrero <juan.guerrero@gmx.de>
|
||||
KO Myung-Hun <komh78@gmail.com>
|
||||
|
||||
Port to z/OS by:
|
||||
Igor Todorovski <itodorov@ca.ibm.com>
|
||||
|
||||
-----------------------------------
|
||||
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>
|
||||
Howard Chu <hyc@highlandsun.com>
|
||||
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>
|
||||
Mike Frysinger <vapier@gentoo.org>
|
||||
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>
|
||||
Ben Hutchings <ben@decadent.org.uk>
|
||||
Cao jin <caoj.fnst@cn.fujitsu.com>
|
||||
Michael Joosten
|
||||
Christian Jullien <eligis@orange.fr>
|
||||
Jim Kelton <jim_kelton@tivoli.com>
|
||||
Kaz Kylheku <kaz@kylheku.com>
|
||||
David Lubbren <uhay@rz.uni-karlsruhe.de>
|
||||
Tim Magill <tim.magill@telops.gte.com>
|
||||
Markus Mauhart <qwe123@chello.at>
|
||||
Greg McGary <greg@mcgary.org>
|
||||
Thien-Thi Nguyen <ttn@gnuvola.org>
|
||||
Thomas Riedl <thomas.riedl@siemens.com>
|
||||
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)
|
||||
Ian Stewartson (Data Logic Limited)
|
||||
David A. Wheeler <dwheeler@dwheeler.com>
|
||||
David Boyce <dsb@boyski.com>
|
||||
Frank Heckenbach <f.heckenbach@fh-soft.de>
|
||||
Kaz Kylheku <kaz@kylheku.com>
|
||||
Tobias Stoeckmann <tobias@stoeckmann.org>
|
||||
Sergei Trofimovich <siarheit@google.com>
|
||||
Justine Tunney <jtunney@gmail.com>
|
||||
Marc Ullman <marc@mathworks.com>
|
||||
Christof Warlich <cwarlich@gmx.de>
|
||||
Florian Weimer <fweimer@redhat.com>
|
||||
David A. Wheeler <dwheeler@dwheeler.com>
|
||||
Bernhard M. Wiedemann <bwiedemann@suse.de>
|
||||
Ben Wijen <ben@wijen.net>
|
||||
Jouke Witteveen <j.witteveen@gmail.com>
|
||||
|
||||
With suggestions/comments/bug reports from a cast of ... well ...
|
||||
hundreds, anyway :)
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 1997-2020 Free Software Foundation, Inc.
|
||||
Copyright (C) 1997-2023 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
|
||||
@@ -87,4 +124,4 @@ 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 <http://www.gnu.org/licenses/>.
|
||||
this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
# Basic GNU -*-Makefile-*- to build GNU make
|
||||
# Basic GNU -*-Makefile-*- to build GNU Make
|
||||
#
|
||||
# NOTE:
|
||||
# If you have no 'make' program at all to process this makefile:
|
||||
# * On Windows, run ".\buildw32.bat" to bootstrap one.
|
||||
# * On Windows, run ".\build_w32.bat" to bootstrap one.
|
||||
# * On MS-DOS, run ".\builddos.bat" to bootstrap one.
|
||||
#
|
||||
# Once you have a GNU make program created, you can use it with this makefile
|
||||
# Once you have a GNU Make program created, you can use it with this makefile
|
||||
# to keep it up to date if you make changes, as:
|
||||
#
|
||||
# make.exe -f Basic.mk
|
||||
#
|
||||
# Copyright (C) 2017-2020 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2017-2023 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
|
||||
@@ -24,7 +24,7 @@
|
||||
# details.
|
||||
#
|
||||
# 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:
|
||||
|
||||
@@ -39,7 +39,6 @@ w32_SOURCES = %w32_SOURCES%
|
||||
vms_SOURCES = %vms_SOURCES%
|
||||
amiga_SOURCES = %amiga_SOURCES%
|
||||
|
||||
posix_SOURCES = $(src)posixos.c
|
||||
remote_SOURCES = $(src)remote-stub.c
|
||||
|
||||
OUTDIR =
|
||||
@@ -88,8 +87,9 @@ COMPILE.cmd = $(CC) $(extra_CFLAGS) $(CFLAGS) $(extra_CPPFLAGS) $(CPPFLAGS) $(TA
|
||||
# $(call LINK.cmd,<objectlist>)
|
||||
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.args ?=
|
||||
|
||||
# $(call MKDIR.cmd,<dirlist>)
|
||||
MKDIR.cmd = mkdir -p $1
|
||||
@@ -103,9 +103,7 @@ CP.cmd = cp $1 $2
|
||||
CLEANSPACE = $(call RM.cmd,$(OBJECTS) $(PROG) $(BUILT_SOURCES))
|
||||
|
||||
# Load overrides for the above variables.
|
||||
include $(firstword $(wildcard $(SRCDIR)/mk/$(lastword $(subst -, ,$(MAKE_HOST)).mk) $(OUTDIR)mk/Posix.mk $(SRCDIR)/mk/Posix.mk))
|
||||
|
||||
VERSION = %VERSION%
|
||||
include $(firstword $(wildcard $(SRCDIR)/mk/$(lastword $(subst -, ,$(MAKE_HOST)).mk)))
|
||||
|
||||
VPATH = $(SRCDIR)
|
||||
|
||||
@@ -123,7 +121,7 @@ $(OBJDIRS):
|
||||
$(call MKDIR.cmd,$@)
|
||||
|
||||
check:
|
||||
$(CHECK.cmd)
|
||||
$(CHECK.cmd) $(CHECK.args)
|
||||
|
||||
clean:
|
||||
$(CLEANSPACE)
|
||||
|
||||
8
COPYING
8
COPYING
@@ -1,7 +1,7 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
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
|
||||
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.
|
||||
|
||||
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.
|
||||
|
||||
@@ -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,
|
||||
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
|
||||
<http://www.gnu.org/licenses/>.
|
||||
<https://www.gnu.org/licenses/>.
|
||||
|
||||
The GNU General Public License does not permit incorporating your program
|
||||
into proprietary programs. If your program is a subroutine library, you
|
||||
may consider it more useful to permit linking proprietary applications with
|
||||
the library. If this is what you want to do, use the GNU Lesser General
|
||||
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.
|
||||
|
||||
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.
|
||||
|
||||
* 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.
|
||||
|
||||
* 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:
|
||||
|
||||
http://git.savannah.gnu.org/cgit/make.git/tree/
|
||||
https://git.savannah.gnu.org/cgit/make.git/tree/
|
||||
|
||||
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.
|
||||
|
||||
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
|
||||
CreateProcess. This avoids weird failures due to buggy quoting by
|
||||
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
|
||||
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
|
||||
escape character before whitespace, if the shell is not a Posix
|
||||
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>
|
||||
|
||||
@@ -1392,7 +1392,7 @@
|
||||
2011-09-16 Paul Smith <psmith@gnu.org>
|
||||
|
||||
* 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>
|
||||
|
||||
@@ -5612,7 +5612,7 @@
|
||||
|
||||
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.
|
||||
|
||||
@@ -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.
|
||||
|
||||
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/>.
|
||||
|
||||
75
Makefile.am
75
Makefile.am
@@ -1,6 +1,6 @@
|
||||
# This is a -*-Makefile-*-, or close enough
|
||||
#
|
||||
# Copyright (C) 1997-2020 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1997-2023 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
|
||||
@@ -14,7 +14,7 @@
|
||||
# details.
|
||||
#
|
||||
# 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-lzip silent-rules std-options subdir-objects nostdinc
|
||||
ACLOCAL_AMFLAGS = -I m4
|
||||
@@ -34,9 +34,10 @@ make_SRCS = src/ar.c src/arscan.c src/commands.c src/commands.h \
|
||||
src/getopt.h src/getopt1.c src/gettext.h src/guile.c \
|
||||
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/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/variable.c src/variable.h src/version.c src/vpath.c
|
||||
src/mkcustom.h src/os.h src/output.c src/output.h src/read.c \
|
||||
src/remake.c src/rule.c src/rule.h src/shuffle.h src/shuffle.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 \
|
||||
src/w32/compat/posixfcn.c src/w32/include/dirent.h \
|
||||
@@ -59,16 +60,28 @@ loadavg_SRCS = lib/getloadavg.c
|
||||
make_SOURCES = $(make_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@
|
||||
|
||||
localedir = $(datadir)/locale
|
||||
|
||||
AM_CPPFLAGS = -Isrc -I$(top_srcdir)/src -Ilib -I$(top_srcdir)/lib \
|
||||
-DLIBDIR=\"$(libdir)\" -DINCLUDEDIR=\"$(includedir)\" \
|
||||
-DLOCALEDIR=\"$(localedir)\"
|
||||
-DLIBDIR=\"$(libdir)\" -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
|
||||
make_SOURCES += $(w32_SRCS)
|
||||
@@ -98,8 +111,8 @@ test_FILES = tests/run_make_tests tests/run_make_tests.bat \
|
||||
tests/mkshadow tests/thelp.pl tests/guile.supp tests/README
|
||||
# test/scripts are added via dist-hook below.
|
||||
|
||||
EXTRA_DIST = ChangeLog README build.sh build.cfg.in $(man_MANS) \
|
||||
README.customs README.OS2 \
|
||||
EXTRA_DIST = ChangeLog INSTALL README build.sh build.cfg.in $(man_MANS) \
|
||||
src/mkconfig.h README.customs README.OS2 README.zOS \
|
||||
README.Amiga SCOPTIONS src/config.ami \
|
||||
README.DOS builddos.bat src/configh.dos \
|
||||
README.W32 build_w32.bat src/config.h.W32 \
|
||||
@@ -124,14 +137,14 @@ src/gmk-default.h: $(top_srcdir)/src/gmk-default.scm
|
||||
dist-hook:
|
||||
(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`; \
|
||||
tar chf - $$sub) \
|
||||
| (cd $(distdir); tar xfBp -)
|
||||
$(AMTAR) chf - $$sub) \
|
||||
| (cd $(distdir); $(AMTAR) xfBp -)
|
||||
|
||||
|
||||
# --------------- Local CHECK Section
|
||||
|
||||
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`; \
|
||||
echo; \
|
||||
echo "$$dashes"; \
|
||||
@@ -149,7 +162,24 @@ MAKETESTFLAGS =
|
||||
|
||||
.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
|
||||
@rm -f $(testfiles)
|
||||
@if test -f '$(top_srcdir)/tests/run_make_tests'; then \
|
||||
ulimit -n 128; \
|
||||
if $(PERL) -v >/dev/null 2>&1; then \
|
||||
@@ -157,17 +187,26 @@ check-regression: tests/config-flags.pm
|
||||
*) test -d tests || mkdir tests; \
|
||||
rm -f srctests; \
|
||||
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; \
|
||||
done; fi ;; \
|
||||
esac; \
|
||||
echo "cd tests && $(PERL) $(PERLFLAGS) ./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 '../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) $(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 \
|
||||
echo "Can't find a working Perl ($(PERL)); the test suite requires Perl."; \
|
||||
fi; \
|
||||
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
|
||||
|
||||
|
||||
|
||||
396
NEWS
396
NEWS
@@ -1,19 +1,247 @@
|
||||
GNU make NEWS -*-indented-text-*-
|
||||
GNU Make NEWS -*-indented-text-*-
|
||||
History of user-visible changes.
|
||||
3 January 2020
|
||||
14 January 2023
|
||||
|
||||
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.
|
||||
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.
|
||||
|
||||
|
||||
Version 4.2.93 (03 Jan 2020)
|
||||
Version 4.4.0.90 (14 Jan 2023)
|
||||
|
||||
This release is primarily a bug-fix release.
|
||||
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=110&set=custom
|
||||
|
||||
* WARNING: Backward-incompatibility!
|
||||
In previous releases it was not well-defined when updates to MAKEFLAGS made
|
||||
inside a makefile would be visible. This release ensures they are visible
|
||||
immediately, even when invoking $(shell ...) functions. Also, command line
|
||||
variable assignments are now always present in MAKEFLAGS, even when parsing
|
||||
makefiles.
|
||||
Implementation provided by Dmitry Goncharov <dgoncharov@users.sf.net>
|
||||
|
||||
* New feature: Parallel builds of archives
|
||||
Previously it was not possible to use parallel builds with archives. It is
|
||||
still not possible using the built-in rules, however you can now override
|
||||
the built-in rules with a slightly different set of rules and use parallel
|
||||
builds with archive creation. See the "Dangers When Using Archives" section
|
||||
of the GNU Make manual, and https://savannah.gnu.org/bugs/index.php?14927
|
||||
|
||||
* New platform: GNU Make is supported on z/OS
|
||||
Thanks to Igor Todorovski <itodorov@ca.ibm.com> for the patches and testing
|
||||
assistance.
|
||||
|
||||
* Previously target-specific variables would inherit their "export" capability
|
||||
from parent target-specific variables even if they were marked private. Now
|
||||
private parent target-specific variables have no affect. For more details
|
||||
see https://savannah.gnu.org/bugs/index.php?61463
|
||||
|
||||
* Updates to allow building on OS/2
|
||||
Provided by KO Myung-Hun <komh78@gmail.com>
|
||||
|
||||
|
||||
Version 4.4 (31 Oct 2022)
|
||||
|
||||
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!
|
||||
Number signs (#) appearing inside a macro reference or function invocation
|
||||
@@ -36,9 +264,24 @@ http://sv.gnu.org/bugs/index.php?group=make&report_id=111&fix_release_id=108&set
|
||||
add a trailing space.
|
||||
|
||||
* WARNING: Backward-incompatibility!
|
||||
Contrary to the documentation, suffix rules with prerequisites were being
|
||||
treated BOTH as simple targets AND as pattern rules. Behavior now matches
|
||||
the documentation, and pattern rules are no longer created in this case.
|
||||
Previously using the .SILENT pseudo-target in a makefile would force all
|
||||
sub-makes to be invoked with the '-s' option, effectively making all
|
||||
sub-makes silent as well. In this release .SILENT only affects the current
|
||||
invocation of make. A side-effect of this is that .SILENT will no longer
|
||||
enable the --no-print-directory option, which using -s will do.
|
||||
|
||||
* NOTE: Deprecated behavior.
|
||||
Contrary to the documentation, suffix rules with prerequisites are being
|
||||
treated BOTH as simple targets AND as pattern rules. Further, the
|
||||
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
|
||||
Pattern rules have always had the ability to generate multiple targets with
|
||||
@@ -54,14 +297,15 @@ http://sv.gnu.org/bugs/index.php?group=make&report_id=111&fix_release_id=108&set
|
||||
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
|
||||
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
|
||||
present, you can use the --disable-posix-spawn option to configure. Aron
|
||||
Barath <baratharon@caesar.elte.hu> provided the basic implementation.
|
||||
present, you can use the --disable-posix-spawn option to configure.
|
||||
Implementation contributed by Aron Barath <baratharon@caesar.elte.hu>
|
||||
|
||||
* Error messages printed when invoking non-existent commands have been cleaned
|
||||
up and made consistent.
|
||||
@@ -75,17 +319,17 @@ http://sv.gnu.org/bugs/index.php?group=make&report_id=111&fix_release_id=108&set
|
||||
|
||||
* A new option -E has been added as a short alias for --eval.
|
||||
|
||||
* All wildcard expansion within GNU make, including $(wildcard ...), will sort
|
||||
* All wildcard expansion within GNU Make, including $(wildcard ...), will sort
|
||||
the results. See https://savannah.gnu.org/bugs/index.php?52076
|
||||
|
||||
* Interoperate with newer GNU libc and musl C runtime libraries.
|
||||
|
||||
* Performance improvements provided by Paolo Bonzini <pbonzini@redhat.com>
|
||||
|
||||
GNU make Developer News
|
||||
GNU Make Developer News
|
||||
|
||||
* Import the GNU standard bootstrap script to replace the hand-rolled
|
||||
"make update" method for building code from a GNU make Git repository.
|
||||
"make update" method for building code from a GNU Make Git repository.
|
||||
|
||||
* Rework the source distribution to move source files into the src/*
|
||||
subdirectory. This aligns with modern best practices in GNU.
|
||||
@@ -99,7 +343,7 @@ Version 4.2.1 (10 Jun 2016)
|
||||
|
||||
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.
|
||||
|
||||
@@ -108,7 +352,7 @@ Version 4.2 (22 May 2016)
|
||||
|
||||
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
|
||||
$(shell ...) function invoked in this instance of make. This will be "0" if
|
||||
@@ -119,11 +363,11 @@ http://sv.gnu.org/bugs/index.php?group=make&report_id=111&fix_release_id=106&set
|
||||
The function is expanded to the contents of the file. The contents are
|
||||
expanded verbatim except that the final newline, if any, is stripped.
|
||||
|
||||
* The makefile line numbers shown by GNU make now point directly to the
|
||||
* The makefile line numbers shown by GNU Make now point directly to the
|
||||
specific line in the recipe where the failure or warning occurred.
|
||||
Sample changes suggested by Brian Vandenberg <phantall@gmail.com>
|
||||
|
||||
* The interface to GNU make's "jobserver" is stable as documented in the
|
||||
* The interface to GNU Make's "jobserver" is stable as documented in the
|
||||
manual, for tools which may want to access it.
|
||||
|
||||
WARNING: Backward-incompatibility! The internal-only command line option
|
||||
@@ -147,7 +391,7 @@ Version 4.1 (05 Oct 2014)
|
||||
|
||||
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
|
||||
values if stdout or stderr, respectively, are believed to be writing to a
|
||||
@@ -158,7 +402,7 @@ http://sv.gnu.org/bugs/index.php?group=make&report_id=111&fix_release_id=105&set
|
||||
requested mode, then closed again.
|
||||
|
||||
* Change the fatal error for mixed explicit and implicit rules, that was
|
||||
introduced in GNU make 3.82, to a non-fatal error. However, this syntax is
|
||||
introduced in GNU Make 3.82, to a non-fatal error. However, this syntax is
|
||||
still deprecated and may return to being illegal in a future version of GNU
|
||||
make. Makefiles that rely on this syntax should be fixed.
|
||||
See https://savannah.gnu.org/bugs/?33034
|
||||
@@ -195,7 +439,7 @@ Version 4.0 (09 Oct 2013)
|
||||
|
||||
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!
|
||||
If .POSIX is specified, then make adheres to the POSIX backslash/newline
|
||||
@@ -206,7 +450,7 @@ http://sv.gnu.org/bugs/index.php?group=make&report_id=111&fix_release_id=101&set
|
||||
single space
|
||||
|
||||
* New feature: GNU Guile integration
|
||||
This version of GNU make can be compiled with GNU Guile integration.
|
||||
This version of GNU Make can be compiled with GNU Guile integration.
|
||||
GNU Guile serves as an embedded extension language for make.
|
||||
See the "Guile Function" section in the GNU Make manual for details.
|
||||
Currently GNU Guile 1.8 and 2.0+ are supported. In Guile 1.8 there is no
|
||||
@@ -238,20 +482,20 @@ http://sv.gnu.org/bugs/index.php?group=make&report_id=111&fix_release_id=101&set
|
||||
* New feature: "!=" shell assignment operator as an alternative to the
|
||||
$(shell ...) function. Implemented for compatibility with BSD makefiles.
|
||||
Note there are subtle differences between "!=" and $(shell ...). See the
|
||||
description in the GNU make manual.
|
||||
description in the GNU Make manual.
|
||||
WARNING: Backward-incompatibility!
|
||||
Variables ending in "!" previously defined as "variable!= value" will now be
|
||||
interpreted as shell assignment. Change your assignment to add whitespace
|
||||
between the "!" and "=": "variable! = value"
|
||||
|
||||
* 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
|
||||
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.
|
||||
|
||||
* New feature: Loadable objects
|
||||
This version of GNU make contains a "technology preview": the ability to
|
||||
This version of GNU Make contains a "technology preview": the ability to
|
||||
load dynamic objects into the make runtime. These objects can be created by
|
||||
the user and can add extended functionality, usable by makefiles.
|
||||
|
||||
@@ -259,8 +503,8 @@ http://sv.gnu.org/bugs/index.php?group=make&report_id=111&fix_release_id=101&set
|
||||
|
||||
* New variable: $(GNUMAKEFLAGS) will be parsed for make flags, just like
|
||||
MAKEFLAGS is. It can be set in the environment or the makefile, containing
|
||||
GNU make-specific flags to allow your makefile to be portable to other
|
||||
versions of make. Once this variable is parsed, GNU make will set it to the
|
||||
GNU Make-specific flags to allow your makefile to be portable to other
|
||||
versions of make. Once this variable is parsed, GNU Make will set it to the
|
||||
empty string so that flags will not be duplicated on recursion.
|
||||
|
||||
* New variable: `MAKE_HOST' gives the name of the host architecture
|
||||
@@ -299,9 +543,9 @@ Version 3.82 (28 Jul 2010)
|
||||
|
||||
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.
|
||||
|
||||
* WARNING: Backward-incompatibility!
|
||||
@@ -309,7 +553,7 @@ http://sv.gnu.org/bugs/index.php?group=make&report_id=111&fix_release_id=104&set
|
||||
fundamentally incompatible way: make is required to invoke the shell as if
|
||||
the '-e' flag were provided. Because this would break many makefiles that
|
||||
have been written to conform to the original text of the standard, the
|
||||
default behavior of GNU make remains to invoke the shell with simply '-c'.
|
||||
default behavior of GNU Make remains to invoke the shell with simply '-c'.
|
||||
However, any makefile specifying the .POSIX special target will follow the
|
||||
new POSIX standard and pass '-e' to the shell. See also .SHELLFLAGS
|
||||
below.
|
||||
@@ -418,9 +662,9 @@ http://sv.gnu.org/bugs/index.php?group=make&report_id=111&fix_release_id=104&set
|
||||
* A note on appending the redirected output. With this change, a simple
|
||||
mechanism is implemented to make ">>" work in action lines. In VMS
|
||||
there is no simple feature like ">>" to have DCL command or program
|
||||
output redirected and appended to a file. GNU make for VMS already
|
||||
output redirected and appended to a file. GNU Make for VMS already
|
||||
implements the redirection of output. If such a redirection is detected,
|
||||
an ">" on the action line, GNU make creates a DCL command procedure to
|
||||
an ">" on the action line, GNU Make creates a DCL command procedure to
|
||||
execute the action and to redirect its output. Based on that, now ">>"
|
||||
is also recognized and a similar but different command procedure is
|
||||
created to implement the append. The main idea here is to create a
|
||||
@@ -429,7 +673,7 @@ http://sv.gnu.org/bugs/index.php?group=make&report_id=111&fix_release_id=104&set
|
||||
in the command procedure to keep changes in make small and simple. This
|
||||
obviously has some limitations but it seems good enough compared with
|
||||
the current ">" implementation. (And in my opinion, redirection is not
|
||||
really what GNU make has to do.) With this approach, it may happen that
|
||||
really what GNU Make has to do.) With this approach, it may happen that
|
||||
the temporary file is not yet appended and is left in SYS$SCRATCH.
|
||||
The temporary file names look like "CMDxxxxx.". Any time the created
|
||||
command procedure can not complete, this happens. Pressing Ctrl+Y to
|
||||
@@ -452,9 +696,9 @@ http://sv.gnu.org/bugs/index.php?group=make&report_id=111&fix_release_id=104&set
|
||||
|
||||
Version 3.81 (01 Apr 2006)
|
||||
|
||||
* GNU make is ported to OS/2.
|
||||
* GNU Make is ported to OS/2.
|
||||
|
||||
* GNU make is ported to MinGW. The MinGW build is only supported by
|
||||
* GNU Make is ported to MinGW. The MinGW build is only supported by
|
||||
the build_w32.bat batch file; see the file README.W32 for more
|
||||
details.
|
||||
|
||||
@@ -462,12 +706,12 @@ Version 3.81 (01 Apr 2006)
|
||||
Up to and including this release, the '$?' variable does not contain
|
||||
any prerequisite that does not exist, even though that prerequisite
|
||||
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.
|
||||
See http://savannah.gnu.org/bugs/?16051
|
||||
See https://savannah.gnu.org/bugs/?16051
|
||||
|
||||
* 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
|
||||
prerequisites of both explicit and implicit (pattern) rules. In order
|
||||
to enable this feature, the special target '.SECONDEXPANSION' must be
|
||||
defined before the first target which takes advantage of it. If this
|
||||
@@ -485,23 +729,23 @@ Version 3.81 (01 Apr 2006)
|
||||
of this SysV feature you will need to update them.
|
||||
|
||||
* WARNING: Backward-incompatibility!
|
||||
In order to comply with POSIX, the way in which GNU make processes
|
||||
In order to comply with POSIX, the way in which GNU Make processes
|
||||
backslash-newline sequences in recipes has changed. If your makefiles
|
||||
use backslash-newline sequences inside of single-quoted strings in
|
||||
recipes you will be impacted by this change. See the GNU make manual
|
||||
recipes you will be impacted by this change. See the GNU Make manual
|
||||
subsection "Splitting Recipe Lines" (node "Splitting Lines"), in
|
||||
section "Recipe Syntax", chapter "Writing Recipe in Rules", for
|
||||
details.
|
||||
|
||||
* WARNING: Backward-incompatibility!
|
||||
Some previous versions of GNU make had a bug where "#" in a function
|
||||
Some previous versions of GNU Make had a bug where "#" in a function
|
||||
invocation such as $(shell ...) was treated as a make comment. A
|
||||
workaround was to escape these with backslashes. This bug has been
|
||||
fixed: if your makefile uses "\#" in a function invocation the
|
||||
backslash is now preserved, so you'll need to remove it.
|
||||
|
||||
* New command line option: -L (--check-symlink-times). On systems that
|
||||
support symbolic links, if this option is given then GNU make will
|
||||
support symbolic links, if this option is given then GNU Make will
|
||||
use the most recent modification time of any symbolic links that are
|
||||
used to resolve target files. The default behavior remains as it
|
||||
always has: use the modification time of the actual target file only.
|
||||
@@ -521,16 +765,16 @@ Version 3.81 (01 Apr 2006)
|
||||
call are now masked in the context of the inner call.
|
||||
|
||||
* Implemented a solution for the "thundering herd" problem with "-j -l".
|
||||
This version of GNU make uses an algorithm suggested by Thomas Riedl
|
||||
This version of GNU Make uses an algorithm suggested by Thomas Riedl
|
||||
<thomas.riedl@siemens.com> to track the number of jobs started in the
|
||||
last second and artificially adjust GNU make's view of the system's
|
||||
last second and artificially adjust GNU Make's view of the system's
|
||||
load average accordingly.
|
||||
|
||||
* New special variables available in this release:
|
||||
- .INCLUDE_DIRS: Expands to a list of directories that make searches
|
||||
for included makefiles.
|
||||
- .FEATURES: Contains a list of special features available in this
|
||||
version of GNU make.
|
||||
version of GNU Make.
|
||||
- .DEFAULT_GOAL: Set the name of the default goal make will
|
||||
use if no goals are provided on the command line.
|
||||
- MAKE_RESTARTS: If set, then this is the number of times this
|
||||
@@ -568,7 +812,7 @@ Version 3.81 (01 Apr 2006)
|
||||
it will be set in the environment, just as before.
|
||||
|
||||
* On MS Windows systems, explicitly setting SHELL to a pathname ending
|
||||
in "cmd" or "cmd.exe" (case-insensitive) will force GNU make to use
|
||||
in "cmd" or "cmd.exe" (case-insensitive) will force GNU Make to use
|
||||
the DOS command interpreter in batch mode even if a UNIX-like shell
|
||||
could be found on the system.
|
||||
|
||||
@@ -588,7 +832,7 @@ Version 3.81 (01 Apr 2006)
|
||||
|
||||
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)
|
||||
@@ -600,7 +844,7 @@ Version 3.80 (03 Oct 2002)
|
||||
requiring that target A will always be rebuilt if target B is updated.
|
||||
Patch for this feature provided by Greg McGary <greg@mcgary.org>.
|
||||
|
||||
* For compatibility with SysV make, GNU make now supports the peculiar
|
||||
* For compatibility with SysV make, GNU Make now supports the peculiar
|
||||
syntax $$@, $$(@D), and $$(@F) in the prerequisites list of a rule.
|
||||
This syntax is only valid within explicit and static pattern rules: it
|
||||
cannot be used in implicit (suffix or pattern) rules. Edouard G. Parmelan
|
||||
@@ -625,7 +869,7 @@ Version 3.80 (03 Oct 2002)
|
||||
useful here.
|
||||
|
||||
* A new built-in variable is defined, $(MAKEFILE_LIST). It contains a
|
||||
list of each makefile GNU make has read, or started to read, in the
|
||||
list of each makefile GNU Make has read, or started to read, in the
|
||||
order in which they were encountered. So, the last filename in the
|
||||
list when a makefile is just being read (before any includes) is the
|
||||
name of the current makefile.
|
||||
@@ -635,7 +879,7 @@ Version 3.80 (03 Oct 2002)
|
||||
makefiles at that moment.
|
||||
|
||||
* A new command line option is defined, -B or --always-make. If
|
||||
specified GNU make will consider all targets out-of-date even if they
|
||||
specified GNU Make will consider all targets out-of-date even if they
|
||||
would otherwise not be.
|
||||
|
||||
* The arguments to $(call ...) functions were being stored in $1, $2,
|
||||
@@ -660,7 +904,7 @@ Version 3.80 (03 Oct 2002)
|
||||
Turkish.
|
||||
|
||||
* Updated internationalization support to Gettext 0.11.5.
|
||||
GNU make now uses Gettext's "external" feature, and does not include
|
||||
GNU Make now uses Gettext's "external" feature, and does not include
|
||||
any internationalization code itself. Configure will search your
|
||||
system for an existing implementation of GNU Gettext (only GNU Gettext
|
||||
is acceptable) and use it if it exists. If not, NLS will be disabled.
|
||||
@@ -692,7 +936,7 @@ Version 3.80 (03 Oct 2002)
|
||||
available ECOs for VMS V7.1 and newer versions. It is fixed in versions
|
||||
shipped with newer VMS versions and all ECO kits after October 1999. It
|
||||
only shows up during the daylight saving time period (DST): stat()
|
||||
returns a modification time 1 hour ahead. This results in GNU make
|
||||
returns a modification time 1 hour ahead. This results in GNU Make
|
||||
warning messages. For a just created source you will see:
|
||||
|
||||
$ gmake x.exe
|
||||
@@ -706,7 +950,7 @@ Version 3.80 (03 Oct 2002)
|
||||
|
||||
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)
|
||||
@@ -720,11 +964,11 @@ Version 3.79.1 (23 Jun 2000)
|
||||
|
||||
Version 3.79 (04 Apr 2000)
|
||||
|
||||
* GNU make optionally supports internationalization and locales via the
|
||||
* GNU Make optionally supports internationalization and locales via the
|
||||
GNU gettext (or local gettext if suitable) package. See the ABOUT-NLS
|
||||
file for more information on configuring GNU make for NLS.
|
||||
file for more information on configuring GNU Make for NLS.
|
||||
|
||||
* Previously, GNU make quoted variables such as MAKEFLAGS and
|
||||
* Previously, GNU Make quoted variables such as MAKEFLAGS and
|
||||
MAKEOVERRIDES for proper parsing by the shell. This allowed them to
|
||||
be used within make build scripts. However, using them there is not
|
||||
proper behavior: they are meant to be passed to subshells via the
|
||||
@@ -758,12 +1002,12 @@ Version 3.79 (04 Apr 2000)
|
||||
value is greater than the "end" value. If that's true, nothing is
|
||||
returned.
|
||||
|
||||
* Hartmut Becker provided many updates for the VMS port of GNU make.
|
||||
* Hartmut Becker provided many updates for the VMS port of GNU Make.
|
||||
See the README.VMS file for more details.
|
||||
|
||||
* VMS-specific changes:
|
||||
|
||||
* Fix a problem with automatically remaking makefiles. GNU make uses an
|
||||
* Fix a problem with automatically remaking makefiles. GNU Make uses an
|
||||
execve to restart itself after a successful remake of the makefile. On
|
||||
UNIX systems execve replaces the running program with a new one and
|
||||
resets all signal handling to the default. On VMS execve creates a child
|
||||
@@ -841,7 +1085,7 @@ Version 3.78 (22 Sep 1999)
|
||||
|
||||
* A "job server" feature, suggested by Howard Chu <hyc@highlandsun.com>.
|
||||
|
||||
On systems that support POSIX pipe(2) semantics, GNU make can now pass
|
||||
On systems that support POSIX pipe(2) semantics, GNU Make can now pass
|
||||
-jN options to submakes rather than forcing them all to use -j1. The
|
||||
top make and all its sub-make processes use a pipe to communicate with
|
||||
each other to ensure that no more than N jobs are started across all
|
||||
@@ -849,20 +1093,20 @@ Version 3.78 (22 Sep 1999)
|
||||
with the --disable-job-server option.
|
||||
|
||||
* The confusing term "dependency" has been replaced by the more accurate
|
||||
and standard term "prerequisite", both in the manual and in all GNU make
|
||||
and standard term "prerequisite", both in the manual and in all GNU Make
|
||||
output.
|
||||
|
||||
* GNU make supports the "big archive" library format introduced in AIX 4.3.
|
||||
* GNU Make supports the "big archive" library format introduced in AIX 4.3.
|
||||
|
||||
* GNU make supports large files on AIX, HP-UX, and IRIX. These changes
|
||||
* GNU Make supports large files on AIX, HP-UX, and IRIX. These changes
|
||||
were provided by Paul Eggert <eggert@twinsun.com>. (Large file
|
||||
support for Solaris and Linux was introduced in 3.77, but the
|
||||
configuration had issues: these have also been resolved).
|
||||
|
||||
* The Windows 95/98/NT (W32) version of GNU make now has native support
|
||||
* The Windows 95/98/NT (W32) version of GNU Make now has native support
|
||||
for the Cygnus Cygwin release B20.1 shell (bash).
|
||||
|
||||
* The GNU make regression test suite, long available separately "under
|
||||
* The GNU Make regression test suite, long available separately "under
|
||||
the table", has been integrated into the release. You can invoke it
|
||||
by running "make check" in the distribution. Note that it requires
|
||||
Perl (either Perl 4 or Perl 5) to run.
|
||||
@@ -905,10 +1149,10 @@ Version 3.77 (28 Jul 1998)
|
||||
you'll have to escape both of them: "foo : bar\\\=baz".
|
||||
|
||||
* A new appendix listing the most common error and warning messages
|
||||
generated by GNU make, with some explanation, has been added to the
|
||||
GNU make User's Manual.
|
||||
generated by GNU Make, with some explanation, has been added to the
|
||||
GNU Make User's Manual.
|
||||
|
||||
* Updates to the GNU make Customs library support (see README.customs).
|
||||
* Updates to the GNU Make Customs library support (see README.customs).
|
||||
|
||||
* Updates to the Windows 95/NT port from Rob Tulloh (see README.W32),
|
||||
and to the DOS port from Eli Zaretski (see README.DOS).
|
||||
@@ -920,7 +1164,7 @@ Version 3.77 (28 Jul 1998)
|
||||
This port was done by Klaus Kämpf <kkaempf@rmi.de>
|
||||
|
||||
* 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.
|
||||
|
||||
* /bin/sh style I/O redirection is supported. You can now write lines like
|
||||
@@ -958,7 +1202,7 @@ Version 3.76.1 (19 Sep 1997)
|
||||
|
||||
Version 3.76 (16 Sep 1997)
|
||||
|
||||
* GNU make now uses automake to control Makefile.in generation. This
|
||||
* GNU Make now uses automake to control Makefile.in generation. This
|
||||
should make it more consistent with the GNU standards.
|
||||
|
||||
* VPATH functionality has been changed to incorporate the VPATH+ patch,
|
||||
@@ -973,7 +1217,7 @@ Version 3.76 (16 Sep 1997)
|
||||
list of words from number S to number E (inclusive) of TEXT.
|
||||
|
||||
* Instead of an error, detection of future modification times gives a
|
||||
warning and continues. The warning is repeated just before GNU make
|
||||
warning and continues. The warning is repeated just before GNU Make
|
||||
exits, so it is less likely to be lost.
|
||||
|
||||
* Fix the $(basename) and $(suffix) functions so they only operate on
|
||||
@@ -1128,9 +1372,9 @@ Version 3.71 (21 May 1994)
|
||||
There is no longer a separate distribution containing Info and DVI files.
|
||||
|
||||
* You can now set the variables `binprefix' and/or `manprefix' in
|
||||
Makefile.in (or on the command line when installing) to install GNU make
|
||||
Makefile.in (or on the command line when installing) to install GNU Make
|
||||
under a name other than `make' (i.e., ``make binprefix=g install''
|
||||
installs GNU make as `gmake').
|
||||
installs GNU Make as `gmake').
|
||||
|
||||
* The built-in Texinfo rules use the new variables `TEXI2DVI_FLAGS' for
|
||||
flags to the `texi2dvi' script, and `MAKEINFO_FLAGS' for flags to the
|
||||
@@ -1610,7 +1854,7 @@ Version 3.05
|
||||
(Changes from versions 1 through 3.05 were never recorded. Sorry.)
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 1988-2020 Free Software Foundation, Inc.
|
||||
Copyright (C) 1988-2023 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
|
||||
@@ -1623,4 +1867,4 @@ 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 <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
|
||||
Uploader: Aaron "Optimizer" Digulla (digulla@fh-konstanz.de)
|
||||
Type: dev/c
|
||||
|
||||
This is a pure Amiga port of GNU make. It needs no extra libraries or
|
||||
This is a pure Amiga port of GNU Make. It needs no extra libraries or
|
||||
anything. It has the following features (in addition to any features of
|
||||
GNU make):
|
||||
GNU Make):
|
||||
|
||||
- Runs Amiga-Commands with SystemTags() (Execute)
|
||||
- Can run multi-line statements
|
||||
@@ -44,9 +44,9 @@ COMPILING FROM SCRATCH
|
||||
|
||||
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
|
||||
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
|
||||
|
||||
@@ -64,7 +64,7 @@ If you plan to use recursive makes, install make resident:
|
||||
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 1995-2020 Free Software Foundation, Inc.
|
||||
Copyright (C) 1995-2023 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
|
||||
@@ -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.
|
||||
|
||||
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.
|
||||
|
||||
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
|
||||
these capabilities, contact bug-make@gnu.org.
|
||||
|
||||
@@ -280,7 +280,7 @@ Bug reports:
|
||||
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 1996-2020 Free Software Foundation, Inc.
|
||||
Copyright (C) 1996-2023 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
|
||||
@@ -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.
|
||||
|
||||
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
|
||||
- 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
|
||||
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:
|
||||
|
||||
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.
|
||||
|
||||
- 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.
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ A standard Unix like build environment:
|
||||
release 2)
|
||||
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
|
||||
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
|
||||
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
|
||||
@@ -59,7 +59,7 @@ A standard Unix like build environment:
|
||||
- gawk
|
||||
- grep
|
||||
- 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
|
||||
- GNU texinfo (you can use 3.1 (gnuinfo.zip), but I recommend 4.0)
|
||||
|
||||
@@ -73,7 +73,7 @@ III. ***** COMPILATION AND INSTALLATION *****
|
||||
To recreate the configuration files use:
|
||||
|
||||
export EMXSHELL=ksh
|
||||
aclocal -I config
|
||||
aclocal -I m4
|
||||
automake
|
||||
autoconf
|
||||
autoheader
|
||||
@@ -93,7 +93,7 @@ Recommended environment variables and installation options:
|
||||
export CFLAGS="-O2 -Zomf -Zmt"
|
||||
export LDFLAGS="-Zcrtdll -Zlinker /exepack:2 -Zlinker /pm:vio -Zstack 0x6000"
|
||||
export RANLIB="echo"
|
||||
./configure --prefix=x:/usr --infodir=x:/usr/share/info --mandir=x:/usr/share/man --without-included-gettext
|
||||
./configure --prefix=x:/usr --infodir=x:/usr/share/info --mandir=x:/usr/share/man
|
||||
make AR=emxomfar
|
||||
make install
|
||||
|
||||
@@ -102,18 +102,21 @@ Note: If you use gcc 2.9.x I recommend to set also LIBS="-lgcc"
|
||||
Note: You can add -DNO_CMD_DEFAULT and -DNO_CHDIR2 to CPPFLAGS.
|
||||
See section I. for details.
|
||||
|
||||
Note: If you use Open Watcom Linker instead of IBM Linker, remove
|
||||
'-Zlinker /exepack:2' from LDFLAGS.
|
||||
|
||||
|
||||
IV. ***** NLS support *****
|
||||
|
||||
GNU make has NLS (National Language Support), with the following
|
||||
GNU Make has NLS (National Language Support), with the following
|
||||
caveats:
|
||||
|
||||
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
|
||||
GNU make you must install GNU gettext on your system before configuring
|
||||
GNU make.
|
||||
GNU Make you must install GNU gettext on your system before configuring
|
||||
GNU Make.
|
||||
|
||||
You can choose the languages to be installed. To install support for
|
||||
English, German and French only enter:
|
||||
@@ -138,7 +141,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"
|
||||
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
|
||||
_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
|
||||
'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
|
||||
@@ -160,7 +163,7 @@ from the make source tree.
|
||||
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2003-2020 Free Software Foundation, Inc.
|
||||
Copyright (C) 2003-2023 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
|
||||
@@ -173,4 +176,4 @@ 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 <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-*-
|
||||
---------
|
||||
|
||||
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)
|
||||
|
||||
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.
|
||||
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
|
||||
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.
|
||||
|
||||
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:
|
||||
-------------------
|
||||
@@ -62,15 +62,15 @@ Recipe differences:
|
||||
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
|
||||
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
|
||||
quotes inside of them are doubled. No environment variable expansion
|
||||
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.
|
||||
* 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
|
||||
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
|
||||
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
|
||||
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.
|
||||
|
||||
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
|
||||
usually have to use OpenVMS format paths for rules and targets.
|
||||
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.
|
||||
|
||||
The variables $^ and $@ separate files with commas instead of spaces.
|
||||
@@ -207,15 +207,15 @@ foo: $(addsuffix .3,$(subs $(comma),$(space),$^)
|
||||
override OpenVMS symbols/logicals.
|
||||
|
||||
OpenVMS logical and symbols names show up as "environment" using the
|
||||
origin function. when the "-e" option is specified, the origion function
|
||||
shows them as "environment override". On Posix the test scripts indicate
|
||||
origin function. when the "-e" option is specified, the origin function
|
||||
shows them as "environment override". On POSIX the test scripts indicate
|
||||
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
|
||||
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
|
||||
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.
|
||||
|
||||
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.
|
||||
|
||||
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
|
||||
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.
|
||||
TODO: Add an option have simulate Posix exit commands in recipes.
|
||||
success. Make will interpret any POSIX code other than 0 as a failure.
|
||||
TODO: Add an option have simulate POSIX exit commands in recipes.
|
||||
|
||||
Lexical functions can be used in pipes to simulate shell file test rules.
|
||||
|
||||
Example:
|
||||
|
||||
Posix:
|
||||
POSIX:
|
||||
b : c ; [ -f $@ ] || echo >> $@
|
||||
|
||||
OpenVMS:
|
||||
@@ -261,16 +261,16 @@ x = %x1035a00a
|
||||
|
||||
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
|
||||
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.
|
||||
|
||||
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.
|
||||
|
||||
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
|
||||
caused the recipe to fail.
|
||||
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.
|
||||
|
||||
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
|
||||
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.
|
||||
|
||||
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
|
||||
of files. On VMS, only the files are writen out, one per line.
|
||||
When make deletes files, on POSIX platforms it writes out 'rm' and the list
|
||||
of files. On VMS, only the files are written out, one per line.
|
||||
TODO: VMS
|
||||
|
||||
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).
|
||||
|
||||
|
||||
Unix compatibilty features:
|
||||
---------------------------
|
||||
Unix compatibility features:
|
||||
----------------------------
|
||||
|
||||
If the command 'echo' is seen, any single quotes on the line will be
|
||||
converted to double quotes.
|
||||
|
||||
The variable $(CD) is implemented as a built in Change Directory
|
||||
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.
|
||||
|
||||
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:
|
||||
"<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
|
||||
|
||||
A note on appending the redirected output. A simple mechanism is
|
||||
implemented to make ">>" work in action lines. In OpenVMS there is no simple
|
||||
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.
|
||||
|
||||
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
|
||||
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
|
||||
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.
|
||||
|
||||
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 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.
|
||||
|
||||
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?
|
||||
|
||||
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
|
||||
long, Ctrl+Y should be used instead.
|
||||
long, CTRL+Y should be used instead.
|
||||
|
||||
|
||||
Build Options:
|
||||
@@ -409,7 +409,7 @@ Unimplemented functionality:
|
||||
The new feature "Loadable objects" is not yet supported. If you need it,
|
||||
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.
|
||||
|
||||
|
||||
@@ -421,8 +421,8 @@ Self test failures and todos:
|
||||
Need to find a way to set the VMS features before running make as a
|
||||
child.
|
||||
|
||||
GNU make was not currently translating the OpenVMS encoded POSIX values
|
||||
returned to it back to the Posix values. I have temporarily modified the
|
||||
GNU Make was not currently translating the OpenVMS encoded POSIX values
|
||||
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
|
||||
internally to Make.
|
||||
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
|
||||
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?
|
||||
|
||||
The internal vmsify and unixify OpenVMS to/from UNIX are not handling logical
|
||||
@@ -443,7 +443,7 @@ Self test failures and todos:
|
||||
|
||||
|
||||
Build instructions:
|
||||
------------------
|
||||
-------------------
|
||||
|
||||
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.
|
||||
@@ -478,7 +478,7 @@ Running the tests:
|
||||
https://sourceforge.net/projects/gnv/files/
|
||||
|
||||
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.
|
||||
|
||||
To get detailed information for running the tests:
|
||||
@@ -499,12 +499,12 @@ Running the tests:
|
||||
$ perl run_make_tests.pl
|
||||
|
||||
|
||||
Acknowlegements:
|
||||
Acknowledgments:
|
||||
----------------
|
||||
|
||||
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
|
||||
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
|
||||
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
|
||||
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
|
||||
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
|
||||
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 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:
|
||||
---------------------------------------------------------
|
||||
|
||||
1. Edit config.h.W32 to your liking (especially the few shell-related
|
||||
defines near the end, or HAVE_CASE_INSENSITIVE_FS which corresponds
|
||||
to './configure --enable-case-insensitive-file-system'). (We 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
|
||||
case, while Makefile rules are written for lower-case versions.)
|
||||
1. If you have special requirements, edit config.h.W32 to your liking
|
||||
(especially the shell-related defines, or HAVE_CASE_INSENSITIVE_FS which
|
||||
corresponds to './configure --enable-case-insensitive-file-system'). We
|
||||
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 case,
|
||||
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
|
||||
@@ -51,7 +53,7 @@ Building with (MinGW-)GCC using build_w32.bat
|
||||
|
||||
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.
|
||||
|
||||
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
|
||||
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.
|
||||
|
||||
The batch file will probe for Guile installation, and will build
|
||||
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.
|
||||
|
||||
|
||||
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
|
||||
(MinGW-)GCC, setup a correct PATH and other environment variables
|
||||
for it, then execute ...
|
||||
@@ -95,7 +97,7 @@ Building with (MinGW-)GCC using GNU make
|
||||
make -f Basic.mk TOOLCHAIN=gcc
|
||||
|
||||
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:
|
||||
|
||||
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.
|
||||
|
||||
|
||||
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
|
||||
(MSVC++-)cl, setup a correct PATH and other environment variables
|
||||
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
|
||||
|
||||
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:
|
||||
|
||||
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
|
||||
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
|
||||
|
||||
@@ -156,7 +158,7 @@ Running the test suite
|
||||
-- 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
|
||||
(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
|
||||
versions of the Microsoft C compiler.
|
||||
|
||||
Do not confuse this port of GNU make with other Windows32 projects
|
||||
which provide a GNU make binary. These are separate projects
|
||||
Do not confuse this port of GNU Make with other Windows32 projects
|
||||
which provide a GNU Make binary. These are separate projects
|
||||
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
|
||||
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 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
|
||||
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
|
||||
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
|
||||
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,
|
||||
define the HAVE_CYGWIN_SHELL in config.h and rebuild make
|
||||
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.
|
||||
|
||||
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
|
||||
support on, define HAVE_MKS_SHELL in the config.h.W32 before you
|
||||
build make. Do not define BATCH_MODE_ONLY_SHELL if you turn
|
||||
on HAVE_MKS_SHELL.
|
||||
|
||||
GNU make handling of drive letters in pathnames (PATH, vpath, VPATH):
|
||||
GNU Make handling of drive letters in pathnames (PATH, vpath, VPATH):
|
||||
|
||||
There is a caveat that should be noted with respect to handling
|
||||
single character pathnames on Windows systems. When colon is
|
||||
@@ -291,7 +293,7 @@ Pathnames and Case insensitivity:
|
||||
the file with other case permutations will succeed (i.e. opening a
|
||||
file named "target" or "TARGET" will open the file "Target").
|
||||
|
||||
By default, GNU make retains its case sensitivity when comparing
|
||||
By default, GNU Make retains its case sensitivity when comparing
|
||||
target names and existing files or directories. It can be
|
||||
configured, however, into a case preserving and case insensitive
|
||||
mode by adding a define for HAVE_CASE_INSENSITIVE_FS to
|
||||
@@ -309,10 +311,10 @@ Pathnames and Case insensitivity:
|
||||
SUBDIR/DepTarget: SubDir/TARGET
|
||||
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
|
||||
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.
|
||||
|
||||
SAMBA/NTFS/VFAT:
|
||||
@@ -342,10 +344,10 @@ FAT:
|
||||
Bug reports:
|
||||
|
||||
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-2020 Free Software Foundation, Inc.
|
||||
Copyright (C) 1996-2023 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
|
||||
@@ -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.
|
||||
|
||||
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-*-
|
||||
|
||||
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.
|
||||
|
||||
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.
|
||||
|
||||
Note that the 2.1.33 Pmake distribution comes with a set of patches to
|
||||
GNU make, distributed in the pmake-2.1.33/etc/gnumake/ directory. These
|
||||
patches are based on GNU make 3.75 (there are patches for earlier
|
||||
versions of GNU make, also). The parts of this patchfile which relate
|
||||
GNU Make, distributed in the pmake-2.1.33/etc/gnumake/ directory. These
|
||||
patches are based on GNU Make 3.75 (there are patches for earlier
|
||||
versions of GNU Make, also). The parts of this patchfile which relate
|
||||
directly to Customs support have already been incorporated into this
|
||||
version of GNU make, so you should _NOT_ apply the patch file.
|
||||
version of GNU Make, so you should _NOT_ apply the patch file.
|
||||
|
||||
However, there are a few non-Customs specific (as far as I could tell)
|
||||
changes here which are not incorporated (for example, the modification
|
||||
@@ -42,14 +42,14 @@ install' there directly).
|
||||
BUILDING GNU MAKE
|
||||
-----------------
|
||||
|
||||
Once you've installed Customs, you can build GNU make to use it. When
|
||||
configuring GNU make, merely use the '--with-customs=DIR' option.
|
||||
Once you've installed Customs, you can build GNU Make to use it. When
|
||||
configuring GNU Make, merely use the '--with-customs=DIR' option.
|
||||
Provide the directory containing the 'lib' and 'include/customs'
|
||||
subdirectories as DIR. For example, if you installed the customs
|
||||
library in /usr/local/lib and the headers in /usr/local/include/customs,
|
||||
then you'd pass '--with-customs=/usr/local' as an option to configure.
|
||||
|
||||
Run make (or use build.sh) normally to build GNU make as described in
|
||||
Run make (or use build.sh) normally to build GNU Make as described in
|
||||
the INSTALL file.
|
||||
|
||||
See the documentation for Customs for information on starting and
|
||||
@@ -83,7 +83,7 @@ PROBLEMS
|
||||
|
||||
SunOS 4.1.x:
|
||||
The customs/sprite.h header file #includes the <malloc.h> header
|
||||
files; this conflicts with GNU make's configuration so you'll get a
|
||||
files; this conflicts with GNU Make's configuration so you'll get a
|
||||
compile error if you use GCC (or any other ANSI-capable C compiler).
|
||||
|
||||
I commented out the #include in sprite.h:107:
|
||||
@@ -96,7 +96,7 @@ SunOS 4.1.x:
|
||||
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 1998-2020 Free Software Foundation, Inc.
|
||||
Copyright (C) 1998-2023 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
|
||||
@@ -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.
|
||||
|
||||
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/>.
|
||||
|
||||
310
README.git
310
README.git
@@ -1,7 +1,7 @@
|
||||
-*-text-*-
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2002-2020 Free Software Foundation, Inc.
|
||||
Copyright (C) 2002-2023 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
|
||||
@@ -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.
|
||||
|
||||
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
|
||||
@@ -23,7 +23,7 @@ Obtaining Git Code
|
||||
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
|
||||
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
|
||||
|
||||
@@ -31,10 +31,13 @@ make source code via Git from the FSF's Savannah project
|
||||
Changes using Git
|
||||
-----------------
|
||||
|
||||
For non-developers, you can continue to provide patches as before, or if you
|
||||
make a public repository I can pull from that if you prefer.
|
||||
If you do not have push privileges to the GNU Make Git repository, see the
|
||||
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
|
||||
convert the Git comments into ChangeLog-style entries for release. As a
|
||||
result, please format your Git comments carefully so they will look clean
|
||||
@@ -43,65 +46,72 @@ 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
|
||||
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:
|
||||
|
||||
* Edit files
|
||||
* Edit files / make / make check
|
||||
* Use "git status" and "git diff" to verify your changes
|
||||
* 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 pull" to accept & merge new changes from the Savannah repository
|
||||
* Use "git push" to push your commits back to 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 upstream repository
|
||||
|
||||
For Emacs users, there are many options for Git integration but I strongly
|
||||
recommend the Magit package: http://www.emacswiki.org/emacs/Magit
|
||||
It makes the workflow much clearer, and has advanced features such as
|
||||
constructing multiple commits from various files and even from different
|
||||
diff chunks in the same file. There is a video available which helps a lot.
|
||||
recommend Magit: https://magit.vc/ It makes the workflow much clearer, and
|
||||
has advanced features such as constructing multiple commits from various files
|
||||
and even from different diff chunks in the same file. There is a video
|
||||
available which helps a lot.
|
||||
|
||||
|
||||
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.
|
||||
|
||||
Additionally, GNU make is a foundational bootstrap package for the GNU
|
||||
project; as such it is very conservative about language features it expects.
|
||||
It should build with any C compiler conforming to the ANSI C89 / ISO C90
|
||||
standard.
|
||||
Additionally, GNU Make is a foundational bootstrap package for the GNU
|
||||
project; as such it is conservative about language features it expects.
|
||||
However, GNU Make does rely on the Gnulib portability library, and Gnulib
|
||||
currently requires a ISO C99 compiler. So features in ISO C99 can be
|
||||
assumed.
|
||||
|
||||
|
||||
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:
|
||||
|
||||
* autoconf
|
||||
* autoconf >= 2.69
|
||||
* automake >= 1.16.1
|
||||
* gettext
|
||||
* autopoint
|
||||
* pkg-config
|
||||
* texinfo (for makeinfo)
|
||||
* GCC (Clang's GCC emulation is not sufficient)
|
||||
* GNU make (POSIX make is not sufficient)
|
||||
* gettext
|
||||
* pkg-config
|
||||
* GCC
|
||||
* GNU Make (POSIX make is not sufficient)
|
||||
|
||||
And any tools that those utilities require (GNU m4, etc.)
|
||||
|
||||
To run the tests you must install Perl.
|
||||
|
||||
To build a release you'll need to install lzip.
|
||||
To create dist files you will additionally need:
|
||||
|
||||
GNU make requires gnulib to provide some facilities. If you want to maintain
|
||||
* lzip (to create tar.lz dist files)
|
||||
* texlive (or some other TeX package)
|
||||
|
||||
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.
|
||||
Otherwise, ./bootstrap will obtain a clone for you.
|
||||
|
||||
Unfortunately due to issues with gnulib's getloadavg, you must have automake
|
||||
1.16.1 or above. This version may not yet be available through GNU/Linux
|
||||
package managers. If you need to install from source be sure to set
|
||||
ACLOCAL_PATH to point to the pkg-config location (e.g., /usr/share/aclocal).
|
||||
Due to issues with gnulib's getloadavg, you must have automake 1.16.1 or
|
||||
above. This version may not yet be available through GNU/Linux package
|
||||
managers. If you need to install from source be sure to set ACLOCAL_PATH to
|
||||
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
|
||||
your make command line (or at least remove any flags your compiler does not
|
||||
@@ -116,6 +126,16 @@ After checking out the code, you will need to run the bootstrap script:
|
||||
|
||||
$ ./bootstrap
|
||||
|
||||
Alternatively you can just pull content from remote locations with:
|
||||
|
||||
$ ./bootstrap --pull
|
||||
|
||||
And/or just re-generate auto-generatable files with:
|
||||
|
||||
$ ./bootstrap --gen
|
||||
|
||||
(Running ./bootstrap does both in one step.)
|
||||
|
||||
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
|
||||
more-or-less like the official package you would get from ftp.gnu.org.
|
||||
@@ -124,9 +144,9 @@ That is, you can just run:
|
||||
$ ./configure
|
||||
$ 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
|
||||
sanity checks enabled. Further this mode assumes a modern GCC, GNU
|
||||
libc, and well-formed system headers and enables a high level of
|
||||
@@ -146,24 +166,60 @@ NOTE! This method builds GNU make in "maintainer mode". Make programs built
|
||||
Building From Git for Windows
|
||||
-----------------------------
|
||||
|
||||
If you have a UNIX emulation like CYGWIN you can opt to run the general
|
||||
build procedure above; it will work. Consult README.W32.template for
|
||||
information on options you might want to use when running ./configure.
|
||||
If you have a UNIX emulation like CYGWIN you can opt to run the general build
|
||||
procedure above; it will work. Consult README.W32 for information on options
|
||||
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
|
||||
script to prime your Git workspace:
|
||||
script to "prime" your Git workspace:
|
||||
|
||||
> .\bootstrap.bat
|
||||
|
||||
Next, rename the file README.W32.template to README.W32 and follow those
|
||||
instructions.
|
||||
Next, follow the instructions in the README.W32 file.
|
||||
|
||||
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
|
||||
------------------
|
||||
|
||||
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:
|
||||
|
||||
$ make dist-gzip
|
||||
@@ -200,33 +256,117 @@ consistent (that's why we don't finalize the Git tag, etc. until the end).
|
||||
"Fixed Release" ID number.
|
||||
* Run "make distcheck" to be sure it all works.
|
||||
* 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
|
||||
* Push everything:
|
||||
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
|
||||
./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
|
||||
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
|
||||
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
|
||||
- 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: 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:
|
||||
|
||||
@@ -235,71 +375,11 @@ Start the next release:
|
||||
* 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
|
||||
--------------------------
|
||||
|
||||
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
|
||||
prerequisites are available of course).
|
||||
|
||||
@@ -310,6 +390,6 @@ For a debugging version:
|
||||
|
||||
./bootstrap && ./configure CFLAGS=-g && make check
|
||||
|
||||
For a release version
|
||||
For an optimized version
|
||||
|
||||
./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.
|
||||
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
|
||||
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.
|
||||
|
||||
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
|
||||
use the shell script 'build.sh' instead. To do this, first run 'configure' as
|
||||
described in INSTALL. Then, instead of typing 'make' to build the program,
|
||||
type 'sh build.sh'. This should compile the program in the current directory.
|
||||
Then you will have a Make program that you can use for './make install', or
|
||||
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
|
||||
whatever else.
|
||||
|
||||
Some systems' Make programs cannot process the Makefile for GNU Make. If you
|
||||
get errors from your system's Make when building GNU Make, try using
|
||||
Some systems' 'make' programs cannot process the Makefile for GNU Make.
|
||||
If you get errors from your system's 'make' when building GNU Make, try using
|
||||
'build.sh' instead.
|
||||
|
||||
|
||||
@@ -34,20 +34,20 @@ Downloading
|
||||
|
||||
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
|
||||
-------------
|
||||
|
||||
GNU make is fully documented in the GNU Make manual, which is contained
|
||||
in this distribution as the file make.texinfo. You can also find
|
||||
on-line and preformatted (PostScript and DVI) versions at the FSF's web
|
||||
site. There is information there about ordering hardcopy documentation.
|
||||
GNU Make is fully documented in the GNU Make manual, which is contained in
|
||||
this distribution as the file make.texi. You can also find on-line and
|
||||
preformatted (PostScript and DVI) versions at the FSF's web site. There is
|
||||
information there about ordering hardcopy documentation.
|
||||
|
||||
http://www.gnu.org/
|
||||
http://www.gnu.org/doc/doc.html
|
||||
http://www.gnu.org/manual/manual.html
|
||||
https://www.gnu.org/
|
||||
https://www.gnu.org/doc/doc.html
|
||||
https://www.gnu.org/manual/manual.html
|
||||
|
||||
|
||||
Development
|
||||
@@ -56,49 +56,82 @@ Development
|
||||
GNU Make development is hosted by Savannah, the FSF's online development
|
||||
management tool. Savannah is here:
|
||||
|
||||
http://savannah.gnu.org
|
||||
https://savannah.gnu.org
|
||||
|
||||
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
|
||||
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
|
||||
-------------
|
||||
|
||||
You can send GNU make 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.
|
||||
If you need help using GNU Make, try asking on <help-make@gnu.org>.
|
||||
|
||||
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
|
||||
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
|
||||
news:gnu.utils.help
|
||||
news:gnu.utils.bug
|
||||
|
||||
Submitting Patches
|
||||
------------------
|
||||
|
||||
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
|
||||
----------
|
||||
|
||||
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:
|
||||
|
||||
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
|
||||
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
|
||||
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.
|
||||
@@ -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.
|
||||
|
||||
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
|
||||
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
|
||||
to check the system's current load average. To make it easier to test and
|
||||
debug this code, you can do 'make check-loadavg' to see if it works
|
||||
properly on your system. (You must run 'configure' beforehand, but you
|
||||
need not build Make itself to run this test.)
|
||||
need not build 'make' itself to run this test.)
|
||||
|
||||
Another potential source of porting problems is the support for large
|
||||
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.
|
||||
|
||||
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,
|
||||
note that many current implementations of tools that *set* timestamps do
|
||||
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
|
||||
-----
|
||||
|
||||
- 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.
|
||||
|
||||
- See README.VMS for details about GNU Make on OpenVMS.
|
||||
@@ -157,22 +190,22 @@ Ports
|
||||
using DJGPP tools.
|
||||
|
||||
A precompiled binary of the MSDOS port of GNU Make is available as part
|
||||
of DJGPP; see the WWW page http://www.delorie.com/djgpp/ for more
|
||||
of DJGPP; see the WWW page https://www.delorie.com/djgpp/ for more
|
||||
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
|
||||
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.
|
||||
|
||||
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,
|
||||
and a DOS-based tool built with DJGPP. Please be sure you are looking
|
||||
at the right README!
|
||||
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 1988-2020 Free Software Foundation, Inc.
|
||||
Copyright (C) 1988-2023 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
|
||||
@@ -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.
|
||||
|
||||
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/>.
|
||||
83
README.zOS
Normal file
83
README.zOS
Normal file
@@ -0,0 +1,83 @@
|
||||
-*-text-*-
|
||||
GNU Make has been ported to z/OS, tested on z/OS V2R4.
|
||||
|
||||
|
||||
PREREQUISITES
|
||||
-------------
|
||||
Building GNU Make requires certain tools be installed on your z/OS system.
|
||||
These tools can be downloaded from: https://github.com/ZOSOpenTools
|
||||
For detailed instructions on how to set up these tools, visit
|
||||
https://zosopentools.github.io/meta/#/Guides/Pre-req
|
||||
|
||||
You will need curl, tar, and gzip to download and unpack the GNU Make release
|
||||
package, but presumably you've already worked this out if you're reading this
|
||||
document!
|
||||
|
||||
You will need the IBM C/C++ compiler. You can download a web deliverable
|
||||
add-on feature to your XL C/C++ compiler here:
|
||||
https://www-40.ibm.com/servers/resourcelink/svc00100.nsf/pages/xlCC++V241ForZOsV24
|
||||
|
||||
Alternatively, you can install and manage C/C++ for Open Enterprise Languages
|
||||
on z/OS using RedHat OpenShift Container Platform and IBM Z and Cloud
|
||||
Modernization Stack.
|
||||
|
||||
GNU Make has a dependency on the ZOSLIB library, which is documented here:
|
||||
https://zosopentools.github.io/meta/#/Guides/Zoslib.
|
||||
|
||||
To obtain the latest release of zoslib, you can download it from here:
|
||||
https://github.com/ZOSOpenTools/zoslibport/releases.
|
||||
|
||||
|
||||
BUILDING
|
||||
--------
|
||||
If you are trying to build from a checked-out Git workspace, see README.git.
|
||||
|
||||
Before building GNU Make, you will need to ensure that the following
|
||||
environment variables are set, to turn on z/OS enhanced ASCII support:
|
||||
|
||||
export _BPXK_AUTOCVT=ON
|
||||
export _CEE_RUNOPTS="$_CEE_RUNOPTS FILETAG(AUTOCVT,AUTOTAG) POSIX(ON)"
|
||||
export _TAG_REDIR_ERR=txt
|
||||
export _TAG_REDIR_IN=txt
|
||||
export _TAG_REDIR_OUT=txt
|
||||
|
||||
To ensure proper functioning of xlclang, set the following environment
|
||||
variables before building:
|
||||
|
||||
export _CC_CCMODE=1
|
||||
export _C89_CCMODE=1
|
||||
export _CXX_CCMODE=1
|
||||
|
||||
Set PATH_TO_ZOSLIB to the location of your zoslib installation; e.g.:
|
||||
|
||||
PATH_TO_ZOSLIB=$HOME/zopen/prod/zoslib
|
||||
|
||||
Invoke ./configure as follows:
|
||||
|
||||
./configure \
|
||||
CC=xlclang \
|
||||
CPPFLAGS="-DNSIG=42 -D_XOPEN_SOURCE=600 -D_ALL_SOURCE -D_OPEN_SYS_FILE_EXT=1 -D_AE_BIMODAL=1 -D_ENHANCED_ASCII_EXT=0xFFFFFFF -DZOSLIB_OVERRIDE_CLIB=1" \
|
||||
CFLAGS="-qascii -std=gnu11 -qnocsect -qenum=int -I$PATH_TO_ZOSLIB/include" \
|
||||
LDFLAGS="-L$PATH_TO_ZOSLIB/lib" \
|
||||
LIBS="-lzoslib $PATH_TO_ZOSLIB/lib/CXXRT64.x"
|
||||
|
||||
If you have an instance of make already available you can build with:
|
||||
|
||||
make
|
||||
|
||||
If not, you can build with:
|
||||
|
||||
./build.sh
|
||||
|
||||
|
||||
TESTING
|
||||
-------
|
||||
To run the regression tests you'll need to install Perl and enable it.
|
||||
Then you can run:
|
||||
|
||||
./make check
|
||||
|
||||
|
||||
INSTALLING
|
||||
----------
|
||||
Copy the "make" program to wherever you want it to be installed, on your PATH.
|
||||
@@ -101,7 +101,7 @@ The Rest of the List
|
||||
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 1997-2020 Free Software Foundation, Inc.
|
||||
Copyright (C) 1997-2023 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
|
||||
@@ -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.
|
||||
|
||||
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/>.
|
||||
|
||||
39
autogen.sh
Executable file
39
autogen.sh
Executable file
@@ -0,0 +1,39 @@
|
||||
#!/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-2023 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.
|
||||
|
||||
me="$0"
|
||||
medir=`dirname "$me"`
|
||||
|
||||
# Read the function library and the configuration.
|
||||
. "$medir"/bootstrap-funclib.sh
|
||||
|
||||
autogen "$@"
|
||||
37
autopull.sh
Executable file
37
autopull.sh
Executable file
@@ -0,0 +1,37 @@
|
||||
#!/bin/sh
|
||||
# Convenience script for fetching auxiliary files that are omitted from
|
||||
# the version control repository of this package.
|
||||
|
||||
# Copyright (C) 2003-2023 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.
|
||||
|
||||
me="$0"
|
||||
medir=`dirname "$me"`
|
||||
|
||||
# Read the function library and the configuration.
|
||||
. "$medir"/bootstrap-funclib.sh
|
||||
|
||||
autopull "$@"
|
||||
1285
bootstrap-funclib.sh
Normal file
1285
bootstrap-funclib.sh
Normal file
File diff suppressed because it is too large
Load Diff
@@ -1,5 +1,5 @@
|
||||
@echo off
|
||||
:: Copyright (C) 2018-2020 Free Software Foundation, Inc.
|
||||
:: Copyright (C) 2018-2023 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
|
||||
@@ -13,22 +13,104 @@
|
||||
:: more details.
|
||||
::
|
||||
:: 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
|
||||
set "svurl=https://git.savannah.gnu.org/cgit"
|
||||
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 intprops.h
|
||||
goto :Done
|
||||
call :Download lib intprops-internal.h
|
||||
|
||||
echo -- Configuring the workspace
|
||||
copy /Y gl\lib\*.* lib > nul
|
||||
|
||||
:: In general it's tricky to use special characters as arguments to a program
|
||||
:: in Windows batch files; the quoting rules are obscure and have changed over
|
||||
:: time which means older systems may behave differently. However, Windows
|
||||
:: echo is a dumb program that just writes out its command line without much
|
||||
:: interpreting: all we have to be careful of is ^ quoting. So, use echo
|
||||
:: to create script files to use with sed -f rather than using sed -e.
|
||||
|
||||
:: 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
|
||||
echo s/^^AC_INIT^(\[GNU.Make\],\[\^([0-9.]*\^)\].*/s,@PACKAGE_VERSION@,\1,g/p > cac.sed
|
||||
sed -n -f cac.sed configure.ac >> convert.sed
|
||||
if ERRORLEVEL 1 goto Failed
|
||||
:: Get the list of sources from Makefile.am
|
||||
echo s,\\\n,,g > mam.sed
|
||||
echo s,[ \t][ \t]*, ,g >> mam.sed
|
||||
echo s, [^^ ]*\.h,,g >> mam.sed
|
||||
echo s,src/,$^(src^),g >> mam.sed
|
||||
echo s,lib/,$^(lib^),g >> mam.sed
|
||||
echo s/^^\^([A-Za-z0-9]*\^)_SRCS *= *\^(.*\^)/s,%%\1_SOURCES%%,\2,/p > mam2.sed
|
||||
sed -z -f mam.sed Makefile.am | sed -n -f mam2.sed >> 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
|
||||
echo s/;.*// > gmk.sed
|
||||
echo /^^[ \t]*$/d >> gmk.sed
|
||||
echo s/"/\\"/g >> gmk.sed
|
||||
echo s/$/ \\/ >> gmk.sed
|
||||
sed -f gmk.sed src\gmk-default.scm >> src\gmk-default.h
|
||||
if ERRORLEVEL 1 goto Failed
|
||||
echo ^";>> src\gmk-default.h
|
||||
|
||||
:: These files would be created by bootstrap; they are not needed on Windows
|
||||
:: but our makefile depends on them
|
||||
echo >> lib\alloca.in.h
|
||||
|
||||
del /Q convert.sed cac.sed mam.sed mam2.sed gmk.sed
|
||||
|
||||
echo.
|
||||
echo Done. Run build_w32.bat to build GNU Make.
|
||||
goto :EOF
|
||||
|
||||
:Download
|
||||
echo Downloading %1\%2
|
||||
curl -sS -o %1\%2 "%gnuliburl%/%1/%2"
|
||||
if exist "%1\%2" goto :EOF
|
||||
echo - Downloading %1\%2
|
||||
curl -sS -o "%1\%2" "%gnuliburl%/%1/%2"
|
||||
if ERRORLEVEL 1 exit /b 1
|
||||
goto :EOF
|
||||
|
||||
:Done
|
||||
echo Done. Run build_w32.bat to build GNU make.
|
||||
goto :EOF
|
||||
:Failed
|
||||
echo *** Bootstrap failed.
|
||||
echo Resolve the issue, or use the configured source in the release tarball
|
||||
exit /b 1
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Bootstrap configuration. -*-shell-script-*-
|
||||
|
||||
# Copyright (C) 2018-2020 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2018-2023 Free Software Foundation, Inc.
|
||||
|
||||
# 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
|
||||
@@ -18,6 +18,12 @@
|
||||
# Allow bootstrap to know that this is not a package
|
||||
checkout_only_file=README.git
|
||||
|
||||
# Choose a specific version of gnulib, when checking out
|
||||
GNULIB_REVISION=stable-202301
|
||||
|
||||
# Always copy files rather than symlink
|
||||
copy=true
|
||||
|
||||
# Additional xgettext options to use. Use "\\\newline" to break lines.
|
||||
# Ensure that all our magical output macros are correctly marked as
|
||||
# C (printf) format strings.
|
||||
@@ -41,7 +47,12 @@ automake 1.16.1
|
||||
"
|
||||
|
||||
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="\
|
||||
alloca
|
||||
@@ -49,5 +60,6 @@ fdl
|
||||
findprog-in
|
||||
getloadavg
|
||||
host-cpu-c-abi
|
||||
strerror
|
||||
make-glob"
|
||||
largefile
|
||||
make-glob
|
||||
make-macros"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# Configuration for building GNU Make in the absence of any 'make' program.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1993-2020 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1993-2023 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
|
||||
@@ -15,7 +15,7 @@
|
||||
# details.
|
||||
#
|
||||
# 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.
|
||||
|
||||
|
||||
73
build.sh
73
build.sh
@@ -1,7 +1,7 @@
|
||||
#!/bin/sh
|
||||
# Shell script to build GNU Make in the absence of any 'make' program.
|
||||
|
||||
# Copyright (C) 1993-2020 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1993-2023 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
|
||||
@@ -15,11 +15,16 @@
|
||||
# details.
|
||||
#
|
||||
# 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
|
||||
. ./build.cfg
|
||||
|
||||
die () { echo "$*" 1>&2; exit 1; }
|
||||
usage () { echo "$0 [-k]"; exit $1; }
|
||||
|
||||
keep_going=false
|
||||
|
||||
: ${OUTDIR:=.}
|
||||
OUTLIB="$OUTDIR/lib"
|
||||
|
||||
@@ -37,33 +42,41 @@ defines="-DLOCALEDIR=\"$localedir\" -DLIBDIR=\"$libdir\" -DINCLUDEDIR=\"$include
|
||||
# Print the value to stdout.
|
||||
get_mk_var ()
|
||||
{
|
||||
file=$1
|
||||
var=$2
|
||||
|
||||
val=
|
||||
v=$(sed -e :a -e '/\\$/N; s/\\\n//; ta' "$file" | sed -n "s=^ *$var *\= *==p")
|
||||
v=$(sed -e :a -e '/\\$/N; s/\\\n//; ta' "$1" | sed -n "s=^ *$2 *\= *==p")
|
||||
for w in $v; do
|
||||
case $w in
|
||||
(\$[\(\{]*[\)\}]) w=${w#\$[\(\{]}; w=$(get_mk_var "$file" "${w%[\)\}]}") ;;
|
||||
(\$[\(\{]*[\)\}]) w=${w#\$[\(\{]}; (get_mk_var "$1" "${w%[\)\}]}") ;;
|
||||
(*) echo "$w" ;;
|
||||
esac
|
||||
val="${val:+$val }$w"
|
||||
done
|
||||
|
||||
printf '%s\n' "$val"
|
||||
}
|
||||
|
||||
# Compile source files. Object files are put into $objs.
|
||||
compile ()
|
||||
{
|
||||
success=true
|
||||
objs=
|
||||
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"
|
||||
case $file in
|
||||
(lib/libgnu_a-*.c) file="lib/${file#lib/libgnu_a-}" ;;
|
||||
esac
|
||||
echo "compiling $file..."
|
||||
of="$OUTDIR/$ofile"
|
||||
mkdir -p "${of%/*}"
|
||||
$CC $cflags $CPPFLAGS $CFLAGS -c -o "$of" "$top_srcdir/$file"
|
||||
mkdir -p "${of%/*}" || exit 1
|
||||
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"
|
||||
done
|
||||
|
||||
$success
|
||||
}
|
||||
|
||||
# Use config.status to convert a .in file. Output file is put into $out.
|
||||
@@ -75,10 +88,13 @@ convert ()
|
||||
var="GENERATE_$(echo $base | tr 'a-z./+' A-Z__X)"
|
||||
|
||||
# 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
|
||||
in="$top_srcdir/lib/$(echo ${base%.*}.in.${base##*.} | tr / _)"
|
||||
out="$OUTLIB/$base"
|
||||
mkdir -p "${out%/*}"
|
||||
|
||||
@@ -103,7 +119,7 @@ convert ()
|
||||
esac
|
||||
|
||||
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}_"
|
||||
int=${int}_
|
||||
@@ -122,28 +138,39 @@ done
|
||||
# Get object files from the Makefile
|
||||
OBJS=$(get_mk_var Makefile make_OBJECTS | sed "s=\$[\(\{]OBJEXT[\)\}]=$OBJEXT=g")
|
||||
|
||||
# Exit as soon as any command fails.
|
||||
set -e
|
||||
while test -n "$1"; do
|
||||
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
|
||||
set -e
|
||||
for b in $(get_mk_var lib/Makefile BUILT_SOURCES); do
|
||||
convert $b
|
||||
done
|
||||
set +e
|
||||
|
||||
# Build the gnulib library
|
||||
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..."
|
||||
$AR $ARFLAGS "$OUTLIB"/libgnu.a $objs
|
||||
$AR $ARFLAGS "$OUTLIB"/libgnu.a $objs || die "Archive of libgnu failed."
|
||||
|
||||
# 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"
|
||||
compile $OBJS
|
||||
compile $OBJS || die "Compilation failed."
|
||||
|
||||
# Link all the objects together.
|
||||
echo "linking make..."
|
||||
$CC $CFLAGS $LDFLAGS -L"$OUTLIB" $objs -lgnu $LOADLIBES -o "$OUTDIR/makenew$EXEEXT"
|
||||
mv -f "$OUTDIR/makenew$EXEEXT" "$OUTDIR/make$EXEEXT"
|
||||
$CC $CFLAGS $LDFLAGS -L"$OUTLIB" -o "$OUTDIR/makenew$EXEEXT" $objs -lgnu $LOADLIBES || die "Link failed."
|
||||
|
||||
mv -f "$OUTDIR/makenew$EXEEXT" "$OUTDIR/make$EXEEXT" || exit 1
|
||||
|
||||
echo done.
|
||||
|
||||
134
build_w32.bat
Executable file → Normal file
134
build_w32.bat
Executable file → Normal file
@@ -1,5 +1,5 @@
|
||||
@echo off
|
||||
:: Copyright (C) 1996-2020 Free Software Foundation, Inc.
|
||||
:: Copyright (C) 1996-2023 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
|
||||
@@ -13,7 +13,7 @@
|
||||
:: more details.
|
||||
::
|
||||
:: 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
|
||||
if not "%RECURSEME%"=="%~0" (
|
||||
@@ -37,6 +37,8 @@ set COMPILER=cl.exe
|
||||
set O=obj
|
||||
set ARCH=x64
|
||||
set DEBUG=N
|
||||
set DIRENT=Y
|
||||
set VERBOSE=N
|
||||
|
||||
if exist maintMakefile (
|
||||
set MAINT=Y
|
||||
@@ -45,13 +47,20 @@ if exist maintMakefile (
|
||||
)
|
||||
|
||||
:ParseSW
|
||||
if "%1" == "--verbose" goto SetVerbose
|
||||
if "%1" == "--debug" goto SetDebug
|
||||
if "%1" == "--without-guile" goto NoGuile
|
||||
if "%1" == "--x86" goto Set32Bit
|
||||
if "%1" == "gcc" goto SetCC
|
||||
if "%1" == "tcc" goto SetTCC
|
||||
if "%1" == "" goto DoneSW
|
||||
goto Usage
|
||||
|
||||
:SetVerbose
|
||||
set VERBOSE=Y
|
||||
shift
|
||||
goto ParseSW
|
||||
|
||||
:SetDebug
|
||||
set DEBUG=Y
|
||||
echo - Building without compiler optimizations
|
||||
@@ -77,20 +86,28 @@ echo - Building with GCC
|
||||
shift
|
||||
goto ParseSW
|
||||
|
||||
:SetTCC
|
||||
set COMPILER=tcc
|
||||
set O=o
|
||||
echo - Building with TinyC
|
||||
shift
|
||||
goto ParseSW
|
||||
|
||||
:DoneSW
|
||||
if "%MAINT%" == "Y" echo - Enabling maintainer mode
|
||||
|
||||
if "%COMPILER%" == "gcc" goto FindGcc
|
||||
if "%COMPILER%" == "tcc" goto FindTcc
|
||||
|
||||
:: 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
|
||||
|
||||
:: Visual Studio 17 and above provides the "vswhere" tool
|
||||
call :FindVswhere
|
||||
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 "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
|
||||
:: Unfortunately this also shows a "usage" note; I can't find anything better.
|
||||
echo.
|
||||
%COMPILER%
|
||||
call %COMPILER%
|
||||
goto Build
|
||||
|
||||
:FindGcc
|
||||
set OUTDIR=.\GccRel
|
||||
set LNKOUT=./GccRel
|
||||
set OPTS=-O2
|
||||
set DIRENT=N
|
||||
if "%DEBUG%" == "Y" set OPTS=-O0
|
||||
if "%DEBUG%" == "Y" set OUTDIR=.\GccDebug
|
||||
if "%DEBUG%" == "Y" set LNKOUT=./GccDebug
|
||||
if "%MAINT%" == "Y" set "OPTS=%OPTS% -DMAKE_MAINTAINER_MODE"
|
||||
:: Show the compiler version that we found
|
||||
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
|
||||
echo No %COMPILER% found.
|
||||
exit 1
|
||||
@@ -197,10 +230,11 @@ mkdir %OUTDIR%\lib
|
||||
|
||||
if "%GUILE%" == "Y" call :ChkGuile
|
||||
|
||||
if not exist src\config.h.W32 goto NotConfig
|
||||
|
||||
echo.
|
||||
echo Compiling %OUTDIR% version
|
||||
|
||||
if exist src\config.h.W32.template call :ConfigSCM
|
||||
copy src\config.h.W32 %OUTDIR%\src\config.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/remote-stub
|
||||
call :Compile src/rule
|
||||
call :Compile src/shuffle
|
||||
call :Compile src/signame
|
||||
call :Compile src/strcache
|
||||
call :Compile src/variable
|
||||
@@ -246,7 +281,8 @@ call :Compile lib/fnmatch
|
||||
call :Compile lib/glob
|
||||
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
|
||||
|
||||
@@ -267,23 +303,33 @@ goto :EOF
|
||||
::
|
||||
|
||||
:Compile
|
||||
if "%VERBOSE%" == "N" echo - Compiling %1.c
|
||||
echo %LNKOUT%/%1.%O% >>%OUTDIR%\link.sc
|
||||
set EXTRAS=
|
||||
if "%2" == "GUILE" set "EXTRAS=%GUILECFLAGS%"
|
||||
if exist "%OUTDIR%\%1.%O%" del "%OUTDIR%\%1.%O%"
|
||||
if "%COMPILER%" == "gcc" goto GccCompile
|
||||
if "%COMPILER%" == "tcc" goto TccCompile
|
||||
|
||||
:: MSVC Compile
|
||||
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
|
||||
if "%VERBOSE%" == "Y" echo on
|
||||
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
|
||||
goto CompileDone
|
||||
|
||||
:GccCompile
|
||||
:: GCC Compile
|
||||
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
|
||||
if "%VERBOSE%" == "Y" echo on
|
||||
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
|
||||
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
|
||||
if not exist "%OUTDIR%\%1.%O%" exit 1
|
||||
@@ -291,56 +337,57 @@ goto :EOF
|
||||
|
||||
:Link
|
||||
echo.
|
||||
echo Linking %LNKOUT%/%MAKE%.exe
|
||||
echo - Linking %LNKOUT%/%MAKE%.exe
|
||||
if "%COMPILER%" == "gcc" goto GccLink
|
||||
if "%COMPILER%" == "tcc" goto TccLink
|
||||
|
||||
:: 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 on
|
||||
link.exe /NOLOGO /SUBSYSTEM:console /PDB:%LNKOUT%\%MAKE%.pdb %LINKOPTS% /OUT:%LNKOUT%\%MAKE%.exe @%LNKOUT%\link.sc
|
||||
if "%VERBOSE%" == "Y" echo on
|
||||
call link.exe /NOLOGO /SUBSYSTEM:console /PDB:%LNKOUT%\%MAKE%.pdb %LINKOPTS% /OUT:%LNKOUT%\%MAKE%.exe @%LNKOUT%\link.sc
|
||||
@echo off
|
||||
goto :EOF
|
||||
|
||||
:GccLink
|
||||
:: 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
|
||||
%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
|
||||
goto :EOF
|
||||
|
||||
:ConfigSCM
|
||||
echo Generating config from SCM templates
|
||||
sed -n "s/^AC_INIT(\[GNU make\],\[\([^]]\+\)\].*/s,%%VERSION%%,\1,g/p" configure.ac > %OUTDIR%\src\config.h.W32.sed
|
||||
echo s,%%PACKAGE%%,make,g >> %OUTDIR%\src\config.h.W32.sed
|
||||
sed -f %OUTDIR%\src\config.h.W32.sed src\config.h.W32.template > src\config.h.W32
|
||||
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
|
||||
echo ^";>> src\gmk-default.h
|
||||
:TccLink
|
||||
:: TCC Link
|
||||
if "%VERBOSE%" == "Y" echo on
|
||||
echo %GUILELIBS% -lkernel32 -luser32 -lgdi32 -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -lodbc32 -lodbccp32 >>%OUTDIR%\link.sc
|
||||
call %COMPILER% -mthreads %OPTS% -o %LNKOUT%/%MAKE%.exe @%LNKOUT%/link.sc
|
||||
@echo off
|
||||
goto :EOF
|
||||
|
||||
:ChkGuile
|
||||
:: Build with Guile is supported only on NT and later versions
|
||||
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
|
||||
|
||||
echo Checking for Guile 2.0
|
||||
set PKGMSC=
|
||||
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
|
||||
if not ERRORLEVEL 1 set /P GUILELIBS= < %OUTDIR%\guile.tmp
|
||||
echo Checking for Guile 2.0
|
||||
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
|
||||
|
||||
echo Checking for Guile 1.8
|
||||
pkg-config --cflags --short-errors "guile-1.8" > %OUTDIR%\guile.tmp
|
||||
if not ERRORLEVEL 1 set /P GUILECFLAGS= < %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%\gl-c18.tmp
|
||||
|
||||
pkg-config --libs --static --short-errors %PKGMSC% "guile-1.8" > %OUTDIR%\guile.tmp
|
||||
if not ERRORLEVEL 1 set /P GUILELIBS= < %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%\gl-l18.tmp
|
||||
|
||||
if not "%GUILECFLAGS%" == "" goto GuileDone
|
||||
|
||||
@@ -359,10 +406,10 @@ goto :EOF
|
||||
|
||||
:FindVswhere
|
||||
set VSWHERE=vswhere
|
||||
%VSWHERE% -help >nul 2>&1
|
||||
call "%VSWHERE%" -help >nul 2>&1
|
||||
if not ERRORLEVEL 1 exit /b 0
|
||||
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
|
||||
goto :EOF
|
||||
|
||||
@@ -370,17 +417,26 @@ goto :EOF
|
||||
if not exist "%VSVARS%" exit /b 1
|
||||
call "%VSVARS%" %ARCH%
|
||||
if ERRORLEVEL 1 exit /b 1
|
||||
%COMPILER% >nul 2>&1
|
||||
call %COMPILER% >nul 2>&1
|
||||
if ERRORLEVEL 1 exit /b 1
|
||||
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
|
||||
echo Usage: %0 [options] [gcc]
|
||||
echo Usage: %0 [options] [gcc] OR [tcc]
|
||||
echo Options:
|
||||
echo. --without-guile Do not compile Guile support even if found
|
||||
echo. --debug Make a Debug build--default is Release
|
||||
echo. --x86 Make a 32bit binary--default is 64bit
|
||||
echo. --help Display these instructions and exit
|
||||
echo.
|
||||
echo. "gcc" means compile with GCC, "tcc" means compile with Tiny C's TCC
|
||||
goto :EOF
|
||||
|
||||
:Reset
|
||||
|
||||
24
builddos.bat
24
builddos.bat
@@ -1,5 +1,5 @@
|
||||
@echo off
|
||||
rem Copyright (C) 1998-2020 Free Software Foundation, Inc.
|
||||
rem Copyright (C) 1998-2023 Free Software Foundation, Inc.
|
||||
rem This file is part of GNU Make.
|
||||
rem
|
||||
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
|
||||
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
|
||||
|
||||
@@ -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/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/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 -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 -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=\"/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=\"/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/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/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/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
|
||||
@@ -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/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/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/fnmatch.c -o lib/fnmatch.o
|
||||
@echo off
|
||||
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 (expand function vpath hash strcache version ar arscan signame remote-stub getopt getopt1) 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 shuffle) 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
|
||||
rem echo guile.o >> respf.$$$
|
||||
gcc -c -I./src -I%XSRC%/src -I./lib -I%XSRC%/lib -DHAVE_CONFIG_H -O2 -g %XSRC%/src/guile.c -o guile.o
|
||||
echo guile.o >> respf.$$$
|
||||
@echo Linking...
|
||||
@echo on
|
||||
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 exist make.exe echo make.exe is now built!
|
||||
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
|
||||
|
||||
:SmallEnv
|
||||
|
||||
150
configure.ac
150
configure.ac
@@ -1,6 +1,6 @@
|
||||
# Process this file with autoconf to produce a configure script.
|
||||
#
|
||||
# Copyright (C) 1993-2020 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1993-2023 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
|
||||
@@ -14,9 +14,9 @@
|
||||
# details.
|
||||
#
|
||||
# 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.93],[bug-make@gnu.org])
|
||||
AC_INIT([GNU Make],[4.4.0.90],[bug-make@gnu.org])
|
||||
|
||||
AC_PREREQ([2.69])
|
||||
|
||||
@@ -31,7 +31,7 @@ AC_CONFIG_LIBOBJ_DIR([lib])
|
||||
# We have to enable "foreign" because ChangeLog is auto-generated
|
||||
# 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.
|
||||
# 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])
|
||||
|
||||
# Checks for programs.
|
||||
@@ -51,42 +51,36 @@ AC_CHECK_PROG([PERL], [perl], [perl], [perl])
|
||||
|
||||
# Specialized system macros
|
||||
AC_CANONICAL_HOST
|
||||
AC_AIX
|
||||
AC_ISC_POSIX
|
||||
AC_MINIX
|
||||
AC_C_BIGENDIAN
|
||||
|
||||
# Enable gettext, in "external" mode.
|
||||
AM_GNU_GETTEXT_VERSION([0.19.4])
|
||||
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.
|
||||
AC_SEARCH_LIBS([strerror],[cposix])
|
||||
AC_SEARCH_LIBS([getpwnam], [sun])
|
||||
|
||||
# Checks for header files.
|
||||
AC_HEADER_STDC
|
||||
AC_HEADER_DIRENT
|
||||
AC_HEADER_STAT
|
||||
AC_HEADER_TIME
|
||||
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 \
|
||||
sys/select.h sys/file.h spawn.h])
|
||||
|
||||
AC_CHECK_HEADERS([stdlib.h string.h strings.h locale.h unistd.h limits.h \
|
||||
memory.h sys/param.h sys/resource.h sys/timeb.h sys/time.h \
|
||||
sys/select.h sys/file.h fcntl.h spawn.h])
|
||||
|
||||
AM_PROG_CC_C_O
|
||||
AC_C_CONST
|
||||
AC_TYPE_SIGNAL
|
||||
AC_TYPE_UID_T
|
||||
AC_TYPE_PID_T
|
||||
AC_TYPE_OFF_T
|
||||
AC_TYPE_SIZE_T
|
||||
AC_TYPE_SSIZE_T
|
||||
AC_TYPE_INTMAX_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.
|
||||
|
||||
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
|
||||
# implementations can differ, just make sure we have the most common
|
||||
# one.
|
||||
@@ -138,10 +129,10 @@ AS_IF([test "$ac_cv_func_gettimeofday" = yes],
|
||||
[Define to 1 if you have a standard gettimeofday function])
|
||||
])
|
||||
|
||||
AC_CHECK_FUNCS([strdup strndup memrchr umask mkstemp mktemp fdopen \
|
||||
dup dup2 getcwd realpath sigsetmask sigaction \
|
||||
AC_CHECK_FUNCS([strtoll strdup strndup stpcpy memrchr mempcpy umask mkstemp \
|
||||
mktemp fdopen dup dup2 getcwd realpath sigsetmask sigaction \
|
||||
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 \
|
||||
posix_spawnattr_setsigmask])
|
||||
|
||||
@@ -153,8 +144,6 @@ AC_CHECK_DECLS([bsd_signal], [], [], [[#define _GNU_SOURCE 1
|
||||
|
||||
AC_FUNC_FORK
|
||||
|
||||
AC_FUNC_SETVBUF_REVERSED
|
||||
|
||||
# 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
|
||||
# make the effort here.
|
||||
@@ -176,7 +165,7 @@ AC_ARG_WITH([guile], [AS_HELP_STRING([--with-guile],
|
||||
PKG_PROG_PKG_CONFIG
|
||||
|
||||
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
|
||||
have_guile=no
|
||||
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], [])
|
||||
done
|
||||
AC_MSG_RESULT([$guile_version])
|
||||
if test "$have_guile" = yes; then
|
||||
PKG_CHECK_MODULES(GUILE, [guile-$guile_version])
|
||||
AC_DEFINE([HAVE_GUILE], [1], [Embed GNU Guile support])
|
||||
fi
|
||||
AS_IF([test "$have_guile" = yes],
|
||||
[ PKG_CHECK_MODULES(GUILE, [guile-$guile_version])
|
||||
# Unfortunately pkg doesn't help in multi-arch environments where the
|
||||
# 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_INCLUDES_DEFAULT
|
||||
@@ -243,8 +260,7 @@ AS_IF([test "$PATH_SEPARATOR" = ';'],
|
||||
AC_SUBST([REMOTE]) REMOTE=stub
|
||||
use_customs=false
|
||||
AC_ARG_WITH([customs],
|
||||
[AC_HELP_STRING([--with-customs=DIR],
|
||||
[enable remote jobs via Customs--see README.customs])],
|
||||
[AS_HELP_STRING([--with-customs=DIR],[enable remote jobs via Customs--see README.customs])],
|
||||
[ AS_CASE([$withval], [n|no], [:],
|
||||
[make_cppflags="$CPPFLAGS"
|
||||
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.
|
||||
AH_TEMPLATE([HAVE_CASE_INSENSITIVE_FS], [Use case insensitive file names])
|
||||
AC_ARG_ENABLE([case-insensitive-file-system],
|
||||
AC_HELP_STRING([--enable-case-insensitive-file-system],
|
||||
[assume file systems are case insensitive]),
|
||||
AS_HELP_STRING([--enable-case-insensitive-file-system],[assume file systems are case insensitive]),
|
||||
[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.
|
||||
AC_ARG_ENABLE([job-server],
|
||||
AC_HELP_STRING([--disable-job-server],
|
||||
[disallow recursive make communication during -jN]),
|
||||
AS_HELP_STRING([--disable-job-server],[disallow recursive make communication during -jN]),
|
||||
[make_cv_job_server="$enableval" user_job_server="$enableval"],
|
||||
[make_cv_job_server="yes"])
|
||||
|
||||
@@ -304,7 +318,7 @@ AS_CASE([$host_os], [os2*|mingw*], [make_cv_job_server=yes])
|
||||
AS_CASE([/$make_cv_job_server/$user_job_server/],
|
||||
[*/no/*], [: no jobserver],
|
||||
[AC_DEFINE(MAKE_JOBSERVER, 1,
|
||||
[Define to 1 to enable job server support in GNU make.])
|
||||
[Define to 1 to enable job server support in GNU Make.])
|
||||
])
|
||||
|
||||
# If dl*() functions are supported we can enable the load operation
|
||||
@@ -312,8 +326,7 @@ AC_CHECK_DECLS([dlopen, dlsym, dlerror], [], [],
|
||||
[[#include <dlfcn.h>]])
|
||||
|
||||
AC_ARG_ENABLE([load],
|
||||
AC_HELP_STRING([--disable-load],
|
||||
[disable support for the 'load' operation]),
|
||||
AS_HELP_STRING([--disable-load],[disable support for the 'load' operation]),
|
||||
[make_cv_load="$enableval" user_load="$enableval"],
|
||||
[make_cv_load="yes"])
|
||||
|
||||
@@ -328,7 +341,7 @@ AS_IF([test "$make_cv_load" = yes], [
|
||||
AS_CASE([/$make_cv_load/$user_load/],
|
||||
[*/no/*], [make_cv_load=no],
|
||||
[AC_DEFINE(MAKE_LOAD, 1,
|
||||
[Define to 1 to enable 'load' support in GNU make.])
|
||||
[Define to 1 to enable 'load' support in GNU Make.])
|
||||
])
|
||||
|
||||
# If we want load support, we might need to link with export-dynamic.
|
||||
@@ -363,8 +376,7 @@ 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
|
||||
|
||||
AC_ARG_ENABLE([posix-spawn],
|
||||
AC_HELP_STRING([--disable-posix-spawn],
|
||||
[disable support for posix_spawn()]),
|
||||
AS_HELP_STRING([--disable-posix-spawn],[disable support for posix_spawn()]),
|
||||
[make_cv_posix_spawn="$enableval" user_posix_spawn="$enableval"],
|
||||
[make_cv_posix_spawn="yes"])
|
||||
|
||||
@@ -376,20 +388,16 @@ AS_IF([test "$make_cv_posix_spawn" = yes],
|
||||
[make_cv_synchronous_posix_spawn],
|
||||
[make_cv_synchronous_posix_spawn=no
|
||||
AC_RUN_IFELSE([AC_LANG_SOURCE([[
|
||||
#include <errno.h>
|
||||
#include <spawn.h>
|
||||
#include <string.h>
|
||||
|
||||
extern char **environ;
|
||||
|
||||
int main() {
|
||||
char* path = strdup("./non-existent");
|
||||
char *argv[[2]];
|
||||
argv[[0]] = path;
|
||||
argv[[1]] = 0;
|
||||
return posix_spawn(0, path, 0, 0, argv, 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=no],
|
||||
[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/],
|
||||
@@ -437,13 +445,21 @@ AS_CASE([$host],
|
||||
[*-*-mingw32],
|
||||
[AM_CONDITIONAL([WINDOWSENV], [true])
|
||||
w32_target_env=yes
|
||||
AC_DEFINE([WINDOWS32], [1], [Use platform specific coding])
|
||||
AC_DEFINE([HAVE_DOS_PATHS], [1], [Use platform specific coding])
|
||||
AC_DEFINE([WINDOWS32], [1], [Build for the WINDOWS32 API.])
|
||||
AC_DEFINE([HAVE_DOS_PATHS], [1], [Support DOS-style pathnames.])
|
||||
])
|
||||
|
||||
AC_DEFINE_UNQUOTED([PATH_SEPARATOR_CHAR],['$PATH_SEPARATOR'],
|
||||
[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.
|
||||
|
||||
MAINT_MAKEFILE=/dev/null
|
||||
@@ -455,6 +471,10 @@ AC_SUBST_FILE([MAINT_MAKEFILE])
|
||||
# Allow building with dmalloc
|
||||
AM_WITH_DMALLOC
|
||||
|
||||
# Add custom header to config.h
|
||||
AH_BOTTOM([/* Include customized declarations. */
|
||||
#include "../src/mkcustom.h"])
|
||||
|
||||
# Forcibly disable SET_MAKE. If it's set it breaks things like the test
|
||||
# scripts, etc.
|
||||
SET_MAKE=
|
||||
@@ -474,7 +494,7 @@ AS_CASE([$with_customs],
|
||||
[ echo
|
||||
echo "WARNING: '$with_customs/lib' does not appear to contain the"
|
||||
echo " Customs library. You must build and install Customs"
|
||||
echo " before compiling GNU make."
|
||||
echo " before compiling GNU Make."
|
||||
echo
|
||||
])])
|
||||
|
||||
@@ -482,7 +502,7 @@ AS_IF([test "x$has_wait_nohang" = xno],
|
||||
[ echo
|
||||
echo "WARNING: Your system has neither waitpid() nor wait3()."
|
||||
echo " Without one of these, signal handling is unreliable."
|
||||
echo " You should be aware that running GNU make with -j"
|
||||
echo " You should be aware that running GNU Make with -j"
|
||||
echo " could result in erratic behavior."
|
||||
echo
|
||||
])
|
||||
@@ -512,12 +532,20 @@ AS_IF([test "x$make_cv_posix_spawn" = xno && test "x$user_posix_spawn" = xyes],
|
||||
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.
|
||||
AC_CONFIG_FILES([Makefile build.cfg lib/Makefile po/Makefile.in doc/Makefile \
|
||||
tests/config-flags.pm])
|
||||
AC_CONFIG_FILES([build.cfg 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.
|
||||
#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!
|
||||
|
||||
AC_OUTPUT
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# -*-Makefile-*-, or close enough
|
||||
# Copyright (C) 2000-2020 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2000-2023 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
|
||||
@@ -13,7 +13,7 @@
|
||||
# details.
|
||||
#
|
||||
# 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_FLAGS = -split_chapter
|
||||
|
||||
81
doc/make.1
81
doc/make.1
@@ -1,6 +1,6 @@
|
||||
.TH MAKE 1 "28 February 2016" "GNU" "User Commands"
|
||||
.TH MAKE 1 "31 May 2022" "GNU" "User Commands"
|
||||
.SH NAME
|
||||
make \- GNU make utility to maintain groups of programs
|
||||
make \- GNU Make utility to maintain groups of programs
|
||||
.SH SYNOPSIS
|
||||
.B make
|
||||
[\fIOPTION\fR]... [\fITARGET\fR]...
|
||||
@@ -26,9 +26,9 @@ To prepare to use
|
||||
.BR make ,
|
||||
you must write a file called the
|
||||
.I makefile
|
||||
that describes the relationships among files in your program, and the states
|
||||
the commands for updating each file. In a program, typically the executable
|
||||
file is updated from object files, which are in turn made by compiling source
|
||||
that describes the relationships among files in your program, and provides
|
||||
commands for updating each file. In a program, typically the executable file
|
||||
is updated from object files, which are in turn made by compiling source
|
||||
files.
|
||||
.LP
|
||||
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
|
||||
executes commands in the
|
||||
.I makefile
|
||||
to update one or more target
|
||||
.IR names ,
|
||||
to update one or more
|
||||
.IR targets ,
|
||||
where
|
||||
.I name
|
||||
.I target
|
||||
is typically a program.
|
||||
If no
|
||||
.B \-f
|
||||
@@ -130,21 +130,28 @@ are omitted, then the behavior is the same as if
|
||||
.B \-d
|
||||
was specified.
|
||||
.I FLAGS
|
||||
may be
|
||||
.I a
|
||||
may be any or all of the following names, comma- or space-separated. Only the
|
||||
first character is significant: the rest may be omitted:
|
||||
.I all
|
||||
for all debugging output (same as using
|
||||
.BR \-d ),
|
||||
.I b
|
||||
.I basic
|
||||
for basic debugging,
|
||||
.I v
|
||||
.I verbose
|
||||
for more verbose basic debugging,
|
||||
.I i
|
||||
for showing implicit rules,
|
||||
.I j
|
||||
for details on invocation of commands, and
|
||||
.I m
|
||||
for debugging while remaking makefiles. Use
|
||||
.I n
|
||||
.I implicit
|
||||
for showing implicit rule search operations,
|
||||
.I jobs
|
||||
for details on invocation of commands,
|
||||
.I makefile
|
||||
for debugging while remaking makefiles,
|
||||
.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.
|
||||
.TP 0.5i
|
||||
\fB\-e\fR, \fB\-\-environment\-overrides\fR
|
||||
@@ -198,6 +205,16 @@ option is given without an argument,
|
||||
.BR make
|
||||
will not limit the number of jobs that can run simultaneously.
|
||||
.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
|
||||
Continue as much as possible after an error.
|
||||
While the target that failed, and those that depend on it, cannot
|
||||
@@ -312,6 +329,26 @@ Turn off
|
||||
.BR \-w ,
|
||||
even if it was turned on implicitly.
|
||||
.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
|
||||
Pretend that the target
|
||||
.I file
|
||||
@@ -361,9 +398,9 @@ This manual page contributed by Dennis Morse of Stanford University.
|
||||
Further updates contributed by Mike Frysinger. It has been reworked by Roland
|
||||
McGrath. Maintained by Paul Smith.
|
||||
.SH "COPYRIGHT"
|
||||
Copyright \(co 1992-1993, 1996-2020 Free Software Foundation, Inc.
|
||||
Copyright \(co 1992-1993, 1996-2023 Free Software Foundation, Inc.
|
||||
This file is part of
|
||||
.IR "GNU make" .
|
||||
.IR "GNU Make" .
|
||||
.LP
|
||||
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
|
||||
@@ -376,4 +413,4 @@ A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||
.LP
|
||||
You should have received a copy of the GNU General Public License along with
|
||||
this program. If not, see
|
||||
.IR http://www.gnu.org/licenses/ .
|
||||
.IR https://www.gnu.org/licenses/ .
|
||||
|
||||
1904
doc/make.texi
1904
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,4 +1,4 @@
|
||||
/* Copyright (C) 1991, 1992, 1993, 1996, 1997, 1998, 1999 Free Software
|
||||
/* Copyright (C) 1991, 1992, 1993, 1996, 1997, 1998, 1999, 2023 Free Software
|
||||
Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
@@ -128,48 +128,20 @@ extern char *getenv ();
|
||||
extern int errno;
|
||||
# endif
|
||||
|
||||
/* This function doesn't exist on most systems. */
|
||||
|
||||
# if !defined HAVE___STRCHRNUL && !defined _LIBC
|
||||
static char *
|
||||
__strchrnul (s, c)
|
||||
const char *s;
|
||||
int c;
|
||||
{
|
||||
char *result = strchr (s, c);
|
||||
if (result == NULL)
|
||||
result = strchr (s, '\0');
|
||||
return result;
|
||||
}
|
||||
# endif
|
||||
|
||||
# ifndef internal_function
|
||||
/* Inside GNU libc we mark some function in a special way. In other
|
||||
environments simply ignore the marking. */
|
||||
# define internal_function
|
||||
# endif
|
||||
|
||||
/* Match STRING against the filename pattern PATTERN, returning zero if
|
||||
it matches, nonzero if not. */
|
||||
static int internal_fnmatch __P ((const char *pattern, const char *string,
|
||||
int no_leading_period, int flags))
|
||||
internal_function;
|
||||
static int
|
||||
internal_function
|
||||
internal_fnmatch (pattern, string, no_leading_period, flags)
|
||||
const char *pattern;
|
||||
const char *string;
|
||||
int no_leading_period;
|
||||
int flags;
|
||||
internal_fnmatch (const char *pattern, const char *string,
|
||||
int no_leading_period, int flags)
|
||||
{
|
||||
register const char *p = pattern, *n = string;
|
||||
register unsigned char c;
|
||||
const char *p = pattern, *n = string;
|
||||
unsigned char c;
|
||||
|
||||
/* Note that this evaluates C many times. */
|
||||
# ifdef _LIBC
|
||||
# define FOLD(c) ((flags & FNM_CASEFOLD) ? tolower (c) : (c))
|
||||
# define FOLD(c) (unsigned char)((flags & FNM_CASEFOLD) ? tolower (c) : (c))
|
||||
# else
|
||||
# define FOLD(c) ((flags & FNM_CASEFOLD) && ISUPPER (c) ? tolower (c) : (c))
|
||||
# define FOLD(c) (unsigned char)((flags & FNM_CASEFOLD) && ISUPPER (c) ? tolower (c) : (c))
|
||||
# endif
|
||||
|
||||
while ((c = *p++) != '\0')
|
||||
@@ -237,7 +209,9 @@ internal_fnmatch (pattern, string, no_leading_period, flags)
|
||||
{
|
||||
const char *endp;
|
||||
|
||||
endp = __strchrnul (n, (flags & FNM_FILE_NAME) ? '/' : '\0');
|
||||
endp = strchr (n, (flags & FNM_FILE_NAME) ? '/' : '\0');
|
||||
if (endp == NULL)
|
||||
endp = n + strlen (n);
|
||||
|
||||
if (c == '[')
|
||||
{
|
||||
@@ -292,7 +266,7 @@ internal_fnmatch (pattern, string, no_leading_period, flags)
|
||||
{
|
||||
/* Nonzero if the sense of the character class is inverted. */
|
||||
static int posixly_correct;
|
||||
register int not;
|
||||
int not;
|
||||
char cold;
|
||||
|
||||
if (posixly_correct == 0)
|
||||
@@ -478,10 +452,7 @@ internal_fnmatch (pattern, string, no_leading_period, flags)
|
||||
|
||||
|
||||
int
|
||||
fnmatch (pattern, string, flags)
|
||||
const char *pattern;
|
||||
const char *string;
|
||||
int flags;
|
||||
fnmatch (const char *pattern, const char *string, int flags)
|
||||
{
|
||||
return internal_fnmatch (pattern, string, flags & FNM_PERIOD, flags);
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 1991, 1992, 1993, 1996, 1997, 1998, 1999 Free Software
|
||||
/* Copyright (C) 1991, 1992, 1993, 1996, 1997, 1998, 1999, 2023 Free Software
|
||||
Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
@@ -24,27 +24,6 @@ USA. */
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#if defined __cplusplus || (defined __STDC__ && __STDC__) || defined WINDOWS32
|
||||
# if !defined __GLIBC__
|
||||
# undef __P
|
||||
# define __P(protos) protos
|
||||
# endif
|
||||
#else /* Not C++ or ANSI C. */
|
||||
# undef __P
|
||||
# define __P(protos) ()
|
||||
/* We can get away without defining `const' here only because in this file
|
||||
it is used only inside the prototype for `fnmatch', which is elided in
|
||||
non-ANSI C where `const' is problematical. */
|
||||
#endif /* C++ or ANSI C. */
|
||||
|
||||
#ifndef const
|
||||
# if (defined __STDC__ && __STDC__) || defined __cplusplus || defined WINDOWS32
|
||||
# define __const const
|
||||
# else
|
||||
# define __const
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* We #undef these before defining them because some losing systems
|
||||
(HP-UX A.08.07 for example) define these in <unistd.h>. */
|
||||
#undef FNM_PATHNAME
|
||||
@@ -75,8 +54,7 @@ extern "C" {
|
||||
|
||||
/* Match NAME against the filename pattern PATTERN,
|
||||
returning zero if it matches, FNM_NOMATCH if not. */
|
||||
extern int fnmatch __P ((__const char *__pattern, __const char *__name,
|
||||
int __flags));
|
||||
extern int fnmatch (const char *pattern, const char *name, int flags);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999 Free
|
||||
Software Foundation, Inc.
|
||||
/* Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
|
||||
2023 Free Software Foundation, Inc.
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
@@ -38,9 +38,6 @@ USA. */
|
||||
/* #define NDEBUG 1 */
|
||||
#include <assert.h>
|
||||
|
||||
#include <stdio.h> /* Needed on stupid SunOS for assert. */
|
||||
|
||||
|
||||
/* Comment out all this code if we are using the GNU C Library, and are not
|
||||
actually compiling the library itself. This code is part of the GNU C
|
||||
Library, but also included in many other GNU distributions. Compiling
|
||||
@@ -50,7 +47,9 @@ USA. */
|
||||
it is simpler to just do this in the source for each such file. */
|
||||
|
||||
#define GLOB_INTERFACE_VERSION 1
|
||||
#if !defined _LIBC && defined __GNU_LIBRARY__ && __GNU_LIBRARY__ > 1
|
||||
#if defined _LIBC
|
||||
# define ELIDE_CODE
|
||||
#elif defined __GNU_LIBRARY__ && __GNU_LIBRARY__ > 1
|
||||
# include <gnu-versions.h>
|
||||
# if _GNU_GLOB_INTERFACE_VERSION == GLOB_INTERFACE_VERSION
|
||||
# define ELIDE_CODE
|
||||
@@ -63,7 +62,7 @@ USA. */
|
||||
# include <stddef.h>
|
||||
#endif
|
||||
|
||||
#if defined HAVE_UNISTD_H || defined _LIBC
|
||||
#if defined HAVE_UNISTD_H
|
||||
# include <unistd.h>
|
||||
# ifndef POSIX
|
||||
# ifdef _POSIX_VERSION
|
||||
@@ -83,11 +82,6 @@ extern int errno;
|
||||
# define __set_errno(val) errno = (val)
|
||||
#endif
|
||||
|
||||
#ifndef NULL
|
||||
# define NULL 0
|
||||
#endif
|
||||
|
||||
|
||||
#if defined HAVE_DIRENT_H || defined __GNU_LIBRARY__
|
||||
# include <dirent.h>
|
||||
# define NAMLEN(dirent) strlen((dirent)->d_name)
|
||||
@@ -108,7 +102,6 @@ extern int errno;
|
||||
# endif /* HAVE_VMSDIR_H */
|
||||
#endif
|
||||
|
||||
|
||||
/* In GNU systems, <dirent.h> defines this macro for us. */
|
||||
#ifdef _D_NAMLEN
|
||||
# undef NAMLEN
|
||||
@@ -130,49 +123,10 @@ extern int errno;
|
||||
# define REAL_DIR_ENTRY(dp) (dp->d_ino != 0)
|
||||
#endif /* POSIX */
|
||||
|
||||
#if defined STDC_HEADERS || defined __GNU_LIBRARY__
|
||||
# include <stdlib.h>
|
||||
# include <string.h>
|
||||
# define ANSI_STRING
|
||||
#else /* No standard headers. */
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
extern char *getenv ();
|
||||
|
||||
# ifdef HAVE_STRING_H
|
||||
# include <string.h>
|
||||
# define ANSI_STRING
|
||||
# else
|
||||
# include <strings.h>
|
||||
# endif
|
||||
# ifdef HAVE_MEMORY_H
|
||||
# include <memory.h>
|
||||
# endif
|
||||
|
||||
extern char *malloc (), *realloc ();
|
||||
extern void free ();
|
||||
|
||||
extern void qsort ();
|
||||
extern void abort (), exit ();
|
||||
|
||||
#endif /* Standard headers. */
|
||||
|
||||
#ifndef ANSI_STRING
|
||||
|
||||
# ifndef bzero
|
||||
extern void bzero ();
|
||||
# endif
|
||||
# ifndef bcopy
|
||||
extern void bcopy ();
|
||||
# endif
|
||||
|
||||
# define memcpy(d, s, n) bcopy ((s), (d), (n))
|
||||
# define strrchr rindex
|
||||
/* memset is only used for zero here, but let's be paranoid. */
|
||||
# define memset(s, better_be_zero, n) \
|
||||
((void) ((better_be_zero) == 0 ? (bzero((s), (n)), 0) : (abort(), 0)))
|
||||
#endif /* Not ANSI_STRING. */
|
||||
|
||||
#if !defined HAVE_STRCOLL && !defined _LIBC
|
||||
#if !defined HAVE_STRCOLL
|
||||
# define strcoll strcmp
|
||||
#endif
|
||||
|
||||
@@ -182,32 +136,6 @@ extern void bcopy ();
|
||||
# define mempcpy(Dest, Src, Len) __mempcpy (Dest, Src, Len)
|
||||
#endif
|
||||
|
||||
#if !defined __GNU_LIBRARY__ && !defined __DJGPP__
|
||||
# ifdef __GNUC__
|
||||
__inline
|
||||
# endif
|
||||
# ifndef __SASC
|
||||
# ifdef WINDOWS32
|
||||
static void *
|
||||
my_realloc (void *p, unsigned int n)
|
||||
# else
|
||||
static char *
|
||||
my_realloc (p, n)
|
||||
char *p;
|
||||
unsigned int n;
|
||||
# endif
|
||||
{
|
||||
/* These casts are the for sake of the broken Ultrix compiler,
|
||||
which warns of illegal pointer combinations otherwise. */
|
||||
if (p == NULL)
|
||||
return (char *) malloc (n);
|
||||
return (char *) realloc (p, n);
|
||||
}
|
||||
# define realloc my_realloc
|
||||
# endif /* __SASC */
|
||||
#endif /* __GNU_LIBRARY__ || __DJGPP__ */
|
||||
|
||||
|
||||
#if !defined __alloca && !defined __GNU_LIBRARY__
|
||||
|
||||
# ifdef __GNUC__
|
||||
@@ -229,7 +157,6 @@ extern char *alloca ();
|
||||
#endif
|
||||
|
||||
#ifndef __GNU_LIBRARY__
|
||||
# define __stat stat
|
||||
# ifdef STAT_MACROS_BROKEN
|
||||
# undef S_ISDIR
|
||||
# endif
|
||||
@@ -238,25 +165,6 @@ extern char *alloca ();
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef _LIBC
|
||||
# undef strdup
|
||||
# define strdup(str) __strdup (str)
|
||||
# define sysconf(id) __sysconf (id)
|
||||
# define closedir(dir) __closedir (dir)
|
||||
# define opendir(name) __opendir (name)
|
||||
# define readdir(str) __readdir (str)
|
||||
# define getpwnam_r(name, bufp, buf, len, res) \
|
||||
__getpwnam_r (name, bufp, buf, len, res)
|
||||
# ifndef __stat
|
||||
# define __stat(fname, buf) __xstat (_STAT_VER, fname, buf)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if !(defined STDC_HEADERS || defined __GNU_LIBRARY__)
|
||||
# undef size_t
|
||||
# define size_t unsigned int
|
||||
#endif
|
||||
|
||||
/* Some system header files erroneously define these.
|
||||
We want our own definitions from <fnmatch.h> to take precedence. */
|
||||
#ifndef __GNU_LIBRARY__
|
||||
@@ -284,30 +192,26 @@ extern char *alloca ();
|
||||
# define __alloca alloca
|
||||
#endif
|
||||
|
||||
#if !defined __stat
|
||||
# define __stat stat
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_GETLOGIN_R
|
||||
extern int getlogin_r __P ((char *, size_t));
|
||||
extern int getlogin_r (char *, size_t);
|
||||
#else
|
||||
extern char *getlogin __P ((void));
|
||||
extern char *getlogin (void);
|
||||
#endif
|
||||
|
||||
static
|
||||
#if __GNUC__ - 0 >= 2
|
||||
inline
|
||||
#endif
|
||||
const char *next_brace_sub __P ((const char *begin));
|
||||
static int glob_in_dir __P ((const char *pattern, const char *directory,
|
||||
int flags,
|
||||
int (*errfunc) (const char *, int),
|
||||
glob_t *pglob));
|
||||
static int prefix_array __P ((const char *prefix, char **array, size_t n));
|
||||
static int collated_compare __P ((const __ptr_t, const __ptr_t));
|
||||
const char *next_brace_sub (const char *begin);
|
||||
static int glob_in_dir (const char *pattern, const char *directory,
|
||||
int flags,
|
||||
int (*errfunc) (const char *, int),
|
||||
glob_t *pglob);
|
||||
static int prefix_array (const char *prefix, char **array, size_t n);
|
||||
static int collated_compare (const void *, const void *);
|
||||
|
||||
#if !defined _LIBC || !defined NO_GLOB_PATTERN_P
|
||||
int __glob_pattern_p __P ((const char *pattern, int quote));
|
||||
#if !defined NO_GLOB_PATTERN_P
|
||||
int __glob_pattern_p (const char *pattern, int quote);
|
||||
#endif
|
||||
|
||||
/* Find the end of the sub-pattern in a brace expression. We define
|
||||
@@ -317,8 +221,7 @@ static
|
||||
inline
|
||||
#endif
|
||||
const char *
|
||||
next_brace_sub (begin)
|
||||
const char *begin;
|
||||
next_brace_sub (const char *begin)
|
||||
{
|
||||
unsigned int depth = 0;
|
||||
const char *cp = begin;
|
||||
@@ -364,11 +267,8 @@ next_brace_sub (begin)
|
||||
If memory cannot be allocated for PGLOB, GLOB_NOSPACE is returned.
|
||||
Otherwise, `glob' returns zero. */
|
||||
int
|
||||
glob (pattern, flags, errfunc, pglob)
|
||||
const char *pattern;
|
||||
int flags;
|
||||
int (*errfunc) __P ((const char *, int));
|
||||
glob_t *pglob;
|
||||
glob (const char *pattern, int flags,
|
||||
int (*errfunc) (const char *, int), glob_t *pglob)
|
||||
{
|
||||
const char *filename;
|
||||
const char *dirname;
|
||||
@@ -647,7 +547,7 @@ glob (pattern, flags, errfunc, pglob)
|
||||
{
|
||||
int success;
|
||||
char *name;
|
||||
# if defined HAVE_GETLOGIN_R || defined _LIBC
|
||||
# if defined HAVE_GETLOGIN_R
|
||||
size_t buflen = sysconf (_SC_LOGIN_NAME_MAX) + 1;
|
||||
|
||||
if (buflen == 0)
|
||||
@@ -663,7 +563,7 @@ glob (pattern, flags, errfunc, pglob)
|
||||
if (success)
|
||||
{
|
||||
struct passwd *p;
|
||||
# if defined HAVE_GETPWNAM_R || defined _LIBC
|
||||
# if defined HAVE_GETPWNAM_R
|
||||
size_t pwbuflen = sysconf (_SC_GETPW_R_SIZE_MAX);
|
||||
char *pwtmpbuf;
|
||||
struct passwd pwbuf;
|
||||
@@ -748,7 +648,7 @@ glob (pattern, flags, errfunc, pglob)
|
||||
/* Look up specific user's home directory. */
|
||||
{
|
||||
struct passwd *p;
|
||||
# if defined HAVE_GETPWNAM_R || defined _LIBC
|
||||
# if defined HAVE_GETPWNAM_R
|
||||
size_t buflen = sysconf (_SC_GETPW_R_SIZE_MAX);
|
||||
char *pwtmpbuf;
|
||||
struct passwd pwbuf;
|
||||
@@ -816,7 +716,7 @@ glob (pattern, flags, errfunc, pglob)
|
||||
if ((flags & GLOB_NOCHECK)
|
||||
|| (((flags & GLOB_ALTDIRFUNC)
|
||||
? (*pglob->gl_stat) (dirname, &st)
|
||||
: __stat (dirname, &st)) == 0
|
||||
: stat (dirname, &st)) == 0
|
||||
&& S_ISDIR (st.st_mode)))
|
||||
{
|
||||
pglob->gl_pathv
|
||||
@@ -833,7 +733,7 @@ glob (pattern, flags, errfunc, pglob)
|
||||
while (pglob->gl_pathc < pglob->gl_offs)
|
||||
pglob->gl_pathv[pglob->gl_pathc++] = NULL;
|
||||
|
||||
#if defined HAVE_STRDUP || defined _LIBC
|
||||
#if defined HAVE_STRDUP
|
||||
pglob->gl_pathv[pglob->gl_pathc] = strdup (dirname);
|
||||
#else
|
||||
{
|
||||
@@ -865,7 +765,7 @@ glob (pattern, flags, errfunc, pglob)
|
||||
have to glob for the directory, and then glob for
|
||||
the pattern in each directory found. */
|
||||
glob_t dirs;
|
||||
register size_t i;
|
||||
size_t i;
|
||||
|
||||
status = glob (dirname,
|
||||
((flags & (GLOB_ERR | GLOB_NOCHECK | GLOB_NOESCAPE))
|
||||
@@ -879,7 +779,7 @@ glob (pattern, flags, errfunc, pglob)
|
||||
appending the results to PGLOB. */
|
||||
for (i = 0; i < dirs.gl_pathc; ++i)
|
||||
{
|
||||
int old_pathc;
|
||||
size_t old_pathc;
|
||||
|
||||
#ifdef SHELL
|
||||
{
|
||||
@@ -962,7 +862,7 @@ glob (pattern, flags, errfunc, pglob)
|
||||
|
||||
/* First check whether this really is a directory. */
|
||||
if (((flags & GLOB_ALTDIRFUNC)
|
||||
? (*pglob->gl_stat) (dir, &st) : __stat (dir, &st)) != 0
|
||||
? (*pglob->gl_stat) (dir, &st) : stat (dir, &st)) != 0
|
||||
|| !S_ISDIR (st.st_mode))
|
||||
/* No directory, ignore this entry. */
|
||||
continue;
|
||||
@@ -1038,7 +938,7 @@ glob (pattern, flags, errfunc, pglob)
|
||||
for (i = oldcount; i < pglob->gl_pathc; ++i)
|
||||
if (((flags & GLOB_ALTDIRFUNC)
|
||||
? (*pglob->gl_stat) (pglob->gl_pathv[i], &st)
|
||||
: __stat (pglob->gl_pathv[i], &st)) == 0
|
||||
: stat (pglob->gl_pathv[i], &st)) == 0
|
||||
&& S_ISDIR (st.st_mode))
|
||||
{
|
||||
size_t len = strlen (pglob->gl_pathv[i]) + 2;
|
||||
@@ -1056,12 +956,12 @@ glob (pattern, flags, errfunc, pglob)
|
||||
if (!(flags & GLOB_NOSORT))
|
||||
{
|
||||
/* Sort the vector. */
|
||||
int non_sort = oldcount;
|
||||
size_t non_sort = oldcount;
|
||||
|
||||
if ((flags & GLOB_DOOFFS) && pglob->gl_offs > oldcount)
|
||||
non_sort = pglob->gl_offs;
|
||||
|
||||
qsort ((__ptr_t) &pglob->gl_pathv[non_sort],
|
||||
qsort ((void *) &pglob->gl_pathv[non_sort],
|
||||
pglob->gl_pathc - non_sort,
|
||||
sizeof (char *), collated_compare);
|
||||
}
|
||||
@@ -1072,25 +972,22 @@ glob (pattern, flags, errfunc, pglob)
|
||||
|
||||
/* Free storage allocated in PGLOB by a previous `glob' call. */
|
||||
void
|
||||
globfree (pglob)
|
||||
register glob_t *pglob;
|
||||
globfree (glob_t *pglob)
|
||||
{
|
||||
if (pglob->gl_pathv != NULL)
|
||||
{
|
||||
register size_t i;
|
||||
size_t i;
|
||||
for (i = 0; i < pglob->gl_pathc; ++i)
|
||||
if (pglob->gl_pathv[i] != NULL)
|
||||
free ((__ptr_t) pglob->gl_pathv[i]);
|
||||
free ((__ptr_t) pglob->gl_pathv);
|
||||
free (pglob->gl_pathv[i]);
|
||||
free (pglob->gl_pathv);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Do a collated comparison of A and B. */
|
||||
static int
|
||||
collated_compare (a, b)
|
||||
const __ptr_t a;
|
||||
const __ptr_t b;
|
||||
collated_compare (const void *a, const void *b)
|
||||
{
|
||||
const char *const s1 = *(const char *const * const) a;
|
||||
const char *const s2 = *(const char *const * const) b;
|
||||
@@ -1110,15 +1007,12 @@ collated_compare (a, b)
|
||||
A slash is inserted between DIRNAME and each elt of ARRAY,
|
||||
unless DIRNAME is just "/". Each old element of ARRAY is freed. */
|
||||
static int
|
||||
prefix_array (dirname, array, n)
|
||||
const char *dirname;
|
||||
char **array;
|
||||
size_t n;
|
||||
prefix_array (const char *dirname, char **array, size_t n)
|
||||
{
|
||||
register size_t i;
|
||||
size_t i;
|
||||
size_t dirlen = strlen (dirname);
|
||||
#if defined __MSDOS__ || defined WINDOWS32
|
||||
int sep_char = '/';
|
||||
char sep_char = '/';
|
||||
# define DIRSEP_CHAR sep_char
|
||||
#else
|
||||
# define DIRSEP_CHAR '/'
|
||||
@@ -1150,7 +1044,7 @@ prefix_array (dirname, array, n)
|
||||
if (new == NULL)
|
||||
{
|
||||
while (i > 0)
|
||||
free ((__ptr_t) array[--i]);
|
||||
free (array[--i]);
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -1165,7 +1059,7 @@ prefix_array (dirname, array, n)
|
||||
new[dirlen] = DIRSEP_CHAR;
|
||||
memcpy (&new[dirlen + 1], array[i], eltlen);
|
||||
#endif
|
||||
free ((__ptr_t) array[i]);
|
||||
free (array[i]);
|
||||
array[i] = new;
|
||||
}
|
||||
|
||||
@@ -1174,15 +1068,13 @@ prefix_array (dirname, array, n)
|
||||
|
||||
|
||||
/* We must not compile this function twice. */
|
||||
#if !defined _LIBC || !defined NO_GLOB_PATTERN_P
|
||||
#if !defined NO_GLOB_PATTERN_P
|
||||
/* Return nonzero if PATTERN contains any metacharacters.
|
||||
Metacharacters can be quoted with backslashes if QUOTE is nonzero. */
|
||||
int
|
||||
__glob_pattern_p (pattern, quote)
|
||||
const char *pattern;
|
||||
int quote;
|
||||
__glob_pattern_p (const char *pattern, int quote)
|
||||
{
|
||||
register const char *p;
|
||||
const char *p;
|
||||
int open = 0;
|
||||
|
||||
for (p = pattern; *p != '\0'; ++p)
|
||||
@@ -1209,9 +1101,6 @@ __glob_pattern_p (pattern, quote)
|
||||
|
||||
return 0;
|
||||
}
|
||||
# ifdef _LIBC
|
||||
weak_alias (__glob_pattern_p, glob_pattern_p)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
||||
@@ -1220,14 +1109,10 @@ weak_alias (__glob_pattern_p, glob_pattern_p)
|
||||
The GLOB_NOSORT bit in FLAGS is ignored. No sorting is ever done.
|
||||
The GLOB_APPEND flag is assumed to be set (always appends). */
|
||||
static int
|
||||
glob_in_dir (pattern, directory, flags, errfunc, pglob)
|
||||
const char *pattern;
|
||||
const char *directory;
|
||||
int flags;
|
||||
int (*errfunc) __P ((const char *, int));
|
||||
glob_t *pglob;
|
||||
glob_in_dir (const char *pattern, const char *directory, int flags,
|
||||
int (*errfunc) (const char *, int), glob_t *pglob)
|
||||
{
|
||||
__ptr_t stream = NULL;
|
||||
void *stream = NULL;
|
||||
|
||||
struct globlink
|
||||
{
|
||||
@@ -1271,7 +1156,7 @@ glob_in_dir (pattern, directory, flags, errfunc, pglob)
|
||||
# endif
|
||||
if (((flags & GLOB_ALTDIRFUNC)
|
||||
? (*pglob->gl_stat) (fullname, &st)
|
||||
: __stat (fullname, &st)) == 0)
|
||||
: stat (fullname, &st)) == 0)
|
||||
/* We found this file to be existing. Now tell the rest
|
||||
of the function to copy this name into the result. */
|
||||
flags |= GLOB_NOCHECK;
|
||||
@@ -1298,7 +1183,7 @@ glob_in_dir (pattern, directory, flags, errfunc, pglob)
|
||||
{
|
||||
stream = ((flags & GLOB_ALTDIRFUNC)
|
||||
? (*pglob->gl_opendir) (directory)
|
||||
: (__ptr_t) opendir (directory));
|
||||
: (void *) opendir (directory));
|
||||
if (stream == NULL)
|
||||
{
|
||||
if (errno != ENOTDIR
|
||||
@@ -1350,10 +1235,9 @@ glob_in_dir (pattern, directory, flags, errfunc, pglob)
|
||||
if (new->name == NULL)
|
||||
goto memory_error;
|
||||
#ifdef HAVE_MEMPCPY
|
||||
*((char *) mempcpy ((__ptr_t) new->name, name, len))
|
||||
= '\0';
|
||||
*((char *) mempcpy (new->name, name, len)) = '\0';
|
||||
#else
|
||||
memcpy ((__ptr_t) new->name, name, len);
|
||||
memcpy (new->name, name, len);
|
||||
new->name[len] = '\0';
|
||||
#endif
|
||||
new->next = names;
|
||||
@@ -1428,7 +1312,7 @@ glob_in_dir (pattern, directory, flags, errfunc, pglob)
|
||||
while (names != NULL)
|
||||
{
|
||||
if (names->name != NULL)
|
||||
free ((__ptr_t) names->name);
|
||||
free (names->name);
|
||||
names = names->next;
|
||||
}
|
||||
return GLOB_NOSPACE;
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Copyright (C) 1991, 1992, 1995, 1996, 1997, 1998 Free Software Foundation,
|
||||
Inc.
|
||||
/* Copyright (C) 1991, 1992, 1995, 1996, 1997, 1998, 2023 Free Software
|
||||
Foundation, Inc.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
@@ -19,60 +19,12 @@ USA. */
|
||||
#ifndef _GLOB_H
|
||||
#define _GLOB_H 1
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#undef __ptr_t
|
||||
#if defined __cplusplus || (defined __STDC__ && __STDC__) || defined WINDOWS32
|
||||
# if !defined __GLIBC__
|
||||
# undef __P
|
||||
# undef __PMT
|
||||
# define __P(protos) protos
|
||||
# define __PMT(protos) protos
|
||||
# if !defined __GNUC__ || __GNUC__ < 2
|
||||
# undef __const
|
||||
# define __const const
|
||||
# endif
|
||||
# endif
|
||||
# define __ptr_t void *
|
||||
#else /* Not C++ or ANSI C. */
|
||||
# undef __P
|
||||
# undef __PMT
|
||||
# define __P(protos) ()
|
||||
# define __PMT(protos) ()
|
||||
# undef __const
|
||||
# define __const
|
||||
# define __ptr_t char *
|
||||
#endif /* C++ or ANSI C. */
|
||||
|
||||
/* We need `size_t' for the following definitions. */
|
||||
#ifndef __size_t
|
||||
# if defined __FreeBSD__
|
||||
# define __size_t size_t
|
||||
# else
|
||||
# if defined __GNUC__ && __GNUC__ >= 2
|
||||
typedef __SIZE_TYPE__ __size_t;
|
||||
# else
|
||||
/* This is a guess. */
|
||||
/*hb
|
||||
* Conflicts with DECCs already defined type __size_t.
|
||||
* Defining an own type with a name beginning with '__' is no good.
|
||||
* Anyway if DECC is used and __SIZE_T is defined then __size_t is
|
||||
* already defined (and I hope it's exactly the one we need here).
|
||||
*/
|
||||
# if !(defined __DECC && defined __SIZE_T)
|
||||
typedef unsigned long int __size_t;
|
||||
# endif
|
||||
# endif
|
||||
# endif
|
||||
#else
|
||||
/* The GNU CC stddef.h version defines __size_t as empty. We need a real
|
||||
definition. */
|
||||
# undef __size_t
|
||||
# define __size_t size_t
|
||||
#endif
|
||||
|
||||
/* Bits set in the FLAGS argument to `glob'. */
|
||||
#define GLOB_ERR (1 << 0)/* Return on read errors. */
|
||||
#define GLOB_MARK (1 << 1)/* Append a slash to each name. */
|
||||
@@ -120,21 +72,21 @@ struct stat;
|
||||
#endif
|
||||
typedef struct
|
||||
{
|
||||
__size_t gl_pathc; /* Count of paths matched by the pattern. */
|
||||
size_t gl_pathc; /* Count of paths matched by the pattern. */
|
||||
char **gl_pathv; /* List of matched pathnames. */
|
||||
__size_t gl_offs; /* Slots to reserve in `gl_pathv'. */
|
||||
size_t gl_offs; /* Slots to reserve in `gl_pathv'. */
|
||||
int gl_flags; /* Set to FLAGS, maybe | GLOB_MAGCHAR. */
|
||||
|
||||
/* If the GLOB_ALTDIRFUNC flag is set, the following functions
|
||||
are used instead of the normal file access functions. */
|
||||
void (*gl_closedir) __PMT ((void *));
|
||||
struct dirent *(*gl_readdir) __PMT ((void *));
|
||||
__ptr_t (*gl_opendir) __PMT ((__const char *));
|
||||
int (*gl_lstat) __PMT ((__const char *, struct stat *));
|
||||
void (*gl_closedir) (void *);
|
||||
struct dirent *(*gl_readdir) (void *);
|
||||
void * (*gl_opendir) (const char *);
|
||||
int (*gl_lstat) (const char *, struct stat *);
|
||||
#if defined(VMS) && defined(__DECC) && !defined(_POSIX_C_SOURCE)
|
||||
int (*gl_stat) __PMT ((__const char *, struct stat *, ...));
|
||||
int (*gl_stat) (const char *, struct stat *, ...);
|
||||
#else
|
||||
int (*gl_stat) __PMT ((__const char *, struct stat *));
|
||||
int (*gl_stat) (const char *, struct stat *);
|
||||
#endif
|
||||
} glob_t;
|
||||
|
||||
@@ -142,18 +94,18 @@ typedef struct
|
||||
struct stat64;
|
||||
typedef struct
|
||||
{
|
||||
__size_t gl_pathc;
|
||||
size_t gl_pathc;
|
||||
char **gl_pathv;
|
||||
__size_t gl_offs;
|
||||
size_t gl_offs;
|
||||
int gl_flags;
|
||||
|
||||
/* If the GLOB_ALTDIRFUNC flag is set, the following functions
|
||||
are used instead of the normal file access functions. */
|
||||
void (*gl_closedir) __PMT ((void *));
|
||||
struct dirent64 *(*gl_readdir) __PMT ((void *));
|
||||
__ptr_t (*gl_opendir) __PMT ((__const char *));
|
||||
int (*gl_lstat) __PMT ((__const char *, struct stat64 *));
|
||||
int (*gl_stat) __PMT ((__const char *, struct stat64 *));
|
||||
void (*gl_closedir) (void *);
|
||||
struct dirent64 *(*gl_readdir) (void *);
|
||||
void * (*gl_opendir) (const char *);
|
||||
int (*gl_lstat) (const char *, struct stat64 *);
|
||||
int (*gl_stat) (const char *, struct stat64 *);
|
||||
} glob64_t;
|
||||
#endif
|
||||
|
||||
@@ -162,11 +114,11 @@ typedef struct
|
||||
# define globfree globfree64
|
||||
#else
|
||||
# ifdef _LARGEFILE64_SOURCE
|
||||
extern int glob64 __P ((__const char *__pattern, int __flags,
|
||||
int (*__errfunc) (__const char *, int),
|
||||
glob64_t *__pglob));
|
||||
extern int glob64 (const char *pattern, int flags,
|
||||
int (*errfunc) (const char *, int),
|
||||
glob64_t *pglob);
|
||||
|
||||
extern void globfree64 __P ((glob64_t *__pglob));
|
||||
extern void globfree64 (glob64_t *pglob);
|
||||
# endif
|
||||
#endif
|
||||
|
||||
@@ -179,18 +131,18 @@ extern void globfree64 __P ((glob64_t *__pglob));
|
||||
If memory cannot be allocated for PGLOB, GLOB_NOSPACE is returned.
|
||||
Otherwise, `glob' returns zero. */
|
||||
#if _FILE_OFFSET_BITS != 64 || __GNUC__ < 2
|
||||
extern int glob __P ((__const char *__pattern, int __flags,
|
||||
int (*__errfunc) (__const char *, int),
|
||||
glob_t *__pglob));
|
||||
extern int glob (const char *pattern, int flags,
|
||||
int (*errfunc) (const char *, int),
|
||||
glob_t *pglob);
|
||||
|
||||
/* Free storage allocated in PGLOB by a previous `glob' call. */
|
||||
extern void globfree __P ((glob_t *__pglob));
|
||||
extern void globfree (glob_t *pglob);
|
||||
#else
|
||||
extern int glob __P ((__const char *__pattern, int __flags,
|
||||
int (*__errfunc) (__const char *, int),
|
||||
glob_t *__pglob)) __asm__ ("glob64");
|
||||
extern int glob (const char *pattern, int flags,
|
||||
int (*errfunc) (const char *, int),
|
||||
glob_t *pglob) __asm__ ("glob64");
|
||||
|
||||
extern void globfree __P ((glob_t *__pglob)) __asm__ ("globfree64");
|
||||
extern void globfree (glob_t *pglob) __asm__ ("globfree64");
|
||||
#endif
|
||||
|
||||
|
||||
@@ -200,7 +152,7 @@ extern void globfree __P ((glob_t *__pglob)) __asm__ ("globfree64");
|
||||
|
||||
This function is not part of the interface specified by POSIX.2
|
||||
but several programs want to use it. */
|
||||
extern int glob_pattern_p __P ((__const char *__pattern, int __quote));
|
||||
extern int glob_pattern_p (const char *pattern, int quote);
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
@@ -1,7 +1,7 @@
|
||||
dnl acinclude.m4 -- Extra macros needed for GNU make.
|
||||
dnl acinclude.m4 -- Extra macros needed for GNU Make.
|
||||
dnl
|
||||
dnl Automake will incorporate this into its generated aclocal.m4.
|
||||
dnl Copyright (C) 1998-2020 Free Software Foundation, Inc.
|
||||
dnl Copyright (C) 1998-2023 Free Software Foundation, Inc.
|
||||
dnl This file is part of GNU Make.
|
||||
dnl
|
||||
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
|
||||
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 Got this from the lynx 2.8 distribution.
|
||||
@@ -43,8 +43,8 @@ AC_MSG_RESULT(working...)
|
||||
cf_cv_netlibs=""
|
||||
cf_test_netlibs=yes
|
||||
AC_CHECK_FUNCS(gethostname,,[
|
||||
CF_RECHECK_FUNC(gethostname,nsl,cf_cv_netlibs,[
|
||||
CF_RECHECK_FUNC(gethostname,socket,cf_cv_netlibs)])])
|
||||
CF_RECHECK_FUNC(gethostname,nsl,cf_cv_netlibs,[
|
||||
CF_RECHECK_FUNC(gethostname,socket,cf_cv_netlibs)])])
|
||||
#
|
||||
# FIXME: sequent needs this library (i.e., -lsocket -linet -lnsl), but
|
||||
# I don't know the entrypoints - 97/7/22 TD
|
||||
@@ -52,12 +52,12 @@ AC_CHECK_LIB(inet,main,cf_cv_netlibs="-linet $cf_cv_netlibs")
|
||||
#
|
||||
if test "$ac_cv_func_lsocket" != no ; then
|
||||
AC_CHECK_FUNCS(socket,,[
|
||||
CF_RECHECK_FUNC(socket,socket,cf_cv_netlibs,[
|
||||
CF_RECHECK_FUNC(socket,bsd,cf_cv_netlibs)])])
|
||||
CF_RECHECK_FUNC(socket,socket,cf_cv_netlibs,[
|
||||
CF_RECHECK_FUNC(socket,bsd,cf_cv_netlibs)])])
|
||||
fi
|
||||
#
|
||||
AC_CHECK_FUNCS(gethostbyname,,[
|
||||
CF_RECHECK_FUNC(gethostbyname,nsl,cf_cv_netlibs)])
|
||||
CF_RECHECK_FUNC(gethostbyname,nsl,cf_cv_netlibs)])
|
||||
])
|
||||
LIBS="$LIBS $cf_cv_netlibs"
|
||||
test $cf_test_netlibs = no && echo "$cf_cv_netlibs" >&AC_FD_MSG
|
||||
@@ -77,14 +77,14 @@ dnl used (autoconf does not distinguish between a null token and one that is
|
||||
dnl set to 'no').
|
||||
AC_DEFUN([CF_RECHECK_FUNC],[
|
||||
AC_CHECK_LIB($2,$1,[
|
||||
CF_UPPER(cf_tr_func,$1)
|
||||
AC_DEFINE_UNQUOTED(HAVE_$cf_tr_func,1,[Define if you have function $1])
|
||||
ac_cv_func_$1=yes
|
||||
$3="-l$2 [$]$3"],[
|
||||
ac_cv_func_$1=unknown
|
||||
unset ac_cv_func_$1 2>/dev/null
|
||||
$4],
|
||||
[[$]$3])
|
||||
CF_UPPER(cf_tr_func,$1)
|
||||
AC_DEFINE_UNQUOTED(HAVE_$cf_tr_func,1,[Define if you have function $1])
|
||||
ac_cv_func_$1=yes
|
||||
$3="-l$2 [$]$3"],[
|
||||
ac_cv_func_$1=unknown
|
||||
unset ac_cv_func_$1 2>/dev/null
|
||||
$4],
|
||||
[[$]$3])
|
||||
])dnl
|
||||
dnl ---------------------------------------------------------------------------
|
||||
dnl Make an uppercase version of a variable
|
||||
@@ -118,7 +118,7 @@ AC_DEFUN([AC_STRUCT_ST_MTIM_NSEC],
|
||||
CPPFLAGS="$ac_save_CPPFLAGS -DST_MTIM_NSEC=$ac_val"
|
||||
AC_TRY_COMPILE([#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
], [struct stat s; s.ST_MTIM_NSEC;],
|
||||
], [struct stat s; s.ST_MTIM_NSEC;],
|
||||
[ac_cv_struct_st_mtim_nsec=$ac_val; break])
|
||||
done
|
||||
CPPFLAGS="$ac_save_CPPFLAGS"
|
||||
@@ -126,7 +126,7 @@ AC_DEFUN([AC_STRUCT_ST_MTIM_NSEC],
|
||||
|
||||
if test $ac_cv_struct_st_mtim_nsec != no; then
|
||||
AC_DEFINE_UNQUOTED([ST_MTIM_NSEC], [$ac_cv_struct_st_mtim_nsec],
|
||||
[Define if struct stat contains a nanoseconds field])
|
||||
[Define if struct stat contains a nanoseconds field])
|
||||
fi
|
||||
]
|
||||
)
|
||||
@@ -1,7 +1,7 @@
|
||||
# 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.
|
||||
#
|
||||
# Copyright (C) 1993-2020 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1993-2023 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
|
||||
@@ -15,7 +15,7 @@
|
||||
# details.
|
||||
#
|
||||
# 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_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-2023 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
|
||||
@@ -1,7 +1,12 @@
|
||||
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.
|
||||
|
||||
Files:
|
||||
lib/fnmatch.c
|
||||
lib/fnmatch.in.h
|
||||
lib/glob.c
|
||||
lib/glob.in.h
|
||||
|
||||
configure.ac:
|
||||
# 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"
|
||||
AC_SUBST([USE_SYSTEM_GLOB])
|
||||
|
||||
|
||||
Makefile.am:
|
||||
if !USE_SYSTEM_GLOB
|
||||
libgnu_a_SOURCES += fnmatch.c
|
||||
@@ -60,7 +64,6 @@ endif
|
||||
|
||||
EXTRA_DIST += fnmatch.in.h glob.in.h
|
||||
|
||||
|
||||
Include:
|
||||
<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
|
||||
|
||||
264
maintMakefile
264
maintMakefile
@@ -1,5 +1,5 @@
|
||||
# Maintainer-only makefile segment. This contains things that are relevant
|
||||
# only if you have the full copy of the GNU make sources from the Git
|
||||
# only if you have the full copy of the GNU Make sources from the Git
|
||||
# tree, not a dist copy.
|
||||
|
||||
# --------------------- #
|
||||
@@ -17,13 +17,10 @@ GPG_KEYID := 80CB727A20C79BB2
|
||||
# SRCROOTDIR is just a handy location to keep source files in
|
||||
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
|
||||
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
|
||||
|
||||
# Enable Perl warnings for the test suite
|
||||
@@ -46,31 +43,28 @@ GUILE_CFLAGS := $(patsubst -I%,-isystem %,$(GUILE_CFLAGS))
|
||||
MAKE_MAINTAINER_MODE := -DMAKE_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!
|
||||
%.i : %.c
|
||||
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) -E -dD -o $@ $<
|
||||
|
||||
# General rule for turning a .template into a regular file.
|
||||
#
|
||||
$(TEMPLATES) : % : %.template Makefile
|
||||
rm -f $@
|
||||
sed -e 's@%VERSION%@$(VERSION)@g' \
|
||||
-e 's@%PACKAGE%@$(PACKAGE)@g' \
|
||||
$< > $@
|
||||
chmod a-w $@
|
||||
# Create the mkconfig.h file for non-POSIX config headers
|
||||
|
||||
all: src/mkconfig.h
|
||||
src/mkconfig.h: src/mkconfig.h.in config.status
|
||||
./config.status --header=$@
|
||||
|
||||
# Build the README
|
||||
|
||||
all: README
|
||||
README : README.in config.status
|
||||
./config.status --file=$@
|
||||
|
||||
# Construct Makefiles by adding on dependencies, etc.
|
||||
#
|
||||
cvt = $(patsubst $1/%,$$($1)%,$(filter %.c,$2))
|
||||
Basic.mk: Basic.mk.template .dep_segment Makefile
|
||||
rm -f $@
|
||||
sed -e 's@%VERSION%@$(VERSION)@g' \
|
||||
-e 's@%make_SOURCES%@$(call cvt,src,$(make_SRCS))@g' \
|
||||
sed -e 's@%make_SOURCES%@$(call cvt,src,$(make_SRCS))@g' \
|
||||
-e 's@%w32_SOURCES%@$(call cvt,src,$(w32_SRCS))@g' \
|
||||
-e 's@%vms_SOURCES%@$(call cvt,src,$(vms_SRCS))@g' \
|
||||
-e 's@%amiga_SOURCES%@$(call cvt,src,$(amiga_SRCS))@g' \
|
||||
@@ -79,12 +73,12 @@ Basic.mk: Basic.mk.template .dep_segment Makefile
|
||||
-e 's@%glob_SOURCES%@$(call cvt,lib,$(glob_SRCS))@g' \
|
||||
$< > $@
|
||||
echo >>$@; echo '# --------------- DEPENDENCIES' >>$@; echo '#' >>$@; \
|
||||
echo >>$@; echo '$$(OBJECTS): $$(SRCDIR)/src/mkconfig.h' >>$@; \
|
||||
sed -e 's@^\([^ ]*\)\.o:@$$(OUTDIR)\1.$$(OBJEXT):@' \
|
||||
-e 's@\([^ ]*\.[ch]\)@$$(SRCDIR)/\1@g' \
|
||||
-e 's@$$(SRCDIR)/src/config.h@$$(OUTDIR)src/config.h@g' \
|
||||
-e 's@$$(SRCDIR)/lib/stdlib.h@@g' \
|
||||
-e 's@$$(SRCDIR)/lib/sys/types.h@@g' \
|
||||
-e 's@$$(SRCDIR)/lib/unistd.h@@g' \
|
||||
-e 's@$$(SRCDIR)/lib/alloca.h@@g' \
|
||||
-e 's@$$(SRCDIR)/lib/stdbool.h@@g' \
|
||||
$(word 2,$^) >>$@
|
||||
chmod a-w $@
|
||||
|
||||
@@ -119,13 +113,16 @@ GIT := git
|
||||
git-clean:
|
||||
-$(GIT) clean -fdX
|
||||
git-very-clean: git-clean
|
||||
-$(GIT) clean -fd
|
||||
-$(GIT) clean -fdx
|
||||
|
||||
|
||||
## ---------------------- ##
|
||||
## Generating ChangeLog. ##
|
||||
## ---------------------- ##
|
||||
|
||||
# Where the gnulib project has been locally cloned
|
||||
GNULIBDIR ?= $(or $(wildcard $(GNULIB_SRCDIR)),./gnulib)
|
||||
|
||||
gl2cl-date := 2013-10-10
|
||||
gl2cl := $(GNULIBDIR)/build-aux/gitlog-to-changelog
|
||||
|
||||
@@ -137,12 +134,13 @@ ChangeLog: .check-git-HEAD
|
||||
echo "WARNING: $(gl2cl) is not available. No $@ generated."; \
|
||||
fi
|
||||
|
||||
.PHONY: .check-git-HEAD
|
||||
.check-git-HEAD:
|
||||
.check-git-HEAD: FORCE
|
||||
sha="`git rev-parse HEAD`"; \
|
||||
[ -f '$@' ] && [ "`cat '$@' 2>/dev/null`" = "$$sha" ] \
|
||||
test -f '$@' && [ "`cat '$@' 2>/dev/null`" = "$$sha" ] \
|
||||
|| echo "$$sha" > '$@'
|
||||
|
||||
.PHONY: FORCE
|
||||
FORCE:;@:
|
||||
|
||||
## ---------------- ##
|
||||
## Updating files. ##
|
||||
@@ -168,16 +166,15 @@ update: po-check
|
||||
|
||||
# PO archive mirrors --- Be careful; some might not be fully populated!
|
||||
# ftp://ftp.unex.es/pub/gnu-i18n/po/maint/
|
||||
# http://translation.sf.net/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_sync = translationproject.org::tp/latest/$(PACKAGE)/
|
||||
|
||||
.PHONY: do-po-update po-update
|
||||
do-po-update:
|
||||
tmppo="/tmp/po-$(PACKAGE)-$(VERSION).$$$$" \
|
||||
tmppo="/tmp/po-$(PACKAGE)-$(PACKAGE_VERSION).$$$$" \
|
||||
&& rm -rf "$$tmppo" \
|
||||
&& mkdir "$$tmppo" \
|
||||
&& $(RSYNC) $(po_sync) "$$tmppo" \
|
||||
@@ -187,7 +184,7 @@ do-po-update:
|
||||
$(MAKE) po-check
|
||||
|
||||
po-update:
|
||||
[ -d "po" ] && $(MAKE) do-po-update
|
||||
test -d "po" && $(MAKE) do-po-update
|
||||
|
||||
# -------------------------- #
|
||||
# Updating GNU build files. #
|
||||
@@ -210,63 +207,128 @@ target = $(patsubst get-%,%,$@)
|
||||
|
||||
config-url = $(git-url)/config.git/plain/$(patsubst get-build-aux/%,%,$@)
|
||||
get-build-aux/config.guess get-build-aux/config.sub:
|
||||
@echo $(WGET) $(config-url) -O $(target) \
|
||||
&& $(WGET) $(config-url) -O $(target).t \
|
||||
@echo Retrieving $(target) from $(config-url)
|
||||
$(WGET) $(config-url) -O $(target).t \
|
||||
&& $(move_if_change)
|
||||
|
||||
gnulib-url = $(git-url)/gnulib.git/plain/build-aux/$(patsubst get-build-aux/%,%,$@)
|
||||
get-build-aux/texinfo.tex:
|
||||
@echo $(WGET) $(gnulib-url) -O $(target) \
|
||||
&& $(WGET) $(gnulib-url) -O $(target).t \
|
||||
@echo Retrieving $(target) from $(gnulib-url)
|
||||
$(WGET) $(gnulib-url) -O $(target).t \
|
||||
&& $(move_if_change)
|
||||
|
||||
gnustandards-url = $(cvs-url)/gnustandards/gnustandards/$(patsubst get-doc/%,%,$@)
|
||||
get-doc/make-stds.texi get-doc/fdl.texi:
|
||||
@echo $(WGET) $(gnustandards-url) -O $(target) \
|
||||
&& $(WGET) $(gnustandards-url) -O $(target).t \
|
||||
@echo Retrieving $(target) from $(gnustandards-url)
|
||||
$(WGET) $(gnustandards-url) -O $(target).t \
|
||||
&& $(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-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
|
||||
|
||||
# Make sure that the files in lib/ have been updated from the files in gl/lib/
|
||||
|
||||
GL_LIB_FILES := $(wildcard gl/lib/*)
|
||||
|
||||
mk-dist:
|
||||
@echo "Checking gl/lib files..."
|
||||
@for fn in $(GL_LIB_FILES); do \
|
||||
cmp $$fn $${fn##gl/} \
|
||||
|| { echo "Run ./bootstrap --gen ?"; exit 1; }; \
|
||||
done; true
|
||||
|
||||
# ---------------------------------- #
|
||||
# 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 := \
|
||||
checkcfg.--disable-job-server \
|
||||
checkcfg.--disable-load \
|
||||
checkcfg.--without-guile \
|
||||
checkcfg.--disable-posix-spawn \
|
||||
checkcfg.make_cv_sys_gnu_glob^no \
|
||||
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.CPPFLAGS^-DNO_OUTPUT_SYNC \
|
||||
checkcfg.CPPFLAGS^-DNO_ARCHIVES
|
||||
checkcfg.strict-c90 \
|
||||
checkcfg.no-jobserver \
|
||||
checkcfg.no-load \
|
||||
checkcfg.no-guile \
|
||||
checkcfg.no-spawn \
|
||||
checkcfg.no-sysglob \
|
||||
checkcfg.no-loadavg \
|
||||
checkcfg.no-sync \
|
||||
checkcfg.no-archives
|
||||
|
||||
.PHONY: check-alt-config
|
||||
check-alt-config: $(CONFIG_CHECKS)
|
||||
@echo --- $@ SUCCESS
|
||||
|
||||
# Trick GNU make so it doesn't run the submake as a recursive make.
|
||||
# Trick GNU Make so it doesn't run the submake as a recursive make.
|
||||
NR_MAKE = $(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
|
||||
@echo "Building $@ (output in checkcfg.$*.log)"
|
||||
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 \
|
||||
&& mkdir $(distdir)/_build \
|
||||
&& cd $(distdir)/_build \
|
||||
&& ../configure --srcdir=.. $(subst ^,=,$(subst +, ,$*)) \
|
||||
$(AM_DISTCHECK_CONFIGURE_FLAGS) $(DISTCHECK_CONFIGURE_FLAGS)
|
||||
exec >>'checkcfg.$*.log' 2>&1; set -x; \
|
||||
cd $(distdir)/_build \
|
||||
&& 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
|
||||
&& ../configure --srcdir=.. $(CFGCHECK_CONFIGFLAGS) \
|
||||
$(AM_DISTCHECK_CONFIGURE_FLAGS) $(DISTCHECK_CONFIGURE_FLAGS)
|
||||
$(build.sh_SCRIPT)
|
||||
$(nrmake_SCRIPT)
|
||||
|
||||
# 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
|
||||
@@ -279,10 +341,10 @@ checkcfg.basicmk: checkcfg.% : distdir
|
||||
&& mkdir $(distdir)/_build \
|
||||
&& cd $(distdir)/_build \
|
||||
&& ../configure --srcdir=.. \
|
||||
$(AM_DISTCHECK_CONFIGURE_FLAGS) $(DISTCHECK_CONFIGURE_FLAGS)
|
||||
$(AM_DISTCHECK_CONFIGURE_FLAGS) $(DISTCHECK_CONFIGURE_FLAGS)
|
||||
exec >>'checkcfg.$*.log' 2>&1; set -x; \
|
||||
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=.. clean
|
||||
exec >>'checkcfg.$*.log' 2>&1; \
|
||||
@@ -290,8 +352,8 @@ checkcfg.basicmk: checkcfg.% : distdir
|
||||
&& rm -rf $(distdir)/_build \
|
||||
&& cd $(distdir) \
|
||||
&& ./configure \
|
||||
$(AM_DISTCHECK_CONFIGURE_FLAGS) $(DISTCHECK_CONFIGURE_FLAGS) \
|
||||
&& $(NR_MAKE) $(AM_MAKEFLAGS) -f Basic.mk CFLAGS='$(AM_CFLAGS)' \
|
||||
$(AM_DISTCHECK_CONFIGURE_FLAGS) $(DISTCHECK_CONFIGURE_FLAGS) \
|
||||
&& $(NR_MAKE) $(AM_MAKEFLAGS) -f Basic.mk '$(CFGCHECK_MAKEFLAGS)' \
|
||||
&& ./make $(AM_MAKEFLAGS) -f Basic.mk check \
|
||||
&& ./make $(AM_MAKEFLAGS) -f Basic.mk clean
|
||||
|
||||
@@ -312,10 +374,10 @@ local-check: po-check changelog-check
|
||||
# copyright-check writable-files
|
||||
|
||||
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 \
|
||||
echo "$(VERSION) not in ChangeLog" 1>&2; \
|
||||
echo "$(PACKAGE_VERSION) not in ChangeLog" 1>&2; \
|
||||
exit 1; \
|
||||
fi
|
||||
|
||||
@@ -342,18 +404,18 @@ makeweb-repo = $(USER)@cvs.sv.gnu.org:/web/make
|
||||
gnuweb-repo = :pserver:anonymous@cvs.sv.gnu.org:/web/www
|
||||
gnuweb-dir = www/server/standards
|
||||
|
||||
# Get the GNU make web page boilerplate etc.
|
||||
# Get the GNU Make web page boilerplate etc.
|
||||
update-makeweb:
|
||||
[ -d '$(MAKEWEBDIR)' ] || mkdir -p '$(MAKEWEBDIR)'
|
||||
[ -d '$(MAKEWEBDIR)'/CVS ] \
|
||||
test -d '$(MAKEWEBDIR)' || mkdir -p '$(MAKEWEBDIR)'
|
||||
test -d '$(MAKEWEBDIR)'/CVS \
|
||||
&& { cd '$(MAKEWEBDIR)' && $(CVS) update; } \
|
||||
|| { mkdir -p '$(dir $(MAKEWEBDIR))' && cd '$(dir $(MAKEWEBDIR))' \
|
||||
&& $(CVS) -d $(makeweb-repo) co -d '$(notdir $(MAKEWEBDIR))' make; }
|
||||
|
||||
# Get the GNU web page boilerplate etc.
|
||||
update-gnuweb:
|
||||
[ -d '$(GNUWEBDIR)' ] || mkdir -p '$(GNUWEBDIR)'
|
||||
[ -d '$(GNUWEBDIR)/$(gnuweb-dir)'/CVS ] \
|
||||
test -d '$(GNUWEBDIR)' || mkdir -p '$(GNUWEBDIR)'
|
||||
test -d '$(GNUWEBDIR)/$(gnuweb-dir)'/CVS \
|
||||
&& { cd '$(GNUWEBDIR)/$(gnuweb-dir)' && $(CVS) update; } \
|
||||
|| { cd '$(GNUWEBDIR)' && $(CVS) -d $(gnuweb-repo) co '$(gnuweb-dir)'; }
|
||||
|
||||
@@ -362,7 +424,7 @@ gendocs: update-gnuweb update-makeweb
|
||||
cd doc \
|
||||
&& rm -rf doc/manual \
|
||||
&& $(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 '{}' \; \)
|
||||
cp -r doc/manual '$(MAKEWEBDIR)'
|
||||
@echo 'Status of $(MAKEWEBDIR) repo:' && cd '$(MAKEWEBDIR)' \
|
||||
@@ -370,7 +432,7 @@ gendocs: update-gnuweb update-makeweb
|
||||
@echo '- cvs add <new files>' \
|
||||
&& echo '- cvs remove <deleted files>' \
|
||||
&& echo '- cvs commit' \
|
||||
&& echo '- cvs tag make-$(subst .,-,$(VERSION))'
|
||||
&& echo '- cvs tag make-$(subst .,-,$(PACKAGE_VERSION))'
|
||||
|
||||
|
||||
## --------------------------------------------- ##
|
||||
@@ -395,7 +457,7 @@ $(COV_BUILD_FILE): $(filter %.c %.h,$(DISTFILES))
|
||||
cd '$(distdir)'/_build \
|
||||
&& ../configure --srcdir=.. \
|
||||
$(AM_DISTCHECK_CONFIGURE_FLAGS) $(DISTCHECK_CONFIGURE_FLAGS) \
|
||||
CFLAGS='$(AM_CFLAGS)'
|
||||
$(CFGCHECK_MAKEFLAGS)
|
||||
PATH="$${COVERITY_PATH:+$$COVERITY_PATH/bin:}$$PATH"; \
|
||||
cd '$(distdir)'/_build \
|
||||
&& cov-build --dir cov-int ../build.sh
|
||||
@@ -405,18 +467,18 @@ $(COV_BUILD_FILE): $(filter %.c %.h,$(DISTFILES))
|
||||
cov-submit: $(COV_BUILD_FILE)-submitted
|
||||
|
||||
$(COV_BUILD_FILE)-submitted: $(COV_BUILD_FILE)
|
||||
@[ -n "$(COVERITY_TOKEN)" ] || { echo 'COVERITY_TOKEN not set'; exit 1; }
|
||||
@[ -n "$(COVERITY_EMAIL)" ] || { echo 'COVERITY_EMAIL not set'; exit 1; }
|
||||
@test -n "$(COVERITY_TOKEN)" || { echo 'COVERITY_TOKEN not set'; exit 1; }
|
||||
@test -n "$(COVERITY_EMAIL)" || { echo 'COVERITY_EMAIL not set'; exit 1; }
|
||||
rm -f '$@'
|
||||
case '$(VERSION)' in \
|
||||
case '$(PACKAGE_VERSION)' in \
|
||||
(*.*.9*) type="daily build"; ext=".$$(date +%Y%m%d)" ;; \
|
||||
(*) type="release"; ext= ;; \
|
||||
esac; \
|
||||
curl --form token='$(COVERITY_TOKEN)' \
|
||||
--form email='$(COVERITY_EMAIL)' \
|
||||
--form file='@$<' \
|
||||
--form version="$(VERSION)$$ext" \
|
||||
--form description="GNU make $$type" \
|
||||
--form version="$(PACKAGE_VERSION)$$ext" \
|
||||
--form description="$(PACKAGE_NAME) $$type" \
|
||||
'https://scan.coverity.com/builds?project=gmake'
|
||||
cp '$<' '$@'
|
||||
|
||||
@@ -427,11 +489,11 @@ $(COV_BUILD_FILE)-submitted: $(COV_BUILD_FILE)
|
||||
|
||||
.PHONY: tag-release
|
||||
tag-release:
|
||||
case '$(VERSION)' in \
|
||||
case '$(PACKAGE_VERSION)' in \
|
||||
(*.*.9*) message=" candidate" ;; \
|
||||
(*) message= ;; \
|
||||
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)'
|
||||
|
||||
|
||||
## ------------------------- ##
|
||||
@@ -442,48 +504,18 @@ tag-release:
|
||||
# Sign it with my key. If you don't have my key/passphrase then sorry,
|
||||
# you're SOL! :)
|
||||
|
||||
GPG = gpg
|
||||
GPGFLAGS = -u $(GPG_KEYID)
|
||||
|
||||
DIST_ARCHIVES_SIG = $(addsuffix .sig,$(DIST_ARCHIVES))
|
||||
DIST_ARCHIVES_DIRECTIVE = $(addsuffix .directive.asc,$(DIST_ARCHIVES))
|
||||
|
||||
# A simple rule to test signing, etc.
|
||||
.PHONY: distsign
|
||||
distsign: $(DIST_ARCHIVES_SIG) $(DIST_ARCHIVES_DIRECTIVE)
|
||||
|
||||
%.sig : %
|
||||
@echo "Signing file '$<':"
|
||||
$(GPG) $(GPGFLAGS) -o "$@" -b "$<"
|
||||
|
||||
%.directive.asc: %
|
||||
@echo "Creating signed directive file '$@':"
|
||||
@( \
|
||||
echo 'version: 1.2'; \
|
||||
echo 'directory: make'; \
|
||||
echo 'filename: $*'; \
|
||||
echo 'comment: Official upload of GNU make version $(VERSION)'; \
|
||||
) > "$*.directive"
|
||||
$(GPG) $(GPGFLAGS) -o "$@" --clearsign "$*.directive"
|
||||
@rm -f "$*.directive"
|
||||
|
||||
# Upload the artifacts
|
||||
|
||||
FTPPUT = ncftpput
|
||||
gnu-upload-host = ftp-upload.gnu.org
|
||||
gnu-upload-dir = /incoming
|
||||
|
||||
GNUPLOAD := $(GNULIBDIR)/build-aux/gnupload
|
||||
|
||||
UPLOADS = upload-alpha upload-ftp
|
||||
.PHONY: $(UPLOADS)
|
||||
$(UPLOADS): $(DIST_ARCHIVES) $(DIST_ARCHIVES_SIG) $(DIST_ARCHIVES_DIRECTIVE)
|
||||
$(FTPPUT) "$(gnu-upload-host)" "$(gnu-upload-dir)/$(@:upload-%=%)" $^
|
||||
$(UPLOADS): upload-%: $(DIST_ARCHIVES)
|
||||
$(GNUPLOAD) --user "$(GPG_KEYID)" --to "$*.gnu.org:make" -- $^
|
||||
|
||||
|
||||
# Rebuild Makefile.in if this file is modifed.
|
||||
# Rebuild Makefile.in if this file is modified.
|
||||
Makefile.in: maintMakefile
|
||||
|
||||
# Copyright (C) 1997-2020 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1997-2023 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
|
||||
@@ -497,4 +529,4 @@ Makefile.in: maintMakefile
|
||||
# details.
|
||||
#
|
||||
# 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
|
||||
_TYPES = {}
|
||||
|
||||
|
||||
def getType(tname):
|
||||
"""Given a type name return a GDB type."""
|
||||
global _TYPES
|
||||
if tname not in _TYPES:
|
||||
tn = tname.rstrip('*')
|
||||
@@ -18,48 +22,129 @@ def getType(tname):
|
||||
_TYPES[tn] = _TYPES[t].pointer()
|
||||
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:
|
||||
A char** where the last one is NULL (e.g., argv)
|
||||
"""
|
||||
|
||||
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()
|
||||
|
||||
|
||||
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):
|
||||
"""Print a file location"""
|
||||
"""Print a file location."""
|
||||
|
||||
def __init__(self, val):
|
||||
"""Create a FileLocation object."""
|
||||
self.val = val
|
||||
|
||||
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 ''
|
||||
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):
|
||||
"""Print a struct variable"""
|
||||
"""Print a struct variable."""
|
||||
|
||||
def __init__(self, val):
|
||||
"""Create a VariablePrinter object."""
|
||||
self.val = val
|
||||
|
||||
def to_string(self):
|
||||
"""Convert a VariablePrinter object into a string."""
|
||||
if self.val['append']:
|
||||
a = '+='
|
||||
elif self.val['conditional']:
|
||||
@@ -80,48 +165,58 @@ class VariablePrinter(object):
|
||||
self.val['fileinfo'], ','.join(flags),
|
||||
self.val['name'].string(), a, self.val['value'].string())
|
||||
|
||||
|
||||
class HashTablePrinter(object):
|
||||
"""Manage a hash table."""
|
||||
"""Pretty-print a hash table."""
|
||||
|
||||
DELITEM = None
|
||||
|
||||
def __init__(self, val):
|
||||
"""Create a HashTablePrinter object."""
|
||||
self.val = val
|
||||
|
||||
def to_string(self):
|
||||
"""Convert a HashTable into a string."""
|
||||
return "size=%d, capacity=%d, empty=%d, collisions=%d, rehashes=%d" % (
|
||||
self.val['ht_size'], self.val['ht_capacity'],
|
||||
self.val['ht_empty_slots'], self.val['ht_collisions'],
|
||||
self.val['ht_rehashes'])
|
||||
|
||||
def children(self):
|
||||
"""Yield each ID and value."""
|
||||
for (i, v) in self.iterator():
|
||||
nm = '[%d] ' % i
|
||||
yield (nm, i)
|
||||
yield (nm, v)
|
||||
|
||||
def iterator(self):
|
||||
"""Provide an iterator for HashTable."""
|
||||
if HashTablePrinter.DELITEM is None:
|
||||
HashTablePrinter.DELITEM = gdb.lookup_global_symbol('hash_deleted_item').value()
|
||||
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]
|
||||
if long(v) != 0 and v != HashTablePrinter.DELITEM:
|
||||
if int(v) != 0 and v != HashTablePrinter.DELITEM:
|
||||
yield (i, v)
|
||||
|
||||
def display_hint(self):
|
||||
"""Show the display hint for the pretty-printer."""
|
||||
return 'map'
|
||||
|
||||
|
||||
class VariableSetPrinter(object):
|
||||
"""Print a variable_set"""
|
||||
"""Print a variable_set."""
|
||||
|
||||
def __init__(self, val):
|
||||
"""Create a variable_set pretty-printer."""
|
||||
self.tbl = HashTablePrinter(val['table'])
|
||||
|
||||
def to_string(self):
|
||||
"""Convert a variable_set to string."""
|
||||
return self.tbl.to_string()
|
||||
|
||||
def children(self):
|
||||
"""Iterate through variables and values."""
|
||||
for (i, v) in self.tbl.iterator():
|
||||
ptr = v.cast(getType('struct variable*'))
|
||||
nm = '[%d] ' % (i)
|
||||
@@ -129,29 +224,35 @@ class VariableSetPrinter(object):
|
||||
yield (nm, str(ptr.dereference()))
|
||||
|
||||
def display_hint(self):
|
||||
"""Show the display hint for the pretty-printer."""
|
||||
return 'map'
|
||||
|
||||
|
||||
class VariableSetListPrinter(object):
|
||||
"""Print a variable_set_list"""
|
||||
"""Print a variable_set_list."""
|
||||
|
||||
GLOBALSET = None
|
||||
|
||||
def __init__(self, val):
|
||||
"""Create a variable_set_list pretty-printer."""
|
||||
self.val = val
|
||||
|
||||
def to_string(self):
|
||||
"""Convert a variable_set_list to string."""
|
||||
return str(self.val.address)
|
||||
|
||||
def children(self):
|
||||
"""Iterate through variables and values."""
|
||||
if VariableSetListPrinter.GLOBALSET is None:
|
||||
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
|
||||
i = 0
|
||||
while long(ptr) != 0:
|
||||
while not isNullptr(ptr):
|
||||
nm = '[%d] ' % (i)
|
||||
yield (nm, ptr['set'])
|
||||
if long(ptr['set']) == long(VariableSetListPrinter.GLOBALSET):
|
||||
if int(ptr['set']) == int(VariableSetListPrinter.GLOBALSET):
|
||||
yield (nm, "global_variable_set")
|
||||
else:
|
||||
yield (nm, str(ptr['set'].dereference()))
|
||||
@@ -159,17 +260,22 @@ class VariableSetListPrinter(object):
|
||||
ptr = ptr['next']
|
||||
|
||||
def display_hint(self):
|
||||
"""Show the display hint for the pretty-printer."""
|
||||
return 'map'
|
||||
|
||||
|
||||
def build_pretty_printer():
|
||||
"""Install all the pretty-printers."""
|
||||
pp = gdb.printing.RegexpCollectionPrettyPrinter("gnumake")
|
||||
pp.add_printer('floc', r'^floc$', FileLocation)
|
||||
pp.add_printer('stringlist', r'^stringlist$', StringListPrinter)
|
||||
pp.add_printer('variable', r'^variable$', VariablePrinter)
|
||||
pp.add_printer('hashtable', r'^hash_table$', HashTablePrinter)
|
||||
pp.add_printer('variableset', r'^variable_set$', VariableSetPrinter)
|
||||
pp.add_printer('variablesetlist', r'^variable_set_list$', VariableSetListPrinter)
|
||||
return pp
|
||||
|
||||
|
||||
# Use replace=True so we can re-source this file
|
||||
gdb.printing.register_pretty_printer(gdb.current_objfile(),
|
||||
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]misc [.src]read [.src]remake [.src]remote-stub " + -
|
||||
"[.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]vms_exit [.src]vms_export_symbol " + -
|
||||
"[.lib]alloca [.lib]fnmatch [.lib]glob [.src]getopt1 [.src]getopt"
|
||||
@@ -154,7 +154,7 @@ $ exit
|
||||
$ endsubroutine : compileit
|
||||
$!
|
||||
$!-----------------------------------------------------------------------------
|
||||
$!Copyright (C) 1996-2020 Free Software Foundation, Inc.
|
||||
$!Copyright (C) 1996-2023 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
|
||||
@@ -168,4 +168,4 @@ $!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 <http://www.gnu.org/licenses/>.
|
||||
$!this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
# GNU -*-Makefile-*- to build GNU make on Amiga
|
||||
# GNU -*-Makefile-*- to build GNU Make on Amiga
|
||||
#
|
||||
# Amiga overrides for use with Basic.mk.
|
||||
#
|
||||
# Copyright (C) 2017-2020 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2017-2023 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
|
||||
@@ -16,7 +16,7 @@
|
||||
# details.
|
||||
#
|
||||
# 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
|
||||
LD = $(CC) Link
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
# GNU -*-Makefile-*- to build GNU make on POSIX systems
|
||||
# GNU -*-Makefile-*- to build GNU Make on POSIX systems
|
||||
#
|
||||
# POSIX overrides for use with Basic.mk.
|
||||
#
|
||||
# Copyright (C) 2017-2020 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2017-2023 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
|
||||
@@ -16,11 +16,11 @@
|
||||
# details.
|
||||
#
|
||||
# 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
|
||||
|
||||
prog_SOURCES += $(posix_SOURCES)
|
||||
prog_SOURCES += $(src)/posixos.c
|
||||
|
||||
extra_CPPFLAGS += @GUILE_CFLAGS@
|
||||
extra_LDFLAGS += @AM_LDFLAGS@
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
# GNU -*-Makefile-*- to build GNU make on VMS
|
||||
# GNU -*-Makefile-*- to build GNU Make on VMS
|
||||
#
|
||||
# VMS overrides for use with Basic.mk.
|
||||
#
|
||||
# Copyright (C) 2017-2020 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2017-2023 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
|
||||
@@ -16,7 +16,7 @@
|
||||
# details.
|
||||
#
|
||||
# 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]
|
||||
lib = [.lib]
|
||||
@@ -93,5 +93,5 @@ define CLEANSPACE
|
||||
endef
|
||||
|
||||
|
||||
$(OUTDIR)$(src)config.h: $(SRCDIR)$(src)config.h.W32
|
||||
$(OUTDIR)$(src)config.h: $(SRCDIR)$(src)config.h-vms
|
||||
$(call CP.cmd,$<,$@)
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
# GNU -*-Makefile-*- to build GNU make on Windows
|
||||
# GNU -*-Makefile-*- to build GNU Make on Windows
|
||||
#
|
||||
# Windows overrides for use with Basic.mk.
|
||||
#
|
||||
# Copyright (C) 2017-2020 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2017-2023 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
|
||||
@@ -16,7 +16,7 @@
|
||||
# details.
|
||||
#
|
||||
# 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 = release
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
# GNU -*-Makefile-*- to build GNU make on MS-DOS with DJGPP
|
||||
# GNU -*-Makefile-*- to build GNU Make on MS-DOS with DJGPP
|
||||
#
|
||||
# MS-DOS overrides for use with Basic.mk.
|
||||
#
|
||||
# Copyright (C) 2017-2020 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2017-2023 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
|
||||
@@ -16,7 +16,7 @@
|
||||
# details.
|
||||
#
|
||||
# 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
|
||||
EXEEXT = .exe
|
||||
|
||||
@@ -19,6 +19,7 @@ nl
|
||||
pl
|
||||
pt
|
||||
pt_BR
|
||||
ro
|
||||
ru
|
||||
sr
|
||||
sv
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# List of source files containing translatable strings.
|
||||
# Copyright (C) 2000-2020 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2000-2023 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
|
||||
@@ -13,7 +13,7 @@
|
||||
# details.
|
||||
#
|
||||
# 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/arscan.c
|
||||
@@ -37,6 +37,7 @@ src/read.c
|
||||
src/remake.c
|
||||
src/remote-cstms.c
|
||||
src/rule.c
|
||||
src/shuffle.c
|
||||
src/signame.c
|
||||
src/strcache.c
|
||||
src/variable.c
|
||||
|
||||
@@ -4,28 +4,27 @@ $!
|
||||
$! This is used for building off the master instead of a release tarball.
|
||||
$!
|
||||
$!
|
||||
$!
|
||||
$! 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. ""
|
||||
$ then
|
||||
$!
|
||||
$! 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. ""
|
||||
$ then
|
||||
$ write sys$output "Could not find config.h-vms*template!"
|
||||
$ write sys$output "Could not find mkconfig.h.in!"
|
||||
$ exit 44
|
||||
$ endif
|
||||
$ endif
|
||||
$ config_template_file = f$parse(config_template,,,"name")
|
||||
$ 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
|
||||
$ac_read_loop:
|
||||
@@ -39,21 +38,26 @@ $ version = f$element (0,"]",version)
|
||||
$ac_read_loop_end:
|
||||
$ close ac_file
|
||||
$!
|
||||
$ if (package .eqs. "") .or. (version .eqs. "")
|
||||
$ if (version .eqs. "")
|
||||
$ then
|
||||
$ write sys$output "Unable to determine package and/or version!"
|
||||
$ write sys$output "Unable to determine version!"
|
||||
$ exit 44
|
||||
$ 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
|
||||
$! maximum token length prior to VMS V8.2:
|
||||
$! %DCL-W-TKNOVF, command element is too long - shorten
|
||||
$ pipe (write sys$output "sub/%PACKAGE%/''package'/WHOLE/NOTYPE" ;-
|
||||
write sys$output "sub/%VERSION%/''version'/WHOLE/NOTYPE" ;-
|
||||
$! PDS: Blown out; someone else will have to figure this out
|
||||
$ 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") |-
|
||||
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,9 +1,9 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Copyright (C) 2014-2020 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2014-2023 Free Software Foundation, Inc.
|
||||
# This file is part of GNU Make.
|
||||
#
|
||||
# Update GNU make copyrights using gnulib update-copyright
|
||||
# Update GNU Make copyrights using gnulib update-copyright
|
||||
|
||||
EXCLUDE='^\(\.[a-z].*\|.*/\.[a-z].*\|.*COPYING\|src/hash\.[ch]\|ChangeLog.*\|.*/ChangeLog.*\|INSTALL\|doc/make\.texi\|bootstrap\)$'
|
||||
|
||||
@@ -17,7 +17,7 @@ getfiles () {
|
||||
|
||||
run () {
|
||||
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
|
||||
|
||||
@@ -30,9 +30,9 @@ run () {
|
||||
|
||||
if $force; then
|
||||
: just do it
|
||||
elif [ ! -f src/makeint.h ]; then
|
||||
die "Run in the root of the GNU make workspace"
|
||||
elif [ -f configure ]; then
|
||||
elif test ! -f src/makeint.h; then
|
||||
die "Run in the root of the GNU Make workspace"
|
||||
elif test -f configure; then
|
||||
die "Run in a clean workspace (git clean -fdX)"
|
||||
fi
|
||||
|
||||
@@ -60,4 +60,4 @@ run "$@"
|
||||
# details.
|
||||
#
|
||||
# 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
|
||||
Copyright (C) 1995-2020 Free Software Foundation, Inc.
|
||||
Copyright (C) 1995-2023 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
|
||||
@@ -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.
|
||||
|
||||
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 "variable.h"
|
||||
@@ -42,7 +42,7 @@ MyExecute (char **argv)
|
||||
buffer = AllocMem (len, MEMF_ANY);
|
||||
|
||||
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;
|
||||
|
||||
@@ -51,9 +51,8 @@ MyExecute (char **argv)
|
||||
if (((*aptr)[0] == ';' && !(*aptr)[1]))
|
||||
{
|
||||
*ptr ++ = '"';
|
||||
strcpy (ptr, *aptr);
|
||||
ptr += strlen (ptr);
|
||||
*ptr ++ = '"';
|
||||
ptr = stpcpy (ptr, *aptr);
|
||||
*(ptr++) = '"';
|
||||
}
|
||||
else if ((*aptr)[0] == '@' && (*aptr)[1] == '@' && !(*aptr)[2])
|
||||
{
|
||||
@@ -61,10 +60,7 @@ MyExecute (char **argv)
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
strcpy (ptr, *aptr);
|
||||
ptr += strlen (ptr);
|
||||
}
|
||||
ptr = stpcpy (ptr, *aptr);
|
||||
*ptr ++ = ' ';
|
||||
*ptr = 0;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Definitions for amiga specific things
|
||||
Copyright (C) 1995-2020 Free Software Foundation, Inc.
|
||||
Copyright (C) 1995-2023 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
|
||||
@@ -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.
|
||||
|
||||
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);
|
||||
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.
|
||||
Copyright (C) 1988-2020 Free Software Foundation, Inc.
|
||||
Copyright (C) 1988-2023 Free Software Foundation, Inc.
|
||||
|
||||
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.
|
||||
|
||||
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"
|
||||
|
||||
@@ -22,6 +22,7 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
#include "filedef.h"
|
||||
#include "dep.h"
|
||||
#include <fnmatch.h>
|
||||
#include <intprops.h>
|
||||
|
||||
/* 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
|
||||
@@ -35,7 +36,7 @@ ar_name (const char *name)
|
||||
const char *p = strchr (name, '(');
|
||||
const char *end;
|
||||
|
||||
if (p == 0 || p == name)
|
||||
if (p == NULL || p == name)
|
||||
return 0;
|
||||
|
||||
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);
|
||||
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[strlen (p) - 1] = '\0';
|
||||
*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. */
|
||||
|
||||
/* ARGSUSED */
|
||||
static long int
|
||||
static intmax_t
|
||||
ar_member_date_1 (int desc UNUSED, const char *mem, int truncated,
|
||||
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,
|
||||
const void *name)
|
||||
{
|
||||
@@ -86,7 +90,7 @@ ar_member_date (const char *name)
|
||||
{
|
||||
char *arname;
|
||||
char *memname;
|
||||
long int val;
|
||||
intmax_t val;
|
||||
|
||||
ar_parse_name (name, &arname, &memname);
|
||||
|
||||
@@ -111,7 +115,7 @@ ar_member_date (const char *name)
|
||||
|
||||
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. */
|
||||
@@ -194,10 +198,10 @@ struct ar_glob_state
|
||||
/* This function is called by 'ar_scan' to match one archive
|
||||
element against the pattern in STATE. */
|
||||
|
||||
static long int
|
||||
static intmax_t
|
||||
ar_glob_match (int desc UNUSED, const char *mem, int truncated 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)
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
||||
return 0L;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Return nonzero if PATTERN contains any metacharacters.
|
||||
|
||||
126
src/arscan.c
126
src/arscan.c
@@ -1,5 +1,5 @@
|
||||
/* Library function for scanning an archive file.
|
||||
Copyright (C) 1987-2020 Free Software Foundation, Inc.
|
||||
Copyright (C) 1987-2023 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
|
||||
@@ -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.
|
||||
|
||||
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"
|
||||
|
||||
@@ -75,9 +75,9 @@ static void *VMS_lib_idx;
|
||||
|
||||
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 */
|
||||
@@ -203,7 +203,7 @@ VMS_get_member_info(struct dsc$descriptor_s *module, unsigned long *rfa)
|
||||
Returns -2 if archive has invalid format.
|
||||
Returns 0 if have scanned successfully. */
|
||||
|
||||
long int
|
||||
intmax_t
|
||||
ar_scan (const char *archive, ar_member_func_t function, const void *varg)
|
||||
{
|
||||
char *vms_archive;
|
||||
@@ -331,7 +331,7 @@ ar_scan (const char *archive, ar_member_func_t function, const void *varg)
|
||||
#endif
|
||||
|
||||
#ifndef WINDOWS32
|
||||
# if !defined (__ANDROID__) && !defined (__BEOS__)
|
||||
# if !defined (__ANDROID__) && !defined (__BEOS__) && !defined(MK_OS_ZOS)
|
||||
# include <ar.h>
|
||||
# else
|
||||
/* These platforms don't have <ar.h> but have archives in the same format
|
||||
@@ -376,8 +376,41 @@ struct ar_hdr
|
||||
# define AR_HDR_SIZE (sizeof (struct ar_hdr))
|
||||
#endif
|
||||
|
||||
#include "intprops.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.
|
||||
|
||||
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 0 if have scanned successfully. */
|
||||
|
||||
long int
|
||||
intmax_t
|
||||
ar_scan (const char *archive, ar_member_func_t function, const void *arg)
|
||||
{
|
||||
#ifdef AIAMAG
|
||||
@@ -416,7 +449,7 @@ ar_scan (const char *archive, ar_member_func_t function, const void *arg)
|
||||
# endif
|
||||
#endif
|
||||
char *namemap = 0;
|
||||
int namemap_size = 0;
|
||||
unsigned int namemap_size = 0;
|
||||
int desc = open (archive, O_RDONLY, 0);
|
||||
if (desc < 0)
|
||||
return -1;
|
||||
@@ -516,7 +549,7 @@ ar_scan (const char *archive, ar_member_func_t function, const void *arg)
|
||||
|
||||
while (1)
|
||||
{
|
||||
int nread;
|
||||
ssize_t nread;
|
||||
struct ar_hdr member_header;
|
||||
#ifdef AIAMAGBIG
|
||||
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
|
||||
char name[ARNAME_MAX + 1];
|
||||
int name_len;
|
||||
long int dateval;
|
||||
intmax_t dateval;
|
||||
int uidval, gidval;
|
||||
long int data_offset;
|
||||
#else
|
||||
@@ -537,9 +570,13 @@ ar_scan (const char *archive, ar_member_func_t function, const void *arg)
|
||||
#endif
|
||||
long int eltsize;
|
||||
unsigned int eltmode;
|
||||
long int fnval;
|
||||
intmax_t eltdate;
|
||||
int eltuid, eltgid;
|
||||
intmax_t fnval;
|
||||
off_t o;
|
||||
|
||||
memset(&member_header, '\0', sizeof (member_header));
|
||||
|
||||
EINTRLOOP (o, lseek (desc, member_offset, 0));
|
||||
if (o < 0)
|
||||
goto invalid;
|
||||
@@ -566,7 +603,7 @@ ar_scan (const char *archive, ar_member_func_t function, const void *arg)
|
||||
|
||||
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_gid, "%12d", &gidval);
|
||||
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';
|
||||
|
||||
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_gid, "%12d", &gidval);
|
||||
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] == '/')
|
||||
&& namemap != 0)
|
||||
{
|
||||
int name_off = atoi (name + 1);
|
||||
int name_len;
|
||||
const char* err;
|
||||
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;
|
||||
|
||||
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[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;
|
||||
|
||||
name = alloca (name_len + 1);
|
||||
nread = readbuf (desc, name, name_len);
|
||||
if (nread != name_len)
|
||||
if (nread < 0 || (unsigned int) nread != name_len)
|
||||
goto invalid;
|
||||
|
||||
name[name_len] = '\0';
|
||||
@@ -703,8 +742,16 @@ ar_scan (const char *archive, ar_member_func_t function, const void *arg)
|
||||
}
|
||||
|
||||
#ifndef M_XENIX
|
||||
sscanf (TOCHAR (member_header.ar_mode), "%8o", &eltmode);
|
||||
eltsize = atol (TOCHAR (member_header.ar_size));
|
||||
#define PARSE_INT(_m, _t, _b, _n) \
|
||||
(_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. */
|
||||
eltmode = (unsigned short int) member_header.ar_mode;
|
||||
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,
|
||||
member_offset + AR_HDR_SIZE, eltsize,
|
||||
#ifndef M_XENIX
|
||||
atol (TOCHAR (member_header.ar_date)),
|
||||
atoi (TOCHAR (member_header.ar_uid)),
|
||||
atoi (TOCHAR (member_header.ar_gid)),
|
||||
eltdate, eltuid, eltgid,
|
||||
#else /* Xenix. */
|
||||
member_header.ar_date,
|
||||
member_header.ar_uid,
|
||||
@@ -856,10 +901,10 @@ ar_name_equal (const char *name, const char *mem, int truncated)
|
||||
|
||||
#ifndef VMS
|
||||
/* ARGSUSED */
|
||||
static long int
|
||||
static intmax_t
|
||||
ar_member_pos (int desc UNUSED, const char *mem, int truncated,
|
||||
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)
|
||||
{
|
||||
if (!ar_name_equal (name, mem, truncated))
|
||||
@@ -877,12 +922,13 @@ ar_member_pos (int desc UNUSED, const char *mem, int truncated,
|
||||
int
|
||||
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;
|
||||
struct ar_hdr ar_hdr;
|
||||
off_t o;
|
||||
int r;
|
||||
unsigned int ui;
|
||||
int datelen;
|
||||
struct stat statbuf;
|
||||
|
||||
if (pos < 0)
|
||||
@@ -890,11 +936,13 @@ ar_member_touch (const char *arname, const char *memname)
|
||||
if (!pos)
|
||||
return 1;
|
||||
|
||||
opos = (off_t) pos;
|
||||
|
||||
EINTRLOOP (fd, open (arname, O_RDWR, 0666));
|
||||
if (fd < 0)
|
||||
return -3;
|
||||
/* Read in this member's header */
|
||||
EINTRLOOP (o, lseek (fd, pos, 0));
|
||||
EINTRLOOP (o, lseek (fd, opos, 0));
|
||||
if (o < 0)
|
||||
goto lose;
|
||||
r = readbuf (fd, &ar_hdr, AR_HDR_SIZE);
|
||||
@@ -906,15 +954,16 @@ ar_member_touch (const char *arname, const char *memname)
|
||||
goto lose;
|
||||
/* Advance member's time to that time */
|
||||
#if defined(ARFMAG) || defined(ARFZMAG) || defined(AIAMAG) || defined(WINDOWS32)
|
||||
for (ui = 0; ui < sizeof ar_hdr.ar_date; ui++)
|
||||
ar_hdr.ar_date[ui] = ' ';
|
||||
sprintf (TOCHAR (ar_hdr.ar_date), "%lu", (long unsigned) statbuf.st_mtime);
|
||||
ar_hdr.ar_date[strlen ((char *) ar_hdr.ar_date)] = ' ';
|
||||
datelen = snprintf (TOCHAR (ar_hdr.ar_date), sizeof ar_hdr.ar_date,
|
||||
"%" PRIdMAX, (intmax_t) statbuf.st_mtime);
|
||||
if (! (0 <= datelen && datelen < (int) sizeof ar_hdr.ar_date))
|
||||
goto lose;
|
||||
memset (ar_hdr.ar_date + datelen, ' ', sizeof ar_hdr.ar_date - datelen);
|
||||
#else
|
||||
ar_hdr.ar_date = statbuf.st_mtime;
|
||||
#endif
|
||||
/* Write back this member's header */
|
||||
EINTRLOOP (o, lseek (fd, pos, 0));
|
||||
EINTRLOOP (o, lseek (fd, opos, 0));
|
||||
if (o < 0)
|
||||
goto lose;
|
||||
r = writebuf (fd, &ar_hdr, AR_HDR_SIZE);
|
||||
@@ -933,18 +982,21 @@ ar_member_touch (const char *arname, const char *memname)
|
||||
|
||||
#ifdef TEST
|
||||
|
||||
long int
|
||||
intmax_t
|
||||
describe_member (int desc, const char *name, int truncated,
|
||||
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)
|
||||
{
|
||||
extern char *ctime ();
|
||||
time_t d = date;
|
||||
char const *ds;
|
||||
|
||||
printf (_("Member '%s'%s: %ld bytes at %ld (%ld).\n"),
|
||||
name, truncated ? _(" (name might be truncated)") : "",
|
||||
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);
|
||||
|
||||
return 0;
|
||||
|
||||
141
src/commands.c
141
src/commands.c
@@ -1,5 +1,5 @@
|
||||
/* Command processing for GNU Make.
|
||||
Copyright (C) 1988-2020 Free Software Foundation, Inc.
|
||||
Copyright (C) 1988-2023 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
|
||||
@@ -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.
|
||||
|
||||
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 "filedef.h"
|
||||
#include "os.h"
|
||||
#include "dep.h"
|
||||
#include "variable.h"
|
||||
#include "job.h"
|
||||
@@ -30,10 +31,6 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
#else
|
||||
# define FILE_LIST_SEPARATOR ' '
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_UNISTD_H
|
||||
pid_t getpid ();
|
||||
#endif
|
||||
|
||||
|
||||
static unsigned long
|
||||
@@ -58,10 +55,13 @@ dep_hash_cmp (const void *x, const void *y)
|
||||
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
|
||||
set_file_variables (struct file *file)
|
||||
set_file_variables (struct file *file, const char *stem)
|
||||
{
|
||||
struct dep *d;
|
||||
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. */
|
||||
if (file->stem == 0)
|
||||
if (stem == 0)
|
||||
{
|
||||
/* In Unix make, $* is set to the target name with
|
||||
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)
|
||||
{
|
||||
size_t slen = strlen (dep_name (d));
|
||||
if (len > slen && strneq (dep_name (d), name + (len - slen), slen))
|
||||
const char *dn = dep_name (d);
|
||||
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;
|
||||
}
|
||||
}
|
||||
if (d == 0)
|
||||
file->stem = "";
|
||||
file->stem = stem = "";
|
||||
}
|
||||
star = file->stem;
|
||||
star = stem;
|
||||
|
||||
/* $< is the first not order-only dependency. */
|
||||
less = "";
|
||||
for (d = file->deps; d != 0; d = d->next)
|
||||
if (!d->ignore_mtime && !d->ignore_automatic_vars)
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -214,8 +214,7 @@ set_file_variables (struct file *file)
|
||||
#endif
|
||||
len = strlen (c);
|
||||
|
||||
memcpy (cp, c, len);
|
||||
cp += len;
|
||||
cp = mempcpy (cp, c, len);
|
||||
*cp++ = FILE_LIST_SEPARATOR;
|
||||
if (! (d->changed || always_make_flag))
|
||||
qmark_len -= len + 1; /* Don't space in $? for this one. */
|
||||
@@ -285,19 +284,16 @@ set_file_variables (struct file *file)
|
||||
|
||||
if (d->ignore_mtime)
|
||||
{
|
||||
memcpy (bp, c, len);
|
||||
bp += len;
|
||||
bp = mempcpy (bp, c, len);
|
||||
*bp++ = FILE_LIST_SEPARATOR;
|
||||
}
|
||||
else
|
||||
{
|
||||
memcpy (cp, c, len);
|
||||
cp += len;
|
||||
cp = mempcpy (cp, c, len);
|
||||
*cp++ = FILE_LIST_SEPARATOR;
|
||||
if (d->changed || always_make_flag)
|
||||
{
|
||||
memcpy (qp, c, len);
|
||||
qp += len;
|
||||
qp = mempcpy (qp, c, len);
|
||||
*qp++ = FILE_LIST_SEPARATOR;
|
||||
}
|
||||
}
|
||||
@@ -326,14 +322,12 @@ set_file_variables (struct file *file)
|
||||
void
|
||||
chop_commands (struct commands *cmds)
|
||||
{
|
||||
unsigned int nlines;
|
||||
unsigned short idx;
|
||||
unsigned short nlines;
|
||||
unsigned short i;
|
||||
char **lines;
|
||||
|
||||
/* If we don't have any commands,
|
||||
or we already parsed them, never mind. */
|
||||
|
||||
if (!cmds || cmds->command_lines != 0)
|
||||
/* If we don't have any commands, or we already parsed them, never mind. */
|
||||
if (!cmds || cmds->command_lines != NULL)
|
||||
return;
|
||||
|
||||
/* Chop CMDS->commands up into lines in CMDS->command_lines. */
|
||||
@@ -352,25 +346,27 @@ chop_commands (struct commands *cmds)
|
||||
}
|
||||
else
|
||||
{
|
||||
const char *p;
|
||||
const char *p = cmds->commands;
|
||||
size_t max = 5;
|
||||
|
||||
nlines = 5;
|
||||
lines = xmalloc (nlines * sizeof (char *));
|
||||
idx = 0;
|
||||
p = cmds->commands;
|
||||
nlines = 0;
|
||||
lines = xmalloc (max * sizeof (char *));
|
||||
while (*p != '\0')
|
||||
{
|
||||
const char *end = p;
|
||||
find_end:;
|
||||
end = strchr (end, '\n');
|
||||
if (end == 0)
|
||||
if (end == NULL)
|
||||
end = p + strlen (p);
|
||||
else if (end > p && end[-1] == '\\')
|
||||
{
|
||||
int backslash = 1;
|
||||
const char *b;
|
||||
for (b = end - 2; b >= p && *b == '\\'; --b)
|
||||
backslash = !backslash;
|
||||
if (end > p + 1)
|
||||
{
|
||||
const char *b;
|
||||
for (b = end - 2; b >= p && *b == '\\'; --b)
|
||||
backslash = !backslash;
|
||||
}
|
||||
if (backslash)
|
||||
{
|
||||
++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;
|
||||
lines = xrealloc (lines, nlines * sizeof (char *));
|
||||
max += 2;
|
||||
lines = xrealloc (lines, max * sizeof (char *));
|
||||
}
|
||||
lines[idx++] = xstrndup (p, (size_t) (end - p));
|
||||
|
||||
lines[nlines++] = xstrndup (p, (size_t) (end - p));
|
||||
p = end;
|
||||
if (*p != '\0')
|
||||
++p;
|
||||
}
|
||||
|
||||
if (idx != nlines)
|
||||
{
|
||||
nlines = idx;
|
||||
lines = xrealloc (lines, nlines * sizeof (char *));
|
||||
}
|
||||
}
|
||||
|
||||
/* Finally, set the corresponding CMDS->lines_flags elements and the
|
||||
CMDS->any_recurse flag. */
|
||||
|
||||
if (nlines > USHRT_MAX)
|
||||
ON (fatal, &cmds->fileinfo, _("Recipe has too many lines (%ud)"), nlines);
|
||||
|
||||
cmds->ncommand_lines = (unsigned short)nlines;
|
||||
cmds->ncommand_lines = nlines;
|
||||
cmds->command_lines = lines;
|
||||
|
||||
cmds->any_recurse = 0;
|
||||
cmds->lines_flags = xmalloc (nlines);
|
||||
|
||||
for (idx = 0; idx < nlines; ++idx)
|
||||
for (i = 0; i < nlines; ++i)
|
||||
{
|
||||
unsigned char flags = 0;
|
||||
const char *p = lines[idx];
|
||||
const char *p = lines[i];
|
||||
|
||||
while (ISBLANK (*p) || *p == '-' || *p == '@' || *p == '+')
|
||||
switch (*(p++))
|
||||
@@ -428,12 +420,12 @@ chop_commands (struct commands *cmds)
|
||||
}
|
||||
|
||||
/* 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))
|
||||
flags |= COMMANDS_RECURSE;
|
||||
|
||||
cmds->lines_flags[idx] = flags;
|
||||
cmds->any_recurse |= flags & COMMANDS_RECURSE ? 1 : 0;
|
||||
cmds->lines_flags[i] = flags;
|
||||
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);
|
||||
|
||||
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. */
|
||||
if (file->loaded)
|
||||
unload_file (file->name);
|
||||
/* Some systems don't support overwriting a loaded object so if this one
|
||||
unload it before remaking. Keep its name in .LOADED: it will be rebuilt
|
||||
and loaded again. If rebuilding or loading again fail, then we'll exit
|
||||
anyway and it won't matter. */
|
||||
if (file->loaded && unload_file (file->name) == 0)
|
||||
{
|
||||
file->loaded = 0;
|
||||
file->unloaded = 1;
|
||||
}
|
||||
|
||||
/* Start the commands running. */
|
||||
new_job (file);
|
||||
@@ -479,11 +476,11 @@ execute_file_commands (struct file *file)
|
||||
/* This is set while we are inside fatal_error_signal,
|
||||
so things can avoid nonreentrant operations. */
|
||||
|
||||
int handling_fatal_signal = 0;
|
||||
volatile sig_atomic_t handling_fatal_signal = 0;
|
||||
|
||||
/* Handle fatal signals. */
|
||||
|
||||
RETSIGTYPE
|
||||
void
|
||||
fatal_error_signal (int sig)
|
||||
{
|
||||
#ifdef __MSDOS__
|
||||
@@ -508,7 +505,7 @@ fatal_error_signal (int sig)
|
||||
#ifdef WINDOWS32
|
||||
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
|
||||
when both threads call reap_children. */
|
||||
if (main_thread)
|
||||
@@ -516,12 +513,12 @@ fatal_error_signal (int sig)
|
||||
DWORD susp_count = SuspendThread (main_thread);
|
||||
|
||||
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)
|
||||
{
|
||||
DWORD ierr = GetLastError ();
|
||||
|
||||
fprintf (stderr, "SuspendThread: error %ld: %s\n",
|
||||
fprintf (stderr, "SuspendThread: error %lu: %s\n",
|
||||
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. */
|
||||
signal (sig, SIG_DFL);
|
||||
|
||||
temp_stdin_unlink ();
|
||||
osync_clear ();
|
||||
jobserver_clear ();
|
||||
|
||||
/* A termination signal won't be sent to the entire
|
||||
process group, but it means we want to kill the children. */
|
||||
|
||||
@@ -596,7 +597,7 @@ fatal_error_signal (int sig)
|
||||
#else
|
||||
/* Signal the same code; this time it will really be fatal. The signal
|
||||
will be unblocked when we return and arrive then to kill us. */
|
||||
if (kill (getpid (), sig) < 0)
|
||||
if (kill (make_pid (), sig) < 0)
|
||||
pfatal_with_name ("kill");
|
||||
#endif /* not WINDOWS32 */
|
||||
#endif /* not Amiga */
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Definition of data structures describing shell commands for GNU Make.
|
||||
Copyright (C) 1988-2020 Free Software Foundation, Inc.
|
||||
Copyright (C) 1988-2023 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
|
||||
@@ -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.
|
||||
|
||||
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
|
||||
and information about where these commands came from. */
|
||||
@@ -34,9 +34,12 @@ struct commands
|
||||
#define COMMANDS_SILENT 2 /* Silent: @. */
|
||||
#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 print_commands (const struct commands *cmds);
|
||||
void delete_child_targets (struct child *child);
|
||||
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-*-
|
||||
Copyright (C) 1995-2020 Free Software Foundation, Inc.
|
||||
Copyright (C) 1995-2023 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
|
||||
@@ -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.
|
||||
|
||||
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.
|
||||
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>. */
|
||||
/* #undef DGUX */
|
||||
|
||||
/* Define if the 'getloadavg' function needs to be run setuid or setgid. */
|
||||
/* #undef GETLOADAVG_PRIVILEGED */
|
||||
/* Define to the widest signed integer type if <stdint.h> and <inttypes.h> do
|
||||
not define. */
|
||||
#define intmax_t long
|
||||
|
||||
/* Define to 'unsigned long' or 'unsigned long long'
|
||||
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). */
|
||||
/* #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. */
|
||||
/* #undef HAVE_FNMATCH */
|
||||
|
||||
/* Define if your system has its own 'getloadavg' function. */
|
||||
/* #undef HAVE_GETLOADAVG */
|
||||
|
||||
/* Define if you have the getmntent function. */
|
||||
/* #undef HAVE_GETMNTENT */
|
||||
|
||||
@@ -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. */
|
||||
/* #undef _POSIX_SOURCE */
|
||||
|
||||
/* Define as the return type of signal handlers (int or void). */
|
||||
#define RETSIGTYPE void
|
||||
|
||||
/* Define if the setvbuf function takes the buffering type as its second
|
||||
argument and the buffer pointer as the third, as on System V
|
||||
before release 3. */
|
||||
/* #undef SETVBUF_REVERSED */
|
||||
|
||||
/* If using the C implementation of alloca, define if you know the
|
||||
direction of stack growth for your system; otherwise it will be
|
||||
automatically deduced at run-time.
|
||||
@@ -173,19 +170,13 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
instead of <sys/cpustats.h>. */
|
||||
/* #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 SCCS_GET "get"
|
||||
|
||||
/* Define this if the SCCS 'get' command understands the '-G<file>' option. */
|
||||
/* #undef SCCS_GET_MINUS_G */
|
||||
|
||||
/* Define this to enable job server support in GNU make. */
|
||||
/* Define this to enable job server support in GNU Make. */
|
||||
/* #undef MAKE_JOBSERVER */
|
||||
|
||||
/* Define to be the nanoseconds member of struct stat's st_mtim,
|
||||
@@ -261,6 +252,9 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
/* Define if you have the strsignal function. */
|
||||
/* #undef HAVE_STRSIGNAL */
|
||||
|
||||
/* Define if you have the strtoll function. */
|
||||
/* #undef HAVE_STRTOLL */
|
||||
|
||||
/* Define if you have the wait3 function. */
|
||||
/* #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). */
|
||||
/* #undef HAVE_LIBSUN */
|
||||
|
||||
/* Output sync sypport */
|
||||
/* Output sync support */
|
||||
#define NO_OUTPUT_SYNC
|
||||
|
||||
/* Define for Case Insensitve behavior */
|
||||
/* Define for Case Insensitive behavior */
|
||||
#define HAVE_CASE_INSENSITIVE_FS
|
||||
|
||||
/* Build host information. */
|
||||
@@ -335,3 +329,6 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
/* Define to `int' if <sys/types.h> does not define. */
|
||||
#define ssize_t int
|
||||
|
||||
/* Include customized declarations. */
|
||||
#include "../src/mkcustom.h"
|
||||
@@ -1,6 +1,6 @@
|
||||
/* config.h-vms. Generated by hand by Klaus Kämpf <kkaempf@rmi.de> -*-C-*-
|
||||
|
||||
Copyright (C) 1996-2020 Free Software Foundation, Inc.
|
||||
Copyright (C) 1996-2023 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
|
||||
@@ -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.
|
||||
|
||||
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. */
|
||||
/* config.h.in. Generated automatically from configure.ac by autoheader. */
|
||||
#include "mkconfig.h"
|
||||
|
||||
#define MK_VMS 1
|
||||
|
||||
/* Pull in types.h here to get __CRTL_VER defined for old versions of the
|
||||
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>. */
|
||||
/* #undef DGUX */
|
||||
|
||||
/* Define to 1 if the 'getloadavg' function needs to be run setuid or setgid. */
|
||||
/* #undef GETLOADAVG_PRIVILEGED */
|
||||
/* Define to the widest signed integer type if <stdint.h> and <inttypes.h> do
|
||||
not define. */
|
||||
#define intmax_t unsigned long
|
||||
|
||||
/* Define to 'unsigned long' or 'unsigned long long'
|
||||
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). */
|
||||
/* #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 HAVE_FDOPEN 1
|
||||
|
||||
/* Define to 1 if your system has a working fnmatch function. */
|
||||
/* #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. */
|
||||
/* #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. */
|
||||
/* #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
|
||||
direction of stack growth for your system; otherwise it will be
|
||||
automatically deduced at run-time.
|
||||
@@ -213,19 +207,13 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
instead of <sys/cpustats.h>. */
|
||||
/* #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. */
|
||||
/* #undef SCCS_GET */
|
||||
|
||||
/* Define this if the SCCS 'get' command understands the '-G<file>' option. */
|
||||
/* #undef SCCS_GET_MINUS_G */
|
||||
|
||||
/* Define this to enable job server support in GNU make. */
|
||||
/* Define this to enable job server support in GNU Make. */
|
||||
/* #undef MAKE_JOBSERVER */
|
||||
|
||||
/* Define to be the nanoseconds member of struct stat's st_mtim,
|
||||
@@ -259,6 +247,9 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
/* Define to 1 if you have the memmove function. */
|
||||
#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 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. */
|
||||
/* #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. */
|
||||
/* #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. */
|
||||
/* #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. */
|
||||
/* #undef HAVE_NDIR_H */
|
||||
|
||||
@@ -431,3 +428,6 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
/* Build host information. */
|
||||
#define MAKE_HOST "VMS"
|
||||
|
||||
/* Include customized declarations. */
|
||||
#include "../src/mkcustom.h"
|
||||
@@ -1,6 +1,6 @@
|
||||
/* config.h.W32 -- hand-massaged config.h file for Windows builds -*-C-*-
|
||||
|
||||
Copyright (C) 1996-2020 Free Software Foundation, Inc.
|
||||
Copyright (C) 1996-2023 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
|
||||
@@ -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.
|
||||
|
||||
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.
|
||||
Maybe after the code cleanup for ISO C we can remove some/all of these. */
|
||||
#if _MSC_VER > 1000
|
||||
# pragma warning(disable:4100) /* unreferenced formal parameter */
|
||||
# pragma warning(disable:4102) /* unreferenced label */
|
||||
# pragma warning(disable:4127) /* conditional expression is constant */
|
||||
# pragma warning(disable:4130) /* logical operation on address of string constant */
|
||||
# pragma warning(disable:4131) /* uses old-style declarator */
|
||||
# pragma warning(disable:4702) /* unreachable code */
|
||||
# define _CRT_SECURE_NO_WARNINGS /* function or variable may be unsafe */
|
||||
# define _CRT_NONSTDC_NO_WARNINGS /* functions w/o a leading underscore */
|
||||
# define _CRT_SECURE_NO_WARNINGS 1 /* function or variable may be unsafe */
|
||||
# define _CRT_NONSTDC_NO_WARNINGS 1 /* functions w/o a leading underscore */
|
||||
#endif
|
||||
|
||||
/* Define to 1 if the 'closedir' function returns void instead of 'int'. */
|
||||
/* #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'. */
|
||||
/* #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>. */
|
||||
/* #undef DGUX */
|
||||
|
||||
@@ -51,15 +49,11 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
/* Use high resolution file timestamps if nonzero. */
|
||||
#define FILE_TIMESTAMP_HI_RES 0
|
||||
|
||||
/* Define to 1 if the 'getloadavg' function needs to be run setuid or setgid.
|
||||
*/
|
||||
/* #undef GETLOADAVG_PRIVILEGED */
|
||||
|
||||
/* Define to 1 if you have 'alloca', as a function or macro. */
|
||||
/* Define to 1 if you have 'alloca' after including <alloca.h>, a header that
|
||||
may be supplied by this distribution. */
|
||||
#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 */
|
||||
|
||||
/* 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. */
|
||||
/* #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.
|
||||
*/
|
||||
/* #undef HAVE_DCGETTEXT */
|
||||
@@ -83,6 +73,21 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
don't. */
|
||||
#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
|
||||
don't. */
|
||||
#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()
|
||||
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
|
||||
#endif
|
||||
|
||||
/* Use platform specific coding */
|
||||
/* Support DOS-style pathnames. */
|
||||
#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 HAVE_DUP2 1
|
||||
|
||||
@@ -120,8 +128,8 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
#define HAVE_FDOPEN 1
|
||||
#endif
|
||||
|
||||
/* Define to 1 if you have the 'fileno' function. */
|
||||
#define HAVE_FILENO 1
|
||||
/* Define to 1 if you have the `fork' function. */
|
||||
/* #undef HAVE_FORK */
|
||||
|
||||
/* Define to 1 if you have the 'getcwd' function. */
|
||||
#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. */
|
||||
/* #undef HAVE_GETHOSTNAME */
|
||||
|
||||
/* Define to 1 if you have the 'getloadavg' function. */
|
||||
/* #undef HAVE_GETLOADAVG */
|
||||
|
||||
/* Define to 1 if you have the 'getrlimit' function. */
|
||||
/* #undef HAVE_GETRLIMIT */
|
||||
|
||||
@@ -149,6 +154,10 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
#define HAVE_GETTIMEOFDAY 1
|
||||
#endif
|
||||
|
||||
/* Embed GNU Guile support. Windows build sets this on the
|
||||
compilation command line. */
|
||||
/* #undef HAVE_GUILE */
|
||||
|
||||
/* Define if you have the iconv() function. */
|
||||
/* #undef HAVE_ICONV */
|
||||
|
||||
@@ -157,17 +166,26 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
#define HAVE_INTTYPES_H 1
|
||||
#endif
|
||||
|
||||
/* Define to 1 if you have the `isatty' function. */
|
||||
#define HAVE_ISATTY 1
|
||||
|
||||
/* Define to 1 if you have the 'dgc' library (-ldgc). */
|
||||
/* #undef HAVE_LIBDGC */
|
||||
|
||||
/* Define to 1 if you have the 'kstat' library (-lkstat). */
|
||||
/* #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 HAVE_LIMITS_H 1
|
||||
|
||||
/* 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. */
|
||||
/* #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 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. */
|
||||
/* #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 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. */
|
||||
/* #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. */
|
||||
/* #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. */
|
||||
/* #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. */
|
||||
/* #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. */
|
||||
/* #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. */
|
||||
#ifdef __MINGW32__
|
||||
#define HAVE_STDINT_H 1
|
||||
#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 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. */
|
||||
#ifdef __MINGW32__
|
||||
#if defined(__MINGW32__) || defined(__TINYC__)
|
||||
#define HAVE_STRCASECMP 1
|
||||
#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 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 HAVE_STRICMP 1
|
||||
|
||||
@@ -273,7 +324,7 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
#define HAVE_STRING_H 1
|
||||
|
||||
/* Define to 1 if you have the 'strncasecmp' function. */
|
||||
#ifdef __MINGW32__
|
||||
#if defined(__MINGW32__) || defined(__TINYC__)
|
||||
#define HAVE_STRNCASECMP 1
|
||||
#endif
|
||||
|
||||
@@ -291,24 +342,23 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
/* Define to 1 if you have the 'strsignal' function. */
|
||||
/* #undef HAVE_STRSIGNAL */
|
||||
|
||||
/* Define to 1 if you have the `strtoll' function. */
|
||||
#define HAVE_STRTOLL 1
|
||||
#ifdef __TINYC__
|
||||
# ifndef strtoll
|
||||
# define strtoll _strtoi64
|
||||
# endif
|
||||
# ifndef strtoull
|
||||
# define strtoull _strtoui64
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* Define to 1 if `d_type' is a member of `struct dirent'. */
|
||||
/* SV 57152: MinGW64 version of dirent doesn't support d_type. */
|
||||
#ifndef __MINGW64__
|
||||
# define HAVE_STRUCT_DIRENT_D_TYPE 1
|
||||
#endif
|
||||
|
||||
/* Define to 1 if you have the `isatty' function. */
|
||||
#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
|
||||
|
||||
/* Define to 1 if 'n_un.n_name' is a member of 'struct nlist'. */
|
||||
/* #undef HAVE_STRUCT_NLIST_N_UN_N_NAME */
|
||||
|
||||
@@ -316,6 +366,12 @@ char *ttyname (int);
|
||||
*/
|
||||
/* #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'.
|
||||
*/
|
||||
/* #undef HAVE_SYS_NDIR_H */
|
||||
@@ -328,6 +384,9 @@ char *ttyname (int);
|
||||
/* Define to 1 if you have the <sys/resource.h> header file. */
|
||||
/* #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 HAVE_SYS_STAT_H 1
|
||||
|
||||
@@ -345,6 +404,21 @@ char *ttyname (int);
|
||||
/* Define to 1 if you have the <sys/wait.h> header file. */
|
||||
/* #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>. */
|
||||
/* #undef HAVE_UNION_WAIT */
|
||||
|
||||
@@ -353,19 +427,40 @@ char *ttyname (int);
|
||||
#define HAVE_UNISTD_H 1
|
||||
#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. */
|
||||
/* #undef HAVE_WAIT3 */
|
||||
|
||||
/* Define to 1 if you have the 'waitpid' function. */
|
||||
/* #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. */
|
||||
#define MAKE_HOST "Windows32"
|
||||
|
||||
/* Define to 1 to enable job server support in GNU make. */
|
||||
/* Define to 1 to enable job server support in GNU Make. */
|
||||
#define MAKE_JOBSERVER 1
|
||||
|
||||
/* Define to 1 to enable 'load' support in GNU make. */
|
||||
/* Define to 1 to enable 'load' support in GNU Make. */
|
||||
#define MAKE_LOAD 1
|
||||
|
||||
/* Define to 1 to enable symbolic link timestamp checking. */
|
||||
@@ -381,38 +476,15 @@ char *ttyname (int);
|
||||
/* Define to 1 if your C compiler doesn't accept -c and -o together. */
|
||||
/* #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 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 SCCS_GET "echo no sccs get"
|
||||
|
||||
/* Define this if the SCCS 'get' command understands the '-G<file>' option. */
|
||||
/* #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
|
||||
direction of stack growth for your system; otherwise it will be
|
||||
automatically deduced at run time.
|
||||
@@ -433,11 +505,6 @@ char *ttyname (int);
|
||||
/* Define to 1 on System V Release 4. */
|
||||
/* #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. */
|
||||
/* #undef UMAX */
|
||||
|
||||
@@ -445,9 +512,6 @@ char *ttyname (int);
|
||||
<sys/cpustats.h>. */
|
||||
/* #undef UMAX4_3 */
|
||||
|
||||
/* Version number of package */
|
||||
#define VERSION "%VERSION%"
|
||||
|
||||
/* Define if using the dmalloc debugging malloc package */
|
||||
/* #undef WITH_DMALLOC */
|
||||
|
||||
@@ -486,6 +550,14 @@ char *ttyname (int);
|
||||
# define __USE_MINGW_ANSI_STDIO 1
|
||||
#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>
|
||||
|
||||
/* Define to 'int' if <sys/types.h> doesn't define. */
|
||||
@@ -507,9 +579,10 @@ char *ttyname (int);
|
||||
/* Define to 'int' if <sys/types.h> doesn't define. */
|
||||
#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
|
||||
#define uintmax_t unsigned long
|
||||
#define intmax_t long long
|
||||
#define uintmax_t unsigned long long
|
||||
#endif
|
||||
|
||||
/* Define if you have <sys/wait.h> that is POSIX.1 compatible. */
|
||||
@@ -525,10 +598,14 @@ char *ttyname (int);
|
||||
|
||||
/*
|
||||
* If you have a shell that does not grok 'sh -c quoted-command-line'
|
||||
* correctly, you need this setting. Please see below for specific
|
||||
* shell support.
|
||||
* correctly, you need this setting; it is the default for tcc.
|
||||
* Please see below for specific shell support.
|
||||
*/
|
||||
#if defined(__TINYC__)
|
||||
#define BATCH_MODE_ONLY_SHELL 1
|
||||
#else
|
||||
/*#define BATCH_MODE_ONLY_SHELL 1 */
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Define if you have the Cygnus "Cygwin" GNU Windows32 tool set.
|
||||
@@ -552,3 +629,6 @@ char *ttyname (int);
|
||||
#ifdef HAVE_CYGWIN_SHELL
|
||||
#undef BATCH_MODE_ONLY_SHELL
|
||||
#endif
|
||||
|
||||
/* Include customized declarations. */
|
||||
#include "../src/mkcustom.h"
|
||||
@@ -1,6 +1,6 @@
|
||||
/* configh.dos -- hand-massaged config.h file for MS-DOS builds -*-C-*-
|
||||
|
||||
Copyright (C) 1994-2020 Free Software Foundation, Inc.
|
||||
Copyright (C) 1994-2023 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
|
||||
@@ -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.
|
||||
|
||||
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
|
||||
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 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 HAVE_MEMORY_H 1
|
||||
|
||||
@@ -66,13 +73,6 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
#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 HAVE_SELECT 1
|
||||
|
||||
@@ -82,35 +82,33 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
/* Define to 1 if you have the 'strncasecmp' function. */
|
||||
#define HAVE_STRNCASECMP 1
|
||||
|
||||
/* Name of the package */
|
||||
#define PACKAGE "%PACKAGE%"
|
||||
/* Define to 1 if you have the `strtoll' function. */
|
||||
#define HAVE_STRTOLL 1
|
||||
|
||||
/* Define to the address where bug reports for this package should be sent. */
|
||||
#define PACKAGE_BUGREPORT "bug-%PACKAGE%@gnu.org"
|
||||
|
||||
/* 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%"
|
||||
/* Output sync support */
|
||||
#define NO_OUTPUT_SYNC 1
|
||||
|
||||
/* Build host information. */
|
||||
#define MAKE_HOST "i386-pc-msdosdjgpp"
|
||||
|
||||
/* 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. */
|
||||
#if __DJGPP__ == 2 && __DJGPP_MINOR__ < 5
|
||||
#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
|
||||
|
||||
/* Include customized declarations. */
|
||||
#include "../src/mkcustom.h"
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Debugging macros and interface.
|
||||
Copyright (C) 1999-2020 Free Software Foundation, Inc.
|
||||
Copyright (C) 1999-2023 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
|
||||
@@ -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.
|
||||
|
||||
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_BASIC (0x001)
|
||||
#define DB_VERBOSE (0x002)
|
||||
#define DB_JOBS (0x004)
|
||||
#define DB_IMPLICIT (0x008)
|
||||
#define DB_PRINT (0x010)
|
||||
#define DB_WHY (0x020)
|
||||
#define DB_MAKEFILES (0x100)
|
||||
|
||||
#define DB_ALL (0xfff)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Data base of default implicit rules for GNU Make.
|
||||
Copyright (C) 1988-2020 Free Software Foundation, Inc.
|
||||
Copyright (C) 1988-2023 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
|
||||
@@ -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.
|
||||
|
||||
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"
|
||||
|
||||
@@ -506,7 +506,7 @@ static const char *default_variables[] =
|
||||
"COMPILE.s", "$(AS) $(ASFLAGS) $(TARGET_MACH)",
|
||||
"LINK.S", "$(CC) $(ASFLAGS) $(CPPFLAGS) $(LDFLAGS) $(TARGET_MACH)",
|
||||
"COMPILE.S", "$(CC) $(ASFLAGS) $(CPPFLAGS) $(TARGET_MACH) -c",
|
||||
"PREPROCESS.S", "$(CC) -E $(CPPFLAGS)",
|
||||
"PREPROCESS.S", "$(CPP) $(CPPFLAGS)",
|
||||
"PREPROCESS.F", "$(FC) $(FFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -F",
|
||||
"PREPROCESS.r", "$(FC) $(FFLAGS) $(RFLAGS) $(TARGET_ARCH) -F",
|
||||
"LINT.c", "$(LINT) $(LINTFLAGS) $(CPPFLAGS) $(TARGET_ARCH)",
|
||||
@@ -518,7 +518,12 @@ static const char *default_variables[] =
|
||||
#else /* !VMS */
|
||||
|
||||
"AR", "ar",
|
||||
"ARFLAGS", "rv",
|
||||
#ifdef _AIX
|
||||
/* AIX requires object file format specification: choose -Xany. */
|
||||
"ARFLAGS", "-Xany -rv",
|
||||
#else
|
||||
"ARFLAGS", "-rv",
|
||||
#endif
|
||||
"AS", "as",
|
||||
#ifdef GCC_IS_NATIVE
|
||||
"CC", "gcc",
|
||||
@@ -636,7 +641,7 @@ static const char *default_variables[] =
|
||||
"COMPILE.s", "$(AS) $(ASFLAGS) $(TARGET_MACH)",
|
||||
"LINK.S", "$(CC) $(ASFLAGS) $(CPPFLAGS) $(LDFLAGS) $(TARGET_MACH)",
|
||||
"COMPILE.S", "$(CC) $(ASFLAGS) $(CPPFLAGS) $(TARGET_MACH) -c",
|
||||
"PREPROCESS.S", "$(CC) -E $(CPPFLAGS)",
|
||||
"PREPROCESS.S", "$(CPP) $(CPPFLAGS)",
|
||||
"PREPROCESS.F", "$(FC) $(FFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -F",
|
||||
"PREPROCESS.r", "$(FC) $(FFLAGS) $(RFLAGS) $(TARGET_ARCH) -F",
|
||||
"LINT.c", "$(LINT) $(LINTFLAGS) $(CPPFLAGS) $(TARGET_ARCH)",
|
||||
@@ -663,7 +668,7 @@ static const char *default_variables[] =
|
||||
|
||||
#endif /* !VMS */
|
||||
/* Make this assignment to avoid undefined variable warnings. */
|
||||
"GNUMAKEFLAGS", "",
|
||||
GNUMAKEFLAGS_NAME, "",
|
||||
0, 0
|
||||
};
|
||||
|
||||
|
||||
40
src/dep.h
40
src/dep.h
@@ -1,5 +1,5 @@
|
||||
/* Definitions of dependency data structures for GNU Make.
|
||||
Copyright (C) 1988-2020 Free Software Foundation, Inc.
|
||||
Copyright (C) 1988-2023 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
|
||||
@@ -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.
|
||||
|
||||
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. */
|
||||
@@ -30,26 +30,32 @@ struct nameseq
|
||||
These flags are saved in the 'flags' field of each
|
||||
'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_INCLUDED (1 << 1) /* Search makefile search path. */
|
||||
#define RM_DONTCARE (1 << 2) /* No error if it doesn't exist. */
|
||||
#define RM_NO_TILDE (1 << 3) /* Don't expand ~ in file name. */
|
||||
#define RM_NOFLAG 0
|
||||
|
||||
/* Structure representing one dependency of a file.
|
||||
Each struct file's 'deps' points to a chain of these, 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) \
|
||||
NAMESEQ (_t); \
|
||||
struct file *file; \
|
||||
_t *shuf; \
|
||||
const char *stem; \
|
||||
unsigned int flags : 8; \
|
||||
unsigned int changed : 1; \
|
||||
unsigned int ignore_mtime : 1; \
|
||||
unsigned int staticpattern : 1; \
|
||||
unsigned int need_2nd_expansion : 1; \
|
||||
unsigned int ignore_automatic_vars : 1
|
||||
unsigned int ignore_automatic_vars : 1; \
|
||||
unsigned int is_explicit : 1; \
|
||||
unsigned int wait_here : 1
|
||||
|
||||
struct dep
|
||||
{
|
||||
@@ -76,6 +82,7 @@ struct goaldep
|
||||
#define PARSEFS_EXISTS 0x0008
|
||||
#define PARSEFS_NOCACHE 0x0010
|
||||
#define PARSEFS_ONEWORD 0x0020
|
||||
#define PARSEFS_WAIT 0x0040
|
||||
|
||||
#define PARSE_FILE_SEQ(_s,_t,_c,_p,_f) \
|
||||
(_t *)parse_file_seq ((_s),sizeof (_t),(_c),(_p),(_f))
|
||||
@@ -95,24 +102,23 @@ char *tilde_expand (const char *name);
|
||||
struct nameseq *ar_glob (const char *arname, const char *member_pattern, size_t size);
|
||||
#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);
|
||||
|
||||
#if defined(MAKE_MAINTAINER_MODE) && defined(__GNUC__)
|
||||
#if defined(MAKE_MAINTAINER_MODE) && defined(__GNUC__) && !defined(__STRICT_ANSI__)
|
||||
/* Use inline to get real type-checking. */
|
||||
#define SI static inline
|
||||
SI struct nameseq *alloc_ns() { return alloc_seq_elt (struct nameseq); }
|
||||
SI struct dep *alloc_dep() { return alloc_seq_elt (struct dep); }
|
||||
SI struct goaldep *alloc_goaldep() { return alloc_seq_elt (struct goaldep); }
|
||||
SI struct nameseq *alloc_ns (void) { return alloc_seq_elt (struct nameseq); }
|
||||
SI struct dep *alloc_dep (void) { return alloc_seq_elt (struct dep); }
|
||||
SI struct goaldep *alloc_goaldep (void) { return alloc_seq_elt (struct goaldep); }
|
||||
|
||||
SI void free_ns(struct nameseq *n) { free (n); }
|
||||
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_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_ns (struct nameseq *n) { free (n); }
|
||||
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_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); }
|
||||
#else
|
||||
# define alloc_ns() alloc_seq_elt (struct nameseq)
|
||||
# define alloc_dep() alloc_seq_elt (struct dep)
|
||||
|
||||
470
src/dir.c
470
src/dir.c
@@ -1,5 +1,5 @@
|
||||
/* Directory hashing for GNU Make.
|
||||
Copyright (C) 1988-2020 Free Software Foundation, Inc.
|
||||
Copyright (C) 1988-2023 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
|
||||
@@ -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.
|
||||
|
||||
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 "hash.h"
|
||||
#include "filedef.h"
|
||||
#include "dep.h"
|
||||
#include "debug.h"
|
||||
|
||||
#ifdef HAVE_DIRENT_H
|
||||
# include <dirent.h>
|
||||
@@ -75,12 +76,12 @@ dosify (const char *filename)
|
||||
char *df;
|
||||
int i;
|
||||
|
||||
if (filename == 0 || _USE_LFN)
|
||||
if (filename == NULL || _USE_LFN)
|
||||
return filename;
|
||||
|
||||
/* FIXME: what about filenames which violate
|
||||
8+3 constraints, like "config.h.in", or ".emacs"? */
|
||||
if (strpbrk (filename, "\"*+,;<=>?[\\]|") != 0)
|
||||
if (strpbrk (filename, "\"*+,;<=>?[\\]|") != NULL)
|
||||
return filename;
|
||||
|
||||
df = dos_filename;
|
||||
@@ -104,7 +105,7 @@ dosify (const char *filename)
|
||||
++filename;
|
||||
if (*filename == '.')
|
||||
return filename;
|
||||
*df = 0;
|
||||
*df = '\0';
|
||||
return dos_filename;
|
||||
}
|
||||
#endif /* __MSDOS__ */
|
||||
@@ -124,8 +125,8 @@ downcase (const char *filename)
|
||||
static PATH_VAR (new_filename);
|
||||
char *df;
|
||||
|
||||
if (filename == 0)
|
||||
return 0;
|
||||
if (filename == NULL)
|
||||
return NULL;
|
||||
|
||||
df = new_filename;
|
||||
while (*filename != '\0')
|
||||
@@ -134,7 +135,7 @@ downcase (const char *filename)
|
||||
++filename;
|
||||
}
|
||||
|
||||
*df = 0;
|
||||
*df = '\0';
|
||||
|
||||
return new_filename;
|
||||
}
|
||||
@@ -175,7 +176,7 @@ vms_hash (const char *name)
|
||||
|
||||
while (*name)
|
||||
{
|
||||
unsigned char uc = *name;
|
||||
unsigned char uc = (unsigned char) *name;
|
||||
int g;
|
||||
#ifdef HAVE_CASE_INSENSITIVE_FS
|
||||
h = (h << 4) + (isupper (uc) ? tolower (uc) : uc);
|
||||
@@ -202,14 +203,14 @@ vmsstat_dir (const char *name, struct stat *st)
|
||||
DIR *dir;
|
||||
|
||||
dir = opendir (name);
|
||||
if (dir == 0)
|
||||
if (dir == NULL)
|
||||
return -1;
|
||||
closedir (dir);
|
||||
s = strchr (name, ':'); /* find device */
|
||||
if (s)
|
||||
{
|
||||
/* to keep the compiler happy we said "const char *name", now we cheat */
|
||||
*s++ = 0;
|
||||
*s++ = '\0';
|
||||
st->st_dev = (char *)vms_hash (name);
|
||||
h = vms_hash (s);
|
||||
*(s-1) = ':';
|
||||
@@ -232,6 +233,12 @@ vmsstat_dir (const char *name, struct stat *st)
|
||||
#endif /* _USE_STD_STAT */
|
||||
#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. */
|
||||
|
||||
#ifndef DIRECTORY_BUCKETS
|
||||
@@ -262,9 +269,26 @@ struct directory_contents
|
||||
# endif
|
||||
#endif /* WINDOWS32 */
|
||||
struct hash_table dirfiles; /* Files in this directory. */
|
||||
unsigned long counter; /* command_count value when last read. */
|
||||
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 = NULL;
|
||||
}
|
||||
if (dc->dirfiles.ht_vec != NULL)
|
||||
hash_free (&dc->dirfiles, 1);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static unsigned long
|
||||
directory_contents_hash_1 (const void *key_0)
|
||||
{
|
||||
@@ -363,7 +387,9 @@ static struct hash_table directory_contents;
|
||||
|
||||
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
|
||||
entries in the hash table, which refer to the same directory
|
||||
@@ -393,12 +419,6 @@ directory_hash_cmp (const void *x, const void *y)
|
||||
/* Table of directories hashed by name. */
|
||||
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. */
|
||||
|
||||
@@ -437,7 +457,7 @@ dirfile_hash_cmp (const void *xv, const void *yv)
|
||||
#define DIRFILE_BUCKETS 107
|
||||
#endif
|
||||
|
||||
static int dir_contents_file_exists_p (struct directory_contents *dir,
|
||||
static int dir_contents_file_exists_p (struct directory *dir,
|
||||
const char *filename);
|
||||
static struct directory *find_directory (const char *name);
|
||||
|
||||
@@ -449,150 +469,161 @@ find_directory (const char *name)
|
||||
struct directory *dir;
|
||||
struct directory **dir_slot;
|
||||
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_slot = (struct directory **) hash_find_slot (&directories, &dir_key);
|
||||
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. */
|
||||
const char *p = name + strlen (name);
|
||||
struct stat st;
|
||||
int r;
|
||||
size_t len = strlen (name);
|
||||
|
||||
dir = xmalloc (sizeof (struct directory));
|
||||
#if defined(HAVE_CASE_INSENSITIVE_FS) && defined(VMS)
|
||||
/* Todo: Why is this only needed on VMS? */
|
||||
{
|
||||
char *lname = downcase_inplace (xstrdup (name));
|
||||
dir->name = strcache_add_len (lname, p - name);
|
||||
dir->name = strcache_add_len (lname, len);
|
||||
free (lname);
|
||||
}
|
||||
#else
|
||||
dir->name = strcache_add_len (name, p - name);
|
||||
dir->name = strcache_add_len (name, len);
|
||||
#endif
|
||||
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)
|
||||
{
|
||||
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
|
||||
valid directories if they end in a slash. */
|
||||
memcpy (tem, name, p - name + 1);
|
||||
tstart = tem;
|
||||
if (tstart[1] == ':')
|
||||
tstart += 2;
|
||||
for (tend = tem + (p - name - 1);
|
||||
tend > tstart && (*tend == '/' || *tend == '\\');
|
||||
tend--)
|
||||
*tend = '\0';
|
||||
/* Remove any trailing slashes. Windows32 stat fails even on
|
||||
valid directories if they end in a slash. */
|
||||
memcpy (tem, name, len + 1);
|
||||
tstart = tem;
|
||||
if (tstart[1] == ':')
|
||||
tstart += 2;
|
||||
for (tend = tem + (len - 1); tend > tstart && ISDIRSEP (*tend); tend--)
|
||||
*tend = '\0';
|
||||
|
||||
r = stat (tem, &st);
|
||||
}
|
||||
r = stat (tem, &st);
|
||||
}
|
||||
#else
|
||||
EINTRLOOP (r, stat (name, &st));
|
||||
EINTRLOOP (r, stat (name, &st));
|
||||
#endif
|
||||
|
||||
if (r < 0)
|
||||
{
|
||||
/* Couldn't stat the directory. Mark this by
|
||||
setting the 'contents' member to a nil pointer. */
|
||||
dir->contents = 0;
|
||||
}
|
||||
if (r < 0)
|
||||
/* Couldn't stat the directory; nothing else to do. */
|
||||
return dir;
|
||||
|
||||
/* 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 == NULL)
|
||||
/* Couldn't open the directory: mark this by setting files to NULL. */
|
||||
dc->dirfiles.ht_vec = NULL;
|
||||
else
|
||||
{
|
||||
/* Search the contents hash table; device and inode are the key. */
|
||||
|
||||
#ifdef WINDOWS32
|
||||
char *w32_path;
|
||||
#endif
|
||||
struct directory_contents *dc;
|
||||
struct directory_contents **dc_slot;
|
||||
struct directory_contents 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
|
||||
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;
|
||||
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 (dir, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -603,17 +634,18 @@ find_directory (const char *name)
|
||||
FILENAME must contain no slashes. */
|
||||
|
||||
static int
|
||||
dir_contents_file_exists_p (struct directory_contents *dir,
|
||||
dir_contents_file_exists_p (struct directory *dir,
|
||||
const char *filename)
|
||||
{
|
||||
struct dirfile *df;
|
||||
struct dirent *d;
|
||||
struct directory_contents *dc = dir->contents;
|
||||
#ifdef WINDOWS32
|
||||
struct stat st;
|
||||
int rehash = 0;
|
||||
#endif
|
||||
|
||||
if (dir == 0 || dir->dirfiles.ht_vec == 0)
|
||||
if (dc == NULL || dc->dirfiles.ht_vec == NULL)
|
||||
/* The directory could not be stat'd or opened. */
|
||||
return 0;
|
||||
|
||||
@@ -626,10 +658,16 @@ dir_contents_file_exists_p (struct directory_contents *dir,
|
||||
#endif
|
||||
|
||||
#ifdef __EMX__
|
||||
if (filename != 0)
|
||||
_fnlwr (filename); /* lower case for FAT drives */
|
||||
if (filename != NULL)
|
||||
{
|
||||
size_t len = strlen (filename);
|
||||
char *fname = alloca (len + 1);
|
||||
memcpy (fname, filename, len + 1);
|
||||
_fnlwr (fname); /* lower case for FAT drives */
|
||||
filename = fname;
|
||||
}
|
||||
#endif
|
||||
if (filename != 0)
|
||||
if (filename != NULL)
|
||||
{
|
||||
struct dirfile dirfile_key;
|
||||
|
||||
@@ -640,7 +678,7 @@ dir_contents_file_exists_p (struct directory_contents *dir,
|
||||
}
|
||||
dirfile_key.name = filename;
|
||||
dirfile_key.length = strlen (filename);
|
||||
df = hash_find_item (&dir->dirfiles, &dirfile_key);
|
||||
df = hash_find_item (&dc->dirfiles, &dirfile_key);
|
||||
if (df)
|
||||
return !df->impossible;
|
||||
}
|
||||
@@ -648,7 +686,7 @@ dir_contents_file_exists_p (struct directory_contents *dir,
|
||||
/* The file was not found in the hashed list.
|
||||
Try to read the directory further. */
|
||||
|
||||
if (dir->dirstream == 0)
|
||||
if (dc->dirstream == NULL)
|
||||
{
|
||||
#ifdef WINDOWS32
|
||||
/*
|
||||
@@ -656,17 +694,17 @@ dir_contents_file_exists_p (struct directory_contents *dir,
|
||||
* filesystems force a rehash always as mtime does not change
|
||||
* on directories (ugh!).
|
||||
*/
|
||||
if (dir->path_key)
|
||||
if (dc->path_key)
|
||||
{
|
||||
if ((dir->fs_flags & FS_FAT) != 0)
|
||||
if ((dc->fs_flags & FS_FAT) != 0)
|
||||
{
|
||||
dir->mtime = time ((time_t *) 0);
|
||||
dc->mtime = time (NULL);
|
||||
rehash = 1;
|
||||
}
|
||||
else if (stat (dir->path_key, &st) == 0 && st.st_mtime > dir->mtime)
|
||||
else if (stat (dc->path_key, &st) == 0 && st.st_mtime > dc->mtime)
|
||||
{
|
||||
/* reset date stamp to show most recent re-process. */
|
||||
dir->mtime = st.st_mtime;
|
||||
dc->mtime = st.st_mtime;
|
||||
rehash = 1;
|
||||
}
|
||||
|
||||
@@ -675,8 +713,8 @@ dir_contents_file_exists_p (struct directory_contents *dir,
|
||||
return 0;
|
||||
|
||||
/* make sure directory can still be opened; if not return. */
|
||||
dir->dirstream = opendir (dir->path_key);
|
||||
if (!dir->dirstream)
|
||||
dc->dirstream = opendir (dc->path_key);
|
||||
if (!dc->dirstream)
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
@@ -692,11 +730,11 @@ dir_contents_file_exists_p (struct directory_contents *dir,
|
||||
struct dirfile dirfile_key;
|
||||
struct dirfile **dirfile_slot;
|
||||
|
||||
ENULLLOOP (d, readdir (dir->dirstream));
|
||||
if (d == 0)
|
||||
ENULLLOOP (d, readdir (dc->dirstream));
|
||||
if (d == NULL)
|
||||
{
|
||||
if (errno)
|
||||
pfatal_with_name ("INTERNAL: readdir");
|
||||
OSS (fatal, NILF, "readdir %s: %s", dir->name, strerror (errno));
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -716,7 +754,7 @@ dir_contents_file_exists_p (struct directory_contents *dir,
|
||||
len = NAMLEN (d);
|
||||
dirfile_key.name = d->d_name;
|
||||
dirfile_key.length = len;
|
||||
dirfile_slot = (struct dirfile **) hash_find_slot (&dir->dirfiles, &dirfile_key);
|
||||
dirfile_slot = (struct dirfile **) hash_find_slot (&dc->dirfiles, &dirfile_key);
|
||||
#ifdef WINDOWS32
|
||||
/*
|
||||
* If re-reading a directory, don't cache files that have
|
||||
@@ -737,21 +775,22 @@ dir_contents_file_exists_p (struct directory_contents *dir,
|
||||
#endif
|
||||
df->length = len;
|
||||
df->impossible = 0;
|
||||
hash_insert_at (&dir->dirfiles, df, dirfile_slot);
|
||||
hash_insert_at (&dc->dirfiles, df, dirfile_slot);
|
||||
}
|
||||
/* Check if the name matches the one we're searching for. */
|
||||
if (filename != 0 && patheq (d->d_name, filename))
|
||||
if (filename != NULL && patheq (d->d_name, filename))
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* If the directory has been completely read in,
|
||||
close the stream and reset the pointer to nil. */
|
||||
if (d == 0)
|
||||
if (d == NULL)
|
||||
{
|
||||
--open_directories;
|
||||
closedir (dir->dirstream);
|
||||
dir->dirstream = 0;
|
||||
closedir (dc->dirstream);
|
||||
dc->dirstream = NULL;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -763,15 +802,10 @@ int
|
||||
dir_file_exists_p (const char *dirname, const char *filename)
|
||||
{
|
||||
#ifdef VMS
|
||||
if ((filename != NULL) && (dirname != NULL))
|
||||
{
|
||||
int want_vmsify;
|
||||
want_vmsify = (strpbrk (dirname, ":<[") != NULL);
|
||||
if (want_vmsify)
|
||||
filename = vmsify (filename, 0);
|
||||
}
|
||||
if (filename && dirname && strpbrk (dirname, ":<[") != NULL)
|
||||
filename = vmsify (filename, 0);
|
||||
#endif
|
||||
return dir_contents_file_exists_p (find_directory (dirname)->contents,
|
||||
return dir_contents_file_exists_p (find_directory (dirname),
|
||||
filename);
|
||||
}
|
||||
|
||||
@@ -791,17 +825,17 @@ file_exists_p (const char *name)
|
||||
|
||||
dirend = strrchr (name, '/');
|
||||
#ifdef VMS
|
||||
if (dirend == 0)
|
||||
if (dirend == NULL)
|
||||
{
|
||||
dirend = strrchr (name, ']');
|
||||
dirend == NULL ? dirend : dirend++;
|
||||
}
|
||||
if (dirend == 0)
|
||||
if (dirend == NULL)
|
||||
{
|
||||
dirend = strrchr (name, '>');
|
||||
dirend == NULL ? dirend : dirend++;
|
||||
}
|
||||
if (dirend == 0)
|
||||
if (dirend == NULL)
|
||||
{
|
||||
dirend = strrchr (name, ':');
|
||||
dirend == NULL ? dirend : dirend++;
|
||||
@@ -818,7 +852,7 @@ file_exists_p (const char *name)
|
||||
dirend = name + 1;
|
||||
}
|
||||
#endif /* HAVE_DOS_PATHS */
|
||||
if (dirend == 0)
|
||||
if (dirend == NULL)
|
||||
#ifndef _AMIGA
|
||||
return dir_file_exists_p (".", name);
|
||||
#else /* !AMIGA */
|
||||
@@ -834,7 +868,7 @@ file_exists_p (const char *name)
|
||||
#ifdef HAVE_DOS_PATHS
|
||||
/* d:/ and d: are *very* different... */
|
||||
if (dirend < name + 3 && name[1] == ':' &&
|
||||
(*dirend == '/' || *dirend == '\\' || *dirend == ':'))
|
||||
(ISDIRSEP (*dirend) || *dirend == ':'))
|
||||
dirend++;
|
||||
#endif
|
||||
p = alloca (dirend - name + 1);
|
||||
@@ -892,7 +926,7 @@ file_impossible (const char *filename)
|
||||
dirend = p + 1;
|
||||
}
|
||||
#endif /* HAVE_DOS_PATHS */
|
||||
if (dirend == 0)
|
||||
if (dirend == NULL)
|
||||
#ifdef _AMIGA
|
||||
dir = find_directory ("");
|
||||
#else /* !AMIGA */
|
||||
@@ -910,7 +944,7 @@ file_impossible (const char *filename)
|
||||
#ifdef HAVE_DOS_PATHS
|
||||
/* d:/ and d: are *very* different... */
|
||||
if (dirend < p + 3 && p[1] == ':' &&
|
||||
(*dirend == '/' || *dirend == '\\' || *dirend == ':'))
|
||||
(ISDIRSEP (*dirend) || *dirend == ':'))
|
||||
dirend++;
|
||||
#endif
|
||||
cp = alloca (dirend - p + 1);
|
||||
@@ -929,16 +963,14 @@ file_impossible (const char *filename)
|
||||
#endif
|
||||
}
|
||||
|
||||
if (dir->contents == 0)
|
||||
if (dir->contents == NULL)
|
||||
/* The directory could not be stat'd. We allocate a contents
|
||||
structure for it, but leave it out of the contents hash table. */
|
||||
dir->contents = xcalloc (sizeof (struct directory_contents));
|
||||
|
||||
if (dir->contents->dirfiles.ht_vec == 0)
|
||||
{
|
||||
hash_init (&dir->contents->dirfiles, DIRFILE_BUCKETS,
|
||||
dirfile_hash_1, dirfile_hash_2, dirfile_hash_cmp);
|
||||
}
|
||||
if (dir->contents->dirfiles.ht_vec == NULL)
|
||||
hash_init (&dir->contents->dirfiles, DIRFILE_BUCKETS,
|
||||
dirfile_hash_1, dirfile_hash_2, dirfile_hash_cmp);
|
||||
|
||||
/* Make a new entry and put it in the table. */
|
||||
|
||||
@@ -990,7 +1022,7 @@ file_impossible_p (const char *filename)
|
||||
dirend = filename + 1;
|
||||
}
|
||||
#endif /* HAVE_DOS_PATHS */
|
||||
if (dirend == 0)
|
||||
if (dirend == NULL)
|
||||
#ifdef _AMIGA
|
||||
dir = find_directory ("")->contents;
|
||||
#else /* !AMIGA */
|
||||
@@ -1008,7 +1040,7 @@ file_impossible_p (const char *filename)
|
||||
#ifdef HAVE_DOS_PATHS
|
||||
/* d:/ and d: are *very* different... */
|
||||
if (dirend < filename + 3 && filename[1] == ':' &&
|
||||
(*dirend == '/' || *dirend == '\\' || *dirend == ':'))
|
||||
(ISDIRSEP (*dirend) || *dirend == ':'))
|
||||
dirend++;
|
||||
#endif
|
||||
cp = alloca (dirend - filename + 1);
|
||||
@@ -1027,7 +1059,7 @@ file_impossible_p (const char *filename)
|
||||
#endif
|
||||
}
|
||||
|
||||
if (dir == 0 || dir->dirfiles.ht_vec == 0)
|
||||
if (dir == NULL || dir->dirfiles.ht_vec == NULL)
|
||||
/* There are no files entered for this directory. */
|
||||
return 0;
|
||||
|
||||
@@ -1069,6 +1101,9 @@ print_dir_data_base (void)
|
||||
unsigned int impossible;
|
||||
struct directory **dir_slot;
|
||||
struct directory **dir_end;
|
||||
#ifdef WINDOWS32
|
||||
char buf[INTSTR_LENGTH + 1];
|
||||
#endif
|
||||
|
||||
puts (_("\n# Directories\n"));
|
||||
|
||||
@@ -1081,27 +1116,22 @@ print_dir_data_base (void)
|
||||
struct directory *dir = *dir_slot;
|
||||
if (! HASH_VACANT (dir))
|
||||
{
|
||||
if (dir->contents == 0)
|
||||
if (dir->contents == NULL)
|
||||
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 == NULL)
|
||||
#ifdef WINDOWS32
|
||||
printf (_("# %s (key %s, mtime %I64u): could not be opened.\n"),
|
||||
dir->name, dir->contents->path_key,
|
||||
(unsigned long long)dir->contents->mtime);
|
||||
#else /* WINDOWS32 */
|
||||
#ifdef VMS_INO_T
|
||||
printf (_("# %s (device %d, inode [%d,%d,%d]): could not be opened.\n"),
|
||||
dir->name, dir->contents->dev,
|
||||
dir->contents->ino[0], dir->contents->ino[1],
|
||||
dir->contents->ino[2]);
|
||||
printf (_("# %s (key %s, mtime %s): could not be opened.\n"),
|
||||
dir->name, dir->contents->path_key,
|
||||
make_ulltoa ((unsigned long long)dir->contents->mtime, buf));
|
||||
#elif defined(VMS_INO_T)
|
||||
printf (_("# %s (device %d, inode [%d,%d,%d]): could not be opened.\n"),
|
||||
dir->name, dir->contents->dev,
|
||||
dir->contents->ino[0], dir->contents->ino[1],
|
||||
dir->contents->ino[2]);
|
||||
#else
|
||||
printf (_("# %s (device %ld, inode %ld): could not be opened.\n"),
|
||||
dir->name, (long int) dir->contents->dev,
|
||||
(long int) dir->contents->ino);
|
||||
printf (_("# %s (device %ld, inode %ld): could not be opened.\n"),
|
||||
dir->name, (long) dir->contents->dev, (long) dir->contents->ino);
|
||||
#endif
|
||||
#endif /* WINDOWS32 */
|
||||
}
|
||||
else
|
||||
{
|
||||
unsigned int f = 0;
|
||||
@@ -1123,21 +1153,18 @@ print_dir_data_base (void)
|
||||
}
|
||||
}
|
||||
#ifdef WINDOWS32
|
||||
printf (_("# %s (key %s, mtime %I64u): "),
|
||||
printf (_("# %s (key %s, mtime %s): "),
|
||||
dir->name, dir->contents->path_key,
|
||||
(unsigned long long)dir->contents->mtime);
|
||||
#else /* WINDOWS32 */
|
||||
#ifdef VMS_INO_T
|
||||
make_ulltoa ((unsigned long long)dir->contents->mtime, buf));
|
||||
#elif defined(VMS_INO_T)
|
||||
printf (_("# %s (device %d, inode [%d,%d,%d]): "),
|
||||
dir->name, dir->contents->dev,
|
||||
dir->contents->ino[0], dir->contents->ino[1],
|
||||
dir->contents->ino[2]);
|
||||
#else
|
||||
printf (_("# %s (device %ld, inode %ld): "),
|
||||
dir->name,
|
||||
printf (_("# %s (device %ld, inode %ld): "), dir->name,
|
||||
(long)dir->contents->dev, (long)dir->contents->ino);
|
||||
#endif
|
||||
#endif /* WINDOWS32 */
|
||||
if (f == 0)
|
||||
fputs (_("No"), stdout);
|
||||
else
|
||||
@@ -1148,7 +1175,7 @@ print_dir_data_base (void)
|
||||
else
|
||||
printf ("%u", im);
|
||||
fputs (_(" impossibilities"), stdout);
|
||||
if (dir->contents->dirstream == 0)
|
||||
if (dir->contents->dirstream == NULL)
|
||||
puts (".");
|
||||
else
|
||||
puts (_(" so far."));
|
||||
@@ -1182,34 +1209,34 @@ struct dirstream
|
||||
};
|
||||
|
||||
/* Forward declarations. */
|
||||
static __ptr_t open_dirstream (const char *);
|
||||
static struct dirent *read_dirstream (__ptr_t);
|
||||
static void *open_dirstream (const char *);
|
||||
static struct dirent *read_dirstream (void *);
|
||||
|
||||
static __ptr_t
|
||||
static void *
|
||||
open_dirstream (const char *directory)
|
||||
{
|
||||
struct dirstream *new;
|
||||
struct directory *dir = find_directory (directory);
|
||||
|
||||
if (dir->contents == 0 || dir->contents->dirfiles.ht_vec == 0)
|
||||
if (dir->contents == NULL || dir->contents->dirfiles.ht_vec == NULL)
|
||||
/* DIR->contents is nil if the directory could not be stat'd.
|
||||
DIR->contents->dirfiles is nil if it could not be opened. */
|
||||
return 0;
|
||||
return NULL;
|
||||
|
||||
/* Read all the contents of the directory now. There is no benefit
|
||||
in being lazy, since glob will want to see every file anyway. */
|
||||
|
||||
dir_contents_file_exists_p (dir->contents, 0);
|
||||
dir_contents_file_exists_p (dir, NULL);
|
||||
|
||||
new = xmalloc (sizeof (struct dirstream));
|
||||
new->contents = dir->contents;
|
||||
new->dirfile_slot = (struct dirfile **) new->contents->dirfiles.ht_vec;
|
||||
|
||||
return (__ptr_t) new;
|
||||
return new;
|
||||
}
|
||||
|
||||
static struct dirent *
|
||||
read_dirstream (__ptr_t stream)
|
||||
read_dirstream (void *stream)
|
||||
{
|
||||
static char *buf;
|
||||
static size_t bufsz;
|
||||
@@ -1253,7 +1280,7 @@ read_dirstream (__ptr_t stream)
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* On 64 bit ReliantUNIX (5.44 and above) in LFS mode, stat() is actually a
|
||||
@@ -1286,13 +1313,12 @@ local_stat (const char *path, struct stat *buf)
|
||||
/* Make sure the parent of "." exists and is a directory, not a
|
||||
file. This is because 'stat' on Windows normalizes the argument
|
||||
foo/. => foo without checking first that foo is a directory. */
|
||||
if (plen > 1 && path[plen - 1] == '.'
|
||||
&& (path[plen - 2] == '/' || path[plen - 2] == '\\'))
|
||||
if (plen > 2 && path[plen - 1] == '.' && ISDIRSEP (path[plen - 2]))
|
||||
{
|
||||
char parent[MAXPATHLEN];
|
||||
char parent[MAX_PATH+1];
|
||||
|
||||
strncpy (parent, path, plen - 2);
|
||||
parent[plen - 2] = '\0';
|
||||
strncpy (parent, path, MAX_PATH);
|
||||
parent[MIN(plen - 2, MAX_PATH)] = '\0';
|
||||
if (stat (parent, buf) < 0 || !_S_ISDIR (buf->st_mode))
|
||||
return -1;
|
||||
}
|
||||
|
||||
42
src/expand.c
42
src/expand.c
@@ -1,5 +1,5 @@
|
||||
/* Variable expansion functions for GNU Make.
|
||||
Copyright (C) 1988-2020 Free Software Foundation, Inc.
|
||||
Copyright (C) 1988-2023 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
|
||||
@@ -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.
|
||||
|
||||
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 <assert.h>
|
||||
|
||||
#include "commands.h"
|
||||
#include "debug.h"
|
||||
#include "filedef.h"
|
||||
#include "job.h"
|
||||
#include "commands.h"
|
||||
#include "variable.h"
|
||||
#include "rule.h"
|
||||
|
||||
@@ -67,14 +68,14 @@ variable_buffer_output (char *ptr, const char *string, size_t length)
|
||||
ptr = variable_buffer + offset;
|
||||
}
|
||||
|
||||
memcpy (ptr, string, length);
|
||||
return ptr + length;
|
||||
return mempcpy (ptr, string, 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 *
|
||||
initialize_variable_output (void)
|
||||
char *
|
||||
initialize_variable_output ()
|
||||
{
|
||||
/* 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;
|
||||
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.
|
||||
This can happen for command-line variables, builtin variables, etc. */
|
||||
saved_varp = expanding_var;
|
||||
@@ -207,7 +231,7 @@ variable_expand_string (char *line, const char *string, size_t length)
|
||||
if (length == 0)
|
||||
{
|
||||
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
|
||||
|
||||
284
src/file.c
284
src/file.c
@@ -1,5 +1,5 @@
|
||||
/* Target file management for GNU Make.
|
||||
Copyright (C) 1988-2020 Free Software Foundation, Inc.
|
||||
Copyright (C) 1988-2023 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
|
||||
@@ -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.
|
||||
|
||||
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"
|
||||
|
||||
@@ -25,6 +25,7 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
#include "variable.h"
|
||||
#include "debug.h"
|
||||
#include "hash.h"
|
||||
#include "shuffle.h"
|
||||
|
||||
|
||||
/* Remember whether snap_deps has been invoked: we need this to be sure we
|
||||
@@ -104,20 +105,10 @@ lookup_file (const char *name)
|
||||
while (name[0] == '<' && name[1] == '>' && name[2] != '\0')
|
||||
name += 2;
|
||||
#endif
|
||||
while (name[0] == '.'
|
||||
#ifdef HAVE_DOS_PATHS
|
||||
&& (name[1] == '/' || name[1] == '\\')
|
||||
#else
|
||||
&& name[1] == '/'
|
||||
#endif
|
||||
&& name[2] != '\0')
|
||||
while (name[0] == '.' && ISDIRSEP (name[1]) && name[2] != '\0')
|
||||
{
|
||||
name += 2;
|
||||
while (*name == '/'
|
||||
#ifdef HAVE_DOS_PATHS
|
||||
|| *name == '\\'
|
||||
#endif
|
||||
)
|
||||
while (ISDIRSEP (*name))
|
||||
/* Skip following slashes: ".//foo" is "foo", not "/foo". */
|
||||
++name;
|
||||
}
|
||||
@@ -270,14 +261,14 @@ rehash_file (struct file *from_file, const char *to_hname)
|
||||
{
|
||||
size_t l = strlen (from_file->name);
|
||||
/* 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. */
|
||||
if (to_file->cmds->fileinfo.filenm != 0)
|
||||
error (&from_file->cmds->fileinfo,
|
||||
l + strlen (to_file->cmds->fileinfo.filenm) + INTSTR_LENGTH,
|
||||
_("Recipe was specified for file '%s' at %s:%lu,"),
|
||||
from_file->name, to_file->cmds->fileinfo.filenm,
|
||||
to_file->cmds->fileinfo.lineno);
|
||||
from_file->name, from_file->cmds->fileinfo.filenm,
|
||||
from_file->cmds->fileinfo.lineno);
|
||||
else
|
||||
error (&from_file->cmds->fileinfo, l,
|
||||
_("Recipe for file '%s' was found by implicit rule search,"),
|
||||
@@ -288,7 +279,7 @@ rehash_file (struct file *from_file, const char *to_hname)
|
||||
from_file->name, to_hname);
|
||||
error (&from_file->cmds->fileinfo, l,
|
||||
_("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 +318,19 @@ rehash_file (struct file *from_file, const char *to_hname)
|
||||
|
||||
#define MERGE(field) to_file->field |= from_file->field
|
||||
MERGE (precious);
|
||||
MERGE (loaded);
|
||||
MERGE (tried_implicit);
|
||||
MERGE (updating);
|
||||
MERGE (updated);
|
||||
MERGE (is_target);
|
||||
MERGE (cmd_target);
|
||||
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 (snapped);
|
||||
#undef MERGE
|
||||
|
||||
to_file->builtin = 0;
|
||||
@@ -369,7 +365,7 @@ remove_intermediates (int sig)
|
||||
int doneany = 0;
|
||||
|
||||
/* If there's no way we will ever remove anything anyway, punt early. */
|
||||
if (question_flag || touch_flag || all_secondary)
|
||||
if (question_flag || touch_flag || all_secondary || no_intermediates)
|
||||
return;
|
||||
|
||||
if (sig && just_print_flag)
|
||||
@@ -386,7 +382,7 @@ remove_intermediates (int sig)
|
||||
given on the command line, and it's either a -include makefile or
|
||||
it's not precious. */
|
||||
if (f->intermediate && (f->dontcare || !f->precious)
|
||||
&& !f->secondary && !f->cmd_target)
|
||||
&& !f->secondary && !f->notintermediate && !f->cmd_target)
|
||||
{
|
||||
int status;
|
||||
if (f->update_status == us_none)
|
||||
@@ -424,7 +420,11 @@ remove_intermediates (int sig)
|
||||
}
|
||||
}
|
||||
if (status < 0)
|
||||
perror_with_name ("unlink: ", f->name);
|
||||
{
|
||||
perror_with_name ("\nunlink: ", f->name);
|
||||
/* Start printing over. */
|
||||
doneany = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -442,8 +442,7 @@ remove_intermediates (int sig)
|
||||
struct dep *
|
||||
split_prereqs (char *p)
|
||||
{
|
||||
struct dep *new = PARSE_FILE_SEQ (&p, struct dep, MAP_PIPE, NULL,
|
||||
PARSEFS_NONE);
|
||||
struct dep *new = PARSE_FILE_SEQ (&p, struct dep, MAP_PIPE, NULL, PARSEFS_WAIT);
|
||||
|
||||
if (*p)
|
||||
{
|
||||
@@ -452,7 +451,7 @@ split_prereqs (char *p)
|
||||
struct dep *ood;
|
||||
|
||||
++p;
|
||||
ood = PARSE_SIMPLE_SEQ (&p, struct dep);
|
||||
ood = PARSE_FILE_SEQ (&p, struct dep, MAP_NUL, NULL, PARSEFS_WAIT);
|
||||
|
||||
if (! new)
|
||||
new = ood;
|
||||
@@ -486,7 +485,6 @@ enter_prereqs (struct dep *deps, const char *stem)
|
||||
if (stem)
|
||||
{
|
||||
const char *pattern = "%";
|
||||
char *buffer = variable_expand ("");
|
||||
struct dep *dp = deps, *dl = 0;
|
||||
|
||||
while (dp != 0)
|
||||
@@ -506,14 +504,15 @@ enter_prereqs (struct dep *deps, const char *stem)
|
||||
if (stem[0] == '\0')
|
||||
{
|
||||
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
|
||||
o = patsubst_expand_pat (buffer, stem, pattern, nm,
|
||||
o = patsubst_expand_pat (variable_buffer, stem, pattern, nm,
|
||||
pattern+1, percent+1);
|
||||
|
||||
/* If the name expanded to the empty string, ignore it. */
|
||||
if (buffer[0] == '\0')
|
||||
if (variable_buffer[0] == '\0')
|
||||
{
|
||||
struct dep *df = dp;
|
||||
if (dp == deps)
|
||||
@@ -525,7 +524,8 @@ enter_prereqs (struct dep *deps, const char *stem)
|
||||
}
|
||||
|
||||
/* 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->staticpattern = 1;
|
||||
@@ -545,21 +545,29 @@ enter_prereqs (struct dep *deps, const char *stem)
|
||||
d1->file = enter_file (d1->name);
|
||||
d1->staticpattern = 0;
|
||||
d1->name = 0;
|
||||
if (!stem)
|
||||
/* This file is explicitly mentioned as a prereq. */
|
||||
d1->file->is_explicit = 1;
|
||||
}
|
||||
|
||||
return deps;
|
||||
}
|
||||
|
||||
/* Expand and parse each dependency line. */
|
||||
static void
|
||||
/* Expand and parse each dependency line.
|
||||
For each dependency of the file, make the 'struct dep' point
|
||||
at the appropriate 'struct file' (which may have to be created). */
|
||||
void
|
||||
expand_deps (struct file *f)
|
||||
{
|
||||
struct dep *d;
|
||||
struct dep **dp;
|
||||
const char *file_stem = f->stem;
|
||||
const char *fstem;
|
||||
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
|
||||
expansion, expand it then insert the result into the list. */
|
||||
@@ -569,7 +577,6 @@ expand_deps (struct file *f)
|
||||
{
|
||||
char *p;
|
||||
struct dep *new, *next;
|
||||
char *name = (char *)d->name;
|
||||
|
||||
if (! d->name || ! d->need_2nd_expansion)
|
||||
{
|
||||
@@ -579,16 +586,46 @@ expand_deps (struct file *f)
|
||||
continue;
|
||||
}
|
||||
|
||||
/* If it's from a static pattern rule, convert the patterns into
|
||||
"$*" so they'll expand properly. */
|
||||
/* If it's from a static pattern rule, convert the initial pattern in
|
||||
each word to "$*" so they'll expand properly. */
|
||||
if (d->staticpattern)
|
||||
{
|
||||
char *o = variable_expand ("");
|
||||
o = subst_expand (o, name, "%", "$*", 1, 2, 0);
|
||||
*o = '\0';
|
||||
free (name);
|
||||
d->name = name = xstrdup (variable_buffer);
|
||||
d->staticpattern = 0;
|
||||
const char *cs = d->name;
|
||||
size_t nperc = 0;
|
||||
|
||||
/* Count the number of % in the string. */
|
||||
while ((cs = strchr (cs, '%')) != NULL)
|
||||
{
|
||||
++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
|
||||
@@ -600,39 +637,53 @@ expand_deps (struct file *f)
|
||||
initialized = 1;
|
||||
}
|
||||
|
||||
if (d->stem != 0)
|
||||
f->stem = d->stem;
|
||||
|
||||
set_file_variables (f);
|
||||
set_file_variables (f, d->stem ? d->stem : f->stem);
|
||||
|
||||
/* Perform second expansion. */
|
||||
p = variable_expand_for_file (d->name, f);
|
||||
|
||||
if (d->stem != 0)
|
||||
f->stem = file_stem;
|
||||
|
||||
/* At this point we don't need the name anymore: free it. */
|
||||
free (name);
|
||||
/* Free the un-expanded name. */
|
||||
free ((char*)d->name);
|
||||
|
||||
/* 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 (new == 0)
|
||||
{
|
||||
*dp = d->next;
|
||||
changed_dep = 1;
|
||||
free_dep (d);
|
||||
d = *dp;
|
||||
continue;
|
||||
}
|
||||
|
||||
/* Add newly parsed prerequisites. */
|
||||
fstem = d->stem;
|
||||
next = d->next;
|
||||
changed_dep = 1;
|
||||
free_dep (d);
|
||||
*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;
|
||||
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);
|
||||
}
|
||||
|
||||
/* Add extra prereqs to the file in question. */
|
||||
@@ -640,9 +691,10 @@ expand_deps (struct file *f)
|
||||
struct dep *
|
||||
expand_extra_prereqs (const struct variable *extra)
|
||||
{
|
||||
struct dep *d;
|
||||
struct dep *prereqs = extra ? split_prereqs (variable_expand (extra->value)) : NULL;
|
||||
|
||||
for (struct dep *d = prereqs; d; d = d->next)
|
||||
for (d = prereqs; d; d = d->next)
|
||||
{
|
||||
d->file = lookup_file (d->name);
|
||||
if (!d->file)
|
||||
@@ -666,10 +718,18 @@ snap_file (const void *item, void *arg)
|
||||
if (!second_expansion)
|
||||
f->updating = 0;
|
||||
|
||||
/* If .SECONDARY is set with no deps, mark all targets as intermediate. */
|
||||
if (all_secondary)
|
||||
/* 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));
|
||||
@@ -700,10 +760,7 @@ snap_file (const void *item, void *arg)
|
||||
}
|
||||
}
|
||||
|
||||
/* For each dependency of each file, make the 'struct dep' point
|
||||
at the appropriate 'struct file' (which may have to be created).
|
||||
|
||||
Also mark the files depended on by .PRECIOUS, .PHONY, .SILENT,
|
||||
/* Mark the files depended on by .PRECIOUS, .PHONY, .SILENT,
|
||||
and various other special targets. */
|
||||
|
||||
void
|
||||
@@ -717,37 +774,6 @@ snap_deps (void)
|
||||
longer define new targets. */
|
||||
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);
|
||||
}
|
||||
|
||||
/* Now manage all the special targets. */
|
||||
|
||||
for (f = lookup_file (".PRECIOUS"); f != 0; f = f->prev)
|
||||
@@ -771,11 +797,32 @@ snap_deps (void)
|
||||
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 cannot 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)
|
||||
/* Mark .INTERMEDIATE deps as intermediate files. */
|
||||
for (d = f->deps; d != 0; d = d->next)
|
||||
for (f2 = d->file; f2 != 0; f2 = f2->prev)
|
||||
f2->intermediate = 1;
|
||||
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.
|
||||
Marking all files as intermediates is useless since the goal targets
|
||||
would be deleted after they are built. */
|
||||
@@ -785,11 +832,20 @@ snap_deps (void)
|
||||
if (f->deps)
|
||||
for (d = f->deps; d != 0; d = d->next)
|
||||
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;
|
||||
/* .SECONDARY with no deps listed marks *all* files that way. */
|
||||
else
|
||||
all_secondary = 1;
|
||||
|
||||
if (no_intermediates && all_secondary)
|
||||
O (fatal, NILF,
|
||||
_(".NOTINTERMEDIATE and .SECONDARY are mutually exclusive"));
|
||||
|
||||
f = lookup_file (".EXPORT_ALL_VARIABLES");
|
||||
if (f != 0 && f->is_target)
|
||||
export_all_variables = 1;
|
||||
@@ -818,7 +874,19 @@ snap_deps (void)
|
||||
|
||||
f = lookup_file (".NOTPARALLEL");
|
||||
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")));
|
||||
@@ -937,13 +1005,16 @@ file_timestamp_sprintf (char *p, FILE_TIMESTAMP ts)
|
||||
struct tm *tm = localtime (&t);
|
||||
|
||||
if (tm)
|
||||
sprintf (p, "%04d-%02d-%02d %02d:%02d:%02d",
|
||||
tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday,
|
||||
tm->tm_hour, tm->tm_min, tm->tm_sec);
|
||||
{
|
||||
intmax_t year = tm->tm_year;
|
||||
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)
|
||||
sprintf (p, "%ld", (long) t);
|
||||
sprintf (p, "%" PRIdMAX, (intmax_t) t);
|
||||
else
|
||||
sprintf (p, "%lu", (unsigned long) t);
|
||||
sprintf (p, "%" PRIuMAX, (uintmax_t) t);
|
||||
p += strlen (p);
|
||||
|
||||
/* Append nanoseconds as a fraction, but remove trailing zeros. We don't
|
||||
@@ -969,17 +1040,17 @@ print_prereqs (const struct dep *deps)
|
||||
/* Print all normal dependencies; note any order-only deps. */
|
||||
for (; deps != 0; deps = deps->next)
|
||||
if (! deps->ignore_mtime)
|
||||
printf (" %s", dep_name (deps));
|
||||
printf (" %s%s", deps->wait_here ? ".WAIT " : "", dep_name (deps));
|
||||
else if (! ood)
|
||||
ood = deps;
|
||||
|
||||
/* Print order-only deps, if we have any. */
|
||||
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)
|
||||
if (ood->ignore_mtime)
|
||||
printf (" %s", dep_name (ood));
|
||||
printf (" %s%s", ood->wait_here ? ".WAIT " : "", dep_name (ood));
|
||||
}
|
||||
|
||||
putchar ('\n');
|
||||
@@ -1033,6 +1104,10 @@ print_file (const void *item)
|
||||
printf (_("# Implicit/static pattern stem: '%s'\n"), f->stem);
|
||||
if (f->intermediate)
|
||||
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)
|
||||
{
|
||||
const struct dep *d;
|
||||
@@ -1180,8 +1255,7 @@ build_target_list (char *value)
|
||||
p = &value[off];
|
||||
}
|
||||
|
||||
memcpy (p, f->name, l);
|
||||
p += l;
|
||||
p = mempcpy (p, f->name, l);
|
||||
*(p++) = ' ';
|
||||
}
|
||||
*(p-1) = '\0';
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Definition of target file data structures for GNU Make.
|
||||
Copyright (C) 1988-2020 Free Software Foundation, Inc.
|
||||
Copyright (C) 1988-2023 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
|
||||
@@ -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.
|
||||
|
||||
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
|
||||
@@ -84,6 +84,7 @@ struct file
|
||||
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 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
|
||||
has only one-second resolution. */
|
||||
unsigned int tried_implicit:1; /* Nonzero if have searched
|
||||
@@ -96,8 +97,11 @@ struct file
|
||||
unsigned int phony:1; /* Nonzero if this is a phony file
|
||||
i.e., a prerequisite of .PHONY. */
|
||||
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
|
||||
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
|
||||
this target cannot be remade. */
|
||||
unsigned int ignore_vpath:1;/* Nonzero if we threw out VPATH name. */
|
||||
@@ -105,6 +109,10 @@ struct file
|
||||
pattern-specific variables. */
|
||||
unsigned int no_diag:1; /* True if the file failed to update and no
|
||||
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. */
|
||||
};
|
||||
|
||||
|
||||
@@ -115,6 +123,7 @@ struct file *lookup_file (const char *name);
|
||||
struct file *enter_file (const char *name);
|
||||
struct dep *split_prereqs (char *prereqstr);
|
||||
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 snap_deps (void);
|
||||
@@ -203,6 +212,8 @@ FILE_TIMESTAMP f_mtime (struct file *file, int search);
|
||||
<< FILE_TIMESTAMP_LO_BITS) \
|
||||
+ 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
|
||||
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
|
||||
|
||||
656
src/function.c
656
src/function.c
File diff suppressed because it is too large
Load Diff
31
src/getopt.c
31
src/getopt.c
@@ -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
|
||||
before changing it!
|
||||
|
||||
Copyright (C) 1987-2020 Free Software Foundation, Inc.
|
||||
Copyright (C) 1987-2023 Free Software Foundation, Inc.
|
||||
|
||||
NOTE: The canonical source of this file is maintained with the GNU C Library.
|
||||
Bugs can be reported to bug-glibc@gnu.org.
|
||||
@@ -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.
|
||||
|
||||
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>.
|
||||
Ditto for AIX 3.2 and <stdlib.h>. */
|
||||
@@ -436,6 +436,10 @@ _getopt_initialize (int argc, char *const *argv, const char *optstring)
|
||||
nonoption_flags_len = 0;
|
||||
#endif
|
||||
|
||||
/* Make the compiler happy. */
|
||||
(void)argc;
|
||||
(void)argv;
|
||||
|
||||
return optstring;
|
||||
}
|
||||
|
||||
@@ -677,17 +681,18 @@ _getopt_internal (int argc, char *const *argv, const char *optstring,
|
||||
else
|
||||
{
|
||||
if (opterr)
|
||||
if (argv[optind - 1][1] == '-')
|
||||
/* --option */
|
||||
fprintf (stderr,
|
||||
_("%s: option '--%s' doesn't allow an argument\n"),
|
||||
argv[0], pfound->name);
|
||||
else
|
||||
/* +option or -option */
|
||||
fprintf (stderr,
|
||||
_("%s: option '%c%s' doesn't allow an argument\n"),
|
||||
argv[0], argv[optind - 1][0], pfound->name);
|
||||
|
||||
{
|
||||
if (argv[optind - 1][1] == '-')
|
||||
/* --option */
|
||||
fprintf (stderr,
|
||||
_("%s: option '--%s' doesn't allow an argument\n"),
|
||||
argv[0], pfound->name);
|
||||
else
|
||||
/* +option or -option */
|
||||
fprintf (stderr,
|
||||
_("%s: option '%c%s' doesn't allow an argument\n"),
|
||||
argv[0], argv[optind - 1][0], pfound->name);
|
||||
}
|
||||
nextchar += strlen (nextchar);
|
||||
|
||||
optopt = pfound->val;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Declarations for getopt.
|
||||
Copyright (C) 1989-2020 Free Software Foundation, Inc.
|
||||
Copyright (C) 1989-2023 Free Software Foundation, Inc.
|
||||
|
||||
NOTE: The canonical source of this file is maintained with the GNU C Library.
|
||||
Bugs can be reported to bug-glibc@gnu.org.
|
||||
@@ -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.
|
||||
|
||||
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
|
||||
#define _GETOPT_H 1
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* getopt_long and getopt_long_only entry points for GNU getopt.
|
||||
Copyright (C) 1987-1994, 1996-2020 Free Software Foundation, Inc.
|
||||
Copyright (C) 1987-1994, 1996-2023 Free Software Foundation, Inc.
|
||||
|
||||
NOTE: The canonical source of this file is maintained with the GNU C Library.
|
||||
Bugs can be reported to bug-glibc@gnu.org.
|
||||
@@ -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.
|
||||
|
||||
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
|
||||
#include <config.h>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Convenience header for conditional use of GNU <libintl.h>.
|
||||
Copyright (C) 1995-2020 Free Software Foundation, Inc.
|
||||
Copyright (C) 1995-2023 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
|
||||
@@ -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.
|
||||
|
||||
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
|
||||
#define _LIBGETTEXT_H 1
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
;; Contents of the (gnu make) Guile module
|
||||
;; Copyright (C) 2011-2020 Free Software Foundation, Inc.
|
||||
;; Contents of the (GNU Make) Guile module
|
||||
;; Copyright (C) 2011-2023 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
|
||||
@@ -13,11 +13,11 @@
|
||||
;; details.
|
||||
;;
|
||||
;; 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)
|
||||
(cond
|
||||
;; In GNU make, "false" is the empty string
|
||||
;; In GNU Make, "false" is the empty string
|
||||
((or (not x)
|
||||
(unspecified? x)
|
||||
(variable? x)
|
||||
@@ -45,7 +45,7 @@
|
||||
(walk x)
|
||||
(string-join (reverse! acc))))
|
||||
|
||||
;; Return the value of the GNU make variable V
|
||||
;; Return the value of the GNU Make variable V
|
||||
(define (gmk-var v)
|
||||
(gmk-expand (format #f "$(~a)" (obj-to-str v))))
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/* External interfaces usable by dynamic objects loaded into GNU Make.
|
||||
--THIS API IS A "TECHNOLOGY PREVIEW" ONLY. IT IS NOT A STABLE INTERFACE--
|
||||
|
||||
Copyright (C) 2013-2020 Free Software Foundation, Inc.
|
||||
Copyright (C) 2013-2023 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
|
||||
@@ -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.
|
||||
|
||||
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_
|
||||
#define _GNUMAKE_H_
|
||||
@@ -41,23 +41,23 @@ typedef char *(*gmk_func_ptr)(const char *nm, unsigned int argc, char **argv);
|
||||
/* Free memory returned by the gmk_expand() function. */
|
||||
GMK_EXPORT void gmk_free (char *str);
|
||||
|
||||
/* Allocate memory in GNU make's context. */
|
||||
/* Allocate memory in GNU Make's context. */
|
||||
GMK_EXPORT char *gmk_alloc (unsigned int len);
|
||||
|
||||
/* Run $(eval ...) on the provided string BUFFER. */
|
||||
GMK_EXPORT void gmk_eval (const char *buffer, const gmk_floc *floc);
|
||||
|
||||
/* Run GNU make expansion on the provided string STR.
|
||||
/* Run GNU Make expansion on the provided string STR.
|
||||
Returns an allocated buffer that the caller must free with gmk_free(). */
|
||||
GMK_EXPORT char *gmk_expand (const char *str);
|
||||
|
||||
/* Register a new GNU make function NAME (maximum of 255 chars long).
|
||||
/* Register a new GNU Make function NAME (maximum of 255 chars long).
|
||||
When the function is expanded in the makefile, FUNC will be invoked with
|
||||
the appropriate arguments.
|
||||
|
||||
The return value of FUNC must be either NULL, in which case it expands to
|
||||
the empty string, or a pointer to the result of the expansion in a string
|
||||
created by gmk_alloc(). GNU make will free the memory when it's done.
|
||||
created by gmk_alloc(). GNU Make will free the memory when it's done.
|
||||
|
||||
MIN_ARGS is the minimum number of arguments the function requires.
|
||||
MAX_ARGS is the maximum number of arguments (or 0 if there's no maximum).
|
||||
|
||||
20
src/guile.c
20
src/guile.c
@@ -1,5 +1,5 @@
|
||||
/* GNU Guile interface for GNU Make.
|
||||
Copyright (C) 2011-2020 Free Software Foundation, Inc.
|
||||
Copyright (C) 2011-2023 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
|
||||
@@ -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.
|
||||
|
||||
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"
|
||||
|
||||
@@ -47,7 +47,7 @@ cvt_scm_to_str (SCM obj)
|
||||
return scm_to_locale_string (scm_call_1 (obj_to_str, obj));
|
||||
}
|
||||
|
||||
/* Perform the GNU make expansion function. */
|
||||
/* Perform the GNU Make expansion function. */
|
||||
static SCM
|
||||
guile_expand_wrapper (SCM obj)
|
||||
{
|
||||
@@ -65,7 +65,7 @@ guile_expand_wrapper (SCM obj)
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* Perform the GNU make eval function. */
|
||||
/* Perform the GNU Make eval function. */
|
||||
static SCM
|
||||
guile_eval_wrapper (SCM obj)
|
||||
{
|
||||
@@ -77,24 +77,24 @@ guile_eval_wrapper (SCM obj)
|
||||
return SCM_BOOL_F;
|
||||
}
|
||||
|
||||
/* Invoked by scm_c_define_module(), in the context of the GNU make module. */
|
||||
/* Invoked by scm_c_define_module(), in the context of the GNU Make module. */
|
||||
static void
|
||||
guile_define_module (void *data UNUSED)
|
||||
{
|
||||
/* Ingest the predefined Guile module for GNU make. */
|
||||
/* Ingest the predefined Guile module for GNU Make. */
|
||||
#include "gmk-default.h"
|
||||
|
||||
/* Register a subr for GNU make's eval capability. */
|
||||
/* Register a subr for GNU Make's eval capability. */
|
||||
scm_c_define_gsubr ("gmk-expand", 1, 0, 0, (GSUBR_TYPE) guile_expand_wrapper);
|
||||
|
||||
/* Register a subr for GNU make's eval capability. */
|
||||
/* Register a subr for GNU Make's eval capability. */
|
||||
scm_c_define_gsubr ("gmk-eval", 1, 0, 0, (GSUBR_TYPE) guile_eval_wrapper);
|
||||
|
||||
/* Define the rest of the module. */
|
||||
scm_c_eval_string (GUILE_module_defn);
|
||||
}
|
||||
|
||||
/* Initialize the GNU make Guile module. */
|
||||
/* Initialize the GNU Make Guile module. */
|
||||
static void *
|
||||
guile_init (void *arg UNUSED)
|
||||
{
|
||||
@@ -104,7 +104,7 @@ guile_init (void *arg UNUSED)
|
||||
/* Get a reference to the object-to-string translator, for later. */
|
||||
obj_to_str = scm_variable_ref (scm_c_module_lookup (make_mod, "obj-to-str"));
|
||||
|
||||
/* Import the GNU make module exports into the generic space. */
|
||||
/* Import the GNU Make module exports into the generic space. */
|
||||
scm_c_eval_string ("(use-modules (gnu make))");
|
||||
|
||||
return NULL;
|
||||
|
||||
28
src/hash.c
28
src/hash.c
@@ -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.
|
||||
|
||||
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 "hash.h"
|
||||
@@ -44,11 +44,11 @@ hash_init (struct hash_table *ht, unsigned long size,
|
||||
{
|
||||
ht->ht_size = round_up_2 (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)
|
||||
{
|
||||
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);
|
||||
}
|
||||
|
||||
@@ -260,7 +260,7 @@ hash_rehash (struct hash_table *ht)
|
||||
ht->ht_capacity = ht->ht_size - (ht->ht_size >> 4);
|
||||
}
|
||||
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++)
|
||||
{
|
||||
@@ -361,7 +361,7 @@ round_up_2 (unsigned long n)
|
||||
#define sum_get_unaligned_32(r, p) \
|
||||
do { \
|
||||
unsigned int val; \
|
||||
memcpy(&val, (p), 4); \
|
||||
memcpy (&val, (p), 4); \
|
||||
r += val; \
|
||||
} while(0);
|
||||
|
||||
@@ -413,13 +413,16 @@ jhash(unsigned const char *k, int length)
|
||||
#define UINTSZ sizeof (unsigned int)
|
||||
|
||||
#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.
|
||||
Help the compiler optimize by using static memcpy length. */
|
||||
#define sum_up_to_nul(r, p, plen, flag) \
|
||||
do { \
|
||||
unsigned int val = 0; \
|
||||
size_t pn = (plen); \
|
||||
size_t n = pn < UINTSZ ? pn : UINTSZ; \
|
||||
memcpy (&val, (p), n); \
|
||||
if (pn >= UINTSZ) \
|
||||
memcpy (&val, (p), UINTSZ); \
|
||||
else \
|
||||
memcpy (&val, (p), pn); \
|
||||
if ((val & 0xFF000000) == 0) \
|
||||
flag = 1; \
|
||||
else if ((val & 0xFF0000) == 0) \
|
||||
@@ -432,13 +435,16 @@ jhash(unsigned const char *k, int length)
|
||||
#else
|
||||
/* 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
|
||||
big endian case, from the first byte in memory to the last. */
|
||||
big endian case, from the first byte in memory to the last.
|
||||
Help the compiler optimize by using static memcpy length. */
|
||||
#define sum_up_to_nul(r, p, plen, flag) \
|
||||
do { \
|
||||
unsigned int val = 0; \
|
||||
size_t pn = (plen); \
|
||||
size_t n = pn < UINTSZ ? pn : UINTSZ; \
|
||||
memcpy (&val, (p), n); \
|
||||
if (pn >= UINTSZ) \
|
||||
memcpy (&val, (p), UINTSZ); \
|
||||
else \
|
||||
memcpy (&val, (p), pn); \
|
||||
flag = ((val - 0x01010101) & ~val) & 0x80808080; \
|
||||
if (!flag) \
|
||||
r += val; \
|
||||
|
||||
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.
|
||||
|
||||
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_
|
||||
#define _hash_h_
|
||||
@@ -56,9 +56,9 @@ struct hash_table
|
||||
typedef int (*qsort_cmp_t) __P((void const *, void const *));
|
||||
|
||||
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,
|
||||
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_item __P((struct hash_table *ht, void const *key));
|
||||
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 { \
|
||||
unsigned char const *_key_ = (unsigned char const *) (KEY) - 1; \
|
||||
while (*++_key_) \
|
||||
(RESULT) += ((isupper (*_key_) ? tolower (*_key_) : *_key_) << (_key_[1] & 0xf)); \
|
||||
(RESULT) += (tolower (*_key_) << (_key_[1] & 0xf)); \
|
||||
} while (0)
|
||||
#define return_ISTRING_HASH_1(KEY) do { \
|
||||
unsigned long _result_ = 0; \
|
||||
@@ -165,7 +165,7 @@ extern void *hash_deleted_item;
|
||||
#define ISTRING_HASH_2(KEY, RESULT) do { \
|
||||
unsigned char const *_key_ = (unsigned char const *) (KEY) - 1; \
|
||||
while (*++_key_) \
|
||||
(RESULT) += ((isupper (*_key_) ? tolower (*_key_) : *_key_) << (_key_[1] & 0x7)); \
|
||||
(RESULT) += (tolower (*_key_) << (_key_[1] & 0x7)); \
|
||||
} while (0)
|
||||
#define return_ISTRING_HASH_2(KEY) do { \
|
||||
unsigned long _result_ = 0; \
|
||||
|
||||
344
src/implicit.c
344
src/implicit.c
@@ -1,5 +1,5 @@
|
||||
/* Implicit rule searching for GNU Make.
|
||||
Copyright (C) 1988-2020 Free Software Foundation, Inc.
|
||||
Copyright (C) 1988-2023 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
|
||||
@@ -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.
|
||||
|
||||
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 "filedef.h"
|
||||
@@ -22,9 +22,12 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
#include "variable.h"
|
||||
#include "job.h" /* struct child, used inside commands.h */
|
||||
#include "commands.h" /* set_file_variables */
|
||||
#include "shuffle.h"
|
||||
#include <assert.h>
|
||||
|
||||
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
|
||||
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
|
||||
should come first. */
|
||||
|
||||
if (pattern_search (file, 0, depth, 0))
|
||||
if (pattern_search (file, 0, depth, 0, 0))
|
||||
return 1;
|
||||
|
||||
#ifndef NO_ARCHIVES
|
||||
@@ -52,8 +55,11 @@ try_implicit_rule (struct file *file, unsigned int depth)
|
||||
{
|
||||
DBF (DB_IMPLICIT,
|
||||
_("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;
|
||||
DBS (DB_IMPLICIT,
|
||||
(_("No archive-member implicit rule found for '%s'.\n"),
|
||||
file->name));
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -153,6 +159,8 @@ struct patdeps
|
||||
struct file *file;
|
||||
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
|
||||
@@ -200,7 +208,8 @@ stemlen_compare (const void *v1, const void *v2)
|
||||
|
||||
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)
|
||||
{
|
||||
/* Filename we are searching for a rule for. */
|
||||
const char *filename = archive ? strchr (file->name, '(') : file->name;
|
||||
@@ -223,7 +232,11 @@ pattern_search (struct file *file, int archive,
|
||||
|
||||
/* Names of possible dependencies are constructed in this buffer.
|
||||
We may replace % by $(*F) for second expansion, increasing the length. */
|
||||
char *depname = alloca (namelen + max_pattern_dep_length + 4);
|
||||
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. */
|
||||
const char *stem = 0;
|
||||
@@ -251,6 +264,7 @@ pattern_search (struct file *file, int archive,
|
||||
int specific_rule_matched = 0;
|
||||
|
||||
unsigned int ri; /* uninit checks OK */
|
||||
int found_compat_rule = 0;
|
||||
struct rule *rule;
|
||||
|
||||
char *pathdir = NULL;
|
||||
@@ -308,7 +322,9 @@ pattern_search (struct file *file, int archive,
|
||||
don't use it here. */
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -431,6 +447,8 @@ pattern_search (struct file *file, int archive,
|
||||
for (intermed_ok = 0; intermed_ok < 2; ++intermed_ok)
|
||||
{
|
||||
pat = deplist;
|
||||
if (intermed_ok)
|
||||
DBS (DB_IMPLICIT, (_("Trying harder.\n")));
|
||||
|
||||
/* Try each pattern rule till we find one that applies. If it does,
|
||||
expand its dependencies (as substituted) and chain them in DEPS. */
|
||||
@@ -479,6 +497,10 @@ pattern_search (struct file *file, int archive,
|
||||
}
|
||||
}
|
||||
|
||||
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%.*s'.\n"),
|
||||
@@ -487,9 +509,6 @@ pattern_search (struct file *file, int archive,
|
||||
continue;
|
||||
}
|
||||
|
||||
DBS (DB_IMPLICIT, (_("Trying pattern rule with stem '%.*s'.\n"),
|
||||
(int) stemlen, stem));
|
||||
|
||||
if (!check_lastslash)
|
||||
{
|
||||
memcpy (stem_str, stem, stemlen);
|
||||
@@ -508,10 +527,6 @@ pattern_search (struct file *file, int archive,
|
||||
if (rule->deps == 0)
|
||||
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
|
||||
to use it. */
|
||||
rule->in_use = 1;
|
||||
@@ -526,7 +541,6 @@ pattern_search (struct file *file, int archive,
|
||||
while (1)
|
||||
{
|
||||
struct dep *dl, *d;
|
||||
char *p;
|
||||
|
||||
/* If we're out of name to parse, start the next prereq. */
|
||||
if (! nptr)
|
||||
@@ -540,32 +554,33 @@ pattern_search (struct file *file, int archive,
|
||||
/* If we don't need a second expansion, just replace the %. */
|
||||
if (! dep->need_2nd_expansion)
|
||||
{
|
||||
p = strchr (nptr, '%');
|
||||
if (p == 0)
|
||||
char *p;
|
||||
int is_explicit = 1;
|
||||
const char *cp = strchr (nptr, '%');
|
||||
if (cp == 0)
|
||||
strcpy (depname, nptr);
|
||||
else
|
||||
{
|
||||
char *o = depname;
|
||||
if (check_lastslash)
|
||||
{
|
||||
memcpy (o, filename, pathlen);
|
||||
o += pathlen;
|
||||
}
|
||||
memcpy (o, nptr, p - nptr);
|
||||
o += p - nptr;
|
||||
memcpy (o, stem, stemlen);
|
||||
o += stemlen;
|
||||
strcpy (o, p + 1);
|
||||
o = mempcpy (o, filename, pathlen);
|
||||
o = mempcpy (o, nptr, cp - nptr);
|
||||
o = mempcpy (o, stem, stemlen);
|
||||
strcpy (o, cp + 1);
|
||||
is_explicit = 0;
|
||||
}
|
||||
|
||||
/* Parse the expanded string. It might have wildcards. */
|
||||
p = depname;
|
||||
dl = PARSE_FILE_SEQ (&p, struct dep, MAP_NUL, NULL, PARSEFS_ONEWORD);
|
||||
dl = PARSE_FILE_SEQ (&p, struct dep, MAP_NUL, NULL,
|
||||
PARSEFS_ONEWORD|PARSEFS_WAIT);
|
||||
for (d = dl; d != NULL; d = d->next)
|
||||
{
|
||||
++deps_found;
|
||||
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. */
|
||||
@@ -585,17 +600,22 @@ pattern_search (struct file *file, int archive,
|
||||
{
|
||||
int add_dir = 0;
|
||||
size_t len;
|
||||
const char *end;
|
||||
struct dep **dptr;
|
||||
int is_explicit;
|
||||
const char *cp;
|
||||
char *p;
|
||||
|
||||
nptr = get_next_word (nptr, &len);
|
||||
if (nptr == 0)
|
||||
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] == '|')
|
||||
{
|
||||
order_only = 1;
|
||||
nptr += len;
|
||||
nptr = end;
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -610,49 +630,76 @@ pattern_search (struct file *file, int archive,
|
||||
(since $* and $(*F) are simple variables) there won't be
|
||||
additional re-expansion of the stem. */
|
||||
|
||||
p = lindex (nptr, nptr + len, '%');
|
||||
if (p == 0)
|
||||
cp = lindex (nptr, end, '%');
|
||||
if (cp == 0)
|
||||
{
|
||||
memcpy (depname, nptr, len);
|
||||
depname[len] = '\0';
|
||||
is_explicit = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
size_t i = p - nptr;
|
||||
/* Go through all % between NPTR and END.
|
||||
Copy contents of [NPTR, END) to depname, with the
|
||||
first % after NPTR and then each first % after white
|
||||
space replaced with $* or $(*F). depname has enough
|
||||
room to substitute each % with $(*F). */
|
||||
char *o = depname;
|
||||
memcpy (o, nptr, i);
|
||||
o += i;
|
||||
if (check_lastslash)
|
||||
|
||||
is_explicit = 0;
|
||||
for (;;)
|
||||
{
|
||||
add_dir = 1;
|
||||
memcpy (o, "$(*F)", 5);
|
||||
o += 5;
|
||||
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;
|
||||
}
|
||||
else
|
||||
{
|
||||
memcpy (o, "$*", 2);
|
||||
o += 2;
|
||||
}
|
||||
memcpy (o, p + 1, len - i - 1);
|
||||
o[len - i - 1] = '\0';
|
||||
len = end - nptr;
|
||||
memcpy (o, nptr, len);
|
||||
o[len] = '\0';
|
||||
}
|
||||
|
||||
/* Set up for the next word. */
|
||||
nptr += len;
|
||||
nptr = end;
|
||||
|
||||
/* Initialize and set file variables if we haven't already
|
||||
done so. */
|
||||
if (!file_vars_initialized)
|
||||
{
|
||||
initialize_file_variables (file, 0);
|
||||
set_file_variables (file);
|
||||
set_file_variables (file, stem_str);
|
||||
file_vars_initialized = 1;
|
||||
}
|
||||
/* Update the stem value in $* for this rule. */
|
||||
else if (!file_variables_set)
|
||||
{
|
||||
define_variable_for_file (
|
||||
"*", 1, file->stem, o_automatic, 0, file);
|
||||
"*", 1, stem_str, o_automatic, 0, file);
|
||||
file_variables_set = 1;
|
||||
}
|
||||
|
||||
@@ -666,7 +713,8 @@ pattern_search (struct file *file, int archive,
|
||||
/* Parse the expanded string. */
|
||||
struct dep *dp = PARSE_FILE_SEQ (&p, struct dep,
|
||||
order_only ? MAP_NUL : MAP_PIPE,
|
||||
add_dir ? pathdir : NULL, PARSEFS_NONE);
|
||||
add_dir ? pathdir : NULL,
|
||||
PARSEFS_WAIT);
|
||||
*dptr = dp;
|
||||
|
||||
for (d = dp; d != NULL; d = d->next)
|
||||
@@ -674,6 +722,7 @@ pattern_search (struct file *file, int archive,
|
||||
++deps_found;
|
||||
if (order_only)
|
||||
d->ignore_mtime = 1;
|
||||
d->is_explicit = is_explicit;
|
||||
dptr = &d->next;
|
||||
}
|
||||
|
||||
@@ -704,8 +753,10 @@ pattern_search (struct file *file, int archive,
|
||||
/* Go through the nameseq and handle each as a prereq name. */
|
||||
for (d = dl; d != 0; d = d->next)
|
||||
{
|
||||
struct dep *expl_d;
|
||||
struct file *df;
|
||||
int is_rule = d->name == dep_name (dep);
|
||||
int explicit = 0;
|
||||
struct dep *dp = 0;
|
||||
|
||||
if (file_impossible_p (d->name))
|
||||
{
|
||||
@@ -714,9 +765,11 @@ pattern_search (struct file *file, int archive,
|
||||
second pass either since we know that will fail. */
|
||||
DBS (DB_IMPLICIT,
|
||||
(is_rule
|
||||
? _("Rejecting impossible rule prerequisite '%s'.\n")
|
||||
: _("Rejecting impossible implicit prerequisite '%s'.\n"),
|
||||
d->name));
|
||||
? _("Rejecting rule '%s' due to impossible rule"
|
||||
" prerequisite '%s'.\n")
|
||||
: _("Rejecting rule '%s' due to impossible implicit"
|
||||
" prerequisite '%s'.\n"),
|
||||
get_rule_defn (rule), d->name));
|
||||
tryrules[ri].rule = 0;
|
||||
|
||||
failed = 1;
|
||||
@@ -726,41 +779,86 @@ pattern_search (struct file *file, int archive,
|
||||
memset (pat, '\0', sizeof (struct patdeps));
|
||||
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,
|
||||
(is_rule
|
||||
? _("Trying rule prerequisite '%s'.\n")
|
||||
: _("Trying implicit prerequisite '%s'.\n"), d->name));
|
||||
|
||||
/* If this prereq is also explicitly mentioned for FILE,
|
||||
skip all tests below since it must be built no matter
|
||||
which implicit rule we choose. */
|
||||
df = lookup_file (d->name);
|
||||
|
||||
for (expl_d = file->deps; expl_d != 0; expl_d = expl_d->next)
|
||||
if (streq (dep_name (expl_d), d->name))
|
||||
break;
|
||||
if (expl_d != 0)
|
||||
if (df && df->is_explicit)
|
||||
pat->is_explicit = 1;
|
||||
|
||||
/* 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;
|
||||
DBS (DB_IMPLICIT, (_("'%s' ought to exist.\n"), d->name));
|
||||
continue;
|
||||
}
|
||||
|
||||
/* The DEP->changed flag says that this dependency resides
|
||||
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))
|
||||
if (file_exists_p (d->name))
|
||||
{
|
||||
(pat++)->name = d->name;
|
||||
DBS (DB_IMPLICIT, (_("Found '%s'.\n"), d->name));
|
||||
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
|
||||
"lib/foo.c", and VPATH=src, searches for
|
||||
"src/lib/foo.c". */
|
||||
@@ -769,7 +867,7 @@ pattern_search (struct file *file, int archive,
|
||||
if (vname)
|
||||
{
|
||||
DBS (DB_IMPLICIT,
|
||||
(_("Found prerequisite '%s' as VPATH '%s'\n"),
|
||||
(_("Found prerequisite '%s' as VPATH '%s'.\n"),
|
||||
d->name, vname));
|
||||
(pat++)->name = d->name;
|
||||
continue;
|
||||
@@ -777,13 +875,15 @@ pattern_search (struct file *file, int archive,
|
||||
}
|
||||
|
||||
/* 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. */
|
||||
|
||||
if (intermed_ok)
|
||||
{
|
||||
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));
|
||||
|
||||
if (int_file == 0)
|
||||
@@ -794,7 +894,8 @@ pattern_search (struct file *file, int archive,
|
||||
if (pattern_search (int_file,
|
||||
0,
|
||||
depth + 1,
|
||||
recursions + 1))
|
||||
recursions + 1,
|
||||
allow_compat_rules))
|
||||
{
|
||||
pat->pattern = int_file->name;
|
||||
int_file->name = d->name;
|
||||
@@ -811,11 +912,24 @@ pattern_search (struct file *file, int archive,
|
||||
free_variable_set (int_file->variables);
|
||||
if (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
|
||||
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;
|
||||
break;
|
||||
}
|
||||
@@ -827,10 +941,6 @@ pattern_search (struct file *file, int archive,
|
||||
break;
|
||||
}
|
||||
|
||||
/* Reset the stem in FILE. */
|
||||
|
||||
file->stem = 0;
|
||||
|
||||
/* This rule is no longer 'in use' for recursive searches. */
|
||||
rule->in_use = 0;
|
||||
|
||||
@@ -882,24 +992,24 @@ pattern_search (struct file *file, int archive,
|
||||
struct file *imf = pat->file;
|
||||
struct file *f = lookup_file (imf->name);
|
||||
|
||||
/* We don't want to delete an intermediate file that happened
|
||||
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
|
||||
if (!f)
|
||||
f = enter_file (imf->name);
|
||||
|
||||
f->deps = imf->deps;
|
||||
f->cmds = imf->cmds;
|
||||
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_searched = imf->pat_searched;
|
||||
f->also_make = imf->also_make;
|
||||
f->is_target = 1;
|
||||
f->intermediate = 1;
|
||||
f->is_explicit |= imf->is_explicit || pat->is_explicit;
|
||||
f->notintermediate |= imf->notintermediate || no_intermediates;
|
||||
f->intermediate |= !f->is_explicit && !f->notintermediate;
|
||||
f->tried_implicit = 1;
|
||||
|
||||
imf = lookup_file (pat->pattern);
|
||||
@@ -916,7 +1026,9 @@ pattern_search (struct file *file, int archive,
|
||||
|
||||
dep = alloc_dep ();
|
||||
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);
|
||||
if (recursions)
|
||||
dep->name = s;
|
||||
@@ -942,8 +1054,14 @@ pattern_search (struct file *file, int archive,
|
||||
|
||||
dep->next = file->deps;
|
||||
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)
|
||||
{
|
||||
/* Always allocate new storage, since STEM might be on the stack for an
|
||||
@@ -965,11 +1083,16 @@ pattern_search (struct file *file, int archive,
|
||||
file->cmds = rule->cmds;
|
||||
file->is_target = 1;
|
||||
|
||||
/* Set precious flag. */
|
||||
/* Set precious and notintermediate flags. */
|
||||
{
|
||||
struct file *f = lookup_file (rule->targets[tryrules[foundrule].matches]);
|
||||
if (f && f->precious)
|
||||
file->precious = 1;
|
||||
if (f)
|
||||
{
|
||||
if (f->precious)
|
||||
file->precious = 1;
|
||||
if (f->notintermediate || no_intermediates)
|
||||
file->notintermediate = 1;
|
||||
}
|
||||
}
|
||||
|
||||
/* If this rule builds other targets, too, put the others into FILE's
|
||||
@@ -985,11 +1108,9 @@ pattern_search (struct file *file, int archive,
|
||||
struct dep *new = alloc_dep ();
|
||||
|
||||
/* GKM FIMXE: handle '|' here too */
|
||||
memcpy (p, rule->targets[ri],
|
||||
rule->suffixes[ri] - rule->targets[ri] - 1);
|
||||
p += rule->suffixes[ri] - rule->targets[ri] - 1;
|
||||
memcpy (p, file->stem, fullstemlen);
|
||||
p += fullstemlen;
|
||||
p = mempcpy (p, rule->targets[ri],
|
||||
rule->suffixes[ri] - rule->targets[ri] - 1);
|
||||
p = mempcpy (p, file->stem, fullstemlen);
|
||||
memcpy (p, rule->suffixes[ri],
|
||||
rule->lens[ri] - (rule->suffixes[ri] - rule->targets[ri])+1);
|
||||
new->name = strcache_add (nm);
|
||||
@@ -998,8 +1119,13 @@ pattern_search (struct file *file, int archive,
|
||||
|
||||
/* Set precious flag. */
|
||||
f = lookup_file (rule->targets[ri]);
|
||||
if (f && f->precious)
|
||||
new->file->precious = 1;
|
||||
if (f)
|
||||
{
|
||||
if (f->precious)
|
||||
new->file->precious = 1;
|
||||
if (f->notintermediate || no_intermediates)
|
||||
new->file->notintermediate = 1;
|
||||
}
|
||||
|
||||
/* Set the is_target flag so that this file is not treated as
|
||||
intermediate by the pattern rule search algorithm and
|
||||
@@ -1013,5 +1139,21 @@ pattern_search (struct file *file, int archive,
|
||||
free (tryrules);
|
||||
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;
|
||||
}
|
||||
|
||||
403
src/job.c
403
src/job.c
@@ -1,5 +1,5 @@
|
||||
/* Job execution and handling for GNU Make.
|
||||
Copyright (C) 1988-2020 Free Software Foundation, Inc.
|
||||
Copyright (C) 1988-2023 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
|
||||
@@ -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.
|
||||
|
||||
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"
|
||||
|
||||
@@ -25,12 +25,11 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
#include "commands.h"
|
||||
#include "variable.h"
|
||||
#include "os.h"
|
||||
#include "dep.h"
|
||||
#include "shuffle.h"
|
||||
|
||||
/* Default shell to use. */
|
||||
#ifdef WINDOWS32
|
||||
# ifdef HAVE_STRINGS_H
|
||||
# include <strings.h> /* for strcasecmp, strncasecmp */
|
||||
# endif
|
||||
# include <windows.h>
|
||||
|
||||
const char *default_shell = "sh.exe";
|
||||
@@ -121,6 +120,10 @@ static void vmsWaitForChildren (int *);
|
||||
# include <process.h>
|
||||
#endif
|
||||
|
||||
#if defined (HAVE_FCNTL_H)
|
||||
# include <fcntl.h>
|
||||
#endif
|
||||
|
||||
#if defined (HAVE_SYS_WAIT_H) || defined (HAVE_UNION_WAIT)
|
||||
# include <sys/wait.h>
|
||||
#endif
|
||||
@@ -198,6 +201,14 @@ int getgid ();
|
||||
# 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.
|
||||
Plus we have to support gettext string translation... Argh. */
|
||||
static const char *
|
||||
@@ -214,10 +225,6 @@ pid2str (pid_t pid)
|
||||
return pidstring;
|
||||
}
|
||||
|
||||
#ifndef HAVE_GETLOADAVG
|
||||
int getloadavg (double loadavg[], int nelem);
|
||||
#endif
|
||||
|
||||
static void free_child (struct child *);
|
||||
static void start_job_command (struct child *child);
|
||||
static int load_too_high (void);
|
||||
@@ -272,7 +279,7 @@ create_batch_file (char const *base, int unixy, int *fd)
|
||||
{
|
||||
const char *const ext = unixy ? "sh" : "bat";
|
||||
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);
|
||||
int path_is_dot = 0;
|
||||
/* The following variable is static so we won't try to reuse a name
|
||||
@@ -367,7 +374,7 @@ create_batch_file (char const *base, int unixy, int *fd)
|
||||
|
||||
*fd = -1;
|
||||
if (error_string == NULL)
|
||||
error_string = _("Cannot create a temporary file\n");
|
||||
error_string = _("Cannot create a temporary file");
|
||||
O (fatal, NILF, error_string);
|
||||
|
||||
/* not reached */
|
||||
@@ -405,7 +412,8 @@ _is_unixy_shell (const char *path)
|
||||
else if (!name) /* name and p must be 0 */
|
||||
name = path;
|
||||
|
||||
if (*name == '/' || *name == '\\') name++;
|
||||
if (ISDIRSEP (*name))
|
||||
name++;
|
||||
|
||||
i = 0;
|
||||
while (known_os2shells[i] != NULL)
|
||||
@@ -428,38 +436,30 @@ is_bourne_compatible_shell (const char *path)
|
||||
static const char *unix_shells[] = {
|
||||
"sh",
|
||||
"bash",
|
||||
"dash",
|
||||
"ksh",
|
||||
"rksh",
|
||||
"zsh",
|
||||
"ash",
|
||||
"dash",
|
||||
NULL
|
||||
};
|
||||
const char **s;
|
||||
|
||||
/* find the rightmost '/' or '\\' */
|
||||
const char *name = strrchr (path, '/');
|
||||
char *p = strrchr (path, '\\');
|
||||
/* find the last directory separator, or the beginning of the string. */
|
||||
const char *cp = path + strlen (path);
|
||||
|
||||
if (name && p) /* take the max */
|
||||
name = (name > p) ? name : p;
|
||||
else if (p) /* name must be 0 */
|
||||
name = p;
|
||||
else if (!name) /* name and p must be 0 */
|
||||
name = path;
|
||||
|
||||
if (*name == '/' || *name == '\\')
|
||||
++name;
|
||||
while (cp > path && !ISDIRSEP (cp[-1]))
|
||||
--cp;
|
||||
|
||||
/* this should be able to deal with extensions on Windows-like systems */
|
||||
for (s = unix_shells; *s != NULL; ++s)
|
||||
{
|
||||
#if defined(WINDOWS32) || defined(__MSDOS__)
|
||||
size_t len = strlen (*s);
|
||||
if ((strlen (name) >= len && STOP_SET (name[len], MAP_DOT|MAP_NUL))
|
||||
&& strncasecmp (name, *s, len) == 0)
|
||||
if ((strlen (cp) >= len && STOP_SET (cp[len], MAP_DOT|MAP_NUL))
|
||||
&& strncasecmp (cp, *s, len) == 0)
|
||||
#else
|
||||
if (strcmp (name, *s) == 0)
|
||||
if (strcmp (cp, *s) == 0)
|
||||
#endif
|
||||
return 1; /* a known unix-style shell */
|
||||
}
|
||||
@@ -504,7 +504,7 @@ block_sigs ()
|
||||
static void
|
||||
unblock_sigs ()
|
||||
{
|
||||
sigsetmask (siggetmask (0) & ~fatal_signal_mask)
|
||||
sigsetmask (siggetmask () & ~fatal_signal_mask);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -539,6 +539,7 @@ child_error (struct child *child,
|
||||
const struct file *f = child->file;
|
||||
const floc *flocp = &f->cmds->fileinfo;
|
||||
const char *nm;
|
||||
const char *smode;
|
||||
size_t l;
|
||||
|
||||
if (ignored && run_silent)
|
||||
@@ -564,18 +565,29 @@ child_error (struct child *child,
|
||||
|
||||
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);
|
||||
|
||||
show_goal_error ();
|
||||
|
||||
if (exit_sig == 0)
|
||||
error (NILF, l + INTSTR_LENGTH,
|
||||
_("%s[%s: %s] Error %d%s"), pre, nm, f->name, exit_code, post);
|
||||
error (NILF, l + INTSTR_LENGTH, _("%s[%s: %s] Error %d%s%s"),
|
||||
pre, nm, f->name, exit_code, post, smode ? smode : "");
|
||||
else
|
||||
{
|
||||
const char *s = strsignal (exit_sig);
|
||||
error (NILF, l + strlen (s) + strlen (dump),
|
||||
"%s[%s: %s] %s%s%s", pre, nm, f->name, s, dump, post);
|
||||
error (NILF, l + strlen (s) + strlen (dump), "%s[%s: %s] %s%s%s%s",
|
||||
pre, nm, f->name, s, dump, post, smode ? smode : "");
|
||||
}
|
||||
|
||||
OUTPUT_UNSET ();
|
||||
@@ -595,7 +607,7 @@ child_error (struct child *child,
|
||||
|
||||
static unsigned int dead_children = 0;
|
||||
|
||||
RETSIGTYPE
|
||||
void
|
||||
child_handler (int sig UNUSED)
|
||||
{
|
||||
++dead_children;
|
||||
@@ -721,9 +733,6 @@ reap_children (int block, int err)
|
||||
else if (pid < 0)
|
||||
{
|
||||
/* A remote status command failed miserably. Punt. */
|
||||
#if !defined(__MSDOS__) && !defined(_AMIGA) && !defined(WINDOWS32)
|
||||
remote_status_lose:
|
||||
#endif
|
||||
pfatal_with_name ("remote_status");
|
||||
}
|
||||
else
|
||||
@@ -779,8 +788,9 @@ reap_children (int block, int err)
|
||||
/* Now try a blocking wait for a remote child. */
|
||||
pid = remote_status (&exit_code, &exit_sig, &coredump, 1);
|
||||
if (pid < 0)
|
||||
goto remote_status_lose;
|
||||
else if (pid == 0)
|
||||
pfatal_with_name ("remote_status");
|
||||
|
||||
if (pid == 0)
|
||||
/* No remote children either. Finally give up. */
|
||||
break;
|
||||
|
||||
@@ -848,7 +858,7 @@ reap_children (int block, int err)
|
||||
map_windows32_error_to_string from calling 'fatal',
|
||||
which will then call reap_children again */
|
||||
if (werr && exit_code > 0 && exit_code < WSABASEERR)
|
||||
fprintf (stderr, "make (e=%d): %s", exit_code,
|
||||
fprintf (stderr, "make (e=%d): %s\n", exit_code,
|
||||
map_windows32_error_to_string (exit_code));
|
||||
|
||||
/* signal */
|
||||
@@ -876,6 +886,9 @@ reap_children (int block, int err)
|
||||
#endif /* WINDOWS32 */
|
||||
}
|
||||
|
||||
/* Some child finished: increment the command count. */
|
||||
++command_count;
|
||||
|
||||
/* Check if this is the child of the 'shell' function. */
|
||||
if (!remote && pid == shell_function_pid)
|
||||
{
|
||||
@@ -921,7 +934,7 @@ reap_children (int block, int err)
|
||||
to fork/exec but I don't want to bother with that. Just do the
|
||||
best we can. */
|
||||
|
||||
EINTRLOOP(r, stat(c->cmd_name, &st));
|
||||
EINTRLOOP(r, stat (c->cmd_name, &st));
|
||||
if (r < 0)
|
||||
e = strerror (errno);
|
||||
else if (S_ISDIR(st.st_mode) || !(st.st_mode & S_IXUSR))
|
||||
@@ -1007,12 +1020,10 @@ reap_children (int block, int err)
|
||||
}
|
||||
else
|
||||
{
|
||||
#ifndef NO_OUTPUT_SYNC
|
||||
/* If we're sync'ing per line, write the previous line's
|
||||
output before starting the next one. */
|
||||
if (output_sync == OUTPUT_SYNC_LINE)
|
||||
output_dump (&c->output);
|
||||
#endif
|
||||
/* Check again whether to start remotely.
|
||||
Whether or not we want to changes over time.
|
||||
Also, start_remote_job may need state set up
|
||||
@@ -1043,10 +1054,8 @@ reap_children (int block, int err)
|
||||
|
||||
/* When we get here, all the commands for c->file are finished. */
|
||||
|
||||
#ifndef NO_OUTPUT_SYNC
|
||||
/* Synchronize any remaining parallel output. */
|
||||
output_dump (&c->output);
|
||||
#endif
|
||||
|
||||
/* At this point c->file->update_status is success or failed. But
|
||||
c->file->command_state is still cs_running if all the commands
|
||||
@@ -1102,13 +1111,27 @@ reap_children (int block, int err)
|
||||
|
||||
/* 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
|
||||
free_child (struct child *child)
|
||||
{
|
||||
output_close (&child->output);
|
||||
|
||||
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);
|
||||
|
||||
/* If we're using the jobserver and this child is not the only outstanding
|
||||
@@ -1134,15 +1157,8 @@ free_child (struct child *child)
|
||||
free (child->command_lines);
|
||||
}
|
||||
|
||||
if (child->environment != 0)
|
||||
{
|
||||
char **ep = child->environment;
|
||||
while (*ep != 0)
|
||||
free (*ep++);
|
||||
free (child->environment);
|
||||
}
|
||||
free_childbase ((struct childbase*)child);
|
||||
|
||||
free (child->cmd_name);
|
||||
free (child);
|
||||
}
|
||||
|
||||
@@ -1332,15 +1348,13 @@ start_job_command (struct child *child)
|
||||
|
||||
OUTPUT_SET (&child->output);
|
||||
|
||||
#ifndef NO_OUTPUT_SYNC
|
||||
if (! child->output.syncout)
|
||||
/* We don't want to sync this command: to avoid misordered
|
||||
output ensure any already-synced content is written. */
|
||||
output_dump (&child->output);
|
||||
#endif
|
||||
|
||||
/* Print the command if appropriate. */
|
||||
if (just_print_flag || trace_flag
|
||||
if (just_print_flag || ISDB (DB_PRINT)
|
||||
|| (!(flags & COMMANDS_SILENT) && !run_silent))
|
||||
OS (message, 0, "%s", p);
|
||||
|
||||
@@ -1408,7 +1422,7 @@ start_job_command (struct child *child)
|
||||
#ifndef _AMIGA
|
||||
/* Set up the environment for the child. */
|
||||
if (child->environment == 0)
|
||||
child->environment = target_environment (child->file);
|
||||
child->environment = target_environment (child->file, child->recursive);
|
||||
#endif
|
||||
|
||||
#if !defined(__MSDOS__) && !defined(_AMIGA) && !defined(WINDOWS32)
|
||||
@@ -1440,9 +1454,6 @@ start_job_command (struct child *child)
|
||||
#endif /* !VMS */
|
||||
{
|
||||
/* Fork the child process. */
|
||||
|
||||
char **parent_environ;
|
||||
|
||||
run_local:
|
||||
block_sigs ();
|
||||
|
||||
@@ -1453,14 +1464,11 @@ start_job_command (struct child *child)
|
||||
|
||||
#else
|
||||
|
||||
parent_environ = environ;
|
||||
|
||||
jobserver_pre_child (flags & COMMANDS_RECURSE);
|
||||
|
||||
child->pid = child_execute_job ((struct childbase *)child,
|
||||
child->good_stdin, argv);
|
||||
|
||||
environ = parent_environ; /* Restore value child may have clobbered. */
|
||||
jobserver_post_child (flags & COMMANDS_RECURSE);
|
||||
|
||||
#endif /* !VMS */
|
||||
@@ -1483,7 +1491,7 @@ start_job_command (struct child *child)
|
||||
char *cmdline = argv[0];
|
||||
/* We don't have a way to pass environment to 'system',
|
||||
so we need to save and restore ours, sigh... */
|
||||
char **parent_environ = environ;
|
||||
char **parent_env = environ;
|
||||
|
||||
environ = child->environment;
|
||||
|
||||
@@ -1498,7 +1506,7 @@ start_job_command (struct child *child)
|
||||
|
||||
dos_command_running = 1;
|
||||
proc_return = system (cmdline);
|
||||
environ = parent_environ;
|
||||
environ = parent_env;
|
||||
execute_by_shell = 0; /* for the next time */
|
||||
}
|
||||
else
|
||||
@@ -1538,8 +1546,8 @@ start_job_command (struct child *child)
|
||||
{
|
||||
HANDLE hPID;
|
||||
char* arg0;
|
||||
int outfd = FD_STDOUT;
|
||||
int errfd = FD_STDERR;
|
||||
int outfd = -1;
|
||||
int errfd = -1;
|
||||
|
||||
/* make UNC paths safe for CreateProcess -- backslash format */
|
||||
arg0 = argv[0];
|
||||
@@ -1551,7 +1559,6 @@ start_job_command (struct child *child)
|
||||
/* make sure CreateProcess() has Path it needs */
|
||||
sync_Path_environment ();
|
||||
|
||||
#ifndef NO_OUTPUT_SYNC
|
||||
/* Divert child output if output_sync in use. */
|
||||
if (child->output.syncout)
|
||||
{
|
||||
@@ -1560,9 +1567,7 @@ start_job_command (struct child *child)
|
||||
if (child->output.err >= 0)
|
||||
errfd = child->output.err;
|
||||
}
|
||||
#else
|
||||
outfd = errfd = -1;
|
||||
#endif
|
||||
|
||||
hPID = process_easy (argv, child->environment, outfd, errfd);
|
||||
|
||||
if (hPID != INVALID_HANDLE_VALUE)
|
||||
@@ -1864,7 +1869,7 @@ new_job (struct file *file)
|
||||
/* There must be at least one child already, or we have no business
|
||||
waiting for a token. */
|
||||
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. */
|
||||
got_token = jobserver_acquire (waiting_jobs != NULL);
|
||||
@@ -1883,9 +1888,8 @@ new_job (struct file *file)
|
||||
|
||||
/* Trace the build.
|
||||
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);
|
||||
const char *nm;
|
||||
|
||||
if (! cmds->fileinfo.filenm)
|
||||
@@ -1897,14 +1901,51 @@ new_job (struct file *file)
|
||||
nm = n;
|
||||
}
|
||||
|
||||
if (newer[0] == '\0')
|
||||
if (c->file->phony)
|
||||
OSS (message, 0, _("%s: update target '%s' due to: target is .PHONY"),
|
||||
nm, c->file->name);
|
||||
else if (c->file->last_mtime == NONEXISTENT_MTIME)
|
||||
OSS (message, 0,
|
||||
_("%s: target '%s' does not exist"), nm, c->file->name);
|
||||
_("%s: update target '%s' due to: target does not exist"),
|
||||
nm, c->file->name);
|
||||
else
|
||||
OSSS (message, 0,
|
||||
_("%s: update target '%s' due to: %s"), nm, c->file->name, newer);
|
||||
{
|
||||
char *newer = allocated_variable_expand_for_file ("$?", c->file);
|
||||
if (newer[0] != '\0')
|
||||
{
|
||||
OSSS (message, 0, _("%s: update target '%s' due to: %s"),
|
||||
nm, c->file->name, newer);
|
||||
free (newer);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* One or more files didn't exist, and didn't get created. */
|
||||
size_t len = 0;
|
||||
struct dep *d;
|
||||
|
||||
free (newer);
|
||||
for (d = c->file->deps; d != NULL; d = d->next)
|
||||
if (d->file->last_mtime == NONEXISTENT_MTIME)
|
||||
len += strlen (d->file->name) + 1;
|
||||
|
||||
if (!len)
|
||||
OSS (message, 0,
|
||||
_("%s: update target '%s' due to: unknown reasons"),
|
||||
nm, c->file->name);
|
||||
else
|
||||
{
|
||||
char *cp = newer = alloca (len);
|
||||
for (d = c->file->deps; d != NULL; d = d->next)
|
||||
if (d->file->last_mtime == NONEXISTENT_MTIME)
|
||||
{
|
||||
if (cp > newer)
|
||||
*(cp++) = ' ';
|
||||
cp = stpcpy (cp, d->file->name);
|
||||
}
|
||||
OSSS (message, 0, _("%s: update target '%s' due to: %s"),
|
||||
nm, c->file->name, newer);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* The job is now primed. Start it running.
|
||||
@@ -1950,12 +1991,13 @@ job_next_command (struct child *child)
|
||||
|
||||
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
|
||||
of processes the kernel is running and, if it's greater than the requested
|
||||
load we don't allow another job to start. We allow a job to start with
|
||||
equal processes since one of those will be for make itself, which will then
|
||||
pause waiting for jobs to clear.
|
||||
of runnable processes, if it's greater than the requested load we don't
|
||||
allow another job to start. We allow a job to start with equal processes
|
||||
since one of those will be for make itself, which will then pause waiting
|
||||
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.
|
||||
However, a very parallel make can easily start tens or even hundreds of
|
||||
@@ -2008,17 +2050,7 @@ load_too_high (void)
|
||||
#else
|
||||
static double last_sec;
|
||||
static time_t last_now;
|
||||
|
||||
/* This is disabled by default for now, because it will behave badly if the
|
||||
user gives a value > the number of cores; in that situation the load will
|
||||
never be exceeded, this function always returns false, and we'll start
|
||||
all the jobs. Also, it's not quite right to limit jobs to the number of
|
||||
cores not busy since a job takes some time to start etc. Maybe that's
|
||||
OK, I'm not sure exactly how to handle that, but for sure we need to
|
||||
clamp this value at the number of cores before this can be enabled.
|
||||
*/
|
||||
#define PROC_FD_INIT -1
|
||||
static int proc_fd = PROC_FD_INIT;
|
||||
static int proc_fd = -2;
|
||||
|
||||
double load, guess;
|
||||
time_t now;
|
||||
@@ -2076,8 +2108,8 @@ load_too_high (void)
|
||||
|
||||
if (p && ISDIGIT(p[1]))
|
||||
{
|
||||
int cnt = atoi (p+1);
|
||||
DB (DB_JOBS, ("Running: system = %d / make = %u (max requested = %f)\n",
|
||||
unsigned int cnt = make_toui (p+1, NULL);
|
||||
DB (DB_JOBS, ("Running: system = %u / make = %u (max requested = %f)\n",
|
||||
cnt, job_slots_used, max_load_average));
|
||||
return (double)cnt > max_load_average;
|
||||
}
|
||||
@@ -2095,7 +2127,7 @@ load_too_high (void)
|
||||
}
|
||||
|
||||
/* Find the real system load average. */
|
||||
make_access ();
|
||||
errno = 0;
|
||||
if (getloadavg (&load, 1) != 1)
|
||||
{
|
||||
static int lossage = -1;
|
||||
@@ -2112,7 +2144,6 @@ load_too_high (void)
|
||||
lossage = errno;
|
||||
load = 0;
|
||||
}
|
||||
user_access ();
|
||||
|
||||
/* 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. */
|
||||
@@ -2197,7 +2228,7 @@ child_execute_job (struct childbase *child, int good_stdin, char **argv)
|
||||
{
|
||||
save_fdin = dup (FD_STDIN);
|
||||
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);
|
||||
|
||||
dup2 (fdin, FD_STDIN);
|
||||
@@ -2209,7 +2240,7 @@ child_execute_job (struct childbase *child, int good_stdin, char **argv)
|
||||
save_fdout = dup (FD_STDOUT);
|
||||
if (save_fdout < 0)
|
||||
O (fatal, NILF,
|
||||
_("no more file handles: could not duplicate stdout\n"));
|
||||
_("no more file handles: could not duplicate stdout"));
|
||||
fd_noinherit (save_fdout);
|
||||
|
||||
dup2 (fdout, FD_STDOUT);
|
||||
@@ -2223,7 +2254,7 @@ child_execute_job (struct childbase *child, int good_stdin, char **argv)
|
||||
save_fderr = dup (FD_STDERR);
|
||||
if (save_fderr < 0)
|
||||
O (fatal, NILF,
|
||||
_("no more file handles: could not duplicate stderr\n"));
|
||||
_("no more file handles: could not duplicate stderr"));
|
||||
fd_noinherit (save_fderr);
|
||||
}
|
||||
|
||||
@@ -2238,7 +2269,7 @@ child_execute_job (struct childbase *child, int good_stdin, char **argv)
|
||||
if (save_fdin >= 0)
|
||||
{
|
||||
if (dup2 (save_fdin, FD_STDIN) != FD_STDIN)
|
||||
O (fatal, NILF, _("Could not restore stdin\n"));
|
||||
O (fatal, NILF, _("Could not restore stdin"));
|
||||
else
|
||||
close (save_fdin);
|
||||
}
|
||||
@@ -2246,7 +2277,7 @@ child_execute_job (struct childbase *child, int good_stdin, char **argv)
|
||||
if (save_fdout >= 0)
|
||||
{
|
||||
if (dup2 (save_fdout, FD_STDOUT) != FD_STDOUT)
|
||||
O (fatal, NILF, _("Could not restore stdout\n"));
|
||||
O (fatal, NILF, _("Could not restore stdout"));
|
||||
else
|
||||
close (save_fdout);
|
||||
}
|
||||
@@ -2254,7 +2285,7 @@ child_execute_job (struct childbase *child, int good_stdin, char **argv)
|
||||
if (save_fderr >= 0)
|
||||
{
|
||||
if (dup2 (save_fderr, FD_STDERR) != FD_STDERR)
|
||||
O (fatal, NILF, _("Could not restore stderr\n"));
|
||||
O (fatal, NILF, _("Could not restore stderr"));
|
||||
else
|
||||
close (save_fderr);
|
||||
}
|
||||
@@ -2276,7 +2307,7 @@ child_execute_job (struct childbase *child, int good_stdin, char **argv)
|
||||
const int fdin = good_stdin ? FD_STDIN : get_bad_stdin ();
|
||||
int fdout = FD_STDOUT;
|
||||
int fderr = FD_STDERR;
|
||||
pid_t pid;
|
||||
pid_t pid = -1;
|
||||
int r;
|
||||
#if defined(USE_POSIX_SPAWN)
|
||||
char *cmd;
|
||||
@@ -2296,9 +2327,16 @@ child_execute_job (struct childbase *child, int good_stdin, char **argv)
|
||||
|
||||
#if !defined(USE_POSIX_SPAWN)
|
||||
|
||||
pid = vfork();
|
||||
if (pid != 0)
|
||||
return pid;
|
||||
{
|
||||
/* The child may clobber environ so remember ours and restore it. */
|
||||
char **parent_env = environ;
|
||||
pid = vfork ();
|
||||
if (pid != 0)
|
||||
{
|
||||
environ = parent_env;
|
||||
return pid;
|
||||
}
|
||||
}
|
||||
|
||||
/* We are the child. */
|
||||
unblock_all_sigs ();
|
||||
@@ -2320,6 +2358,7 @@ child_execute_job (struct childbase *child, int good_stdin, char **argv)
|
||||
|
||||
/* Run the command. */
|
||||
exec_command (argv, child->environment);
|
||||
_exit (127);
|
||||
|
||||
#else /* USE_POSIX_SPAWN */
|
||||
|
||||
@@ -2361,8 +2400,8 @@ child_execute_job (struct childbase *child, int good_stdin, char **argv)
|
||||
if ((r = posix_spawn_file_actions_adddup2 (&fa, fderr, FD_STDERR)) != 0)
|
||||
goto cleanup;
|
||||
|
||||
/* Be the user, permanently. */
|
||||
flags |= POSIX_SPAWN_RESETIDS;
|
||||
/* We can't use the POSIX_SPAWN_RESETIDS flag: when make is invoked under
|
||||
restrictive environments like unshare it will fail with EINVAL. */
|
||||
|
||||
/* Apply the spawn flags. */
|
||||
if ((r = posix_spawnattr_setflags (&attr, flags)) != 0)
|
||||
@@ -2381,7 +2420,19 @@ child_execute_job (struct childbase *child, int good_stdin, char **argv)
|
||||
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)
|
||||
@@ -2451,12 +2502,7 @@ child_execute_job (struct childbase *child, int good_stdin, char **argv)
|
||||
/* Replace the current process with one running the command in ARGV,
|
||||
with environment ENVP. This function does not return. */
|
||||
|
||||
/* EMX: This function returns the pid of the child process. */
|
||||
# ifdef __EMX__
|
||||
pid_t
|
||||
# else
|
||||
void
|
||||
# endif
|
||||
exec_command (char **argv, char **envp)
|
||||
{
|
||||
#ifdef VMS
|
||||
@@ -2503,7 +2549,7 @@ exec_command (char **argv, char **envp)
|
||||
exit_code = process_exit_code (hWaitPID);
|
||||
|
||||
if (err)
|
||||
fprintf (stderr, "make (e=%d, rc=%d): %s",
|
||||
fprintf (stderr, "make (e=%d, rc=%d): %s\n",
|
||||
err, exit_code, map_windows32_error_to_string (err));
|
||||
|
||||
/* cleanup process */
|
||||
@@ -2523,17 +2569,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);
|
||||
|
||||
#else /* !WINDOWS32 */
|
||||
|
||||
# ifdef __EMX__
|
||||
pid_t pid;
|
||||
# endif
|
||||
|
||||
/* Be the user, permanently. */
|
||||
child_access ();
|
||||
pid_t pid = -1;
|
||||
|
||||
# ifdef __EMX__
|
||||
/* Run the program. */
|
||||
@@ -2545,8 +2586,15 @@ exec_command (char **argv, char **envp)
|
||||
if (errno == ENOENT)
|
||||
errno = ENOEXEC;
|
||||
|
||||
# elif MK_OS_ZOS
|
||||
/* In z/OS we can't set environ in ASCII mode. */
|
||||
environ = envp;
|
||||
execvpe(argv[0], argv, envp);
|
||||
|
||||
# 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;
|
||||
execvp (argv[0], argv);
|
||||
|
||||
@@ -2593,7 +2641,7 @@ exec_command (char **argv, char **envp)
|
||||
# ifdef __EMX__
|
||||
if (!unixy_shell)
|
||||
{
|
||||
new_argv[1] = "/c";
|
||||
new_argv[1] = (char *)"/c";
|
||||
++i;
|
||||
--argc;
|
||||
}
|
||||
@@ -2610,6 +2658,9 @@ exec_command (char **argv, char **envp)
|
||||
pid = spawnvpe (P_NOWAIT, shell, new_argv, envp);
|
||||
if (pid >= 0)
|
||||
break;
|
||||
# elif MK_OS_ZOS
|
||||
/* In z/OS we can't set environ in ASCII mode. */
|
||||
execvpe(shell, new_argv, envp);
|
||||
# else
|
||||
execvp (shell, new_argv);
|
||||
# endif
|
||||
@@ -2629,11 +2680,7 @@ exec_command (char **argv, char **envp)
|
||||
break;
|
||||
}
|
||||
|
||||
# ifdef __EMX__
|
||||
return pid;
|
||||
# else
|
||||
_exit (127);
|
||||
# endif
|
||||
#endif /* !WINDOWS32 */
|
||||
#endif /* !VMS */
|
||||
}
|
||||
@@ -2656,8 +2703,8 @@ void clean_tmp (void)
|
||||
avoid using a shell. This routine handles only ' quoting, and " quoting
|
||||
when no backslash, $ or ' characters are seen in the quotes. Starting
|
||||
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
|
||||
is the first word of a line, the shell is used.
|
||||
sh_chars is seen, or any of the builtin commands listed in sh_cmds is the
|
||||
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 NULL, newlines will be ignored.
|
||||
@@ -2665,10 +2712,14 @@ void clean_tmp (void)
|
||||
SHELL is the shell to use, or nil to use the default shell.
|
||||
IFS is the value of $IFS, or nil (meaning the default).
|
||||
|
||||
FLAGS is the value of lines_flags for this command line. It is
|
||||
used in the WINDOWS32 port to check whether + or $(MAKE) were found
|
||||
in this command line, in which case the effect of just_print_flag
|
||||
is overridden. */
|
||||
FLAGS is the value of lines_flags for this command line. It is used in the
|
||||
WINDOWS32 port to check whether + or $(MAKE) were found in this command
|
||||
line, in which case the effect of just_print_flag 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 **
|
||||
construct_command_argv_internal (char *line, char **restp, const char *shell,
|
||||
@@ -2754,7 +2805,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
|
||||
that caused any command line with quoted file names be run
|
||||
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
|
||||
the limit from a very frequent use case, because using quoted
|
||||
file names is commonplace on MS-Windows. */
|
||||
@@ -2785,9 +2836,10 @@ construct_command_argv_internal (char *line, char **restp, const char *shell,
|
||||
#else /* must be UNIX-ish */
|
||||
static const char *sh_chars = "#;\"*?[]&|<>(){}$`^~!";
|
||||
static const char *sh_cmds[] =
|
||||
{ ".", ":", "break", "case", "cd", "command", "continue", "eval", "exec",
|
||||
"exit", "export", "for", "if", "login", "logout", "read", "readonly",
|
||||
"set", "shift", "switch", "test", "times", "trap", "ulimit", "umask",
|
||||
{ ".", ":", "alias", "bg", "break", "case", "cd", "command", "continue",
|
||||
"eval", "exec", "exit", "export", "fc", "fg", "for", "getopts", "hash",
|
||||
"if", "jobs", "login", "logout", "read", "readonly", "return", "set",
|
||||
"shift", "test", "times", "trap", "type", "ulimit", "umask", "unalias",
|
||||
"unset", "wait", "while", 0 };
|
||||
|
||||
# ifdef HAVE_DOS_PATHS
|
||||
@@ -3038,8 +3090,7 @@ construct_command_argv_internal (char *line, char **restp, const char *shell,
|
||||
}
|
||||
else
|
||||
#endif
|
||||
if (p[1] != '\\' && p[1] != '\''
|
||||
&& !ISSPACE (p[1])
|
||||
if (p[1] != '\\' && p[1] != '\'' && !ISSPACE (p[1])
|
||||
&& strchr (sh_chars_sh, p[1]) == 0)
|
||||
/* back up one notch, to copy the backslash */
|
||||
--p;
|
||||
@@ -3219,7 +3270,13 @@ construct_command_argv_internal (char *line, char **restp, const char *shell,
|
||||
|
||||
# ifdef __EMX__ /* is this necessary? */
|
||||
if (!unixy_shell && shellflags)
|
||||
shellflags[0] = '/'; /* "/c" */
|
||||
{
|
||||
size_t len = strlen (shellflags);
|
||||
char *shflags = alloca (len + 1);
|
||||
memcpy (shflags, shellflags, len + 1);
|
||||
shflags[0] = '/'; /* "/c" */
|
||||
shellflags = shflags;
|
||||
}
|
||||
# endif
|
||||
|
||||
/* In .ONESHELL mode we are allowed to throw the entire current
|
||||
@@ -3357,25 +3414,44 @@ construct_command_argv_internal (char *line, char **restp, const char *shell,
|
||||
#endif /* WINDOWS32 */
|
||||
/* 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[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. */
|
||||
if (! shellflags)
|
||||
new_argv[n++] = xstrdup ("");
|
||||
{
|
||||
new_argv[n++] = nextp;
|
||||
*(nextp++) = '\0';
|
||||
}
|
||||
else
|
||||
{
|
||||
const char *s = shellflags;
|
||||
char *t;
|
||||
size_t len;
|
||||
while ((t = find_next_token (&s, &len)) != 0)
|
||||
new_argv[n++] = xstrndup (t, len);
|
||||
/* Parse shellflags using construct_command_argv_internal to
|
||||
handle quotes. */
|
||||
char **argv;
|
||||
char *f = alloca (sflags_len + 1);
|
||||
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. */
|
||||
new_argv[n++] = line;
|
||||
new_argv[n++] = nextp;
|
||||
memcpy(nextp, line, line_len + 1);
|
||||
new_argv[n++] = NULL;
|
||||
}
|
||||
return new_argv;
|
||||
@@ -3396,9 +3472,10 @@ construct_command_argv_internal (char *line, char **restp, const char *shell,
|
||||
}
|
||||
*(ap++) = ' ';
|
||||
if (shellflags)
|
||||
memcpy (ap, shellflags, sflags_len);
|
||||
ap += sflags_len;
|
||||
*(ap++) = ' ';
|
||||
{
|
||||
ap = mempcpy (ap, shellflags, sflags_len);
|
||||
*(ap++) = ' ';
|
||||
}
|
||||
#ifdef WINDOWS32
|
||||
command_ptr = ap;
|
||||
#endif
|
||||
@@ -3443,8 +3520,7 @@ construct_command_argv_internal (char *line, char **restp, const char *shell,
|
||||
else if (unixy_shell && strneq (p, "...", 3))
|
||||
{
|
||||
/* The case of '...' wildcard again. */
|
||||
strcpy (ap, "\\.\\.\\");
|
||||
ap += 5;
|
||||
ap = stpcpy (ap, "\\.\\.\\");
|
||||
p += 2;
|
||||
}
|
||||
#endif
|
||||
@@ -3460,7 +3536,7 @@ construct_command_argv_internal (char *line, char **restp, const char *shell,
|
||||
|
||||
#ifdef WINDOWS32
|
||||
/* 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. */
|
||||
if (just_print_flag && !(flags & COMMANDS_RECURSE))
|
||||
{
|
||||
@@ -3523,9 +3599,9 @@ construct_command_argv_internal (char *line, char **restp, const char *shell,
|
||||
/* new_line is local, must not be freed therefore
|
||||
We use line here instead of new_line because we run the shell
|
||||
manually. */
|
||||
size_t line_len = strlen (line);
|
||||
char *p = new_line;
|
||||
char *q = new_line;
|
||||
line_len = strlen (line);
|
||||
p = new_line;
|
||||
memcpy (new_line, line, line_len + 1);
|
||||
/* Replace all backslash-newline combination and also following tabs.
|
||||
Important: stop at the first '\n' because that's what the loop above
|
||||
@@ -3668,8 +3744,7 @@ construct_command_argv (char *line, char **restp, struct file *file,
|
||||
performed) and if shell is an absolute path without drive letter,
|
||||
try whether it exists e.g.: if "/bin/sh" does not exist use
|
||||
"$UNIXROOT/bin/sh" instead. */
|
||||
if (unixroot && shell && strcmp (shell, last_shell) != 0
|
||||
&& (shell[0] == '/' || shell[0] == '\\'))
|
||||
if (unixroot && shell && ISDIRSEP (shell[0]) && !streq (shell, last_shell))
|
||||
{
|
||||
/* trying a new shell, check whether it exists */
|
||||
size_t size = strlen (shell);
|
||||
|
||||
15
src/job.h
15
src/job.h
@@ -1,5 +1,5 @@
|
||||
/* Definitions for managing subprocesses in GNU Make.
|
||||
Copyright (C) 1992-2020 Free Software Foundation, Inc.
|
||||
Copyright (C) 1992-2023 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
|
||||
@@ -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.
|
||||
|
||||
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"
|
||||
|
||||
@@ -29,7 +29,7 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
#endif
|
||||
|
||||
#define CHILDBASE \
|
||||
char *cmd_name; /* Alloced copy of command run. */ \
|
||||
char *cmd_name; /* Allocated copy of command run. */ \
|
||||
char **environment; /* Environment for commands. */ \
|
||||
VMSCHILD \
|
||||
struct output output /* Output for this child. */
|
||||
@@ -68,11 +68,12 @@ struct child
|
||||
extern struct child *children;
|
||||
|
||||
/* 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);
|
||||
void new_job (struct file *file);
|
||||
void reap_children (int block, int err);
|
||||
void start_waiting_jobs (void);
|
||||
void free_childbase (struct childbase* child);
|
||||
|
||||
char **construct_command_argv (char *line, char **restp, struct file *file,
|
||||
int cmd_flags, char** batch_file);
|
||||
@@ -80,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);
|
||||
|
||||
#ifdef _AMIGA
|
||||
void exec_command (char **argv) __attribute__ ((noreturn));
|
||||
#elif defined(__EMX__)
|
||||
int exec_command (char **argv, char **envp);
|
||||
void exec_command (char **argv) NORETURN;
|
||||
#else
|
||||
void exec_command (char **argv, char **envp) __attribute__ ((noreturn));
|
||||
pid_t exec_command (char **argv, char **envp);
|
||||
#endif
|
||||
|
||||
void unblock_all_sigs (void);
|
||||
|
||||
91
src/load.c
91
src/load.c
@@ -1,5 +1,5 @@
|
||||
/* Loading dynamic objects for GNU Make.
|
||||
Copyright (C) 2012-2020 Free Software Foundation, Inc.
|
||||
Copyright (C) 2012-2023 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
|
||||
@@ -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.
|
||||
|
||||
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"
|
||||
|
||||
@@ -84,12 +84,14 @@ load_object (const floc *flocp, int noerror, const char *ldname,
|
||||
{
|
||||
const char *err = dlerror ();
|
||||
if (noerror)
|
||||
DB (DB_BASIC, ("%s", err));
|
||||
DB (DB_BASIC, ("%s\n", err));
|
||||
else
|
||||
OS (error, flocp, "%s", err);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
DB (DB_VERBOSE, (_("Loaded shared object %s\n"), ldname));
|
||||
|
||||
/* Assert that the GPL license symbol is defined. */
|
||||
symp = (load_func_t) dlsym (dlp, "plugin_is_GPL_compatible");
|
||||
if (! symp)
|
||||
@@ -119,19 +121,19 @@ load_object (const floc *flocp, int noerror, const char *ldname,
|
||||
}
|
||||
|
||||
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 *symname = NULL;
|
||||
char *loaded;
|
||||
const char *fp;
|
||||
int r;
|
||||
load_func_t symp;
|
||||
|
||||
/* 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. */
|
||||
fp = strchr (*ldname, '(');
|
||||
fp = strchr (ldname, '(');
|
||||
if (fp)
|
||||
{
|
||||
const char *ep;
|
||||
@@ -142,16 +144,16 @@ load_file (const floc *flocp, const char **ldname, int noerror)
|
||||
ep = strchr (fp+1, ')');
|
||||
if (ep && ep[1] == '\0')
|
||||
{
|
||||
size_t l = fp - *ldname;;
|
||||
size_t l = fp - ldname;
|
||||
|
||||
++fp;
|
||||
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. */
|
||||
memcpy (new, *ldname, l);
|
||||
memcpy (new, ldname, l);
|
||||
new[l] = '\0';
|
||||
*ldname = new;
|
||||
ldname = new;
|
||||
nmlen = l;
|
||||
|
||||
/* 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. */
|
||||
*ldname = strcache_add (*ldname);
|
||||
/* Make sure this name is in the string cache. */
|
||||
ldname = file->name = strcache_add (ldname);
|
||||
|
||||
/* If this object has been loaded, we're done. */
|
||||
loaded = allocated_variable_expand ("$(.LOADED)");
|
||||
fp = strstr (loaded, *ldname);
|
||||
r = fp && (fp==loaded || fp[-1]==' ') && (fp[nmlen]=='\0' || fp[nmlen]==' ');
|
||||
if (r)
|
||||
goto exit;
|
||||
/* If this object has been loaded, we're done: return -1 to ensure make does
|
||||
not rebuild again. If a rebuild is allowed it was set up when this
|
||||
object was initially loaded. */
|
||||
file = lookup_file (ldname);
|
||||
if (file && file->loaded)
|
||||
return -1;
|
||||
|
||||
/* If we didn't find a symbol name yet, construct it from the ldname. */
|
||||
if (! symname)
|
||||
{
|
||||
char *p = new;
|
||||
|
||||
fp = strrchr (*ldname, '/');
|
||||
fp = strrchr (ldname, '/');
|
||||
#ifdef HAVE_DOS_PATHS
|
||||
if (fp)
|
||||
{
|
||||
@@ -186,82 +188,75 @@ load_file (const floc *flocp, const char **ldname, int noerror)
|
||||
fp = fp2;
|
||||
}
|
||||
else
|
||||
fp = strrchr (*ldname, '\\');
|
||||
fp = strrchr (ldname, '\\');
|
||||
/* The (improbable) case of d:foo. */
|
||||
if (fp && *fp && fp[1] == ':')
|
||||
fp++;
|
||||
#endif
|
||||
if (!fp)
|
||||
fp = *ldname;
|
||||
fp = ldname;
|
||||
else
|
||||
++fp;
|
||||
while (isalnum (*fp) || *fp == '_')
|
||||
while (isalnum ((unsigned char) *fp) || *fp == '_')
|
||||
*(p++) = *(fp++);
|
||||
strcpy (p, SYMBOL_EXTENSION);
|
||||
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! */
|
||||
symp = load_object (flocp, noerror, *ldname, symname);
|
||||
symp = load_object (flocp, noerror, ldname, symname);
|
||||
if (! symp)
|
||||
return 0;
|
||||
|
||||
/* Invoke the symbol. */
|
||||
r = (*symp) (flocp);
|
||||
|
||||
/* If it succeeded, add the load file to the loaded variable. */
|
||||
if (r > 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);
|
||||
}
|
||||
/* If the load didn't fail, add the file to the .LOADED variable. */
|
||||
if (r)
|
||||
do_variable_definition(flocp, ".LOADED", ldname, o_file, f_append_value, 0);
|
||||
|
||||
exit:
|
||||
free (loaded);
|
||||
return r;
|
||||
}
|
||||
|
||||
void
|
||||
int
|
||||
unload_file (const char *name)
|
||||
{
|
||||
int rc = 0;
|
||||
struct load_list *d;
|
||||
|
||||
for (d = loaded_syms; d != NULL; d = d->next)
|
||||
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);
|
||||
d->dlp = NULL;
|
||||
else
|
||||
d->dlp = NULL;
|
||||
break;
|
||||
}
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
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)
|
||||
O (fatal, flocp,
|
||||
_("The 'load' operation is not supported on this platform."));
|
||||
_("The 'load' operation is not supported on this platform"));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
int
|
||||
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 */
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* API for GNU Make dynamic objects.
|
||||
Copyright (C) 2013-2020 Free Software Foundation, Inc.
|
||||
Copyright (C) 2013-2023 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
|
||||
@@ -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.
|
||||
|
||||
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"
|
||||
|
||||
|
||||
1638
src/main.c
1638
src/main.c
File diff suppressed because it is too large
Load Diff
235
src/makeint.h
235
src/makeint.h
@@ -1,5 +1,5 @@
|
||||
/* Miscellaneous global declarations and portability cruft for GNU Make.
|
||||
Copyright (C) 1988-2020 Free Software Foundation, Inc.
|
||||
Copyright (C) 1988-2023 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
|
||||
@@ -12,33 +12,26 @@ 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 <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
|
||||
using -I. -I$srcdir will use ./config.h rather than $srcdir/config.h
|
||||
(which it would do because makeint.h was found in $srcdir). */
|
||||
#include <config.h>
|
||||
#undef HAVE_CONFIG_H
|
||||
#define HAVE_CONFIG_H 1
|
||||
|
||||
/* Specify we want GNU source code. This must be defined before any
|
||||
system headers are included. */
|
||||
/* 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 */
|
||||
|
||||
#define _GNU_SOURCE 1
|
||||
|
||||
/* AIX requires this to be the first thing in the file. */
|
||||
#if HAVE_ALLOCA_H
|
||||
# include <alloca.h>
|
||||
#else
|
||||
# ifdef _AIX
|
||||
#pragma alloca
|
||||
#if defined (__has_builtin)
|
||||
# if __has_builtin (__builtin_alloca)
|
||||
# define free_alloca()
|
||||
# else
|
||||
# if !defined(__GNUC__) && !defined(WINDOWS32)
|
||||
# ifndef alloca /* predefined by HP cc +Olibcalls */
|
||||
char *alloca ();
|
||||
# endif
|
||||
# endif
|
||||
# define free_alloca() alloca (0)
|
||||
# endif
|
||||
#else
|
||||
# define free_alloca() alloca (0)
|
||||
#endif
|
||||
|
||||
/* Disable assert() unless we're a maintainer.
|
||||
@@ -67,7 +60,6 @@ char *alloca ();
|
||||
# define __NO_STRING_INLINES
|
||||
#endif
|
||||
|
||||
#include <stddef.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <signal.h>
|
||||
@@ -79,16 +71,10 @@ char *alloca ();
|
||||
unless <sys/timeb.h> has been included first. */
|
||||
# include <sys/timeb.h>
|
||||
#endif
|
||||
#if TIME_WITH_SYS_TIME
|
||||
#if HAVE_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
|
||||
#include <time.h>
|
||||
|
||||
#include <errno.h>
|
||||
|
||||
@@ -96,6 +82,11 @@ char *alloca ();
|
||||
extern int errno;
|
||||
#endif
|
||||
|
||||
/* Define macros specifying which OS we are building for. */
|
||||
#if defined(__MVS__)
|
||||
# define MK_OS_ZOS 1
|
||||
#endif
|
||||
|
||||
#ifdef __VMS
|
||||
/* In strict ANSI mode, VMS compilers should not be defining the
|
||||
VMS macro. Define it here instead of a bulk edit for the correct code.
|
||||
@@ -115,7 +106,7 @@ extern int errno;
|
||||
#endif
|
||||
|
||||
/* Some systems define _POSIX_VERSION but are not really POSIX.1. */
|
||||
#if (defined (butterfly) || defined (__arm) || (defined (__mips) && defined (_SYSTYPE_SVR3)) || (defined (sequent) && defined (i386)))
|
||||
#if (defined (butterfly) || (defined (__mips) && defined (_SYSTYPE_SVR3)) || (defined (sequent) && defined (i386)))
|
||||
# undef POSIX
|
||||
#endif
|
||||
|
||||
@@ -123,10 +114,6 @@ extern int errno;
|
||||
# define POSIX 1
|
||||
#endif
|
||||
|
||||
#ifndef RETSIGTYPE
|
||||
# define RETSIGTYPE void
|
||||
#endif
|
||||
|
||||
#ifndef sigmask
|
||||
# define sigmask(sig) (1 << ((sig) - 1))
|
||||
#endif
|
||||
@@ -147,13 +134,14 @@ extern int errno;
|
||||
#endif
|
||||
|
||||
#ifndef PATH_MAX
|
||||
# ifndef POSIX
|
||||
# ifdef 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
|
||||
#ifndef MAXPATHLEN
|
||||
# define MAXPATHLEN 1024
|
||||
#endif
|
||||
|
||||
#ifdef PATH_MAX
|
||||
# define GET_PATH_MAX PATH_MAX
|
||||
@@ -220,19 +208,22 @@ extern int vms_legacy_behavior;
|
||||
extern int vms_unix_simulation;
|
||||
#endif
|
||||
|
||||
#ifndef __attribute__
|
||||
/* This feature is available in gcc versions 2.5 and later. */
|
||||
# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) || __STRICT_ANSI__
|
||||
# define __attribute__(x)
|
||||
# endif
|
||||
#if !defined(__attribute__) && (__GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) || __STRICT_ANSI__)
|
||||
/* Don't use __attribute__ if it's not supported. */
|
||||
# define ATTRIBUTE(x)
|
||||
#else
|
||||
# define ATTRIBUTE(x) __attribute__ (x)
|
||||
#endif
|
||||
|
||||
/* The __-protected variants of 'format' and 'printf' attributes
|
||||
are accepted by gcc versions 2.6.4 (effectively 2.7) and later. */
|
||||
# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7)
|
||||
# define __format__ format
|
||||
# define __printf__ printf
|
||||
# endif
|
||||
#if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7)
|
||||
# define __format__ format
|
||||
# define __printf__ printf
|
||||
#endif
|
||||
#define UNUSED __attribute__ ((unused))
|
||||
|
||||
#define UNUSED ATTRIBUTE ((unused))
|
||||
#define NORETURN ATTRIBUTE ((noreturn))
|
||||
|
||||
#if defined (STDC_HEADERS) || defined (__GNU_LIBRARY__)
|
||||
# include <stdlib.h>
|
||||
@@ -242,8 +233,6 @@ extern int vms_unix_simulation;
|
||||
# ifdef HAVE_STRING_H
|
||||
# include <string.h>
|
||||
# define ANSI_STRING 1
|
||||
# else
|
||||
# include <strings.h>
|
||||
# endif
|
||||
# ifdef HAVE_MEMORY_H
|
||||
# include <memory.h>
|
||||
@@ -255,8 +244,8 @@ void *malloc (int);
|
||||
void *realloc (void *, int);
|
||||
void free (void *);
|
||||
|
||||
void abort (void) __attribute__ ((noreturn));
|
||||
void exit (int) __attribute__ ((noreturn));
|
||||
void abort (void) NORETURN;
|
||||
void exit (int) NORETURN;
|
||||
# endif /* HAVE_STDLIB_H. */
|
||||
|
||||
#endif /* Standard headers. */
|
||||
@@ -286,6 +275,25 @@ char *strerror (int errnum);
|
||||
#if HAVE_STDINT_H
|
||||
# include <stdint.h>
|
||||
#endif
|
||||
|
||||
#if HAVE_STRINGS_H
|
||||
# include <strings.h> /* Needed for strcasecmp / strncasecmp. */
|
||||
#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
|
||||
|
||||
#if !defined(HAVE_STRSIGNAL)
|
||||
@@ -327,7 +335,7 @@ extern mode_t umask (mode_t);
|
||||
|
||||
#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
|
||||
#else
|
||||
# define ENUM_BITFIELD(bits)
|
||||
@@ -385,11 +393,14 @@ extern int unixy_shell;
|
||||
# define WIN32_LEAN_AND_MEAN
|
||||
#endif /* WINDOWS32 */
|
||||
|
||||
/* ALL_SET() evaluates the second argument twice. */
|
||||
#define ANY_SET(_v,_m) (((_v)&(_m)) != 0)
|
||||
#define NONE_SET(_v,_m) (! ANY_SET ((_v),(_m)))
|
||||
#define ALL_SET(_v,_m) (((_v)&(_m)) == (_m))
|
||||
|
||||
/* Bitmasks for the STOPCHAR array. */
|
||||
#define MAP_NUL 0x0001
|
||||
#define MAP_BLANK 0x0002
|
||||
#define MAP_BLANK 0x0002 /* space, TAB */
|
||||
#define MAP_NEWLINE 0x0004
|
||||
#define MAP_COMMENT 0x0008
|
||||
#define MAP_SEMI 0x0010
|
||||
@@ -437,16 +448,33 @@ extern int unixy_shell;
|
||||
# define MAP_PATHSEP MAP_SEMI
|
||||
#elif PATH_SEPARATOR_CHAR == ','
|
||||
# define MAP_PATHSEP MAP_COMMA
|
||||
|
||||
#else
|
||||
# error "Unknown PATH_SEPARATOR_CHAR"
|
||||
#endif
|
||||
|
||||
#define STOP_SET(_v,_m) ANY_SET(stopchar_map[(unsigned char)(_v)],(_m))
|
||||
|
||||
/* True if C is whitespace but not newline. */
|
||||
#define ISBLANK(c) STOP_SET((c),MAP_BLANK)
|
||||
/* True if C is whitespace including newlines. */
|
||||
#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 END_OF_TOKEN(s) while (! STOP_SET (*(s), MAP_SPACE|MAP_NUL)) ++(s)
|
||||
|
||||
/* True if C is a directory separator on the current system. */
|
||||
#define ISDIRSEP(c) STOP_SET((c),MAP_DIRSEP)
|
||||
|
||||
/* True if S starts with a drive specifier. */
|
||||
#if defined(HAVE_DOS_PATHS)
|
||||
# define HAS_DRIVESPEC(_s) ((((_s)[0] >= 'a' && (_s)[0] <= 'z') \
|
||||
|| ((_s)[0] >= 'A' && (_s)[0] <= 'Z')) \
|
||||
&& (_s)[1] == ':')
|
||||
#else
|
||||
# define HAS_DRIVESPEC(_s) 0
|
||||
#endif
|
||||
|
||||
/* 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)
|
||||
@@ -461,11 +489,17 @@ extern struct rlimit stack_limit;
|
||||
|
||||
#define NILF ((floc *)0)
|
||||
|
||||
/* Number of characters in a string constant. Does NOT include the \0 byte. */
|
||||
#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)
|
||||
|
||||
/* The number of bytes needed to represent the largest integer as a string. */
|
||||
#define INTSTR_LENGTH CSTRLEN ("18446744073709551616")
|
||||
/* The number of bytes needed to represent the largest signed and unsigned
|
||||
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"
|
||||
#ifdef HAVE_TTYNAME
|
||||
@@ -474,8 +508,19 @@ extern struct rlimit stack_limit;
|
||||
# define TTYNAME(_f) DEFAULT_TTYNAME
|
||||
#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. */
|
||||
typedef struct
|
||||
{
|
||||
@@ -486,12 +531,12 @@ typedef struct
|
||||
|
||||
const char *concat (unsigned int, ...);
|
||||
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, ...)
|
||||
__attribute__ ((__format__ (__printf__, 3, 4)));
|
||||
ATTRIBUTE ((__format__ (__printf__, 3, 4)));
|
||||
void fatal (const floc *flocp, size_t length, const char *fmt, ...)
|
||||
__attribute__ ((noreturn, __format__ (__printf__, 3, 4)));
|
||||
void out_of_memory () __attribute__((noreturn));
|
||||
ATTRIBUTE ((noreturn, __format__ (__printf__, 3, 4)));
|
||||
void out_of_memory (void) NORETURN;
|
||||
|
||||
/* When adding macros to this list be sure to update the value of
|
||||
XGETTEXT_OPTIONS in the po/Makevars file. */
|
||||
@@ -509,10 +554,23 @@ void out_of_memory () __attribute__((noreturn));
|
||||
#define ONS(_t,_a,_f,_n,_s) _t((_a), INTSTR_LENGTH + strlen (_s), \
|
||||
(_f), (_n), (_s))
|
||||
|
||||
void die (int) __attribute__ ((noreturn));
|
||||
void pfatal_with_name (const char *) __attribute__ ((noreturn));
|
||||
enum variable_origin;
|
||||
struct variable;
|
||||
|
||||
void reset_makeflags (enum variable_origin origin);
|
||||
struct variable *define_makeflags (int makefile);
|
||||
int should_print_dir (void);
|
||||
void temp_stdin_unlink (void);
|
||||
void die (int) NORETURN;
|
||||
void pfatal_with_name (const char *) NORETURN;
|
||||
void perror_with_name (const char *, const char *);
|
||||
#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 *xcalloc (size_t);
|
||||
void *xrealloc (void *, size_t);
|
||||
@@ -527,7 +585,9 @@ int alpha_compare (const void *, const void *);
|
||||
void print_spaces (unsigned int);
|
||||
char *find_percent (char *);
|
||||
const char *find_percent_cached (const char **);
|
||||
FILE *get_tmpfile (char **, const char *);
|
||||
const char *get_tmpdir (void);
|
||||
int get_tmpfd (char **);
|
||||
FILE *get_tmpfile (char **);
|
||||
ssize_t writebuf (int, const void *, size_t);
|
||||
ssize_t readbuf (int, void *, size_t);
|
||||
|
||||
@@ -541,13 +601,14 @@ void ar_parse_name (const char *, char **, char **);
|
||||
int ar_touch (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 size, long int date, int uid,
|
||||
long int size, intmax_t date, int uid,
|
||||
int gid, unsigned int mode,
|
||||
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);
|
||||
#ifndef VMS
|
||||
int ar_member_touch (const char *arname, const char *memname);
|
||||
@@ -577,10 +638,6 @@ int gpath_search (const char *file, size_t len);
|
||||
|
||||
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);
|
||||
|
||||
void show_goal_error (void);
|
||||
@@ -597,15 +654,19 @@ int guile_gmake_setup (const floc *flocp);
|
||||
|
||||
/* Loadable object support. Sets to the strcached name of the loaded file. */
|
||||
typedef int (*load_func_t)(const floc *flocp);
|
||||
int load_file (const floc *flocp, const char **filename, int noerror);
|
||||
void unload_file (const char *name);
|
||||
int load_file (const floc *flocp, struct file *file, int noerror);
|
||||
int unload_file (const char *name);
|
||||
|
||||
/* Maintainer mode support */
|
||||
#ifdef MAKE_MAINTAINER_MODE
|
||||
# define SPIN(_s) spin (_s)
|
||||
void spin (const char* suffix);
|
||||
# define DBG(_f) dbg _f
|
||||
void dbg (const char *fmt, ...);
|
||||
#else
|
||||
# define SPIN(_s)
|
||||
/* Never put this code into Git or a release. */
|
||||
# define DBG(_f) compile-error
|
||||
#endif
|
||||
|
||||
/* We omit these declarations on non-POSIX systems which define _POSIX_VERSION,
|
||||
@@ -613,17 +674,16 @@ void spin (const char* suffix);
|
||||
|
||||
#if !defined (__GNU_LIBRARY__) && !defined (POSIX) && !defined (_POSIX_VERSION) && !defined(WINDOWS32)
|
||||
|
||||
long int atol ();
|
||||
# ifndef VMS
|
||||
long int lseek ();
|
||||
# endif
|
||||
|
||||
# ifdef HAVE_GETCWD
|
||||
# if !defined(VMS) && !defined(__DECC)
|
||||
char *getcwd ();
|
||||
char *getcwd (void);
|
||||
# endif
|
||||
# else
|
||||
char *getwd ();
|
||||
char *getwd (void);
|
||||
# define getcwd(buf, len) getwd (buf)
|
||||
# endif
|
||||
|
||||
@@ -634,9 +694,6 @@ char *getwd ();
|
||||
# define strcasecmp stricmp
|
||||
# elif HAVE_STRCMPI
|
||||
# define strcasecmp strcmpi
|
||||
# else
|
||||
/* Create our own, in misc.c */
|
||||
int strcasecmp (const char *s1, const char *s2);
|
||||
# endif
|
||||
#endif
|
||||
|
||||
@@ -645,9 +702,6 @@ int strcasecmp (const char *s1, const char *s2);
|
||||
# define strncasecmp strnicmp
|
||||
# elif HAVE_STRNCMPI
|
||||
# define strncasecmp strncmpi
|
||||
# else
|
||||
/* Create our own, in misc.c */
|
||||
int strncasecmp (const char *s1, const char *s2, int n);
|
||||
# endif
|
||||
#endif
|
||||
|
||||
@@ -667,21 +721,30 @@ extern unsigned short stopchar_map[];
|
||||
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 env_overrides, no_builtin_rules_flag, no_builtin_variables_flag;
|
||||
extern int print_version_flag, print_directory_flag, check_symlink_flag;
|
||||
extern int warn_undefined_variables_flag, trace_flag, posix_pedantic;
|
||||
extern int print_version_flag, check_symlink_flag;
|
||||
extern int warn_undefined_variables_flag, posix_pedantic;
|
||||
extern int not_parallel, second_expansion, clock_skew_detected;
|
||||
extern int rebuilding_makefiles, one_shell, output_sync, verify_flag;
|
||||
extern unsigned long command_count;
|
||||
|
||||
extern const char *default_shell;
|
||||
|
||||
/* can we run commands via 'sh -c xxx' or must we use batch files? */
|
||||
extern int batch_mode_shell;
|
||||
|
||||
#define GNUMAKEFLAGS_NAME "GNUMAKEFLAGS"
|
||||
#define MAKEFLAGS_NAME "MAKEFLAGS"
|
||||
|
||||
/* Resetting the command script introduction prefix character. */
|
||||
#define RECIPEPREFIX_NAME ".RECIPEPREFIX"
|
||||
#define RECIPEPREFIX_DEFAULT '\t'
|
||||
#define RECIPEPREFIX_NAME ".RECIPEPREFIX"
|
||||
#define RECIPEPREFIX_DEFAULT '\t'
|
||||
extern char cmd_prefix;
|
||||
|
||||
extern unsigned int no_intermediates;
|
||||
|
||||
#define JOBSERVER_AUTH_OPT "jobserver-auth"
|
||||
|
||||
extern char *jobserver_auth;
|
||||
extern unsigned int job_slots;
|
||||
extern double max_load_average;
|
||||
|
||||
@@ -734,7 +797,7 @@ extern char *version_string, *remote_description, *make_host;
|
||||
|
||||
extern unsigned int commands_started;
|
||||
|
||||
extern int handling_fatal_signal;
|
||||
extern volatile sig_atomic_t handling_fatal_signal;
|
||||
|
||||
#ifndef MIN
|
||||
#define MIN(_a,_b) ((_a)<(_b)?(_a):(_b))
|
||||
|
||||
755
src/misc.c
755
src/misc.c
@@ -1,5 +1,5 @@
|
||||
/* Miscellaneous generic support functions for GNU Make.
|
||||
Copyright (C) 1988-2020 Free Software Foundation, Inc.
|
||||
Copyright (C) 1988-2023 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
|
||||
@@ -12,15 +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.
|
||||
|
||||
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 "filedef.h"
|
||||
#include "dep.h"
|
||||
#include "os.h"
|
||||
#include "debug.h"
|
||||
|
||||
/* GNU make no longer supports pre-ANSI89 environments. */
|
||||
|
||||
#include <assert.h>
|
||||
#include <stdarg.h>
|
||||
|
||||
#ifdef WINDOWS32
|
||||
@@ -34,6 +34,71 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
# include <sys/file.h>
|
||||
#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.
|
||||
Return negative if the first is less, positive if it is greater,
|
||||
zero if they are equal. */
|
||||
@@ -93,7 +158,7 @@ collapse_continuations (char *line)
|
||||
if (i & 1)
|
||||
{
|
||||
/* Backslash/newline handling:
|
||||
In traditional GNU make all trailing whitespace, consecutive
|
||||
In traditional GNU Make all trailing whitespace, consecutive
|
||||
backslash/newlines, and any leading non-newline whitespace on the
|
||||
next line is reduced to a single space.
|
||||
In POSIX, each backslash/newline and is replaced by a space. */
|
||||
@@ -173,6 +238,16 @@ concat (unsigned int num, ...)
|
||||
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. */
|
||||
/* Don't bother if we're using dmalloc; it provides these for us. */
|
||||
|
||||
@@ -308,7 +383,8 @@ lindex (const char *s, const char *limit, int c)
|
||||
char *
|
||||
end_of_token (const char *s)
|
||||
{
|
||||
END_OF_TOKEN (s);
|
||||
while (! END_OF_TOKEN (*s))
|
||||
++s;
|
||||
return (char *)s;
|
||||
}
|
||||
|
||||
@@ -453,6 +529,22 @@ spin (const char* type)
|
||||
}
|
||||
}
|
||||
|
||||
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
|
||||
|
||||
|
||||
@@ -475,52 +567,215 @@ umask (mode_t mask)
|
||||
}
|
||||
#endif
|
||||
|
||||
FILE *
|
||||
get_tmpfile (char **name, const char *template)
|
||||
{
|
||||
FILE *file;
|
||||
#ifdef HAVE_FDOPEN
|
||||
int fd;
|
||||
#ifdef VMS
|
||||
# define DEFAULT_TMPFILE "sys$scratch:gnv$make_cmdXXXXXX.com"
|
||||
#else
|
||||
# define DEFAULT_TMPFILE "GmXXXXXX"
|
||||
#endif
|
||||
|
||||
const char *
|
||||
get_tmpdir ()
|
||||
{
|
||||
static const char *tmpdir = NULL;
|
||||
|
||||
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
|
||||
|
||||
strcpy (cp, DEFAULT_TMPFILE);
|
||||
|
||||
return template;
|
||||
}
|
||||
|
||||
#if !HAVE_MKSTEMP || !HAVE_FDOPEN
|
||||
/* Generate a temporary filename. This is not safe as another program could
|
||||
snipe our filename after we've generated it: use this only on systems
|
||||
without more secure alternatives. */
|
||||
|
||||
static char *
|
||||
get_tmppath ()
|
||||
{
|
||||
char *path;
|
||||
|
||||
# ifdef HAVE_MKTEMP
|
||||
path = get_tmptemplate ();
|
||||
if (*mktemp (path) == '\0')
|
||||
{
|
||||
OSS (error, NILF,
|
||||
_("cannot generate temp path from %s: %s"), path, strerror (errno));
|
||||
return NULL;
|
||||
}
|
||||
# else
|
||||
path = xmalloc (L_tmpnam + 1);
|
||||
if (tmpnam (path) == NULL)
|
||||
{
|
||||
OS (error, NILF,
|
||||
_("cannot generate temp name: %s"), strerror (errno));
|
||||
return NULL;
|
||||
}
|
||||
# endif
|
||||
|
||||
return path;
|
||||
}
|
||||
#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. If
|
||||
name is not null then *name will point to an allocated buffer, or set to
|
||||
NULL on failure. */
|
||||
int
|
||||
get_tmpfd (char **name)
|
||||
{
|
||||
int fd = -1;
|
||||
char *tmpnm;
|
||||
mode_t mask;
|
||||
|
||||
if (name)
|
||||
*name = NULL;
|
||||
else
|
||||
{
|
||||
/* If there's an os-specific way to get an anonymous temp file use it. */
|
||||
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 ();
|
||||
if (!tmpnm)
|
||||
return -1;
|
||||
|
||||
/* 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 (error, NILF,
|
||||
_("cannot create temporary file %s: %s"), tmpnm, strerror (errno));
|
||||
free (tmpnm);
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (name)
|
||||
*name = tmpnm;
|
||||
else
|
||||
{
|
||||
int r;
|
||||
EINTRLOOP (r, unlink (tmpnm));
|
||||
if (r < 0)
|
||||
OSS (error, NILF,
|
||||
_("cannot unlink temporary file %s: %s"), tmpnm, strerror (errno));
|
||||
free (tmpnm);
|
||||
}
|
||||
|
||||
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,
|
||||
or NULL on failure. Note, name 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;
|
||||
assert (name);
|
||||
fd = get_tmpfd (name);
|
||||
if (fd < 0)
|
||||
return NULL;
|
||||
assert (*name);
|
||||
|
||||
ENULLLOOP (file, fdopen (fd, tmpfile_mode));
|
||||
if (file == NULL)
|
||||
OSS (error, 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);
|
||||
|
||||
#if defined(HAVE_MKSTEMP) || defined(HAVE_MKTEMP)
|
||||
# define TEMPLATE_LEN strlen (template)
|
||||
#else
|
||||
# define TEMPLATE_LEN L_tmpnam
|
||||
#endif
|
||||
*name = xmalloc (TEMPLATE_LEN + 1);
|
||||
strcpy (*name, template);
|
||||
assert (name);
|
||||
*name = get_tmppath ();
|
||||
if (!*name)
|
||||
return NULL;
|
||||
|
||||
#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
|
||||
(void) mktemp (*name);
|
||||
# else
|
||||
(void) tmpnam (*name);
|
||||
# endif
|
||||
/* Although this fopen is insecure, it is executed only on non-fdopen
|
||||
platforms, which should be a rarity nowadays. */
|
||||
|
||||
# ifdef HAVE_FDOPEN
|
||||
/* 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
|
||||
ENULLLOOP (file, fopen (*name, tmpfile_mode));
|
||||
if (file == NULL)
|
||||
{
|
||||
OSS (error, NILF,
|
||||
_("fopen: temporary file %s: %s"), *name, strerror (errno));
|
||||
free (*name);
|
||||
*name = NULL;
|
||||
}
|
||||
|
||||
umask (mask);
|
||||
#endif
|
||||
|
||||
return file;
|
||||
}
|
||||
@@ -535,8 +790,8 @@ strcasecmp (const char *s1, const char *s2)
|
||||
{
|
||||
while (1)
|
||||
{
|
||||
int c1 = (int) *(s1++);
|
||||
int c2 = (int) *(s2++);
|
||||
int c1 = (unsigned char) *(s1++);
|
||||
int c2 = (unsigned char) *(s2++);
|
||||
|
||||
if (isalpha (c1))
|
||||
c1 = tolower (c1);
|
||||
@@ -556,12 +811,12 @@ strcasecmp (const char *s1, const char *s2)
|
||||
substitute for it, define our own version. */
|
||||
|
||||
int
|
||||
strncasecmp (const char *s1, const char *s2, int n)
|
||||
strncasecmp (const char *s1, const char *s2, size_t n)
|
||||
{
|
||||
while (n-- > 0)
|
||||
{
|
||||
int c1 = (int) *(s1++);
|
||||
int c2 = (int) *(s2++);
|
||||
int c1 = (unsigned char) *(s1++);
|
||||
int c2 = (unsigned char) *(s2++);
|
||||
|
||||
if (isalpha (c1))
|
||||
c1 = tolower (c1);
|
||||
@@ -578,254 +833,6 @@ strncasecmp (const char *s1, const char *s2, int n)
|
||||
}
|
||||
#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
|
||||
unsigned int
|
||||
@@ -835,13 +842,163 @@ get_path_max (void)
|
||||
|
||||
if (value == 0)
|
||||
{
|
||||
long int x = pathconf ("/", _PC_PATH_MAX);
|
||||
long x = pathconf ("/", _PC_PATH_MAX);
|
||||
if (x > 0)
|
||||
value = x;
|
||||
value = (unsigned int) x;
|
||||
else
|
||||
return MAXPATHLEN;
|
||||
value = PATH_MAX;
|
||||
}
|
||||
|
||||
return value;
|
||||
}
|
||||
#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-2023 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@"
|
||||
65
src/mkcustom.h
Normal file
65
src/mkcustom.h
Normal file
@@ -0,0 +1,65 @@
|
||||
/* Miscellaneous global declarations and portability cruft for GNU Make.
|
||||
Copyright (C) 2023 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/>. */
|
||||
|
||||
/*
|
||||
This file is included at the end of config.h
|
||||
|
||||
That means it's included _everywhere_ as the first thing,
|
||||
INCLUDING content imported from gnulib. BE AWARE!!
|
||||
*/
|
||||
|
||||
#undef HAVE_CONFIG_H
|
||||
#define HAVE_CONFIG_H 1
|
||||
|
||||
/* Specify we want GNU source code. This must be defined before any
|
||||
system headers are included. */
|
||||
|
||||
#define _GNU_SOURCE 1
|
||||
|
||||
/* AIX requires this to be the first thing in the file. */
|
||||
#if HAVE_ALLOCA_H
|
||||
# include <alloca.h>
|
||||
#else
|
||||
# ifdef _AIX
|
||||
#pragma alloca
|
||||
# else
|
||||
# if !defined(__GNUC__) && !defined(WINDOWS32)
|
||||
# ifndef alloca /* predefined by HP cc +Olibcalls */
|
||||
char *alloca ();
|
||||
# endif
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* Declare function prototypes for src/misc.c functions if needed. */
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
#if !HAVE_STRCASECMP && !HAVE_STRICMP && !HAVE_STRCMPI
|
||||
int strcasecmp (const char *s1, const char *s2);
|
||||
#endif
|
||||
|
||||
#if !HAVE_STRNCASECMP && !HAVE_STRNICMP && !HAVE_STRNCMPI
|
||||
int strncasecmp (const char *s1, const char *s2, size_t n);
|
||||
#endif
|
||||
|
||||
#if !HAVE_MEMPCPY
|
||||
void *mempcpy (void *dest, const void *src, size_t n);
|
||||
#endif
|
||||
|
||||
#if !HAVE_STPCPY
|
||||
char *stpcpy (char *dest, const char *src);
|
||||
#endif
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user