mirror of
https://github.com/mirror/make.git
synced 2026-08-23 10:23:29 +08:00
Compare commits
550 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ed493f6c91 | ||
|
|
7c3260bbdd | ||
|
|
38b19976f5 | ||
|
|
1dd52ab472 | ||
|
|
92789aa2e7 | ||
|
|
4e18732a1d | ||
|
|
11f9da227e | ||
|
|
b92340a1ea | ||
|
|
8064aee4f9 | ||
|
|
cf78e65fda | ||
|
|
04f0d8427f | ||
|
|
f8401ad28b | ||
|
|
e4b3bf7f97 | ||
|
|
d18a87d0a4 | ||
|
|
41c35f2ffe | ||
|
|
deb4a42c3e | ||
|
|
252c26bd20 | ||
|
|
6f8da5f4b8 | ||
|
|
c46b5a9e0e | ||
|
|
b4157d2ff4 | ||
|
|
f364e0d8d6 | ||
|
|
bb0c05a7f0 | ||
|
|
f987d181c4 | ||
|
|
cad3ddd165 | ||
|
|
54214176b1 | ||
|
|
c2f92c980f | ||
|
|
5b1ca277ca | ||
|
|
7c71df5695 | ||
|
|
a0956c1803 | ||
|
|
4ec74e568d | ||
|
|
d9fc1ac5d2 | ||
|
|
9f55e9fd13 | ||
|
|
7bb7bb4ba4 | ||
|
|
b79791533b | ||
|
|
9d24d41801 | ||
|
|
2d943d3d2e | ||
|
|
b16913a67e | ||
|
|
72ee43c473 | ||
|
|
e5e538fb7a | ||
|
|
c453f898a0 | ||
|
|
18c4b508ef | ||
|
|
383eb3a923 | ||
|
|
01b1d4f401 | ||
|
|
bf2d71498c | ||
|
|
3e20e376b7 | ||
|
|
7ddfc42ee3 | ||
|
|
ca92d83cde | ||
|
|
ae80eefe65 | ||
|
|
01142a53c9 | ||
|
|
dee6af912a | ||
|
|
7296991d6c | ||
|
|
d51ac70122 | ||
|
|
3cb84fe933 | ||
|
|
ad84ec2fdc | ||
|
|
26b9f30714 | ||
|
|
5ac80176a3 | ||
|
|
c801a7fb67 | ||
|
|
c2eddf9be2 | ||
|
|
f8852311cc | ||
|
|
a99378ebe4 | ||
|
|
6c87f3fb85 | ||
|
|
38116baee9 | ||
|
|
614033f8c6 | ||
|
|
f3640ecf4f | ||
|
|
c4e232e44f | ||
|
|
aa99e810a9 | ||
|
|
8f49029561 | ||
|
|
f7ed583675 | ||
|
|
cf7f7de7ae | ||
|
|
d4cb7ae6d4 | ||
|
|
387d349dc8 | ||
|
|
caad0e2181 | ||
|
|
990d6f9b9a | ||
|
|
134480787e | ||
|
|
a9a4919909 | ||
|
|
d12ff78cb2 | ||
|
|
fabb03eac4 | ||
|
|
618c53a225 | ||
|
|
88d126d6c4 | ||
|
|
f6ea899d83 | ||
|
|
ee861a4e9f | ||
|
|
ca4234c4b5 | ||
|
|
257b82ac1f | ||
|
|
aac4004444 | ||
|
|
86fc644dcc | ||
|
|
02b3a6ad46 | ||
|
|
77734be2af | ||
|
|
820210ab85 | ||
|
|
77706874a7 | ||
|
|
a9548aeb8f | ||
|
|
70ba0357a0 | ||
|
|
7d48401707 | ||
|
|
1fc13bf576 | ||
|
|
896908180e | ||
|
|
80e9a422e4 | ||
|
|
15a7e3830f | ||
|
|
26e359c71d | ||
|
|
4da2055a10 | ||
|
|
a2ba5ccbda | ||
|
|
5eff618c8c | ||
|
|
10e130b207 | ||
|
|
62da1c45e5 | ||
|
|
ab31f0b594 | ||
|
|
8f1b6bca46 | ||
|
|
6faa02247e | ||
|
|
c72e1ec446 | ||
|
|
91d87ccf32 | ||
|
|
7ad2593b2d | ||
|
|
09cce75c30 | ||
|
|
07eea3aa49 | ||
|
|
16e14b4114 | ||
|
|
77881d2281 | ||
|
|
2fe96e4a41 | ||
|
|
dd24a4c1cf | ||
|
|
f36c6c7347 | ||
|
|
87d24154af | ||
|
|
614557d04c | ||
|
|
047544785b | ||
|
|
73b08af181 | ||
|
|
5c1d9e54c7 | ||
|
|
2d7b5d6d80 | ||
|
|
5dc7358547 | ||
|
|
e33af0fb4a | ||
|
|
6f7e06ec4e | ||
|
|
3f3eecc115 | ||
|
|
b09e9af0b8 | ||
|
|
9992cb0b83 | ||
|
|
0cbee1b475 | ||
|
|
d63925d863 | ||
|
|
0793658c09 | ||
|
|
98da874c43 | ||
|
|
88d6c22a48 | ||
|
|
c3b39d0654 | ||
|
|
fe55d6e1e3 | ||
|
|
768f287a06 | ||
|
|
8dd302cda6 | ||
|
|
df75efb114 | ||
|
|
3ec497f8f8 | ||
|
|
84ed34ba5a | ||
|
|
08c964b4ac | ||
|
|
97e51c0285 | ||
|
|
59abb46bc9 | ||
|
|
6d6f12b0c3 | ||
|
|
621d3196fa | ||
|
|
e4b7ac21dc | ||
|
|
d444b87173 | ||
|
|
1c179f9636 | ||
|
|
5690084634 | ||
|
|
9fa63eb918 | ||
|
|
668eda0527 | ||
|
|
4e1be4a60c | ||
|
|
5b1e871d2d | ||
|
|
2da3bb46f2 | ||
|
|
b264d3d4f8 | ||
|
|
51c1c07e7a | ||
|
|
700af780af | ||
|
|
f14824878d | ||
|
|
8c2aa889bb | ||
|
|
bb21dd4d2d | ||
|
|
93fd0c0c9a | ||
|
|
cf56036c60 | ||
|
|
88ceff8b2f | ||
|
|
9755d4c09c | ||
|
|
634ef057ad | ||
|
|
949c0464a9 | ||
|
|
416664b1e7 | ||
|
|
667d70eac2 | ||
|
|
b9078e5bd3 | ||
|
|
0de7b74896 | ||
|
|
236589642e | ||
|
|
cb9ac2b0cc | ||
|
|
40a6751abf | ||
|
|
1bc35a7ae7 | ||
|
|
8cdaabbf8e | ||
|
|
2be8661433 | ||
|
|
8b3e678ace | ||
|
|
ec09ec775a | ||
|
|
bdaeca49e9 | ||
|
|
342a9bb54b | ||
|
|
6761122be0 | ||
|
|
1fd0bfaf1e | ||
|
|
8eb171e469 | ||
|
|
7154e316b7 | ||
|
|
f3e345c869 | ||
|
|
d34f46c1f3 | ||
|
|
f0ab709640 | ||
|
|
5f2d114c6d | ||
|
|
cbe0d2e47f | ||
|
|
f485881d4a | ||
|
|
15db387f18 | ||
|
|
aab51f7ef2 | ||
|
|
2b25eac587 | ||
|
|
e72c5e021f | ||
|
|
b6a779d262 | ||
|
|
26f4bb89bd | ||
|
|
320714ae85 | ||
|
|
6682fbc2cb | ||
|
|
f2b130bda8 | ||
|
|
8aba33a8bd | ||
|
|
d365bdfdbc | ||
|
|
f440c3ebe2 | ||
|
|
3efba8a145 | ||
|
|
e7b2f6818c | ||
|
|
c90db9276a | ||
|
|
7192d0ec4a | ||
|
|
9230bfb9ae | ||
|
|
55b993ae09 | ||
|
|
1d20aa7247 | ||
|
|
21f7ac8f47 | ||
|
|
aa376ad638 | ||
|
|
35b51df110 | ||
|
|
e62f4cf9a2 | ||
|
|
116767901f | ||
|
|
71eb0a8038 | ||
|
|
d9291d09b8 | ||
|
|
f3ad572099 | ||
|
|
cefe747e85 | ||
|
|
3ecf97d3af | ||
|
|
21d3865973 | ||
|
|
29d92d4091 | ||
|
|
f8f9d371ff | ||
|
|
f5af979357 | ||
|
|
76cb186732 | ||
|
|
6c06c547dc | ||
|
|
c5d4b7b2f2 | ||
|
|
9e4b3d3f4c | ||
|
|
5a96d5a066 | ||
|
|
4488592dda | ||
|
|
e7eb8b5962 | ||
|
|
0c2fc00544 | ||
|
|
214df0e92a | ||
|
|
b2e898d0bf | ||
|
|
abb1e8d10b | ||
|
|
cc6dc70b16 | ||
|
|
2638552859 | ||
|
|
de48d6a4f7 | ||
|
|
55f06bdc3f | ||
|
|
0d367bbe6e | ||
|
|
f4b8ddf260 | ||
|
|
e13fd5c83d | ||
|
|
7c4e6b0299 | ||
|
|
b9c4fc441b | ||
|
|
65b73ce434 | ||
|
|
2d73c9bf25 | ||
|
|
33468b3f31 | ||
|
|
1cffd0a203 | ||
|
|
b580949ae0 | ||
|
|
f2771aa614 | ||
|
|
5e829188d3 | ||
|
|
297cb5adb7 | ||
|
|
012918bf11 | ||
|
|
1ae90c030d | ||
|
|
0fb6f2d985 | ||
|
|
97a8d9b45a | ||
|
|
c5c02accb7 | ||
|
|
76a099997b | ||
|
|
c5319e75f5 | ||
|
|
510e5ce801 | ||
|
|
144f436c4b | ||
|
|
52056d7b2c | ||
|
|
c66ec5fa20 | ||
|
|
da6fc6aae2 | ||
|
|
d9aff6b817 | ||
|
|
e5f6dc54b9 | ||
|
|
88732a29f2 | ||
|
|
7b0a741857 | ||
|
|
74bd8b3aa5 | ||
|
|
9043b28250 | ||
|
|
fcc11d05a6 | ||
|
|
a8f4669b23 | ||
|
|
bd4829096c | ||
|
|
7044e0c93c | ||
|
|
94d9077691 | ||
|
|
c4cc2e9595 | ||
|
|
5e234e4048 | ||
|
|
950f3d305f | ||
|
|
58a37927e6 | ||
|
|
ec272f3a9c | ||
|
|
ef6aca5a38 | ||
|
|
b262ea5d8f | ||
|
|
cc20f90507 | ||
|
|
9e2fa24649 | ||
|
|
2dc0280d82 | ||
|
|
90959b8b70 | ||
|
|
19ae6fe72a | ||
|
|
0e020bbc24 | ||
|
|
c01222c018 | ||
|
|
957aa450a0 | ||
|
|
e49e11e069 | ||
|
|
f4f353bb54 | ||
|
|
a80b0096f5 | ||
|
|
62e8f029e9 | ||
|
|
db7658e042 | ||
|
|
fa7f95c66c | ||
|
|
df5f30a76a | ||
|
|
1770540217 | ||
|
|
c8a6263eb5 | ||
|
|
a015d1f822 | ||
|
|
c604e53a45 | ||
|
|
d79fe162c0 | ||
|
|
0c326a66c9 | ||
|
|
f79bde1a6d | ||
|
|
289108cc9b | ||
|
|
61c413d5ea | ||
|
|
d3a53d5d16 | ||
|
|
1306023a4f | ||
|
|
80b90b7866 | ||
|
|
8e024a2532 | ||
|
|
660a2eafe5 | ||
|
|
8277806db6 | ||
|
|
6ba5ea022a | ||
|
|
4533348826 | ||
|
|
68fbad6667 | ||
|
|
f430a65ccb | ||
|
|
c30da63fd2 | ||
|
|
3fb7312e9f | ||
|
|
dd6adfa454 | ||
|
|
3b5e47b2e2 | ||
|
|
4e277f6fbd | ||
|
|
ec946d7e21 | ||
|
|
16d06006a4 | ||
|
|
b774aebffa | ||
|
|
06de697268 | ||
|
|
fdfe0446b6 | ||
|
|
12b14f0484 | ||
|
|
4e12a5fa45 | ||
|
|
e56243fe57 | ||
|
|
7449abfe1b | ||
|
|
53b9770b40 | ||
|
|
766baeef0a | ||
|
|
ee204c78f2 | ||
|
|
e64674b718 | ||
|
|
564fb212a7 | ||
|
|
30cc10093b | ||
|
|
69c5a2128b | ||
|
|
577dd1ff6d | ||
|
|
86f2f8bcb5 | ||
|
|
c72205b28b | ||
|
|
057e33d6b5 | ||
|
|
e4499a1fb5 | ||
|
|
57b043c7fb | ||
|
|
f389aabde6 | ||
|
|
acbef3f612 | ||
|
|
3822f77c1d | ||
|
|
1cf3932a39 | ||
|
|
33bda40086 | ||
|
|
e666a6a021 | ||
|
|
5920d6d2b3 | ||
|
|
2e6468c811 | ||
|
|
393d2a2d4a | ||
|
|
bd7d03f8cd | ||
|
|
a4a173928f | ||
|
|
0e113897f7 | ||
|
|
b0eab8ecb9 | ||
|
|
f84821b249 | ||
|
|
99d1423059 | ||
|
|
7fbd58cd6b | ||
|
|
3ede0b96ac | ||
|
|
1d289b424a | ||
|
|
96285f875b | ||
|
|
bd4ce86785 | ||
|
|
e1c072aa7e | ||
|
|
af0074547d | ||
|
|
4a7a8278e8 | ||
|
|
00fa3ca3a5 | ||
|
|
00e590fdef | ||
|
|
4c64a5f986 | ||
|
|
414af96a50 | ||
|
|
1b976397e5 | ||
|
|
9bc5491712 | ||
|
|
57b13c8020 | ||
|
|
02a4c2913a | ||
|
|
8acb89c8c4 | ||
|
|
271e572ba2 | ||
|
|
bde990bfea | ||
|
|
60e54608bd | ||
|
|
60905a8afb | ||
|
|
ebe1d37104 | ||
|
|
c0cb9c8b3d | ||
|
|
34ee9adaed | ||
|
|
64f5375fe0 | ||
|
|
da81e0815f | ||
|
|
9be3c0e2b2 | ||
|
|
9da708772c | ||
|
|
0967624050 | ||
|
|
ba950a796a | ||
|
|
005a251689 | ||
|
|
76b6e668a6 | ||
|
|
5ff6ae6177 | ||
|
|
7c202b50fa | ||
|
|
f0182df865 | ||
|
|
0a6c38eff8 | ||
|
|
4b45e2828d | ||
|
|
4f3a41c60a | ||
|
|
757a9d06e3 | ||
|
|
31394f7f53 | ||
|
|
b6884c73b7 | ||
|
|
8bffc8d53c | ||
|
|
a9609084f4 | ||
|
|
8d820d57f6 | ||
|
|
73e11a5024 | ||
|
|
85cdc9e9ae | ||
|
|
7e60ffe83e | ||
|
|
715c787dc6 | ||
|
|
e304a03b6d | ||
|
|
2273ab7069 | ||
|
|
2e388a18a1 | ||
|
|
39bf50b2da | ||
|
|
a0c17b5af1 | ||
|
|
a483334f97 | ||
|
|
069f2bca99 | ||
|
|
40847ce9b8 | ||
|
|
a01c5bee02 | ||
|
|
38e96eadea | ||
|
|
d7cfbf1961 | ||
|
|
ee167c650e | ||
|
|
4d00ceba26 | ||
|
|
1c045bca52 | ||
|
|
4ed31830cb | ||
|
|
d7ff21ecd7 | ||
|
|
da2b275658 | ||
|
|
f32ca1666f | ||
|
|
9ce370249b | ||
|
|
b5de783f77 | ||
|
|
389dcb608f | ||
|
|
8c888d95f6 | ||
|
|
1710573272 | ||
|
|
80ca781adf | ||
|
|
4a31ca461f | ||
|
|
214865ed5c | ||
|
|
5d6508a475 | ||
|
|
ac11ec5497 | ||
|
|
d603b2e6ac | ||
|
|
8fd614e238 | ||
|
|
92032bc16a | ||
|
|
67e6d81256 | ||
|
|
a1bb739165 | ||
|
|
05769ca009 | ||
|
|
e2234bc1ab | ||
|
|
f9ba22e029 | ||
|
|
eedea52afb | ||
|
|
a9975756d0 | ||
|
|
a37fa47e32 | ||
|
|
9ff4d6af92 | ||
|
|
a370268739 | ||
|
|
1129df27b8 | ||
|
|
749a54d7a4 | ||
|
|
fa937343f5 | ||
|
|
3112c87993 | ||
|
|
8bde7db16f | ||
|
|
5d985c2851 | ||
|
|
3f194b69e3 | ||
|
|
b7acb10e86 | ||
|
|
b36a8ec92a | ||
|
|
23554ee658 | ||
|
|
0ce880e5ee | ||
|
|
c808f10d08 | ||
|
|
1dfd55ca36 | ||
|
|
0bc699a761 | ||
|
|
63b42fa235 | ||
|
|
a7b0dfddac | ||
|
|
73ac4526b9 | ||
|
|
afbecbd9dc | ||
|
|
192469952f | ||
|
|
8a731d1b2c | ||
|
|
48c8a116a9 | ||
|
|
fb779d2f1e | ||
|
|
1af314465e | ||
|
|
b80837c553 | ||
|
|
aa44e66c8f | ||
|
|
a7e0dd98e4 | ||
|
|
0c44ca2683 | ||
|
|
b280989ab7 | ||
|
|
9860296198 | ||
|
|
4fd56724ad | ||
|
|
0ca31088dc | ||
|
|
ef7a1b7d6e | ||
|
|
0c5a9f9b92 | ||
|
|
6264deece3 | ||
|
|
b9c25de370 | ||
|
|
193f1e81ed | ||
|
|
d8728efc80 | ||
|
|
baa57d2cf9 | ||
|
|
7ef56bc8dc | ||
|
|
ac97214635 | ||
|
|
22fd578693 | ||
|
|
78b5fec689 | ||
|
|
75b5268faf | ||
|
|
66a9b5c3ba | ||
|
|
b552b05251 | ||
|
|
5345adf82f | ||
|
|
248f70510e | ||
|
|
b90fabc8d6 | ||
|
|
816a867ff5 | ||
|
|
8ff529b1cb | ||
|
|
5acc59c704 | ||
|
|
68be4f74fc | ||
|
|
2b8e3bb23f | ||
|
|
c4f30e6012 | ||
|
|
fbf71ec25a | ||
|
|
e20c48e385 | ||
|
|
fda00f88d3 | ||
|
|
d9d4e06084 | ||
|
|
a95cb30ab5 | ||
|
|
d351c1fef2 | ||
|
|
3daaa4dd3e | ||
|
|
a359e32eb5 | ||
|
|
bee153c762 | ||
|
|
c5ccc4930c | ||
|
|
45bf0e3a67 | ||
|
|
c6966b3238 | ||
|
|
0029ea8941 | ||
|
|
053d49367c | ||
|
|
80861cce43 | ||
|
|
72af7ce8af | ||
|
|
e4a9c9b825 | ||
|
|
3d7c17c5a9 | ||
|
|
9c487cc537 | ||
|
|
1c9790e6f5 | ||
|
|
b13dcfe501 | ||
|
|
212cb00923 | ||
|
|
ac90d80b2a | ||
|
|
a3f6e49705 | ||
|
|
db72ca1b7d | ||
|
|
8d0aff7e81 | ||
|
|
bc9d72beb0 | ||
|
|
d3bba301ce | ||
|
|
15066b73f4 | ||
|
|
7ed37f0166 | ||
|
|
912a0df127 | ||
|
|
0b41373312 | ||
|
|
6f339b22eb | ||
|
|
e26560508c | ||
|
|
9ab8af7cd8 | ||
|
|
f522852f07 | ||
|
|
a3d8c086d5 | ||
|
|
4762480ae9 | ||
|
|
ef6c059e1e | ||
|
|
cf4ed2ebe8 | ||
|
|
5a4f9a67a3 | ||
|
|
2987163ac4 | ||
|
|
ec61980122 | ||
|
|
9bb994e831 | ||
|
|
e2ebea35f1 | ||
|
|
c73ed7dd1c | ||
|
|
ba8383efd8 | ||
|
|
6f7fb050b4 | ||
|
|
45200a42d3 | ||
|
|
4c9e10fd94 | ||
|
|
6e640321fd |
28
.ccls
Normal file
28
.ccls
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
clang
|
||||||
|
%h --include=makeint.h
|
||||||
|
-DHAVE_CONFIG_H
|
||||||
|
-Isrc
|
||||||
|
-Ilib
|
||||||
|
-DLIBDIR="/usr/local/lib"
|
||||||
|
-DINCLUDEDIR="/usr/local/include"
|
||||||
|
-DLOCALEDIR="/usr/local/share/locale"
|
||||||
|
-DMAKE_MAINTAINER_MODE
|
||||||
|
-pthread
|
||||||
|
-isystem
|
||||||
|
/usr/include/guile/2.0
|
||||||
|
-Wall
|
||||||
|
-Wextra
|
||||||
|
-Werror
|
||||||
|
-Wno-address
|
||||||
|
-Wwrite-strings
|
||||||
|
-Wshadow
|
||||||
|
-Wdeclaration-after-statement
|
||||||
|
-Wbad-function-cast
|
||||||
|
-Wformat-security
|
||||||
|
-Wtype-limits
|
||||||
|
-Wunused-but-set-parameter
|
||||||
|
-Wlogical-op
|
||||||
|
-Wpointer-arith
|
||||||
|
-Wignored-qualifiers
|
||||||
|
-Wformat-signedness
|
||||||
|
-Wduplicated-cond
|
||||||
21
.dir-locals.el
Normal file
21
.dir-locals.el
Normal file
@@ -0,0 +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-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")))
|
||||||
|
)
|
||||||
52
.gitignore
vendored
52
.gitignore
vendored
@@ -1,32 +1,52 @@
|
|||||||
# Development artifacts
|
# Development artifacts
|
||||||
ID
|
ID
|
||||||
TAGS
|
TAGS
|
||||||
|
GPATH
|
||||||
|
GRTAGS
|
||||||
|
GTAGS
|
||||||
|
.*cache
|
||||||
.*gdbinit
|
.*gdbinit
|
||||||
.gdb_history
|
.gdb_history
|
||||||
|
.vscode
|
||||||
*~
|
*~
|
||||||
#*
|
#*
|
||||||
.#*
|
.#*
|
||||||
|
*.diff
|
||||||
|
*.patch
|
||||||
|
*.orig
|
||||||
|
*.rej
|
||||||
|
|
||||||
# Configure artifacts
|
# Configure artifacts
|
||||||
|
/lib/
|
||||||
|
/m4/
|
||||||
ABOUT-NLS
|
ABOUT-NLS
|
||||||
|
INSTALL
|
||||||
Makefile
|
Makefile
|
||||||
Makefile.in
|
Makefile.in
|
||||||
|
Basic.mk
|
||||||
aclocal.m4
|
aclocal.m4
|
||||||
autom4te.cache
|
autom4te.cache/
|
||||||
|
build-aux/
|
||||||
config.cache
|
config.cache
|
||||||
config.h
|
config.h
|
||||||
config.h.in
|
config.h.in
|
||||||
config.log
|
config.log
|
||||||
config.status
|
config.status
|
||||||
configure
|
configure
|
||||||
stamp-h1
|
/mk/Posix.mk
|
||||||
|
stamp-*
|
||||||
|
.dirstamp
|
||||||
|
gnulib
|
||||||
|
convert.sed
|
||||||
|
|
||||||
# Build artifacts
|
# Build artifacts
|
||||||
.deps
|
.deps/
|
||||||
gmk-default.h
|
gmk-default.h
|
||||||
loadavg
|
loadavg
|
||||||
make
|
make
|
||||||
|
*.i
|
||||||
*.o
|
*.o
|
||||||
|
*.a
|
||||||
*.exe
|
*.exe
|
||||||
*.dll.a
|
*.dll.a
|
||||||
*.obj
|
*.obj
|
||||||
@@ -35,28 +55,22 @@ make
|
|||||||
*.sbr
|
*.sbr
|
||||||
|
|
||||||
# Windows build artifacts
|
# Windows build artifacts
|
||||||
/WinDebug/
|
WinDebug/
|
||||||
/WinRel/
|
WinRel/
|
||||||
/GccDebug/
|
GccDebug/
|
||||||
/GccRel/
|
GccRel/
|
||||||
|
|
||||||
|
# Test artifacts
|
||||||
|
makeerror-*
|
||||||
|
test-suite.log
|
||||||
|
|
||||||
# Distribution artifacts
|
# Distribution artifacts
|
||||||
.dep_segment
|
.dep_segment
|
||||||
.check-git-HEAD
|
.check-git-HEAD
|
||||||
ChangeLog
|
ChangeLog
|
||||||
Makefile.DOS
|
|
||||||
NMakefile
|
|
||||||
README
|
README
|
||||||
README.DOS
|
build.cfg
|
||||||
README.OS2
|
mkconfig.h
|
||||||
README.W32
|
|
||||||
SMakefile
|
|
||||||
build.sh
|
|
||||||
build.sh.in
|
|
||||||
config.ami
|
|
||||||
config.h-vms
|
|
||||||
config.h.W32
|
|
||||||
configh.dos
|
|
||||||
make-[0-9]*/
|
make-[0-9]*/
|
||||||
make-[0-9]*.tar.*
|
make-[0-9]*.tar.*
|
||||||
checkcfg.*.log
|
checkcfg.*.log
|
||||||
|
|||||||
12
.purify
12
.purify
@@ -1,12 +0,0 @@
|
|||||||
# Solaris (2.5.1) has a couple if issues.
|
|
||||||
#
|
|
||||||
suppress plk malloc; setvbuf "libc*"; main "main.c"
|
|
||||||
suppress umr kstat_read; kstat_chain_update; kstat_open; getloadavg
|
|
||||||
suppress umr kstat_chain_update; kstat_open; getloadavg
|
|
||||||
|
|
||||||
# The command line options stuff leaks a little bit. No big deal.
|
|
||||||
#
|
|
||||||
suppress mlk malloc; xmalloc "misc.c"; decode_env_switches "main.c"
|
|
||||||
suppress plk malloc; xmalloc "misc.c"; decode_env_switches "main.c"
|
|
||||||
suppress mlk malloc; xmalloc "misc.c"; concat "misc.c"; decode_env_switches "main.c"
|
|
||||||
suppress plk malloc; xmalloc "misc.c"; concat "misc.c"; decode_env_switches "main.c"
|
|
||||||
60
AUTHORS
60
AUTHORS
@@ -1,15 +1,16 @@
|
|||||||
-----------------------------------
|
-----------------------------------
|
||||||
|
|
||||||
GNU make development up to version 3.75 by:
|
GNU Make development starting with GNU Make 3.76 by:
|
||||||
Roland McGrath <roland@gnu.org>
|
|
||||||
|
|
||||||
|
|
||||||
Development starting with GNU make 3.76 by:
|
|
||||||
Paul D. Smith <psmith@gnu.org>
|
Paul D. Smith <psmith@gnu.org>
|
||||||
|
|
||||||
Additional development starting with GNU make 3.81 by:
|
Additional development starting with GNU Make 4.3 by:
|
||||||
|
Dmitry Goncharov <dgoncharov@users.sf.net>
|
||||||
|
|
||||||
|
Additional development starting with GNU Make 3.81 by:
|
||||||
Boris Kolpackov <boris@kolpackov.net>
|
Boris Kolpackov <boris@kolpackov.net>
|
||||||
|
|
||||||
|
GNU Make development up to version 3.75 by:
|
||||||
|
Roland McGrath <roland@gnu.org>
|
||||||
|
|
||||||
GNU Make User's Manual
|
GNU Make User's Manual
|
||||||
Written by:
|
Written by:
|
||||||
@@ -22,7 +23,7 @@ GNU Make User's Manual
|
|||||||
Paul D. Smith <psmith@gnu.org>
|
Paul D. Smith <psmith@gnu.org>
|
||||||
|
|
||||||
-----------------------------------
|
-----------------------------------
|
||||||
GNU make porting efforts:
|
GNU Make porting efforts:
|
||||||
|
|
||||||
Port to VMS by:
|
Port to VMS by:
|
||||||
Klaus Kaempf <kkaempf@progis.de>
|
Klaus Kaempf <kkaempf@progis.de>
|
||||||
@@ -34,6 +35,9 @@ GNU make porting efforts:
|
|||||||
Port to Amiga by:
|
Port to Amiga by:
|
||||||
Aaron Digulla <digulla@fh-konstanz.de>
|
Aaron Digulla <digulla@fh-konstanz.de>
|
||||||
|
|
||||||
|
Port to MS-Windows (native/MinGW) maintained by:
|
||||||
|
Eli Zaretskii <eliz@gnu.org>
|
||||||
|
|
||||||
Port to MS-DOS (DJGPP), OS/2, and MS-Windows (native/MinGW) by:
|
Port to MS-DOS (DJGPP), OS/2, and MS-Windows (native/MinGW) by:
|
||||||
DJ Delorie <dj@delorie.com>
|
DJ Delorie <dj@delorie.com>
|
||||||
Rob Tulloh <rob_tulloh@tivoli.com>
|
Rob Tulloh <rob_tulloh@tivoli.com>
|
||||||
@@ -42,37 +46,67 @@ GNU make porting efforts:
|
|||||||
Andreas Beuning <andreas.buening@nexgo.de>
|
Andreas Beuning <andreas.buening@nexgo.de>
|
||||||
Earnie Boyd <earnie@uses.sf.net>
|
Earnie Boyd <earnie@uses.sf.net>
|
||||||
Troy Runkel <Troy.Runkel@mathworks.com>
|
Troy Runkel <Troy.Runkel@mathworks.com>
|
||||||
|
Juan M. Guerrero <juan.guerrero@gmx.de>
|
||||||
|
|
||||||
-----------------------------------
|
-----------------------------------
|
||||||
Other contributors:
|
Other contributors:
|
||||||
|
|
||||||
|
Luke Allardyce <lukeallardyce@gmail.com>
|
||||||
|
Aron Barath <baratharon@caesar.elte.hu>
|
||||||
|
David Boyce <dsb@boyski.com>
|
||||||
|
Kevin Buettner <kevinb@redhat.com>
|
||||||
Janet Carson <janet_carson@tivoli.com>
|
Janet Carson <janet_carson@tivoli.com>
|
||||||
Howard Chu <hyc@highlandsun.com>
|
Howard Chu <hyc@highlandsun.com>
|
||||||
Ludovic Courtès <ludo@gnu.org>
|
Ludovic Courtès <ludo@gnu.org>
|
||||||
|
Joe Crayne <oh.hello.joe@gmail.com>
|
||||||
|
Jeremy Devenport <jeremy.devenport@gmail.com>
|
||||||
|
Pete Dietl <petedietl@gmail.com>
|
||||||
|
Martin Dorey <martin.dorey@hds.com>
|
||||||
|
Christian Eggers <ceggers@arri.de>
|
||||||
Paul Eggert <eggert@twinsun.com>
|
Paul Eggert <eggert@twinsun.com>
|
||||||
|
Mike Frysinger <vapier@gentoo.org>
|
||||||
Ramon Garcia Fernandez <ramon.garcia.f@gmail.com>
|
Ramon Garcia Fernandez <ramon.garcia.f@gmail.com>
|
||||||
|
Noah Goldstein <goldstein.w.n@gmail.com>
|
||||||
|
Mike Haboustak <haboustak@gmail.com>
|
||||||
|
Frank Heckenbach <f.heckenbach@fh-soft.de>
|
||||||
Klaus Heinz <kamar@ease.rhein-main.de>
|
Klaus Heinz <kamar@ease.rhein-main.de>
|
||||||
|
Ben Hutchings <ben@decadent.org.uk>
|
||||||
|
Cao jin <caoj.fnst@cn.fujitsu.com>
|
||||||
Michael Joosten
|
Michael Joosten
|
||||||
|
Christian Jullien <eligis@orange.fr>
|
||||||
Jim Kelton <jim_kelton@tivoli.com>
|
Jim Kelton <jim_kelton@tivoli.com>
|
||||||
|
Kaz Kylheku <kaz@kylheku.com>
|
||||||
David Lubbren <uhay@rz.uni-karlsruhe.de>
|
David Lubbren <uhay@rz.uni-karlsruhe.de>
|
||||||
Tim Magill <tim.magill@telops.gte.com>
|
Tim Magill <tim.magill@telops.gte.com>
|
||||||
Markus Mauhart <qwe123@chello.at>
|
Markus Mauhart <qwe123@chello.at>
|
||||||
Greg McGary <greg@mcgary.org>
|
Greg McGary <greg@mcgary.org>
|
||||||
Thien-Thi Nguyen <ttn@gnuvola.org>
|
Thien-Thi Nguyen <ttn@gnuvola.org>
|
||||||
Thomas Riedl <thomas.riedl@siemens.com>
|
|
||||||
Han-Wen Nienhuys <hanwen@cs.uu.nl>
|
Han-Wen Nienhuys <hanwen@cs.uu.nl>
|
||||||
Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
|
Enrique Olaizola <enrique_olaizola16@hotmail.com>
|
||||||
|
Ola Olsson <ola1olsson@gmail.com>
|
||||||
|
Jens Rehsack <sno@netbsd.org>
|
||||||
|
Thomas Riedl <thomas.riedl@siemens.com>
|
||||||
|
Jaak Ristioja <jaak@ristioja.ee>
|
||||||
|
Christoph Schulz <develop@kristov.de>
|
||||||
|
Andreas Schwab <schwab@suse.de>
|
||||||
|
spagoveanu <spagoveanu@gmail.com>
|
||||||
Carl Staelin (Princeton University)
|
Carl Staelin (Princeton University)
|
||||||
Ian Stewartson (Data Logic Limited)
|
Ian Stewartson (Data Logic Limited)
|
||||||
|
Tobias Stoeckmann <tobias@stoeckmann.org>
|
||||||
|
Sergei Trofimovich <siarheit@google.com>
|
||||||
|
Marc Ullman <marc@mathworks.com>
|
||||||
|
Christof Warlich <cwarlich@gmx.de>
|
||||||
|
Florian Weimer <fweimer@redhat.com>
|
||||||
David A. Wheeler <dwheeler@dwheeler.com>
|
David A. Wheeler <dwheeler@dwheeler.com>
|
||||||
David Boyce <dsb@boyski.com>
|
Bernhard M. Wiedemann <bwiedemann@suse.de>
|
||||||
Frank Heckenbach <f.heckenbach@fh-soft.de>
|
Ben Wijen <ben@wijen.net>
|
||||||
|
Jouke Witteveen <j.witteveen@gmail.com>
|
||||||
|
|
||||||
With suggestions/comments/bug reports from a cast of ... well ...
|
With suggestions/comments/bug reports from a cast of ... well ...
|
||||||
hundreds, anyway :)
|
hundreds, anyway :)
|
||||||
|
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 1997-2016 Free Software Foundation, Inc.
|
Copyright (C) 1997-2022 Free Software Foundation, Inc.
|
||||||
This file is part of GNU Make.
|
This file is part of GNU Make.
|
||||||
|
|
||||||
GNU Make is free software; you can redistribute it and/or modify it under the
|
GNU Make is free software; you can redistribute it and/or modify it under the
|
||||||
@@ -85,4 +119,4 @@ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|||||||
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License along with
|
You should have received a copy of the GNU General Public License along with
|
||||||
this program. If not, see <http://www.gnu.org/licenses/>.
|
this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|||||||
133
Basic.mk.template
Normal file
133
Basic.mk.template
Normal file
@@ -0,0 +1,133 @@
|
|||||||
|
# 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 MS-DOS, run ".\builddos.bat" to bootstrap one.
|
||||||
|
#
|
||||||
|
# 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-2022 Free Software Foundation, Inc.
|
||||||
|
# This file is part of GNU Make.
|
||||||
|
#
|
||||||
|
# GNU Make is free software; you can redistribute it and/or modify it under
|
||||||
|
# the terms of the GNU General Public License as published by the Free Software
|
||||||
|
# Foundation; either version 3 of the License, or (at your option) any later
|
||||||
|
# version.
|
||||||
|
#
|
||||||
|
# GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||||
|
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||||
|
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
||||||
|
# details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License along with
|
||||||
|
# this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
all:
|
||||||
|
|
||||||
|
src = src/
|
||||||
|
lib = lib/
|
||||||
|
|
||||||
|
make_SOURCES = %make_SOURCES%
|
||||||
|
glob_SOURCES = %glob_SOURCES%
|
||||||
|
loadavg_SOURCES = %loadavg_SOURCES%
|
||||||
|
alloca_SOURCES = %alloca_SOURCES%
|
||||||
|
w32_SOURCES = %w32_SOURCES%
|
||||||
|
vms_SOURCES = %vms_SOURCES%
|
||||||
|
amiga_SOURCES = %amiga_SOURCES%
|
||||||
|
|
||||||
|
remote_SOURCES = $(src)remote-stub.c
|
||||||
|
|
||||||
|
OUTDIR =
|
||||||
|
SRCDIR = .
|
||||||
|
|
||||||
|
OBJEXT = o
|
||||||
|
EXEEXT =
|
||||||
|
|
||||||
|
PREFIX = /usr/local
|
||||||
|
INCLUDEDIR = $(PREFIX)/include
|
||||||
|
LIBDIR = $(PREFIX)/lib
|
||||||
|
LOCALEDIR = $(PREFIX)/share
|
||||||
|
|
||||||
|
PROG = $(OUTDIR)make$(EXEEXT)
|
||||||
|
|
||||||
|
prog_SOURCES = $(make_SOURCES) $(remote_SOURCES)
|
||||||
|
|
||||||
|
BUILT_SOURCES =
|
||||||
|
|
||||||
|
OBJECTS = $(patsubst %.c,$(OUTDIR)%.$(OBJEXT),$(prog_SOURCES))
|
||||||
|
|
||||||
|
OBJDIRS = $(addsuffix .,$(sort $(dir $(OBJECTS))))
|
||||||
|
|
||||||
|
# Use the default value of CC
|
||||||
|
LD = $(CC)
|
||||||
|
|
||||||
|
# Reserved for command-line override
|
||||||
|
CPPFLAGS =
|
||||||
|
CFLAGS = -g -O2
|
||||||
|
LDFLAGS =
|
||||||
|
|
||||||
|
extra_CPPFLAGS = -DHAVE_CONFIG_H -I$(OUTDIR)src -I$(SRCDIR)/src -I$(OUTDIR)lib -I$(SRCDIR)/lib \
|
||||||
|
-DLIBDIR=\"$(LIBDIR)\" -DINCLUDEDIR=\"$(INCLUDEDIR)\" -DLOCALEDIR=\"$(LOCALDIR)\"
|
||||||
|
extra_CFLAGS =
|
||||||
|
extra_LDFLAGS = $(extra_CFLAGS) $(CFLAGS)
|
||||||
|
|
||||||
|
C_SOURCE = -c
|
||||||
|
OUTPUT_OPTION = -o $@
|
||||||
|
LINK_OUTPUT = -o $@
|
||||||
|
|
||||||
|
# Command lines
|
||||||
|
|
||||||
|
# $(call COMPILE.cmd,<src>,<tgt>)
|
||||||
|
COMPILE.cmd = $(CC) $(extra_CFLAGS) $(CFLAGS) $(extra_CPPFLAGS) $(CPPFLAGS) $(TARGET_ARCH) $(OUTPUT_OPTION) $(C_SOURCE) $1
|
||||||
|
|
||||||
|
# $(call LINK.cmd,<objectlist>)
|
||||||
|
LINK.cmd = $(LD) $(extra_LDFLAGS) $(LDFLAGS) $(TARGET_ARCH) $1 $(LDLIBS) $(LINK_OUTPUT)
|
||||||
|
|
||||||
|
# $(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
|
||||||
|
|
||||||
|
# $(call RM.cmd,<filelist>)
|
||||||
|
RM.cmd = rm -f $1
|
||||||
|
|
||||||
|
# $(call CP.cmd,<from>,<to>)
|
||||||
|
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)))
|
||||||
|
|
||||||
|
VPATH = $(SRCDIR)
|
||||||
|
|
||||||
|
all: $(PROG)
|
||||||
|
|
||||||
|
$(PROG): $(OBJECTS)
|
||||||
|
$(call LINK.cmd,$^)
|
||||||
|
|
||||||
|
$(OBJECTS): $(OUTDIR)%.$(OBJEXT): %.c
|
||||||
|
$(call COMPILE.cmd,$<)
|
||||||
|
|
||||||
|
$(OBJECTS): | $(OBJDIRS) $(BUILT_SOURCES)
|
||||||
|
|
||||||
|
$(OBJDIRS):
|
||||||
|
$(call MKDIR.cmd,$@)
|
||||||
|
|
||||||
|
check:
|
||||||
|
$(CHECK.cmd) $(CHECK.args)
|
||||||
|
|
||||||
|
clean:
|
||||||
|
$(CLEANSPACE)
|
||||||
|
|
||||||
|
$(filter %.h,$(BUILT_SOURCES)): %.h : %.in.h
|
||||||
|
$(call RM.cmd,$@)
|
||||||
|
$(call CP.cmd,$<,$@)
|
||||||
|
|
||||||
|
.PHONY: all check clean
|
||||||
8
COPYING
8
COPYING
@@ -1,7 +1,7 @@
|
|||||||
GNU GENERAL PUBLIC LICENSE
|
GNU GENERAL PUBLIC LICENSE
|
||||||
Version 3, 29 June 2007
|
Version 3, 29 June 2007
|
||||||
|
|
||||||
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
||||||
Everyone is permitted to copy and distribute verbatim copies
|
Everyone is permitted to copy and distribute verbatim copies
|
||||||
of this license document, but changing it is not allowed.
|
of this license document, but changing it is not allowed.
|
||||||
|
|
||||||
@@ -645,7 +645,7 @@ the "copyright" line and a pointer to where the full notice is found.
|
|||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
Also add information on how to contact you by electronic and paper mail.
|
Also add information on how to contact you by electronic and paper mail.
|
||||||
|
|
||||||
@@ -664,11 +664,11 @@ might be different; for a GUI interface, you would use an "about box".
|
|||||||
You should also get your employer (if you work as a programmer) or school,
|
You should also get your employer (if you work as a programmer) or school,
|
||||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||||
For more information on this, and how to apply and follow the GNU GPL, see
|
For more information on this, and how to apply and follow the GNU GPL, see
|
||||||
<http://www.gnu.org/licenses/>.
|
<https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
The GNU General Public License does not permit incorporating your program
|
The GNU General Public License does not permit incorporating your program
|
||||||
into proprietary programs. If your program is a subroutine library, you
|
into proprietary programs. If your program is a subroutine library, you
|
||||||
may consider it more useful to permit linking proprietary applications with
|
may consider it more useful to permit linking proprietary applications with
|
||||||
the library. If this is what you want to do, use the GNU Lesser General
|
the library. If this is what you want to do, use the GNU Lesser General
|
||||||
Public License instead of this License. But first, please read
|
Public License instead of this License. But first, please read
|
||||||
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
|
<https://www.gnu.org/philosophy/why-not-lgpl.html>.
|
||||||
|
|||||||
@@ -4994,4 +4994,4 @@ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|||||||
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License along with
|
You should have received a copy of the GNU General Public License along with
|
||||||
this program. If not, see <http://www.gnu.org/licenses/>.
|
this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|||||||
@@ -1322,7 +1322,7 @@
|
|||||||
non-standard versions of free() don't like it.
|
non-standard versions of free() don't like it.
|
||||||
|
|
||||||
* configure.in (--enable-dmalloc): Install some support for using
|
* configure.in (--enable-dmalloc): Install some support for using
|
||||||
dmalloc (http://www.dmalloc.com/) with make. Use --enable-dmalloc
|
dmalloc (https://www.dmalloc.com/) with make. Use --enable-dmalloc
|
||||||
with configure to enable it.
|
with configure to enable it.
|
||||||
|
|
||||||
* function.c (function_table_entry): Whoops! The function.c
|
* function.c (function_table_entry): Whoops! The function.c
|
||||||
@@ -6632,7 +6632,7 @@ Fri Nov 1 19:34:28 1991 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
|
|||||||
|
|
||||||
See ChangeLog.1, available in the Git repository at:
|
See ChangeLog.1, available in the Git repository at:
|
||||||
|
|
||||||
http://git.savannah.gnu.org/cgit/make.git/tree/
|
https://git.savannah.gnu.org/cgit/make.git/tree/
|
||||||
|
|
||||||
for earlier changes.
|
for earlier changes.
|
||||||
|
|
||||||
@@ -6650,4 +6650,4 @@ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|||||||
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License along with
|
You should have received a copy of the GNU General Public License along with
|
||||||
this program. If not, see <http://www.gnu.org/licenses/>.
|
this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|||||||
10
ChangeLog.3
10
ChangeLog.3
@@ -664,7 +664,7 @@
|
|||||||
characters in its name, pass NULL as the first argument to
|
characters in its name, pass NULL as the first argument to
|
||||||
CreateProcess. This avoids weird failures due to buggy quoting by
|
CreateProcess. This avoids weird failures due to buggy quoting by
|
||||||
CreateProcess. For the details, see the discussion starting at
|
CreateProcess. For the details, see the discussion starting at
|
||||||
http://lists.gnu.org/archive/html/make-w32/2013-04/msg00008.html.
|
https://lists.gnu.org/archive/html/make-w32/2013-04/msg00008.html.
|
||||||
|
|
||||||
* load.c (load_object, load_file): Accept an additional argument
|
* load.c (load_object, load_file): Accept an additional argument
|
||||||
DLP and return in it a pointer that can be used to unload the
|
DLP and return in it a pointer that can be used to unload the
|
||||||
@@ -706,7 +706,7 @@
|
|||||||
(construct_command_argv_internal): Don't treat a backslash as an
|
(construct_command_argv_internal): Don't treat a backslash as an
|
||||||
escape character before whitespace, if the shell is not a Posix
|
escape character before whitespace, if the shell is not a Posix
|
||||||
shell. For the description of the problem, see
|
shell. For the description of the problem, see
|
||||||
http://lists.gnu.org/archive/html/make-w32/2013-04/msg00014.html.
|
https://lists.gnu.org/archive/html/make-w32/2013-04/msg00014.html.
|
||||||
|
|
||||||
2013-05-01 Paul Smith <psmith@gnu.org>
|
2013-05-01 Paul Smith <psmith@gnu.org>
|
||||||
|
|
||||||
@@ -1392,7 +1392,7 @@
|
|||||||
2011-09-16 Paul Smith <psmith@gnu.org>
|
2011-09-16 Paul Smith <psmith@gnu.org>
|
||||||
|
|
||||||
* maintMakefile (do-po-update): Apparently we have to avoid
|
* maintMakefile (do-po-update): Apparently we have to avoid
|
||||||
certificate checks on the http://translationproject.org site now.
|
certificate checks on the https://translationproject.org site now.
|
||||||
|
|
||||||
2011-09-12 Paul Smith <psmith@gnu.org>
|
2011-09-12 Paul Smith <psmith@gnu.org>
|
||||||
|
|
||||||
@@ -5612,7 +5612,7 @@
|
|||||||
|
|
||||||
See ChangeLog.2, available in the Git repository at:
|
See ChangeLog.2, available in the Git repository at:
|
||||||
|
|
||||||
http://git.savannah.gnu.org/cgit/make.git/tree/
|
https://git.savannah.gnu.org/cgit/make.git/tree/
|
||||||
|
|
||||||
for earlier changes.
|
for earlier changes.
|
||||||
|
|
||||||
@@ -5630,4 +5630,4 @@ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|||||||
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License along with
|
You should have received a copy of the GNU General Public License along with
|
||||||
this program. If not, see <http://www.gnu.org/licenses/>.
|
this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|||||||
231
INSTALL
231
INSTALL
@@ -1,231 +0,0 @@
|
|||||||
Installation Instructions
|
|
||||||
*************************
|
|
||||||
|
|
||||||
Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004 Free
|
|
||||||
Software Foundation, Inc.
|
|
||||||
|
|
||||||
This file is free documentation; the Free Software Foundation gives
|
|
||||||
unlimited permission to copy, distribute and modify it.
|
|
||||||
|
|
||||||
Basic Installation
|
|
||||||
==================
|
|
||||||
|
|
||||||
These are generic installation instructions.
|
|
||||||
|
|
||||||
The `configure' shell script attempts to guess correct values for
|
|
||||||
various system-dependent variables used during compilation. It uses
|
|
||||||
those values to create a `Makefile' in each directory of the package.
|
|
||||||
It may also create one or more `.h' files containing system-dependent
|
|
||||||
definitions. Finally, it creates a shell script `config.status' that
|
|
||||||
you can run in the future to recreate the current configuration, and a
|
|
||||||
file `config.log' containing compiler output (useful mainly for
|
|
||||||
debugging `configure').
|
|
||||||
|
|
||||||
It can also use an optional file (typically called `config.cache'
|
|
||||||
and enabled with `--cache-file=config.cache' or simply `-C') that saves
|
|
||||||
the results of its tests to speed up reconfiguring. (Caching is
|
|
||||||
disabled by default to prevent problems with accidental use of stale
|
|
||||||
cache files.)
|
|
||||||
|
|
||||||
If you need to do unusual things to compile the package, please try
|
|
||||||
to figure out how `configure' could check whether to do them, and mail
|
|
||||||
diffs or instructions to the address given in the `README' so they can
|
|
||||||
be considered for the next release. If you are using the cache, and at
|
|
||||||
some point `config.cache' contains results you don't want to keep, you
|
|
||||||
may remove or edit it.
|
|
||||||
|
|
||||||
The file `configure.ac' (or `configure.in') is used to create
|
|
||||||
`configure' by a program called `autoconf'. You only need
|
|
||||||
`configure.ac' if you want to change it or regenerate `configure' using
|
|
||||||
a newer version of `autoconf'.
|
|
||||||
|
|
||||||
The simplest way to compile this package is:
|
|
||||||
|
|
||||||
1. `cd' to the directory containing the package's source code and type
|
|
||||||
`./configure' to configure the package for your system. If you're
|
|
||||||
using `csh' on an old version of System V, you might need to type
|
|
||||||
`sh ./configure' instead to prevent `csh' from trying to execute
|
|
||||||
`configure' itself.
|
|
||||||
|
|
||||||
Running `configure' takes awhile. While running, it prints some
|
|
||||||
messages telling which features it is checking for.
|
|
||||||
|
|
||||||
2. Type `make' to compile the package.
|
|
||||||
|
|
||||||
3. Optionally, type `make check' to run any self-tests that come with
|
|
||||||
the package.
|
|
||||||
|
|
||||||
4. Type `make install' to install the programs and any data files and
|
|
||||||
documentation.
|
|
||||||
|
|
||||||
5. You can remove the program binaries and object files from the
|
|
||||||
source code directory by typing `make clean'. To also remove the
|
|
||||||
files that `configure' created (so you can compile the package for
|
|
||||||
a different kind of computer), type `make distclean'. There is
|
|
||||||
also a `make maintainer-clean' target, but that is intended mainly
|
|
||||||
for the package's developers. If you use it, you may have to get
|
|
||||||
all sorts of other programs in order to regenerate files that came
|
|
||||||
with the distribution.
|
|
||||||
|
|
||||||
Compilers and Options
|
|
||||||
=====================
|
|
||||||
|
|
||||||
Some systems require unusual options for compilation or linking that the
|
|
||||||
`configure' script does not know about. Run `./configure --help' for
|
|
||||||
details on some of the pertinent environment variables.
|
|
||||||
|
|
||||||
You can give `configure' initial values for configuration parameters
|
|
||||||
by setting variables in the command line or in the environment. Here
|
|
||||||
is an example:
|
|
||||||
|
|
||||||
./configure CC=c89 CFLAGS=-O2 LIBS=-lposix
|
|
||||||
|
|
||||||
*Note Defining Variables::, for more details.
|
|
||||||
|
|
||||||
Compiling For Multiple Architectures
|
|
||||||
====================================
|
|
||||||
|
|
||||||
You can compile the package for more than one kind of computer at the
|
|
||||||
same time, by placing the object files for each architecture in their
|
|
||||||
own directory. To do this, you must use a version of `make' that
|
|
||||||
supports the `VPATH' variable, such as GNU `make'. `cd' to the
|
|
||||||
directory where you want the object files and executables to go and run
|
|
||||||
the `configure' script. `configure' automatically checks for the
|
|
||||||
source code in the directory that `configure' is in and in `..'.
|
|
||||||
|
|
||||||
If you have to use a `make' that does not support the `VPATH'
|
|
||||||
variable, you have to compile the package for one architecture at a
|
|
||||||
time in the source code directory. After you have installed the
|
|
||||||
package for one architecture, use `make distclean' before reconfiguring
|
|
||||||
for another architecture.
|
|
||||||
|
|
||||||
Installation Names
|
|
||||||
==================
|
|
||||||
|
|
||||||
By default, `make install' will install the package's files in
|
|
||||||
`/usr/local/bin', `/usr/local/man', etc. You can specify an
|
|
||||||
installation prefix other than `/usr/local' by giving `configure' the
|
|
||||||
option `--prefix=PREFIX'.
|
|
||||||
|
|
||||||
You can specify separate installation prefixes for
|
|
||||||
architecture-specific files and architecture-independent files. If you
|
|
||||||
give `configure' the option `--exec-prefix=PREFIX', the package will
|
|
||||||
use PREFIX as the prefix for installing programs and libraries.
|
|
||||||
Documentation and other data files will still use the regular prefix.
|
|
||||||
|
|
||||||
In addition, if you use an unusual directory layout you can give
|
|
||||||
options like `--bindir=DIR' to specify different values for particular
|
|
||||||
kinds of files. Run `configure --help' for a list of the directories
|
|
||||||
you can set and what kinds of files go in them.
|
|
||||||
|
|
||||||
If the package supports it, you can cause programs to be installed
|
|
||||||
with an extra prefix or suffix on their names by giving `configure' the
|
|
||||||
option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
|
|
||||||
|
|
||||||
Optional Features
|
|
||||||
=================
|
|
||||||
|
|
||||||
Some packages pay attention to `--enable-FEATURE' options to
|
|
||||||
`configure', where FEATURE indicates an optional part of the package.
|
|
||||||
They may also pay attention to `--with-PACKAGE' options, where PACKAGE
|
|
||||||
is something like `gnu-as' or `x' (for the X Window System). The
|
|
||||||
`README' should mention any `--enable-' and `--with-' options that the
|
|
||||||
package recognizes.
|
|
||||||
|
|
||||||
For packages that use the X Window System, `configure' can usually
|
|
||||||
find the X include and library files automatically, but if it doesn't,
|
|
||||||
you can use the `configure' options `--x-includes=DIR' and
|
|
||||||
`--x-libraries=DIR' to specify their locations.
|
|
||||||
|
|
||||||
Specifying the System Type
|
|
||||||
==========================
|
|
||||||
|
|
||||||
There may be some features `configure' cannot figure out automatically,
|
|
||||||
but needs to determine by the type of machine the package will run on.
|
|
||||||
Usually, assuming the package is built to be run on the _same_
|
|
||||||
architectures, `configure' can figure that out, but if it prints a
|
|
||||||
message saying it cannot guess the machine type, give it the
|
|
||||||
`--build=TYPE' option. TYPE can either be a short name for the system
|
|
||||||
type, such as `sun4', or a canonical name which has the form:
|
|
||||||
|
|
||||||
CPU-COMPANY-SYSTEM
|
|
||||||
|
|
||||||
where SYSTEM can have one of these forms:
|
|
||||||
|
|
||||||
OS KERNEL-OS
|
|
||||||
|
|
||||||
See the file `config.sub' for the possible values of each field. If
|
|
||||||
`config.sub' isn't included in this package, then this package doesn't
|
|
||||||
need to know the machine type.
|
|
||||||
|
|
||||||
If you are _building_ compiler tools for cross-compiling, you should
|
|
||||||
use the `--target=TYPE' option to select the type of system they will
|
|
||||||
produce code for.
|
|
||||||
|
|
||||||
If you want to _use_ a cross compiler, that generates code for a
|
|
||||||
platform different from the build platform, you should specify the
|
|
||||||
"host" platform (i.e., that on which the generated programs will
|
|
||||||
eventually be run) with `--host=TYPE'.
|
|
||||||
|
|
||||||
Sharing Defaults
|
|
||||||
================
|
|
||||||
|
|
||||||
If you want to set default values for `configure' scripts to share, you
|
|
||||||
can create a site shell script called `config.site' that gives default
|
|
||||||
values for variables like `CC', `cache_file', and `prefix'.
|
|
||||||
`configure' looks for `PREFIX/share/config.site' if it exists, then
|
|
||||||
`PREFIX/etc/config.site' if it exists. Or, you can set the
|
|
||||||
`CONFIG_SITE' environment variable to the location of the site script.
|
|
||||||
A warning: not all `configure' scripts look for a site script.
|
|
||||||
|
|
||||||
Defining Variables
|
|
||||||
==================
|
|
||||||
|
|
||||||
Variables not defined in a site shell script can be set in the
|
|
||||||
environment passed to `configure'. However, some packages may run
|
|
||||||
configure again during the build, and the customized values of these
|
|
||||||
variables may be lost. In order to avoid this problem, you should set
|
|
||||||
them in the `configure' command line, using `VAR=value'. For example:
|
|
||||||
|
|
||||||
./configure CC=/usr/local2/bin/gcc
|
|
||||||
|
|
||||||
will cause the specified gcc to be used as the C compiler (unless it is
|
|
||||||
overridden in the site shell script).
|
|
||||||
|
|
||||||
`configure' Invocation
|
|
||||||
======================
|
|
||||||
|
|
||||||
`configure' recognizes the following options to control how it operates.
|
|
||||||
|
|
||||||
`--help'
|
|
||||||
`-h'
|
|
||||||
Print a summary of the options to `configure', and exit.
|
|
||||||
|
|
||||||
`--version'
|
|
||||||
`-V'
|
|
||||||
Print the version of Autoconf used to generate the `configure'
|
|
||||||
script, and exit.
|
|
||||||
|
|
||||||
`--cache-file=FILE'
|
|
||||||
Enable the cache: use and save the results of the tests in FILE,
|
|
||||||
traditionally `config.cache'. FILE defaults to `/dev/null' to
|
|
||||||
disable caching.
|
|
||||||
|
|
||||||
`--config-cache'
|
|
||||||
`-C'
|
|
||||||
Alias for `--cache-file=config.cache'.
|
|
||||||
|
|
||||||
`--quiet'
|
|
||||||
`--silent'
|
|
||||||
`-q'
|
|
||||||
Do not print messages saying which checks are being made. To
|
|
||||||
suppress all normal output, redirect it to `/dev/null' (any error
|
|
||||||
messages will still be shown).
|
|
||||||
|
|
||||||
`--srcdir=DIR'
|
|
||||||
Look for the package's source code in directory DIR. Usually
|
|
||||||
`configure' can determine that directory automatically.
|
|
||||||
|
|
||||||
`configure' also accepts some other, not widely useful, options. Run
|
|
||||||
`configure --help' for more details.
|
|
||||||
|
|
||||||
@@ -1,587 +0,0 @@
|
|||||||
# -*-Makefile-*- template for DJGPP
|
|
||||||
# Makefile.in generated automatically by automake 1.2 from Makefile.am
|
|
||||||
#
|
|
||||||
# Copyright (C) 1994-2016 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 <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
SHELL = /bin/sh
|
|
||||||
|
|
||||||
srcdir = .
|
|
||||||
VPATH = $(srcdir)
|
|
||||||
# $DJDIR is defined automatically by DJGPP to point
|
|
||||||
# to the root of the DJGPP installation tree.
|
|
||||||
prefix = /dev/env/DJDIR
|
|
||||||
exec_prefix = ${prefix}
|
|
||||||
|
|
||||||
bindir = /bin
|
|
||||||
datadir = /share
|
|
||||||
libdir = /lib
|
|
||||||
infodir = /info
|
|
||||||
mandir = /man
|
|
||||||
includedir = /include
|
|
||||||
oldincludedir = c:/djgpp/include
|
|
||||||
|
|
||||||
DESTDIR = /dev/env/DJDIR
|
|
||||||
|
|
||||||
pkgdatadir = $(datadir)/make
|
|
||||||
pkglibdir = $(libdir)/make
|
|
||||||
pkgincludedir = $(includedir)/make
|
|
||||||
localedir = $(datadir)/locale
|
|
||||||
|
|
||||||
INSTALL = ${exec_prefix}/bin/ginstall -c
|
|
||||||
INSTALL_PROGRAM = ${exec_prefix}/bin/ginstall -c
|
|
||||||
INSTALL_DATA = ${exec_prefix}/bin/ginstall -c -m 644
|
|
||||||
INSTALL_SCRIPT = ${exec_prefix}/bin/ginstall -c
|
|
||||||
transform = s,x,x,
|
|
||||||
|
|
||||||
# This will fail even if they don't have a Unix-like shell (stock DOS
|
|
||||||
# shell doesn't know about `false'). The only difference is that they
|
|
||||||
# get "Error -1" instead of "Error 1".
|
|
||||||
EXIT_FAIL = false
|
|
||||||
|
|
||||||
NORMAL_INSTALL = :
|
|
||||||
PRE_INSTALL = :
|
|
||||||
POST_INSTALL = :
|
|
||||||
NORMAL_UNINSTALL = :
|
|
||||||
PRE_UNINSTALL = :
|
|
||||||
POST_UNINSTALL = :
|
|
||||||
EXEEXT = .exe
|
|
||||||
OBJEXT = o
|
|
||||||
|
|
||||||
AR = ar
|
|
||||||
AWK = gawk
|
|
||||||
CC = gcc
|
|
||||||
CPP = gcc -E
|
|
||||||
LIBOBJS =
|
|
||||||
MAKEINFO = ${exec_prefix}/bin/makeinfo
|
|
||||||
PACKAGE = make
|
|
||||||
PERL = perl
|
|
||||||
RANLIB = ranlib
|
|
||||||
REMOTE = stub
|
|
||||||
VERSION = %VERSION%
|
|
||||||
|
|
||||||
AUTOMAKE_OPTIONS = 1.2
|
|
||||||
|
|
||||||
bin_PROGRAMS = %PROGRAMS%$(EXEEXT)
|
|
||||||
|
|
||||||
make_SOURCES = %SOURCES%
|
|
||||||
# This should include the glob/ prefix
|
|
||||||
libglob_a_SOURCES = %GLOB_SOURCES%
|
|
||||||
make_LDADD = glob/libglob.a
|
|
||||||
|
|
||||||
man_MANS = make.1
|
|
||||||
|
|
||||||
INCLUDES = -I$(srcdir)/glob -DLIBDIR=\"$(prefix)$(libdir)\" -DINCLUDEDIR=\"$(prefix)$(includedir)\" -DLOCALEDIR=\"$(prefix)$(localedir)\"
|
|
||||||
|
|
||||||
BUILT_SOURCES = README build.sh-in
|
|
||||||
|
|
||||||
EXTRA_DIST = $(BUILT_SOURCES) $(man_MANS) README.customs remote-cstms.c make-stds.texi texinfo.tex SCOPTIONS SMakefile Makefile.ami README.Amiga config.ami amiga.c amiga.h NMakefile README.DOS configh.dos configure.bat makefile.com README.W32 build_w32.bat config.h-W32 subproc.bat make.lnk config.h-vms makefile.vms README.VMS vmsdir.h vmsfunctions.c vmsify.c gmk-default.scm gmk-default.h
|
|
||||||
|
|
||||||
SUBDIRS = glob doc
|
|
||||||
mkinstalldirs = ${exec_prefix}/bin/gmkdir -p
|
|
||||||
CONFIG_HEADER = config.h
|
|
||||||
CONFIG_CLEAN_FILES = build.sh
|
|
||||||
PROGRAMS = $(bin_PROGRAMS)
|
|
||||||
|
|
||||||
MAKE_HOST = i386-pc-msdosdjgpp
|
|
||||||
|
|
||||||
|
|
||||||
DEFS = -I. -I$(srcdir) -I.
|
|
||||||
CPPFLAGS = -DHAVE_CONFIG_H
|
|
||||||
LDFLAGS =
|
|
||||||
LIBS =
|
|
||||||
make_OBJECTS = %OBJECTS%
|
|
||||||
make_DEPENDENCIES = glob/libglob.a
|
|
||||||
make_LDFLAGS =
|
|
||||||
libglob_a_LIBADD =
|
|
||||||
libglob_a_OBJECTS = %GLOB_OBJECTS%
|
|
||||||
noinst_LIBRARIES = glob/libglob.a
|
|
||||||
CFLAGS = -O2 -g
|
|
||||||
COMPILE = $(CC) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS)
|
|
||||||
LINK = $(CC) $(CFLAGS) $(LDFLAGS) -o $@
|
|
||||||
TEXI2DVI = texi2dvi
|
|
||||||
TEXINFO_TEX = $(srcdir)/config/texinfo.tex
|
|
||||||
INFO_DEPS = doc/make.info
|
|
||||||
DVIS = doc/make.dvi
|
|
||||||
TEXINFOS = doc/make.texi
|
|
||||||
noinst_TEXINFOS = doc/fdl.texi doc/make-stds.texi
|
|
||||||
man1dir = $(mandir)/man1
|
|
||||||
MANS = $(man_MANS)
|
|
||||||
|
|
||||||
NROFF = nroff
|
|
||||||
DIST_COMMON = README ABOUT-NLS AUTHORS COPYING ChangeLog INSTALL Makefile.am Makefile.in NEWS acconfig.h aclocal.m4 alloca.c build.sh-in config.h-in configure configure.ac getloadavg.c
|
|
||||||
|
|
||||||
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
|
|
||||||
|
|
||||||
TAR = gtar
|
|
||||||
GZIP = --best
|
|
||||||
SOURCES = $(make_SOURCES)
|
|
||||||
OBJECTS = $(make_OBJECTS)
|
|
||||||
HEADERS = $(wildcard $(srcdir)/*.h)
|
|
||||||
|
|
||||||
default: all
|
|
||||||
|
|
||||||
.SUFFIXES:
|
|
||||||
.SUFFIXES: .c .dvi .info .o .obj .ps .texi .tex .html
|
|
||||||
|
|
||||||
mostlyclean-hdr:
|
|
||||||
|
|
||||||
clean-hdr:
|
|
||||||
|
|
||||||
distclean-hdr:
|
|
||||||
-rm -f config.h
|
|
||||||
|
|
||||||
maintainer-clean-hdr:
|
|
||||||
|
|
||||||
mostlyclean-binPROGRAMS:
|
|
||||||
|
|
||||||
clean-binPROGRAMS:
|
|
||||||
-test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
|
|
||||||
|
|
||||||
distclean-binPROGRAMS:
|
|
||||||
|
|
||||||
maintainer-clean-binPROGRAMS:
|
|
||||||
|
|
||||||
install-binPROGRAMS: $(bin_PROGRAMS)
|
|
||||||
@$(NORMAL_INSTALL)
|
|
||||||
$(mkinstalldirs) $(DESTDIR)$(bindir)
|
|
||||||
@list='$(bin_PROGRAMS)'; for p in $$list; do if test -f $$p; then echo " $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p | sed '$(transform)'`"; $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p | sed '$(transform)'`; else :; fi; done
|
|
||||||
|
|
||||||
uninstall-binPROGRAMS:
|
|
||||||
$(NORMAL_UNINSTALL)
|
|
||||||
list='$(bin_PROGRAMS)'; for p in $$list; do rm -f $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`.exe; done
|
|
||||||
|
|
||||||
.c.o:
|
|
||||||
$(COMPILE) -c $<
|
|
||||||
|
|
||||||
clean-noinstLIBRARIES:
|
|
||||||
-test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES)
|
|
||||||
|
|
||||||
mostlyclean-compile:
|
|
||||||
-rm -f *.$(OBJEXT) *$(EXEEXT) make.new core
|
|
||||||
|
|
||||||
clean-compile:
|
|
||||||
|
|
||||||
distclean-compile:
|
|
||||||
-rm -f *.tab.c *_tab.c
|
|
||||||
|
|
||||||
maintainer-clean-compile:
|
|
||||||
|
|
||||||
make$(EXEEXT): $(make_OBJECTS) $(make_DEPENDENCIES)
|
|
||||||
@command.com /c if exist make del make
|
|
||||||
@command.com /c if exist make.exe del make.exe
|
|
||||||
$(LINK) $(make_LDFLAGS) $(make_OBJECTS) $(make_LDADD) $(LIBS)
|
|
||||||
|
|
||||||
# Documentation
|
|
||||||
|
|
||||||
make.info: make.texi
|
|
||||||
make.dvi: make.texi
|
|
||||||
make.ps: make.dvi make.texi
|
|
||||||
make.html: make.texi
|
|
||||||
|
|
||||||
|
|
||||||
DVIPS = dvips
|
|
||||||
|
|
||||||
.texi.info:
|
|
||||||
@command.com /c if exist make.info* del make.info*
|
|
||||||
@command.com /c if exist make.i* del make.i*
|
|
||||||
$(MAKEINFO) -I$(srcdir) --no-split $< -o ./$@
|
|
||||||
|
|
||||||
.texi:
|
|
||||||
@command.com /c if exist make.info* del make.info*
|
|
||||||
@command.com /c if exist make.i* del make.i*
|
|
||||||
$(MAKEINFO) -I$(srcdir) --no-split $< -o ./$@
|
|
||||||
|
|
||||||
.texi.dvi:
|
|
||||||
TEXINPUTS="$(srcdir);$$TEXINPUTS" MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $<
|
|
||||||
|
|
||||||
.dvi.ps:
|
|
||||||
$(DVIPS) $< -o $@
|
|
||||||
|
|
||||||
# Other documentation formats
|
|
||||||
|
|
||||||
html: html-recursive
|
|
||||||
|
|
||||||
.texi.html:
|
|
||||||
@command.com /c if exist make.html* del make.html*
|
|
||||||
$(MAKEINFO) --html -I$(srcdir) --no-split $< -o ./$@
|
|
||||||
|
|
||||||
install-info-am: $(INFO_DEPS)
|
|
||||||
@$(NORMAL_INSTALL)
|
|
||||||
$(mkinstalldirs) $(DESTDIR)$(infodir)
|
|
||||||
@for file in $(INFO_DEPS); do iifile=`echo $$file | sed "s|doc/||"`; d=$(srcdir); for ifile in `cd $$d && echo $$file`; do if test -f $$d/$$ifile; then echo " $(INSTALL_DATA) $$d/$$ifile $(DESTDIR)$(infodir)/$$iifile"; $(INSTALL_DATA) $$d/$$ifile $(DESTDIR)$(infodir)/$$iifile; else : ; fi; done; done
|
|
||||||
@$(POST_INSTALL)
|
|
||||||
@if $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then for file in $(INFO_DEPS); do iifile=`echo $$file | sed "s|doc/||"`; echo " install-info --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/$$iifile"; install-info --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/$$iifile || :; done; else : ; fi
|
|
||||||
|
|
||||||
uninstall-info:
|
|
||||||
$(PRE_UNINSTALL)
|
|
||||||
@if $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then ii=yes; else ii=; fi; for file in $(INFO_DEPS); do test -z $ii || install-info --info-dir=$(DESTDIR)$(infodir) --remove $$file; done
|
|
||||||
$(NORMAL_UNINSTALL)
|
|
||||||
for file in $(INFO_DEPS); do (cd $(DESTDIR)$(infodir) && rm -f $$file); done
|
|
||||||
|
|
||||||
dist-info: $(INFO_DEPS)
|
|
||||||
for base in $(INFO_DEPS); do d=$(srcdir); for file in `cd $$d && eval echo $$base*`; do test -f $(distdir)/$$file || ln $$d/$$file $(distdir)/$$file 2> /dev/null || cp -p $$d/$$file $(distdir)/$$file; done; done
|
|
||||||
|
|
||||||
mostlyclean-aminfo:
|
|
||||||
-rm -f $(srcdir)/doc/make.aux $(srcdir)/doc/make.cp $(srcdir)/doc/make.cps $(srcdir)/doc/make.dvi \
|
|
||||||
$(srcdir)/doc/make.fn $(srcdir)/doc/make.fns $(srcdir)/doc/make.ky $(srcdir)/doc/make.kys \
|
|
||||||
$(srcdir)/doc/make.ps $(srcdir)/doc/make.log $(srcdir)/doc/make.pg $(srcdir)/doc/make.toc \
|
|
||||||
$(srcdir)/doc/make.tp $(srcdir)/doc/make.tps $(srcdir)/doc/make.vr $(srcdir)/doc/make.vrs \
|
|
||||||
$(srcdir)/doc/make.op $(srcdir)/doc/make.tr $(srcdir)/doc/make.cv $(srcdir)/doc/make.cn \
|
|
||||||
$(srcdir)/doc/make.html
|
|
||||||
|
|
||||||
clean-aminfo:
|
|
||||||
|
|
||||||
distclean-aminfo:
|
|
||||||
|
|
||||||
maintainer-clean-aminfo:
|
|
||||||
for i in $(INFO_DEPS); do rm -f $$i*; done
|
|
||||||
|
|
||||||
install-man1:
|
|
||||||
$(mkinstalldirs) $(DESTDIR)$(man1dir)
|
|
||||||
@list='$(man1_MANS)'; \
|
|
||||||
l2='$(man_MANS)'; for i in $$l2; do \
|
|
||||||
case "$$i" in \
|
|
||||||
*.1*) list="$$list $$i" ;; \
|
|
||||||
esac; \
|
|
||||||
done; \
|
|
||||||
for i in $$list; do \
|
|
||||||
if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \
|
|
||||||
else file=$$i; fi; \
|
|
||||||
ext=`echo $$i | sed -e 's/^.*\\.//'`; \
|
|
||||||
inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
|
|
||||||
inst=`echo $$inst | sed '$(transform)'`.$$ext; \
|
|
||||||
echo " $(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst"; \
|
|
||||||
$(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst; \
|
|
||||||
done
|
|
||||||
|
|
||||||
uninstall-man1:
|
|
||||||
@list='$(man1_MANS)'; \
|
|
||||||
l2='$(man_MANS)'; for i in $$l2; do \
|
|
||||||
case "$$i" in \
|
|
||||||
*.1*) list="$$list $$i" ;; \
|
|
||||||
esac; \
|
|
||||||
done; \
|
|
||||||
for i in $$list; do \
|
|
||||||
ext=`echo $$i | sed -e 's/^.*\\.//'`; \
|
|
||||||
inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
|
|
||||||
inst=`echo $$inst | sed '$(transform)'`.$$ext; \
|
|
||||||
echo " rm -f $(DESTDIR)$(man1dir)/$$inst"; \
|
|
||||||
rm -f $(DESTDIR)$(man1dir)/$$inst; \
|
|
||||||
done
|
|
||||||
install-man: $(MANS)
|
|
||||||
@$(NORMAL_INSTALL)
|
|
||||||
$(MAKE) install-man1
|
|
||||||
uninstall-man:
|
|
||||||
@$(NORMAL_UNINSTALL)
|
|
||||||
$(MAKE) uninstall-man1
|
|
||||||
|
|
||||||
# Assume that the only thing to do in glob is to build libglob.a,
|
|
||||||
# but do a sanity check: if $SUBDIRS will ever have more than
|
|
||||||
# a single directory, yell bloody murder.
|
|
||||||
all-recursive:
|
|
||||||
ifeq ($(findstring glob, $(SUBDIRS)), glob)
|
|
||||||
@command.com /c if not exist glob\\nul md glob
|
|
||||||
@echo Making all in glob
|
|
||||||
$(MAKE) -C glob -f ../Makefile INCLUDES='-I$(srcdir) -I$(srcdir)/glob' DEFS='-I.. -I$(srcdir)' VPATH=$(srcdir)/glob libglob.a
|
|
||||||
endif
|
|
||||||
|
|
||||||
$(SUBDIRS):
|
|
||||||
command.com /c md $@
|
|
||||||
|
|
||||||
libglob.a: $(libglob_a_OBJECTS)
|
|
||||||
command.com /c if exist libglob.a del libglob.a
|
|
||||||
$(AR) cru libglob.a $(libglob_a_OBJECTS) $(libglob_a_LIBADD)
|
|
||||||
$(RANLIB) libglob.a
|
|
||||||
|
|
||||||
mostlyclean-recursive clean-recursive distclean-recursive \
|
|
||||||
maintainer-clean-recursive check-recursive:
|
|
||||||
ifeq ($(words $(SUBDIRS)), 2)
|
|
||||||
@echo Making $(shell echo $@ | sed s/-recursive//) in glob
|
|
||||||
$(MAKE) -C glob -f ../Makefile $(shell echo $@ | sed s/-recursive//)-am
|
|
||||||
@echo Making $(shell echo $@ | sed s/-recursive//) in doc
|
|
||||||
$(MAKE) -C doc -f ../Makefile $(shell echo $@ | sed s/-recursive//)-am
|
|
||||||
else
|
|
||||||
@echo FATAL: There is more than two directory in "($(SUBDIRS))"
|
|
||||||
@$(EXIT_FAIL)
|
|
||||||
endif
|
|
||||||
|
|
||||||
tags-in-glob: $(libglob_a_SOURCES)
|
|
||||||
etags $(addprefix $(srcdir)/,$^) -o ./glob/TAGS
|
|
||||||
|
|
||||||
tags-recursive:
|
|
||||||
ifeq ($(words $(SUBDIRS)), 2)
|
|
||||||
$(MAKE) tags-in-glob
|
|
||||||
else
|
|
||||||
@echo FATAL: There is more than two directory in "($(SUBDIRS))"
|
|
||||||
@$(EXIT_FAIL)
|
|
||||||
endif
|
|
||||||
|
|
||||||
tags: TAGS
|
|
||||||
|
|
||||||
ID: $(HEADERS) $(SOURCES)
|
|
||||||
mkid $(srcdir)/$(SOURCES) $(srcdir)/$(libglob_a_SOURCES) ./config.h $(HEADERS)
|
|
||||||
|
|
||||||
TAGS: tags-recursive $(HEADERS) $(srcdir)/$(SOURCES) config.h $(TAGS_DEPENDENCIES)
|
|
||||||
etags -i ./glob/TAGS $(ETAGS_ARGS) $(srcdir)/$(SOURCES) ./config.h $(HEADERS)
|
|
||||||
|
|
||||||
mostlyclean-tags:
|
|
||||||
|
|
||||||
clean-tags:
|
|
||||||
|
|
||||||
distclean-tags:
|
|
||||||
-rm -f TAGS ID
|
|
||||||
|
|
||||||
maintainer-clean-tags:
|
|
||||||
|
|
||||||
distdir = $(PACKAGE)-$(VERSION)
|
|
||||||
top_distdir = $(distdir)
|
|
||||||
|
|
||||||
# This target untars the dist file and tries a VPATH configuration. Then
|
|
||||||
# it guarantees that the distribution is self-contained by making another
|
|
||||||
# tarfile.
|
|
||||||
distcheck: dist
|
|
||||||
rm -rf $(distdir)
|
|
||||||
GZIP=$(GZIP) $(TAR) zxf $(distdir).tar.gz
|
|
||||||
mkdir $(distdir)/=build
|
|
||||||
mkdir $(distdir)/=inst
|
|
||||||
dc_install_base=`cd $(distdir)/=inst && pwd`; cd $(distdir)/=build && ../configure --srcdir=.. --prefix=$$dc_install_base && $(MAKE) && $(MAKE) dvi && $(MAKE) check && $(MAKE) install && $(MAKE) installcheck && $(MAKE) dist
|
|
||||||
rm -rf $(distdir)
|
|
||||||
@echo "========================"; echo "$(distdir).tar.gz is ready for distribution"; echo "========================"
|
|
||||||
dist: distdir
|
|
||||||
-chmod -R a+r $(distdir)
|
|
||||||
GZIP=$(GZIP) $(TAR) chozf $(distdir).tar.gz $(distdir)
|
|
||||||
rm -rf $(distdir)
|
|
||||||
dist-all: distdir
|
|
||||||
-chmod -R a+r $(distdir)
|
|
||||||
GZIP=$(GZIP) $(TAR) chozf $(distdir).tar.gz $(distdir)
|
|
||||||
rm -rf $(distdir)
|
|
||||||
distdir: $(DISTFILES)
|
|
||||||
rm -rf $(distdir)
|
|
||||||
mkdir $(distdir)
|
|
||||||
-chmod 777 $(distdir)
|
|
||||||
@for file in $(DISTFILES); do d=$(srcdir); test -f $(distdir)/$$file || ln $$d/$$file $(distdir)/$$file 2> /dev/null || cp -p $$d/$$file $(distdir)/$$file; done; for subdir in $(SUBDIRS); do test -d $(distdir)/$$subdir || mkdir $(distdir)/$$subdir || exit 1; chmod 777 $(distdir)/$$subdir; (cd $$subdir && $(MAKE) top_distdir=../$(top_distdir)/$$subdir distdir=../$(distdir)/$$subdir distdir) || exit 1; done
|
|
||||||
$(MAKE) top_distdir="$(top_distdir)" distdir="$(distdir)" dist-info
|
|
||||||
$(MAKE) top_distdir="$(top_distdir)" distdir="$(distdir)" dist-hook
|
|
||||||
|
|
||||||
info: info-recursive
|
|
||||||
info-recursive:
|
|
||||||
ifeq ($(findstring doc, $(SUBDIRS)), doc)
|
|
||||||
@command.com /c if not exist doc\\nul md doc
|
|
||||||
@echo Making all in doc
|
|
||||||
$(MAKE) -C doc -f ../Makefile VPATH=$(srcdir)/doc make.info
|
|
||||||
endif
|
|
||||||
|
|
||||||
dvi: dvi-recursive
|
|
||||||
dvi-recursive:
|
|
||||||
ifeq ($(findstring doc, $(SUBDIRS)), doc)
|
|
||||||
@command.com /c if not exist doc\\nul md doc
|
|
||||||
@echo Making all in doc
|
|
||||||
$(MAKE) -C doc -f ../Makefile VPATH=$(srcdir)/doc make.dvi
|
|
||||||
endif
|
|
||||||
|
|
||||||
ps: ps-recursive
|
|
||||||
ps-recursive:
|
|
||||||
ifeq ($(findstring doc, $(SUBDIRS)), doc)
|
|
||||||
@command.com /c if not exist doc\\nul md doc
|
|
||||||
@echo Making all in doc
|
|
||||||
$(MAKE) -C doc -f ../Makefile VPATH=$(srcdir)/doc make.ps
|
|
||||||
endif
|
|
||||||
|
|
||||||
html-recursive:
|
|
||||||
ifeq ($(findstring doc, $(SUBDIRS)), doc)
|
|
||||||
@command.com /c if not exist doc\\nul md doc
|
|
||||||
@echo Making all in doc
|
|
||||||
$(MAKE) -C doc -f ../Makefile VPATH=$(srcdir)/doc make.html
|
|
||||||
endif
|
|
||||||
|
|
||||||
check: all-am check-recursive check-local
|
|
||||||
@:
|
|
||||||
installcheck: installcheck-recursive
|
|
||||||
all-recursive-am: config.h
|
|
||||||
$(MAKE) all-recursive
|
|
||||||
|
|
||||||
all-am: Makefile $(PROGRAMS) config.h info
|
|
||||||
|
|
||||||
install-exec-am: install-binPROGRAMS
|
|
||||||
|
|
||||||
install-data-am: install-info-am
|
|
||||||
|
|
||||||
uninstall-am: uninstall-binPROGRAMS uninstall-info
|
|
||||||
|
|
||||||
install-exec: install-exec-recursive install-exec-am
|
|
||||||
@$(NORMAL_INSTALL)
|
|
||||||
|
|
||||||
install-data: install-data-recursive install-data-am
|
|
||||||
@$(NORMAL_INSTALL)
|
|
||||||
|
|
||||||
install-recursive uninstall-recursive:
|
|
||||||
@:
|
|
||||||
|
|
||||||
install: install-recursive install-exec-am install-data-am
|
|
||||||
@:
|
|
||||||
|
|
||||||
uninstall: uninstall-recursive uninstall-am
|
|
||||||
|
|
||||||
all: all-recursive-am all-am
|
|
||||||
|
|
||||||
install-strip:
|
|
||||||
$(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install
|
|
||||||
installdirs: installdirs-recursive
|
|
||||||
$(mkinstalldirs) $(bindir) $(infodir)
|
|
||||||
|
|
||||||
|
|
||||||
mostlyclean-generic:
|
|
||||||
-test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
|
|
||||||
|
|
||||||
clean-generic:
|
|
||||||
-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
|
|
||||||
|
|
||||||
distclean-generic:
|
|
||||||
-rm -f Makefile $(DISTCLEANFILES)
|
|
||||||
-rm -f config.cache config.log stamp-h stamp-h[0-9]*
|
|
||||||
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
|
|
||||||
|
|
||||||
maintainer-clean-generic:
|
|
||||||
-test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
|
|
||||||
-test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
|
|
||||||
mostlyclean-am: mostlyclean-hdr mostlyclean-binPROGRAMS mostlyclean-compile mostlyclean-aminfo mostlyclean-tags mostlyclean-generic
|
|
||||||
|
|
||||||
clean-am: clean-hdr clean-binPROGRAMS clean-compile clean-aminfo clean-tags clean-generic mostlyclean-am
|
|
||||||
|
|
||||||
distclean-am: distclean-hdr distclean-binPROGRAMS distclean-compile distclean-aminfo distclean-tags distclean-generic clean-am
|
|
||||||
|
|
||||||
maintainer-clean-am: maintainer-clean-hdr maintainer-clean-binPROGRAMS maintainer-clean-compile maintainer-clean-aminfo maintainer-clean-tags maintainer-clean-generic distclean-am
|
|
||||||
|
|
||||||
mostlyclean: mostlyclean-recursive mostlyclean-am
|
|
||||||
|
|
||||||
clean: clean-noinstLIBRARIES clean-recursive clean-am
|
|
||||||
|
|
||||||
distclean: distclean-recursive distclean-am
|
|
||||||
rm -f config.status
|
|
||||||
|
|
||||||
maintainer-clean: maintainer-clean-recursive maintainer-clean-am
|
|
||||||
@echo "This command is intended for maintainers to use;"
|
|
||||||
@echo "it deletes files that may require special tools to rebuild."
|
|
||||||
rm -f config.status
|
|
||||||
|
|
||||||
.PHONY: default mostlyclean-hdr distclean-hdr clean-hdr \
|
|
||||||
maintainer-clean-hdr mostlyclean-binPROGRAMS distclean-binPROGRAMS \
|
|
||||||
clean-binPROGRAMS maintainer-clean-binPROGRAMS uninstall-binPROGRAMS \
|
|
||||||
install-binPROGRAMS mostlyclean-compile distclean-compile clean-compile \
|
|
||||||
maintainer-clean-compile install-info-am uninstall-info \
|
|
||||||
mostlyclean-aminfo distclean-aminfo clean-aminfo \
|
|
||||||
maintainer-clean-aminfo install-data-recursive uninstall-data-recursive \
|
|
||||||
install-exec-recursive uninstall-exec-recursive installdirs-recursive \
|
|
||||||
uninstalldirs-recursive all-recursive check-recursive check-am \
|
|
||||||
installcheck-recursive info-recursive dvi-recursive \
|
|
||||||
mostlyclean-recursive distclean-recursive clean-recursive \
|
|
||||||
maintainer-clean-recursive tags tags-recursive mostlyclean-tags \
|
|
||||||
distclean-tags clean-tags maintainer-clean-tags distdir \
|
|
||||||
mostlyclean-depend distclean-depend clean-depend \
|
|
||||||
maintainer-clean-depend info dvi check-local installcheck \
|
|
||||||
all-recursive-am all-am install-exec-am install-data-am uninstall-am \
|
|
||||||
install-exec install-data install uninstall all installdirs \
|
|
||||||
mostlyclean-generic distclean-generic clean-generic \
|
|
||||||
maintainer-clean-generic clean mostlyclean distclean maintainer-clean \
|
|
||||||
html
|
|
||||||
|
|
||||||
|
|
||||||
# --------------- Local DIST Section
|
|
||||||
|
|
||||||
# Install the w32 subdirectory
|
|
||||||
#
|
|
||||||
dist-hook:
|
|
||||||
(cd $(srcdir); \
|
|
||||||
w32=`find w32 -follow \( -name .git -prune \) -o -type f -print`; \
|
|
||||||
tar chf - $$w32) \
|
|
||||||
| (cd $(distdir); tar xfBp -)
|
|
||||||
|
|
||||||
# --------------- Local CHECK Section
|
|
||||||
|
|
||||||
# Note: check-loadavg is NOT a prerequisite of check-local, since
|
|
||||||
# there's no uptime utility, and the test it does doesn't make sense
|
|
||||||
# on MSDOS anyway.
|
|
||||||
check-local: check-shell check-regression
|
|
||||||
@banner=" Regression PASSED: GNU Make $(VERSION) ($(MAKE_HOST)) built with $(CC) "; \
|
|
||||||
dashes=`echo "$$banner" | sed s/./=/g`; \
|
|
||||||
echo; \
|
|
||||||
echo "$$dashes"; \
|
|
||||||
echo "$$banner"; \
|
|
||||||
echo "$$dashes"; \
|
|
||||||
echo
|
|
||||||
|
|
||||||
.PHONY: check-loadavg check-shell check-regression
|
|
||||||
|
|
||||||
# > check-shell
|
|
||||||
#
|
|
||||||
# check-shell is designed to fail if they don't have a Unixy shell
|
|
||||||
# installed. The test suite requires such a shell.
|
|
||||||
check-shell:
|
|
||||||
@echo If Make says Error -1, you do not have Unix-style shell installed
|
|
||||||
@foo=bar.exe :
|
|
||||||
|
|
||||||
# > check-loadavg
|
|
||||||
#
|
|
||||||
loadavg: loadavg.c config.h
|
|
||||||
@rm -f loadavg
|
|
||||||
$(LINK) -DTEST $(make_LDFLAGS) loadavg.c $(LIBS)
|
|
||||||
# We copy getloadavg.c into a different file rather than compiling it
|
|
||||||
# directly because some compilers clobber getloadavg.o in the process.
|
|
||||||
loadavg.c: getloadavg.c
|
|
||||||
ln $(srcdir)/getloadavg.c loadavg.c || \
|
|
||||||
cp $(srcdir)/getloadavg.c loadavg.c
|
|
||||||
check-loadavg: loadavg
|
|
||||||
@echo The system uptime program believes the load average to be:
|
|
||||||
-uptime
|
|
||||||
@echo The GNU load average checking code believes:
|
|
||||||
-./loadavg
|
|
||||||
|
|
||||||
# > check-regression
|
|
||||||
#
|
|
||||||
# Look for the make test suite, and run it if found. Look in MAKE_TEST if
|
|
||||||
# specified, or else in the srcdir or the distdir, their parents, and _their_
|
|
||||||
# parents.
|
|
||||||
#
|
|
||||||
check-regression:
|
|
||||||
@if test -f "$(srcdir)/tests/run_make_tests"; then \
|
|
||||||
if $(PERL) -v >/dev/null 2>&1; then \
|
|
||||||
case `cd $(srcdir); pwd` in `pwd`) : ;; \
|
|
||||||
*) test -d tests || mkdir tests; \
|
|
||||||
for f in run_make_tests run_make_tests.pl test_driver.pl scripts; do \
|
|
||||||
rm -rf tests/$$f; cp -pr $(srcdir)/tests/$$f tests; \
|
|
||||||
done ;; \
|
|
||||||
esac; \
|
|
||||||
echo "cd tests && $(PERL) ./run_make_tests.pl -make ../make.exe $(MAKETESTFLAGS)"; \
|
|
||||||
cd tests && $(PERL) ./run_make_tests.pl -make ../make.exe $(MAKETESTFLAGS); \
|
|
||||||
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 ($(srcdir)/tests)."; \
|
|
||||||
fi
|
|
||||||
|
|
||||||
# --------------- Maintainer's Section
|
|
||||||
|
|
||||||
# Note this requires GNU make. Not to worry, since it will only be included
|
|
||||||
# in the Makefile if we're in the maintainer's environment.
|
|
||||||
#include $(srcdir)/maintMakefile
|
|
||||||
|
|
||||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
|
||||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
|
||||||
.NOEXPORT:
|
|
||||||
|
|
||||||
# --------------- DEPENDENCIES
|
|
||||||
260
Makefile.am
260
Makefile.am
@@ -1,6 +1,6 @@
|
|||||||
# This is a -*-Makefile-*-, or close enough
|
# This is a -*-Makefile-*-, or close enough
|
||||||
#
|
#
|
||||||
# Copyright (C) 1997-2016 Free Software Foundation, Inc.
|
# Copyright (C) 1997-2022 Free Software Foundation, Inc.
|
||||||
# This file is part of GNU Make.
|
# This file is part of GNU Make.
|
||||||
#
|
#
|
||||||
# GNU Make is free software; you can redistribute it and/or modify it under
|
# GNU Make is free software; you can redistribute it and/or modify it under
|
||||||
@@ -14,139 +14,137 @@
|
|||||||
# details.
|
# details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License along with
|
# You should have received a copy of the GNU General Public License along with
|
||||||
# this program. If not, see <http://www.gnu.org/licenses/>.
|
# this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
AUTOMAKE_OPTIONS = dist-bzip2 silent-rules std-options
|
AUTOMAKE_OPTIONS = dist-lzip silent-rules std-options subdir-objects nostdinc
|
||||||
ACLOCAL_AMFLAGS = -I config
|
ACLOCAL_AMFLAGS = -I m4
|
||||||
|
|
||||||
MAKE_HOST = @MAKE_HOST@
|
MAKE_HOST = @MAKE_HOST@
|
||||||
|
|
||||||
# Only process if target is MS-Windows
|
SUBDIRS = lib po doc
|
||||||
if WINDOWSENV
|
|
||||||
MAYBE_W32 = w32
|
|
||||||
W32INC = -I $(top_srcdir)/w32/include
|
|
||||||
W32LIB = -Lw32 -lw32
|
|
||||||
ossrc =
|
|
||||||
else
|
|
||||||
ossrc = posixos.c
|
|
||||||
endif
|
|
||||||
|
|
||||||
SUBDIRS = glob config po doc $(MAYBE_W32)
|
|
||||||
|
|
||||||
bin_PROGRAMS = make
|
bin_PROGRAMS = make
|
||||||
include_HEADERS = gnumake.h
|
include_HEADERS = src/gnumake.h
|
||||||
|
|
||||||
if USE_CUSTOMS
|
man_MANS = doc/make.1
|
||||||
remote = remote-cstms.c
|
|
||||||
|
make_SRCS = src/ar.c src/arscan.c src/commands.c src/commands.h \
|
||||||
|
src/debug.h src/default.c src/dep.h src/dir.c src/expand.c \
|
||||||
|
src/file.c src/filedef.h src/function.c src/getopt.c \
|
||||||
|
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/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 \
|
||||||
|
src/w32/include/dlfcn.h src/w32/include/pathstuff.h \
|
||||||
|
src/w32/include/sub_proc.h src/w32/include/w32err.h \
|
||||||
|
src/w32/subproc/misc.c src/w32/subproc/proc.h \
|
||||||
|
src/w32/subproc/sub_proc.c src/w32/subproc/w32err.c
|
||||||
|
|
||||||
|
vms_SRCS = src/vms_exit.c src/vms_export_symbol.c src/vms_progname.c \
|
||||||
|
src/vmsdir.h src/vmsfunctions.c src/vmsify.c
|
||||||
|
|
||||||
|
amiga_SRCS = src/amiga.c src/amiga.h
|
||||||
|
|
||||||
|
glob_SRCS = lib/fnmatch.c lib/fnmatch.h lib/glob.c lib/glob.h
|
||||||
|
|
||||||
|
alloca_SRCS = lib/alloca.c
|
||||||
|
|
||||||
|
loadavg_SRCS = lib/getloadavg.c
|
||||||
|
|
||||||
|
make_SOURCES = $(make_SRCS)
|
||||||
|
EXTRA_make_SOURCES = $(amiga_SRCS) $(vms_SRCS)
|
||||||
|
|
||||||
|
if HAVE_GUILE
|
||||||
|
_GUILE_CFLAGS = $(GUILE_CFLAGS)
|
||||||
|
_GUILE_LIBS = $(GUILE_LIBS)
|
||||||
else
|
else
|
||||||
remote = remote-stub.c
|
_GUILE_CFLAGS =
|
||||||
|
_GUILE_LIBS =
|
||||||
endif
|
endif
|
||||||
|
|
||||||
make_SOURCES = ar.c arscan.c commands.c default.c dir.c expand.c file.c \
|
make_LDADD = $(LIBOBJS) $(_GUILE_LIBS) lib/libgnu.a $(GETLOADAVG_LIBS) \
|
||||||
function.c getopt.c getopt1.c guile.c implicit.c job.c load.c \
|
@LIBINTL@
|
||||||
loadapi.c main.c misc.c $(ossrc) output.c read.c remake.c \
|
|
||||||
rule.c signame.c strcache.c variable.c version.c vpath.c \
|
|
||||||
hash.c $(remote)
|
|
||||||
|
|
||||||
EXTRA_make_SOURCES = vmsjobs.c remote-stub.c remote-cstms.c
|
|
||||||
|
|
||||||
noinst_HEADERS = commands.h dep.h filedef.h job.h makeint.h rule.h variable.h \
|
|
||||||
debug.h getopt.h gettext.h hash.h output.h os.h
|
|
||||||
|
|
||||||
make_LDADD = @LIBOBJS@ @ALLOCA@ $(GLOBLIB) @GETLOADAVG_LIBS@ @LIBINTL@ \
|
|
||||||
$(GUILE_LIBS)
|
|
||||||
# Only process if target is MS-Windows
|
|
||||||
if WINDOWSENV
|
|
||||||
make_LDADD += $(W32LIB)
|
|
||||||
endif
|
|
||||||
|
|
||||||
man_MANS = make.1
|
|
||||||
|
|
||||||
DEFS = -DLOCALEDIR=\"$(localedir)\" -DLIBDIR=\"$(libdir)\" -DINCLUDEDIR=\"$(includedir)\" @DEFS@
|
|
||||||
|
|
||||||
AM_CPPFLAGS = $(GLOBINC)
|
|
||||||
AM_CFLAGS = $(GUILE_CFLAGS)
|
|
||||||
# Only process if target is MS-Windows
|
|
||||||
if WINDOWSENV
|
|
||||||
AM_CPPFLAGS += $(W32INC)
|
|
||||||
endif
|
|
||||||
|
|
||||||
|
|
||||||
# Extra stuff to include in the distribution.
|
|
||||||
|
|
||||||
EXTRA_DIST = README build.sh.in $(man_MANS) \
|
|
||||||
README.customs README.OS2 \
|
|
||||||
SCOPTIONS SMakefile \
|
|
||||||
README.Amiga Makefile.ami config.ami make.lnk amiga.c amiga.h \
|
|
||||||
README.DOS Makefile.DOS configure.bat dosbuild.bat configh.dos\
|
|
||||||
README.W32 NMakefile config.h.W32 build_w32.bat subproc.bat \
|
|
||||||
make_msvc_net2003.sln make_msvc_net2003.vcproj \
|
|
||||||
README.VMS makefile.vms makefile.com config.h-vms \
|
|
||||||
vmsdir.h vmsfunctions.c vmsify.c vms_exit.c vms_progname.c \
|
|
||||||
vms_export_symbol.c vms_export_symbol_test.com \
|
|
||||||
gmk-default.scm gmk-default.h
|
|
||||||
|
|
||||||
# This is built during configure, but behind configure's back
|
|
||||||
|
|
||||||
DISTCLEANFILES = build.sh
|
|
||||||
|
|
||||||
# --------------- Internationalization Section
|
|
||||||
|
|
||||||
localedir = $(datadir)/locale
|
localedir = $(datadir)/locale
|
||||||
|
|
||||||
# --------------- Local INSTALL Section
|
AM_CPPFLAGS = -Isrc -I$(top_srcdir)/src -Ilib -I$(top_srcdir)/lib \
|
||||||
|
-DLIBDIR=\"$(libdir)\" -DLOCALEDIR=\"$(localedir)\"
|
||||||
|
|
||||||
# If necessary, change the gid of the app and turn on the setgid flag.
|
# If prefix is not a standard location, look in prefix as well
|
||||||
#
|
if !KNOWN_PREFIX
|
||||||
|
AM_CPPFLAGS += -DINCLUDEDIR=\"$(includedir)\"
|
||||||
|
endif
|
||||||
|
|
||||||
# Whether or not make needs to be installed setgid.
|
AM_CFLAGS = $(_GUILE_CFLAGS)
|
||||||
# The value should be either 'true' or 'false'.
|
|
||||||
# On many systems, the getloadavg function (used to implement the '-l'
|
|
||||||
# switch) will not work unless make is installed setgid kmem.
|
|
||||||
#
|
|
||||||
inst_setgid = @NEED_SETGID@
|
|
||||||
|
|
||||||
# Install make setgid to this group so it can get the load average.
|
if WINDOWSENV
|
||||||
#
|
make_SOURCES += $(w32_SRCS)
|
||||||
inst_group = @KMEM_GROUP@
|
AM_CPPFLAGS += -I $(top_srcdir)/src/w32/include
|
||||||
|
else
|
||||||
|
make_SOURCES += src/posixos.c
|
||||||
|
endif
|
||||||
|
|
||||||
install-exec-local:
|
if USE_CUSTOMS
|
||||||
@if $(inst_setgid); then \
|
make_SOURCES += src/remote-cstms.c
|
||||||
app=$(DESTDIR)$(bindir)/`echo $(bin_PROGRAMS)|sed '$(transform)'`; \
|
else
|
||||||
if chgrp $(inst_group) $$app && chmod g+s $$app; then \
|
make_SOURCES += src/remote-stub.c
|
||||||
echo "chgrp $(inst_group) $$app && chmod g+s $$app"; \
|
endif
|
||||||
else \
|
|
||||||
echo "$$app needs to be owned by group $(inst_group) and setgid;"; \
|
# Extra stuff to include in the distribution.
|
||||||
echo "otherwise the '-l' option will probably not work."; \
|
|
||||||
echo "You may need special privileges to complete the installation"; \
|
mk_FILES = Basic.mk mk/msdosdjgpp.mk mk/Amiga.mk mk/VMS.mk mk/Windows32.mk
|
||||||
echo "of $$app."; \
|
# We don't need this, since the standard automake output will do.
|
||||||
fi; \
|
#mk/Posix.mk.in
|
||||||
else true; fi
|
|
||||||
|
m4_FILES = m4/gnulib-cache.m4
|
||||||
|
|
||||||
|
test_FILES = tests/run_make_tests tests/run_make_tests.bat \
|
||||||
|
tests/run_make_tests.pl tests/test_driver.pl \
|
||||||
|
tests/config-flags.pm.in tests/config_flags_pm.com \
|
||||||
|
tests/config-flags.pm.W32 \
|
||||||
|
tests/mkshadow tests/thelp.pl tests/guile.supp tests/README
|
||||||
|
# test/scripts are added via dist-hook below.
|
||||||
|
|
||||||
|
EXTRA_DIST = ChangeLog INSTALL README build.sh build.cfg.in $(man_MANS) \
|
||||||
|
src/mkconfig.h README.customs README.OS2 \
|
||||||
|
README.Amiga SCOPTIONS src/config.ami \
|
||||||
|
README.DOS builddos.bat src/configh.dos \
|
||||||
|
README.W32 build_w32.bat src/config.h.W32 \
|
||||||
|
README.VMS makefile.com src/config.h-vms src/vmsjobs.c \
|
||||||
|
vms_export_symbol_test.com \
|
||||||
|
src/gmk-default.scm src/gmk-default.h \
|
||||||
|
$(mk_FILES) $(m4_FILES) $(test_FILES)
|
||||||
|
|
||||||
# --------------- Generate the Guile default module content
|
# --------------- Generate the Guile default module content
|
||||||
|
|
||||||
guile.$(OBJEXT): gmk-default.h
|
src/guile.$(OBJEXT): src/gmk-default.h
|
||||||
gmk-default.h: $(srcdir)/gmk-default.scm
|
src/gmk-default.h: $(top_srcdir)/src/gmk-default.scm
|
||||||
(echo 'static const char *const GUILE_module_defn = " '\\ \
|
(echo 'static const char *const GUILE_module_defn = " '\\ \
|
||||||
&& sed -e 's/;.*//' -e '/^[ \t]*$$/d' -e 's/"/\\"/g' -e 's/$$/ \\/' \
|
&& sed -e 's/;.*//' -e '/^[ \t]*$$/d' -e 's/"/\\"/g' -e 's/$$/ \\/' \
|
||||||
$(srcdir)/gmk-default.scm \
|
$(top_srcdir)/src/gmk-default.scm \
|
||||||
&& echo '";') > $@
|
&& echo '";') > src/gmk-default.h
|
||||||
|
|
||||||
# --------------- Local DIST Section
|
# --------------- Local DIST Section
|
||||||
|
|
||||||
# Install the w32 and tests subdirectories
|
# Install the mk and tests subdirectories
|
||||||
#
|
#
|
||||||
dist-hook:
|
dist-hook:
|
||||||
(cd $(srcdir); \
|
(cd $(top_srcdir); \
|
||||||
sub=`find w32 tests -follow \( -name .git -o -name .deps -o -name work -o -name .gitignore -o -name \*.orig -o -name \*.rej -o -name \*~ -o -name Makefile \) -prune -o -type f -print`; \
|
sub=`find tests/scripts -follow \( -name .git -o -name .deps -o -name work -o -name .gitignore -o -name \*.orig -o -name \*.rej -o -name \*~ -o -name \*.out -o -name Makefile \) -prune -o -type f -print`; \
|
||||||
tar chf - $$sub) \
|
$(AMTAR) chf - $$sub) \
|
||||||
| (cd $(distdir); tar xfBp -)
|
| (cd $(distdir); $(AMTAR) xfBp -)
|
||||||
|
|
||||||
|
|
||||||
# --------------- Local CHECK Section
|
# --------------- Local CHECK Section
|
||||||
|
|
||||||
check-local: check-regression check-loadavg
|
check-local: check-regression
|
||||||
@banner=" Regression PASSED: GNU Make $(VERSION) ($(MAKE_HOST)) built with $(CC) "; \
|
@banner=" Regression PASSED: $(PACKAGE_STRING) ($(MAKE_HOST)) built with $(CC) "; \
|
||||||
dashes=`echo "$$banner" | sed s/./=/g`; \
|
dashes=`echo "$$banner" | sed s/./=/g`; \
|
||||||
echo; \
|
echo; \
|
||||||
echo "$$dashes"; \
|
echo "$$dashes"; \
|
||||||
@@ -154,20 +152,6 @@ check-local: check-regression check-loadavg
|
|||||||
echo "$$dashes"; \
|
echo "$$dashes"; \
|
||||||
echo
|
echo
|
||||||
|
|
||||||
.PHONY: check-loadavg check-regression
|
|
||||||
|
|
||||||
check-loadavg: loadavg$(EXEEXT)
|
|
||||||
@echo The system uptime program believes the load average to be:
|
|
||||||
-uptime
|
|
||||||
@echo The GNU load average checking code thinks:
|
|
||||||
-./loadavg$(EXEEXT)
|
|
||||||
|
|
||||||
# The loadavg function is invoked during "make check" to test getloadavg.
|
|
||||||
check_PROGRAMS = loadavg
|
|
||||||
nodist_loadavg_SOURCES = getloadavg.c
|
|
||||||
loadavg_CPPFLAGS = -DTEST
|
|
||||||
loadavg_LDADD = @GETLOADAVG_LIBS@
|
|
||||||
|
|
||||||
# > check-regression
|
# > check-regression
|
||||||
#
|
#
|
||||||
# Look for the make test suite, and run it if found and we can find perl.
|
# Look for the make test suite, and run it if found and we can find perl.
|
||||||
@@ -176,25 +160,53 @@ loadavg_LDADD = @GETLOADAVG_LIBS@
|
|||||||
#
|
#
|
||||||
MAKETESTFLAGS =
|
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
|
check-regression: tests/config-flags.pm
|
||||||
@if test -f '$(srcdir)/tests/run_make_tests'; then \
|
@rm -f $(testfiles)
|
||||||
|
@if test -f '$(top_srcdir)/tests/run_make_tests'; then \
|
||||||
ulimit -n 128; \
|
ulimit -n 128; \
|
||||||
if $(PERL) -v >/dev/null 2>&1; then \
|
if $(PERL) -v >/dev/null 2>&1; then \
|
||||||
case `cd '$(srcdir)'; pwd` in `pwd`) : ;; \
|
case `cd '$(top_srcdir)'; pwd` in `pwd`) : ;; \
|
||||||
*) test -d tests || mkdir tests; \
|
*) test -d tests || mkdir tests; \
|
||||||
rm -f srctests; \
|
rm -f srctests; \
|
||||||
if ln -s '$(srcdir)/tests' srctests; then \
|
if ln -s '$(top_srcdir)/tests' srctests; then \
|
||||||
for f in run_make_tests run_make_tests.pl test_driver.pl scripts; do \
|
for f in run_make_tests run_make_tests.pl test_driver.pl scripts thelp.pl; do \
|
||||||
rm -f tests/$$f; ln -s ../srctests/$$f tests; \
|
rm -f tests/$$f; ln -s ../srctests/$$f tests; \
|
||||||
done; fi ;; \
|
done; fi ;; \
|
||||||
esac; \
|
esac; \
|
||||||
echo "cd tests && $(PERL) ./run_make_tests.pl -srcdir $(abs_srcdir) -make ../make$(EXEEXT) $(MAKETESTFLAGS)"; \
|
echo "cd tests && $(PERL) $(PERLFLAGS) ./run_make_tests.pl -srcdir $(abs_top_srcdir) -make $(GMK_OUTDIR)/make$(EXEEXT) $(MAKETESTFLAGS)"; \
|
||||||
cd tests && $(PERL) ./run_make_tests.pl -srcdir '$(abs_srcdir)' -make '../make$(EXEEXT)' $(MAKETESTFLAGS); \
|
(cd tests && $(PERL) $(PERLFLAGS) ./run_make_tests.pl -srcdir '$(abs_top_srcdir)' -make '$(GMK_OUTDIR)/make$(EXEEXT)' $(MAKETESTFLAGS); echo $$? >.test-result) 2>&1 | tee $(testlog); \
|
||||||
|
er=$$(cat $(testresult)); if test "$$er" -ne 0; then \
|
||||||
|
dirnm="$(errorpre)-$$($(rand_string))"; fnm="$$dirnm.tar.gz"; \
|
||||||
|
rm -rf "$$dirnm"; mkdir "$$dirnm"; \
|
||||||
|
$(AMTAR) chf - $(errordetails) | (cd "$$dirnm"; $(AMTAR) xf -); \
|
||||||
|
$(AMTAR) chf - "$$dirnm" | eval GZIP= gzip $(GZIP_ENV) -c >"$$fnm"; \
|
||||||
|
echo "*** Testing FAILED! Details: $$fnm"; \
|
||||||
|
echo '*** Please report to <$(PACKAGE_BUGREPORT)>'; echo; \
|
||||||
|
exit $$er; \
|
||||||
|
fi; \
|
||||||
else \
|
else \
|
||||||
echo "Can't find a working Perl ($(PERL)); the test suite requires Perl."; \
|
echo "Can't find a working Perl ($(PERL)); the test suite requires Perl."; \
|
||||||
fi; \
|
fi; \
|
||||||
else \
|
else \
|
||||||
echo "Can't find the GNU Make test suite ($(srcdir)/tests)."; \
|
echo "Can't find the $(PACKAGE_NAME) test suite ($(top_srcdir)/tests)."; \
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
308
Makefile.ami
308
Makefile.ami
@@ -1,308 +0,0 @@
|
|||||||
# -*-Makefile-*- for GNU make on Amiga
|
|
||||||
#
|
|
||||||
# NOTE: If you have no 'make' program at all to process this makefile, run
|
|
||||||
# 'build.sh' instead.
|
|
||||||
#
|
|
||||||
# Copyright (C) 1995-2016 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 <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
#
|
|
||||||
# Makefile for GNU Make
|
|
||||||
#
|
|
||||||
|
|
||||||
CC = sc
|
|
||||||
RM = delete
|
|
||||||
|
|
||||||
CFLAGS =
|
|
||||||
CPPFLAGS =
|
|
||||||
LDFLAGS =
|
|
||||||
|
|
||||||
# Define these for your system as follows:
|
|
||||||
# -DNO_ARCHIVES To disable 'ar' archive support.
|
|
||||||
# -DNO_FLOAT To avoid using floating-point numbers.
|
|
||||||
# -DENUM_BITFIELDS If the compiler isn't GCC but groks enum foo:2.
|
|
||||||
# Some compilers apparently accept this
|
|
||||||
# without complaint but produce losing code,
|
|
||||||
# so beware.
|
|
||||||
# NeXT 1.0a uses an old version of GCC, which required -D__inline=inline.
|
|
||||||
# See also 'config.h'.
|
|
||||||
defines =
|
|
||||||
|
|
||||||
# Which flavor of remote job execution support to use.
|
|
||||||
# The code is found in 'remote-$(REMOTE).c'.
|
|
||||||
REMOTE = stub
|
|
||||||
|
|
||||||
# If you are using the GNU C library, or have the GNU getopt functions in
|
|
||||||
# your C library, you can comment these out.
|
|
||||||
GETOPT = getopt.o getopt1.o
|
|
||||||
GETOPT_SRC = $(srcdir)getopt.c $(srcdir)getopt1.c $(srcdir)getopt.h
|
|
||||||
|
|
||||||
# If you are using the GNU C library, or have the GNU glob functions in
|
|
||||||
# your C library, you can comment this out. GNU make uses special hooks
|
|
||||||
# into the glob functions to be more efficient (by using make's directory
|
|
||||||
# cache for globbing), so you must use the GNU functions even if your
|
|
||||||
# system's C library has the 1003.2 glob functions already. Also, the glob
|
|
||||||
# functions in the AIX and HPUX C libraries are said to be buggy.
|
|
||||||
GLOB = glob/glob.lib
|
|
||||||
|
|
||||||
# If your system doesn't have alloca, or the one provided is bad, define this.
|
|
||||||
ALLOCA = alloca.o
|
|
||||||
ALLOCA_SRC = $(srcdir)alloca.c
|
|
||||||
|
|
||||||
# If your system needs extra libraries loaded in, define them here.
|
|
||||||
# System V probably need -lPW for alloca. HP-UX 7.0's alloca in
|
|
||||||
# libPW.a is broken on HP9000s300 and HP9000s400 machines. Use
|
|
||||||
# alloca.c instead on those machines.
|
|
||||||
LOADLIBES =
|
|
||||||
|
|
||||||
# Any extra object files your system needs.
|
|
||||||
extras = amiga.o
|
|
||||||
|
|
||||||
# Common prefix for machine-independent installed files.
|
|
||||||
prefix =
|
|
||||||
# Common prefix for machine-dependent installed files.
|
|
||||||
exec_prefix =
|
|
||||||
|
|
||||||
# Directory to install 'make' in.
|
|
||||||
bindir = sc:c
|
|
||||||
# Directory to find libraries in for '-lXXX'.
|
|
||||||
libdir = lib:
|
|
||||||
# Directory to search by default for included makefiles.
|
|
||||||
includedir = include:
|
|
||||||
# Directory to install the Info files in.
|
|
||||||
infodir = doc:
|
|
||||||
# Directory to install the man page in.
|
|
||||||
mandir = t:
|
|
||||||
# Number to put on the man page filename.
|
|
||||||
manext = 1
|
|
||||||
# Prefix to put on installed 'make' binary file name.
|
|
||||||
binprefix =
|
|
||||||
# Prefix to put on installed 'make' man page file name.
|
|
||||||
manprefix = $(binprefix)
|
|
||||||
|
|
||||||
# Whether or not make needs to be installed setgid.
|
|
||||||
# The value should be either 'true' or 'false'.
|
|
||||||
# On many systems, the getloadavg function (used to implement the '-l'
|
|
||||||
# switch) will not work unless make is installed setgid kmem.
|
|
||||||
install_setgid = false
|
|
||||||
# Install make setgid to this group so it can read /dev/kmem.
|
|
||||||
group = sys
|
|
||||||
|
|
||||||
# Program to install 'make'.
|
|
||||||
INSTALL_PROGRAM = copy
|
|
||||||
# Program to install the man page.
|
|
||||||
INSTALL_DATA = copy
|
|
||||||
# Generic install program.
|
|
||||||
INSTALL = copy
|
|
||||||
|
|
||||||
# Program to format Texinfo source into Info files.
|
|
||||||
MAKEINFO = makeinfo
|
|
||||||
# Program to format Texinfo source into DVI files.
|
|
||||||
TEXI2DVI = texi2dvi
|
|
||||||
|
|
||||||
# Programs to make tags files.
|
|
||||||
ETAGS = etags -w
|
|
||||||
CTAGS = ctags -w
|
|
||||||
|
|
||||||
#guile = guile.o
|
|
||||||
|
|
||||||
objs = commands.o job.o dir.o file.o misc.o main.o read.o remake.o \
|
|
||||||
rule.o implicit.o default.o variable.o expand.o function.o \
|
|
||||||
vpath.o version.o ar.o arscan.o signame.o strcache.o hash.o \
|
|
||||||
remote-$(REMOTE).o $(GETOPT) $(ALLOCA) $(extras) $(guile)
|
|
||||||
|
|
||||||
srcs = $(srcdir)commands.c $(srcdir)job.c $(srcdir)dir.c \
|
|
||||||
$(srcdir)file.c $(srcdir)getloadavg.c $(srcdir)misc.c \
|
|
||||||
$(srcdir)main.c $(srcdir)read.c $(srcdir)remake.c \
|
|
||||||
$(srcdir)rule.c $(srcdir)implicit.c $(srcdir)default.c \
|
|
||||||
$(srcdir)variable.c $(srcdir)expand.c $(srcdir)function.c \
|
|
||||||
$(srcdir)vpath.c $(srcdir)version.c $(srcdir)hash.c \
|
|
||||||
$(srcdir)guile.c $(srcdir)remote-$(REMOTE).c \
|
|
||||||
$(srcdir)ar.c $(srcdir)arscan.c $(srcdir)strcache.c \
|
|
||||||
$(srcdir)signame.c $(srcdir)signame.h $(GETOPT_SRC) \
|
|
||||||
$(srcdir)commands.h $(srcdir)dep.h $(srcdir)filedep.h \
|
|
||||||
$(srcdir)job.h $(srcdir)makeint.h $(srcdir)rule.h \
|
|
||||||
$(srcdir)variable.h $(ALLOCA_SRC) $(srcdir)config.h.in
|
|
||||||
|
|
||||||
|
|
||||||
.SUFFIXES:
|
|
||||||
.SUFFIXES: .o .c .h .ps .dvi .info .texinfo
|
|
||||||
|
|
||||||
all: make
|
|
||||||
info: make.info
|
|
||||||
dvi: make.dvi
|
|
||||||
# Some makes apparently use .PHONY as the default goal if it is before 'all'.
|
|
||||||
.PHONY: all check info dvi
|
|
||||||
|
|
||||||
make.info: make.texinfo
|
|
||||||
$(MAKEINFO) -I$(srcdir) $(srcdir)make.texinfo -o make.info
|
|
||||||
|
|
||||||
make.dvi: make.texinfo
|
|
||||||
$(TEXI2DVI) $(srcdir)make.texinfo
|
|
||||||
|
|
||||||
make.ps: make.dvi
|
|
||||||
dvi2ps make.dvi > make.ps
|
|
||||||
|
|
||||||
make: $(objs) $(GLOB)
|
|
||||||
$(CC) Link $(LDFLAGS) $(objs) Lib $(GLOB) $(LOADLIBES) To make.new
|
|
||||||
-delete make
|
|
||||||
rename make.new make
|
|
||||||
|
|
||||||
TMPFILE = t:Make$$
|
|
||||||
|
|
||||||
$(GLOB):
|
|
||||||
cd glob @@\
|
|
||||||
$(MAKE) -$(MAKEFLAGS) -f Makefile
|
|
||||||
|
|
||||||
# -I. is needed to find config.h in the build directory.
|
|
||||||
OUTPUT_OPTION =
|
|
||||||
.c.o:
|
|
||||||
$(CC) $(defines) IDir "" IDir glob \
|
|
||||||
$(CPPFLAGS) $(CFLAGS) $< $(OUTPUT_OPTION)
|
|
||||||
|
|
||||||
# For some losing Unix makes.
|
|
||||||
SHELL = /bin/sh
|
|
||||||
#@SET_MAKE@
|
|
||||||
|
|
||||||
glob/libglob.a: FORCE config.h
|
|
||||||
cd glob; $(MAKE) libglob.a
|
|
||||||
FORCE:
|
|
||||||
|
|
||||||
.PHONY: install installdirs
|
|
||||||
install: installdirs \
|
|
||||||
$(bindir)$(binprefix)make $(infodir)make.info \
|
|
||||||
$(mandir)$(manprefix)make.$(manext)
|
|
||||||
|
|
||||||
installdirs:
|
|
||||||
$(SHELL) ${srcdir}/mkinstalldirs $(bindir) $(infodir) $(mandir)
|
|
||||||
|
|
||||||
$(bindir)$(binprefix)make: make
|
|
||||||
$(INSTALL_PROGRAM) make $@.new
|
|
||||||
@if $(install_setgid); then \
|
|
||||||
if chgrp $(group) $@.new && chmod g+s $@.new; then \
|
|
||||||
echo "chgrp $(group) $@.new && chmod g+s $@.new"; \
|
|
||||||
else \
|
|
||||||
echo "$@ needs to be owned by group $(group) and setgid;"; \
|
|
||||||
echo "otherwise the '-l' option will probably not work."; \
|
|
||||||
echo "You may need special privileges to install $@."; \
|
|
||||||
fi; \
|
|
||||||
else true; fi
|
|
||||||
# Some systems can't deal with renaming onto a running binary.
|
|
||||||
-$(RM) $@.old
|
|
||||||
-mv $@ $@.old
|
|
||||||
mv $@.new $@
|
|
||||||
|
|
||||||
$(infodir)make.info: make.info
|
|
||||||
if [ -r ./make.info ]; then dir=.; else dir=$(srcdir); fi; \
|
|
||||||
for file in $${dir}/make.info*; do \
|
|
||||||
name="`basename $$file`"; \
|
|
||||||
$(INSTALL_DATA) $$file \
|
|
||||||
`echo $@ | sed "s,make.info\$$,$$name,"`; \
|
|
||||||
done
|
|
||||||
# Run install-info only if it exists.
|
|
||||||
# Use 'if' instead of just prepending '-' to the
|
|
||||||
# line so we notice real errors from install-info.
|
|
||||||
# We use '$(SHELL) -c' because some shells do not
|
|
||||||
# fail gracefully when there is an unknown command.
|
|
||||||
if $(SHELL) -c 'install-info --version' >/dev/null 2>&1; then \
|
|
||||||
if [ -r ./make.info ]; then dir=.; else dir=$(srcdir); fi; \
|
|
||||||
install-info --infodir=$(infodir) $$dir/make.info; \
|
|
||||||
else true; fi
|
|
||||||
|
|
||||||
$(mandir)$(manprefix)make.$(manext): make.man
|
|
||||||
$(INSTALL_DATA) $(srcdir)make.man $@
|
|
||||||
|
|
||||||
|
|
||||||
loadavg: loadavg.c config.h
|
|
||||||
$(CC) $(defines) -DTEST -I. -I$(srcdir) $(CFLAGS) $(LDFLAGS) \
|
|
||||||
loadavg.c $(LOADLIBES) -o $@
|
|
||||||
# We copy getloadavg.c into a different file rather than compiling it
|
|
||||||
# directly because some compilers clobber getloadavg.o in the process.
|
|
||||||
loadavg.c: getloadavg.c
|
|
||||||
ln $(srcdir)getloadavg.c loadavg.c || \
|
|
||||||
cp $(srcdir)getloadavg.c loadavg.c
|
|
||||||
check-loadavg: loadavg
|
|
||||||
@echo The system uptime program believes the load average to be:
|
|
||||||
-uptime
|
|
||||||
@echo The GNU load average checking code believes:
|
|
||||||
./loadavg
|
|
||||||
check: check-loadavg
|
|
||||||
|
|
||||||
|
|
||||||
.PHONY: clean realclean distclean mostlyclean
|
|
||||||
clean: glob-clean
|
|
||||||
-$(RM) make loadavg "#?.o" core make.dvi
|
|
||||||
|
|
||||||
distclean: clean glob-realclean
|
|
||||||
-$(RM) Makefile config.h config.status build.sh
|
|
||||||
-$(RM) config.log config.cache
|
|
||||||
-$(RM) TAGS tags
|
|
||||||
-$(RM) make.?? make.??s make.log make.toc make.*aux
|
|
||||||
-$(RM) loadavg.c
|
|
||||||
|
|
||||||
realclean: distclean
|
|
||||||
-$(RM) make.info*
|
|
||||||
mostlyclean: clean
|
|
||||||
|
|
||||||
.PHONY: glob-clean glob-realclean
|
|
||||||
glob-clean glob-realclean:
|
|
||||||
cd glob @@\
|
|
||||||
$(MAKE) $@
|
|
||||||
|
|
||||||
# This tells versions [3.59,3.63) of GNU make not to export all variables.
|
|
||||||
.NOEXPORT:
|
|
||||||
|
|
||||||
# The automatically generated dependencies below may omit config.h
|
|
||||||
# because it is included with '#include <config.h>' rather than
|
|
||||||
# '#include "config.h"'. So we add the explicit dependency to make sure.
|
|
||||||
$(objs): config.h
|
|
||||||
|
|
||||||
# Automatically generated dependencies will be put at the end of the file.
|
|
||||||
|
|
||||||
# Automatically generated dependencies.
|
|
||||||
commands.o: commands.c makeint.h dep.h filedef.h variable.h job.h \
|
|
||||||
commands.h
|
|
||||||
job.o: job.c makeint.h job.h filedef.h commands.h variable.h
|
|
||||||
dir.o: dir.c makeint.h
|
|
||||||
file.o: file.c makeint.h dep.h filedef.h job.h commands.h variable.h
|
|
||||||
misc.o: misc.c makeint.h dep.h
|
|
||||||
main.o: main.c makeint.h dep.h filedef.h variable.h job.h commands.h \
|
|
||||||
getopt.h
|
|
||||||
guile.o: guile.c makeint.h dep.h debug.h variable.h gmk-default.h
|
|
||||||
read.o: read.c makeint.h dep.h filedef.h job.h commands.h variable.h \
|
|
||||||
glob/glob.h
|
|
||||||
remake.o: remake.c makeint.h filedef.h job.h commands.h dep.h
|
|
||||||
rule.o: rule.c makeint.h dep.h filedef.h job.h commands.h variable.h \
|
|
||||||
rule.h
|
|
||||||
implicit.o: implicit.c makeint.h rule.h dep.h filedef.h
|
|
||||||
default.o: default.c makeint.h rule.h dep.h filedef.h job.h commands.h \
|
|
||||||
variable.h
|
|
||||||
variable.o: variable.c makeint.h dep.h filedef.h job.h commands.h \
|
|
||||||
variable.h
|
|
||||||
expand.o: expand.c makeint.h filedef.h job.h commands.h variable.h
|
|
||||||
function.o: function.c makeint.h filedef.h variable.h dep.h job.h \
|
|
||||||
commands.h amiga.h
|
|
||||||
vpath.o: vpath.c makeint.h filedef.h variable.h
|
|
||||||
strcache.o: strcache.c makeint.h hash.h
|
|
||||||
version.o: version.c
|
|
||||||
ar.o: ar.c makeint.h filedef.h dep.h
|
|
||||||
arscan.o: arscan.c makeint.h
|
|
||||||
signame.o: signame.c signame.h
|
|
||||||
remote-stub.o: remote-stub.c makeint.h filedef.h job.h commands.h
|
|
||||||
getopt.o: getopt.c
|
|
||||||
getopt1.o : getopt1.c getopt.h
|
|
||||||
getloadavg.o: getloadavg.c
|
|
||||||
amiga.o: amiga.c makeint.h variable.h amiga.h
|
|
||||||
337
NEWS
337
NEWS
@@ -1,19 +1,322 @@
|
|||||||
GNU make NEWS -*-indented-text-*-
|
GNU Make NEWS -*-indented-text-*-
|
||||||
History of user-visible changes.
|
History of user-visible changes.
|
||||||
11 Apr 2016
|
31 October 2022
|
||||||
|
|
||||||
See the end of this file for copyrights and conditions.
|
See the end of this file for copyrights and conditions.
|
||||||
|
|
||||||
All changes mentioned here are more fully described in the GNU make
|
All user-visible changes are more fully described in the GNU Make manual,
|
||||||
manual, which is contained in this distribution as the file doc/make.texi.
|
which is contained in this distribution as the file doc/make.texi.
|
||||||
See the README file and the GNU make manual for instructions for
|
See the README file and the GNU Make manual for instructions for
|
||||||
reporting bugs.
|
reporting bugs.
|
||||||
|
|
||||||
Version 4.1.90 (11 Apr 2016)
|
Version 4.4 (31 Oct 2022)
|
||||||
|
|
||||||
A complete list of bugs fixed in this version is available here:
|
A complete list of bugs fixed in this version is available here:
|
||||||
|
|
||||||
http://sv.gnu.org/bugs/index.php?group=make&report_id=111&fix_release_id=106&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
|
||||||
|
no longer introduce comments and should not be escaped with backslashes:
|
||||||
|
thus a call such as:
|
||||||
|
foo := $(shell echo '#')
|
||||||
|
is legal. Previously the number sign needed to be escaped, for example:
|
||||||
|
foo := $(shell echo '\#')
|
||||||
|
Now this latter will resolve to "\#". If you want to write makefiles
|
||||||
|
portable to both versions, assign the number sign to a variable:
|
||||||
|
H := \#
|
||||||
|
foo := $(shell echo '$H')
|
||||||
|
This was claimed to be fixed in 3.81, but wasn't, for some reason.
|
||||||
|
To detect this change search for 'nocomment' in the .FEATURES variable.
|
||||||
|
|
||||||
|
* WARNING: Backward-incompatibility!
|
||||||
|
Previously appending using '+=' to an empty variable would result in a value
|
||||||
|
starting with a space. Now the initial space is only added if the variable
|
||||||
|
already contains some value. Similarly, appending an empty string does not
|
||||||
|
add a trailing space.
|
||||||
|
|
||||||
|
* WARNING: Backward-incompatibility!
|
||||||
|
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
|
||||||
|
a single invocation of the recipe. It's now possible to declare that an
|
||||||
|
explicit rule generates multiple targets with a single invocation. To use
|
||||||
|
this, replace the ":" token with "&:" in the rule. To detect this feature
|
||||||
|
search for 'grouped-target' in the .FEATURES special variable.
|
||||||
|
Implementation contributed by Kaz Kylheku <kaz@kylheku.com>
|
||||||
|
|
||||||
|
* New feature: .EXTRA_PREREQS variable
|
||||||
|
Words in this variable are considered prerequisites of targets but they are
|
||||||
|
not added to any of the automatic variable values when expanding the
|
||||||
|
recipe. This variable can either be global (applies to all targets) or
|
||||||
|
a target-specific variable. To detect this feature search for 'extra-prereqs'
|
||||||
|
in the .FEATURES special variable.
|
||||||
|
Implementation contributed by Christof Warlich <cwarlich@gmx.de>
|
||||||
|
|
||||||
|
* Makefiles can now specify the '-j' option in their MAKEFLAGS variable and
|
||||||
|
this will cause make to enable that parallelism mode.
|
||||||
|
|
||||||
|
* 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.
|
||||||
|
Implementation contributed by Aron Barath <baratharon@caesar.elte.hu>
|
||||||
|
|
||||||
|
* Error messages printed when invoking non-existent commands have been cleaned
|
||||||
|
up and made consistent.
|
||||||
|
|
||||||
|
* The previous limit of 63 jobs under -jN on MS-Windows is now
|
||||||
|
increased to 4095. That limit includes the subprocess started by
|
||||||
|
the $(shell) function.
|
||||||
|
|
||||||
|
* A new option --no-silent has been added, that cancels the effect of the
|
||||||
|
-s/--silent/--quiet flag.
|
||||||
|
|
||||||
|
* A new option -E has been added as a short alias for --eval.
|
||||||
|
|
||||||
|
* 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
|
||||||
|
|
||||||
|
* Import the GNU standard bootstrap script to replace the hand-rolled
|
||||||
|
"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.
|
||||||
|
|
||||||
|
* Replace local portability code with Gnulib content. Unfortunately due to a
|
||||||
|
problem with Gnulib support for getloadavg, this forces a requirement on
|
||||||
|
Automake 1.16 or above in order to build from Git. See README.git.
|
||||||
|
|
||||||
|
|
||||||
|
Version 4.2.1 (10 Jun 2016)
|
||||||
|
|
||||||
|
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=107&set=custom
|
||||||
|
|
||||||
|
This release is a bug-fix release.
|
||||||
|
|
||||||
|
|
||||||
|
Version 4.2 (22 May 2016)
|
||||||
|
|
||||||
|
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=106&set=custom
|
||||||
|
|
||||||
* New variable: $(.SHELLSTATUS) is set to the exit status of the last != or
|
* New variable: $(.SHELLSTATUS) is set to the exit status of the last != or
|
||||||
$(shell ...) function invoked in this instance of make. This will be "0" if
|
$(shell ...) function invoked in this instance of make. This will be "0" if
|
||||||
@@ -52,7 +355,7 @@ Version 4.1 (05 Oct 2014)
|
|||||||
|
|
||||||
A complete list of bugs fixed in this version is available here:
|
A complete list of bugs fixed in this version is available here:
|
||||||
|
|
||||||
http://sv.gnu.org/bugs/index.php?group=make&report_id=111&fix_release_id=105&set=custom
|
https://sv.gnu.org/bugs/index.php?group=make&report_id=111&fix_release_id=105&set=custom
|
||||||
|
|
||||||
* New variables: $(MAKE_TERMOUT) and $(MAKE_TERMERR) are set to non-empty
|
* New variables: $(MAKE_TERMOUT) and $(MAKE_TERMERR) are set to non-empty
|
||||||
values if stdout or stderr, respectively, are believed to be writing to a
|
values if stdout or stderr, respectively, are believed to be writing to a
|
||||||
@@ -100,7 +403,7 @@ Version 4.0 (09 Oct 2013)
|
|||||||
|
|
||||||
A complete list of bugs fixed in this version is available here:
|
A complete list of bugs fixed in this version is available here:
|
||||||
|
|
||||||
http://sv.gnu.org/bugs/index.php?group=make&report_id=111&fix_release_id=101&set=custom
|
https://sv.gnu.org/bugs/index.php?group=make&report_id=111&fix_release_id=101&set=custom
|
||||||
|
|
||||||
* WARNING: Backward-incompatibility!
|
* WARNING: Backward-incompatibility!
|
||||||
If .POSIX is specified, then make adheres to the POSIX backslash/newline
|
If .POSIX is specified, then make adheres to the POSIX backslash/newline
|
||||||
@@ -152,7 +455,7 @@ http://sv.gnu.org/bugs/index.php?group=make&report_id=111&fix_release_id=101&set
|
|||||||
* New feature: "::=" simple assignment operator as defined by POSIX in 2012.
|
* New feature: "::=" simple assignment operator as defined by POSIX in 2012.
|
||||||
This operator has identical functionality to ":=" in GNU make, but will be
|
This operator has identical functionality to ":=" in GNU make, but will be
|
||||||
portable to any implementation of make conforming to a sufficiently new
|
portable to any implementation of make conforming to a sufficiently new
|
||||||
version of POSIX (see http://austingroupbugs.net/view.php?id=330). It is
|
version of POSIX (see https://austingroupbugs.net/view.php?id=330). It is
|
||||||
not necessary to define the .POSIX target to access this operator.
|
not necessary to define the .POSIX target to access this operator.
|
||||||
|
|
||||||
* New feature: Loadable objects
|
* New feature: Loadable objects
|
||||||
@@ -204,7 +507,7 @@ Version 3.82 (28 Jul 2010)
|
|||||||
|
|
||||||
A complete list of bugs fixed in this version is available here:
|
A complete list of bugs fixed in this version is available here:
|
||||||
|
|
||||||
http://sv.gnu.org/bugs/index.php?group=make&report_id=111&fix_release_id=104&set=custom
|
https://sv.gnu.org/bugs/index.php?group=make&report_id=111&fix_release_id=104&set=custom
|
||||||
|
|
||||||
* Compiling GNU make now requires a conforming ISO C 1989 compiler and
|
* Compiling GNU make now requires a conforming ISO C 1989 compiler and
|
||||||
standard runtime library.
|
standard runtime library.
|
||||||
@@ -369,7 +672,7 @@ Version 3.81 (01 Apr 2006)
|
|||||||
might have caused the target to rebuild. Starting with the _next_
|
might have caused the target to rebuild. Starting with the _next_
|
||||||
release of GNU make, '$?' will contain all prerequisites that caused
|
release of GNU make, '$?' will contain all prerequisites that caused
|
||||||
the target to be considered out of date.
|
the target to be considered out of date.
|
||||||
See http://savannah.gnu.org/bugs/?16051
|
See https://savannah.gnu.org/bugs/?16051
|
||||||
|
|
||||||
* WARNING: Backward-incompatibility!
|
* WARNING: Backward-incompatibility!
|
||||||
GNU make now implements a generic "second expansion" feature on the
|
GNU make now implements a generic "second expansion" feature on the
|
||||||
@@ -493,7 +796,7 @@ Version 3.81 (01 Apr 2006)
|
|||||||
|
|
||||||
A complete list of bugs fixed in this version is available here:
|
A complete list of bugs fixed in this version is available here:
|
||||||
|
|
||||||
http://savannah.gnu.org/bugs/index.php?group=make&report_id=111&fix_release_id=103
|
https://savannah.gnu.org/bugs/index.php?group=make&report_id=111&fix_release_id=103
|
||||||
|
|
||||||
|
|
||||||
Version 3.80 (03 Oct 2002)
|
Version 3.80 (03 Oct 2002)
|
||||||
@@ -611,7 +914,7 @@ Version 3.80 (03 Oct 2002)
|
|||||||
|
|
||||||
A complete list of bugs fixed in this version is available here:
|
A complete list of bugs fixed in this version is available here:
|
||||||
|
|
||||||
http://savannah.gnu.org/bugs/index.php?group=make&report_id=111&fix_release_id=102
|
https://savannah.gnu.org/bugs/index.php?group=make&report_id=111&fix_release_id=102
|
||||||
|
|
||||||
|
|
||||||
Version 3.79.1 (23 Jun 2000)
|
Version 3.79.1 (23 Jun 2000)
|
||||||
@@ -825,7 +1128,7 @@ Version 3.77 (28 Jul 1998)
|
|||||||
This port was done by Klaus Kämpf <kkaempf@rmi.de>
|
This port was done by Klaus Kämpf <kkaempf@rmi.de>
|
||||||
|
|
||||||
* There is first-level support available from proGIS Software, Germany.
|
* There is first-level support available from proGIS Software, Germany.
|
||||||
Visit their web-site at http://www.progis.de to get information
|
Visit their web-site at https://www.progis.de to get information
|
||||||
about other vms software and forthcoming updates to gnu make.
|
about other vms software and forthcoming updates to gnu make.
|
||||||
|
|
||||||
* /bin/sh style I/O redirection is supported. You can now write lines like
|
* /bin/sh style I/O redirection is supported. You can now write lines like
|
||||||
@@ -1515,7 +1818,7 @@ Version 3.05
|
|||||||
(Changes from versions 1 through 3.05 were never recorded. Sorry.)
|
(Changes from versions 1 through 3.05 were never recorded. Sorry.)
|
||||||
|
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 1988-2016 Free Software Foundation, Inc.
|
Copyright (C) 1988-2022 Free Software Foundation, Inc.
|
||||||
This file is part of GNU Make.
|
This file is part of GNU Make.
|
||||||
|
|
||||||
GNU Make is free software; you can redistribute it and/or modify it under the
|
GNU Make is free software; you can redistribute it and/or modify it under the
|
||||||
@@ -1528,4 +1831,4 @@ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|||||||
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License along with
|
You should have received a copy of the GNU General Public License along with
|
||||||
this program. If not, see <http://www.gnu.org/licenses/>.
|
this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|||||||
@@ -1,132 +0,0 @@
|
|||||||
# -*-Makefile-*- to build GNU make with nmake
|
|
||||||
#
|
|
||||||
# NOTE: If you have no 'make' program at all to process this makefile,
|
|
||||||
# run 'build_w32.bat' instead.
|
|
||||||
#
|
|
||||||
# Copyright (C) 1996-2016 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 <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
LINK = link
|
|
||||||
CC = cl
|
|
||||||
MAKE = nmake
|
|
||||||
|
|
||||||
OUTDIR=.
|
|
||||||
MAKEFILE=NMakefile
|
|
||||||
SUBPROC_MAKEFILE=NMakefile
|
|
||||||
|
|
||||||
CFLAGS_any = /nologo /MT /W4 /GX /Zi /YX /I . /I glob /I w32/include /D WIN32 /D WINDOWS32 /D _CONSOLE /D HAVE_CONFIG_H
|
|
||||||
CFLAGS_debug = $(CFLAGS_any) /Od /D DEBUG /D _DEBUG /FR.\WinDebug/ /Fp.\WinDebug/make.pch /Fo.\WinDebug/ /Fd.\WinDebug/make.pdb
|
|
||||||
CFLAGS_release = $(CFLAGS_any) /O2 /D NDEBUG /FR.\WinRel/ /Fp.\WinRel/make.pch /Fo.\WinRel/
|
|
||||||
|
|
||||||
LDFLAGS_debug = w32\subproc\WinDebug\subproc.lib /NOLOGO /SUBSYSTEM:console\
|
|
||||||
/STACK:0x400000 /INCREMENTAL:no /PDB:WinDebug/make.pdb /OUT:WinDebug/make.exe /DEBUG
|
|
||||||
LDFLAGS_release = w32\subproc\WinRel\subproc.lib /NOLOGO /SUBSYSTEM:console\
|
|
||||||
/STACK:0x400000 /INCREMENTAL:no /OUT:WinRel/make.exe
|
|
||||||
|
|
||||||
all: config.h subproc Release Debug
|
|
||||||
|
|
||||||
#
|
|
||||||
# Make sure we build the subproc library first. It has it's own
|
|
||||||
# makefile. To be portable to Windows 95, we put the instructions
|
|
||||||
# on how to build the library into a batch file. On NT, we could
|
|
||||||
# simply have done foo && bar && dog, but this doesn't port.
|
|
||||||
#
|
|
||||||
subproc: w32/subproc/WinDebug/subproc.lib w32/subproc/WinRel/subproc.lib
|
|
||||||
|
|
||||||
w32/subproc/WinDebug/subproc.lib w32/subproc/WinRel/subproc.lib: w32/subproc/misc.c w32/subproc/sub_proc.c w32/subproc/w32err.c
|
|
||||||
subproc.bat $(SUBPROC_MAKEFILE) $(MAKE)
|
|
||||||
if exist WinDebug\make.exe erase WinDebug\make.exe
|
|
||||||
if exist WinRel\make.exe erase WinRel\make.exe
|
|
||||||
|
|
||||||
config.h: config.h.W32
|
|
||||||
copy $? $@
|
|
||||||
|
|
||||||
Release:
|
|
||||||
$(MAKE) /f $(MAKEFILE) LDFLAGS="$(LDFLAGS_release)" CFLAGS="$(CFLAGS_release)" OUTDIR=WinRel WinRel/make.exe
|
|
||||||
Debug:
|
|
||||||
$(MAKE) /f $(MAKEFILE) LDFLAGS="$(LDFLAGS_debug)" CFLAGS="$(CFLAGS_debug)" OUTDIR=WinDebug WinDebug/make.exe
|
|
||||||
|
|
||||||
clean:
|
|
||||||
if exist WinDebug\nul rmdir /s /q WinDebug
|
|
||||||
if exist WinRel\nul rmdir /s /q WinRel
|
|
||||||
if exist w32\subproc\WinDebug\nul rmdir /s /q w32\subproc\WinDebug
|
|
||||||
if exist w32\subproc\WinRel\nul rmdir /s /q w32\subproc\WinRel
|
|
||||||
if exist config.h erase config.h
|
|
||||||
erase *.pdb
|
|
||||||
|
|
||||||
$(OUTDIR):
|
|
||||||
if not exist .\$@\nul mkdir .\$@
|
|
||||||
|
|
||||||
LIBS = kernel32.lib user32.lib advapi32.lib
|
|
||||||
|
|
||||||
guile = $(OUTDIR)/guile.obj
|
|
||||||
|
|
||||||
OBJS = \
|
|
||||||
$(OUTDIR)/ar.obj \
|
|
||||||
$(OUTDIR)/arscan.obj \
|
|
||||||
$(OUTDIR)/commands.obj \
|
|
||||||
$(OUTDIR)/default.obj \
|
|
||||||
$(OUTDIR)/dir.obj \
|
|
||||||
$(OUTDIR)/expand.obj \
|
|
||||||
$(OUTDIR)/file.obj \
|
|
||||||
$(OUTDIR)/function.obj \
|
|
||||||
$(OUTDIR)/getloadavg.obj \
|
|
||||||
$(OUTDIR)/getopt.obj \
|
|
||||||
$(OUTDIR)/getopt1.obj \
|
|
||||||
$(OUTDIR)/hash.obj \
|
|
||||||
$(OUTDIR)/implicit.obj \
|
|
||||||
$(OUTDIR)/job.obj \
|
|
||||||
$(OUTDIR)/load.obj \
|
|
||||||
$(OUTDIR)/main.obj \
|
|
||||||
$(OUTDIR)/misc.obj \
|
|
||||||
$(OUTDIR)/output.obj \
|
|
||||||
$(OUTDIR)/read.obj \
|
|
||||||
$(OUTDIR)/remake.obj \
|
|
||||||
$(OUTDIR)/remote-stub.obj \
|
|
||||||
$(OUTDIR)/rule.obj \
|
|
||||||
$(OUTDIR)/signame.obj \
|
|
||||||
$(OUTDIR)/strcache.obj \
|
|
||||||
$(OUTDIR)/variable.obj \
|
|
||||||
$(OUTDIR)/version.obj \
|
|
||||||
$(OUTDIR)/vpath.obj \
|
|
||||||
$(OUTDIR)/glob.obj \
|
|
||||||
$(OUTDIR)/fnmatch.obj \
|
|
||||||
$(OUTDIR)/dirent.obj \
|
|
||||||
$(OUTDIR)/pathstuff.obj \
|
|
||||||
$(OUTDIR)/posixfcn.obj \
|
|
||||||
$(OUTDIR)/w32os.obj \
|
|
||||||
$(guile)
|
|
||||||
|
|
||||||
$(OUTDIR)/make.exe: $(OUTDIR) $(OBJS)
|
|
||||||
$(LINK) @<<
|
|
||||||
$(LDFLAGS) $(LIBS) $(OBJS)
|
|
||||||
<<
|
|
||||||
|
|
||||||
.c{$(OUTDIR)}.obj:
|
|
||||||
$(CC) $(CFLAGS) /c $<
|
|
||||||
|
|
||||||
$(OUTDIR)/glob.obj : glob/glob.c
|
|
||||||
$(CC) $(CFLAGS) /c $?
|
|
||||||
$(OUTDIR)/fnmatch.obj : glob/fnmatch.c
|
|
||||||
$(CC) $(CFLAGS) /c $?
|
|
||||||
$(OUTDIR)/dirent.obj : w32/compat/dirent.c
|
|
||||||
$(CC) $(CFLAGS) /c $?
|
|
||||||
$(OUTDIR)/posixfcn.obj : w32/compat/posixfcn.c
|
|
||||||
$(CC) $(CFLAGS) /c $?
|
|
||||||
$(OUTDIR)/pathstuff.obj : w32/pathstuff.c
|
|
||||||
$(CC) $(CFLAGS) /c $?
|
|
||||||
$(OUTDIR)/w32os.obj : w32/w32os.c
|
|
||||||
$(CC) $(CFLAGS) /c $?
|
|
||||||
27
README.Amiga
27
README.Amiga
@@ -1,11 +1,11 @@
|
|||||||
Short: Port of GNU make with SAS/C (no ixemul.library required)
|
Short: Port of GNU Make with SAS/C (no ixemul.library required)
|
||||||
Author: GNU, Amiga port by Aaron "Optimizer" Digulla
|
Author: GNU, Amiga port by Aaron "Optimizer" Digulla
|
||||||
Uploader: Aaron "Optimizer" Digulla (digulla@fh-konstanz.de)
|
Uploader: Aaron "Optimizer" Digulla (digulla@fh-konstanz.de)
|
||||||
Type: dev/c
|
Type: dev/c
|
||||||
|
|
||||||
This is a pure Amiga port of GNU make. It needs no extra libraries or
|
This is a pure Amiga port of GNU Make. It needs no extra libraries or
|
||||||
anything. It has the following features (in addition to any features of
|
anything. It has the following features (in addition to any features of
|
||||||
GNU make):
|
GNU Make):
|
||||||
|
|
||||||
- Runs Amiga-Commands with SystemTags() (Execute)
|
- Runs Amiga-Commands with SystemTags() (Execute)
|
||||||
- Can run multi-line statements
|
- Can run multi-line statements
|
||||||
@@ -42,15 +42,18 @@ place). You have to use "$(wildcard src/*.c)" instead.
|
|||||||
COMPILING FROM SCRATCH
|
COMPILING FROM SCRATCH
|
||||||
----------------------
|
----------------------
|
||||||
|
|
||||||
To recompile, you need SAS/C 6.51. make itself is not necessary, there
|
To recompile, you need SAS/C 6.51.
|
||||||
is an smakefile.
|
|
||||||
|
|
||||||
1. Copy config.ami to config.h
|
As of GNU Make 4.3, the build environment has been cleaned up and alternate
|
||||||
2. If you use make to compile, copy Makefile.ami to Makefile and
|
make files (including smakefiles) have been removed. If you have an existing
|
||||||
glob/Makefile.ami to glob/Makefile. Copy make into the current
|
version of GNU Make available you _should_ be able to run:
|
||||||
directory.
|
|
||||||
|
|
||||||
3. Run smake/make
|
make -f Basic.mk
|
||||||
|
|
||||||
|
However this is untested.
|
||||||
|
|
||||||
|
If you have an Amiga system and would like to collaborate on getting
|
||||||
|
bootstrapping to work properly please contact bug-make@gnu.org.
|
||||||
|
|
||||||
INSTALLATION
|
INSTALLATION
|
||||||
|
|
||||||
@@ -61,7 +64,7 @@ If you plan to use recursive makes, install make resident:
|
|||||||
|
|
||||||
|
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 1995-2016 Free Software Foundation, Inc.
|
Copyright (C) 1995-2022 Free Software Foundation, Inc.
|
||||||
This file is part of GNU Make.
|
This file is part of GNU Make.
|
||||||
|
|
||||||
GNU Make is free software; you can redistribute it and/or modify it under the
|
GNU Make is free software; you can redistribute it and/or modify it under the
|
||||||
@@ -74,4 +77,4 @@ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|||||||
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License along with
|
You should have received a copy of the GNU General Public License along with
|
||||||
this program. If not, see <http://www.gnu.org/licenses/>.
|
this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|||||||
@@ -27,8 +27,8 @@ New (since 3.74) DOS-specific features:
|
|||||||
8. Can be built without (a previous version of) Make.
|
8. Can be built without (a previous version of) Make.
|
||||||
|
|
||||||
9. The build process requires only standard tools. (Optional
|
9. The build process requires only standard tools. (Optional
|
||||||
targets like "install:" and "clean:" still need additional
|
targets like "check:" still need additional programs, though,
|
||||||
programs, though, see below.)
|
see below.)
|
||||||
|
|
||||||
10. Beginning with v3.78, the test suite works in the DJGPP
|
10. Beginning with v3.78, the test suite works in the DJGPP
|
||||||
environment (requires Perl and auxiliary tools; see below).
|
environment (requires Perl and auxiliary tools; see below).
|
||||||
@@ -55,78 +55,34 @@ To build from sources:
|
|||||||
either DJTAR (which is part of the DJGPP development
|
either DJTAR (which is part of the DJGPP development
|
||||||
environment), or the DJGPP port of GNU Tar.
|
environment), or the DJGPP port of GNU Tar.
|
||||||
|
|
||||||
2. Invoke the 'configure.bat' batch file.
|
2. If you have a working Make already, you can run:
|
||||||
|
|
||||||
If you are building Make in-place, i.e. in the same directory
|
make -f Basic.mk
|
||||||
where its sources are kept, just type "configure.bat" and press
|
|
||||||
[Enter]. Otherwise, you need to supply the path to the source
|
|
||||||
directory as an argument to the batch file, like this:
|
|
||||||
|
|
||||||
c:\djgpp\gnu\make-%VERSION%\configure.bat c:/djgpp/gnu/make-%VERSION%
|
3. If you don't have a working Make already you can bootstrap one
|
||||||
|
by running:
|
||||||
|
|
||||||
Note the forward slashes in the source path argument: you MUST
|
.\builddos.bat
|
||||||
use them here.
|
|
||||||
|
|
||||||
3. If configure.bat doesn't find a working Make, it will suggest to
|
4. If you are building from outside of the source directory, you
|
||||||
use the 'dosbuild.bat' batch file to build Make. Either do as it
|
|
||||||
suggests or install another Make program (a pre-compiled binary
|
|
||||||
should be available from the usual DJGPP sites) and rerun
|
|
||||||
configure.bat.
|
|
||||||
|
|
||||||
4. If you will need to run Make on machines without an FPU, you
|
|
||||||
might consider building a version of Make which doesn't issue
|
|
||||||
floating-point instructions (they don't help much on MSDOS
|
|
||||||
anyway). To this end, edit the Makefile created by
|
|
||||||
configure.bat and add -DNO_FLOAT to the value of CPPFLAGS.
|
|
||||||
|
|
||||||
5. Invoke Make.
|
|
||||||
|
|
||||||
If you are building from outside of the source directory, you
|
|
||||||
need to tell Make where the sources are, like this:
|
need to tell Make where the sources are, like this:
|
||||||
|
|
||||||
make srcdir=c:/djgpp/gnu/make-%VERSION%
|
make -f c:/djgpp/gnu/make/Basic.mk SRCDIR=c:/djgpp/gnu/make
|
||||||
|
|
||||||
(configure.bat will tell you this when it finishes). You MUST
|
or:
|
||||||
use a full, not relative, name of the source directory here, or
|
|
||||||
else Make might fail.
|
|
||||||
|
|
||||||
6. After Make finishes, if you have a Unix-style shell installed,
|
c:/djgpp/gnu/make/builddos.bat c:/djgpp/gnu/make
|
||||||
you can use the 'install' target to install the package. You
|
|
||||||
will also need GNU Fileutils and GNU Sed for this (they should
|
|
||||||
be available from the DJGPP sites).
|
|
||||||
|
|
||||||
By default, GNU make will install into your DJGPP installation
|
5. To run the test suite, type "make check". This requires a Unix
|
||||||
area. If you wish to use a different directory, override the
|
|
||||||
DESTDIR variable when invoking "make install", like this:
|
|
||||||
|
|
||||||
make install DESTDIR=c:/other/dir
|
|
||||||
|
|
||||||
This causes the make executable to be placed in c:/other/dir/bin,
|
|
||||||
the man pages in c:/other/dir/man, etc.
|
|
||||||
|
|
||||||
Without a Unix-style shell, you will have to install programs
|
|
||||||
and the docs manually. Copy make.exe to a directory on your
|
|
||||||
PATH, make.i* info files to your Info directory, and update the
|
|
||||||
file 'dir' in your Info directory by adding the following item
|
|
||||||
to the main menu:
|
|
||||||
|
|
||||||
* Make: (make.info). The GNU make utility.
|
|
||||||
|
|
||||||
If you have the 'install-info' program (from the GNU Texinfo
|
|
||||||
package), it will do that for you if you invoke it like this:
|
|
||||||
|
|
||||||
install-info --info-dir=c:/djgpp/info c:/djgpp/info/make.info
|
|
||||||
|
|
||||||
(If your Info directory is other than C:\DJGPP\INFO, change this
|
|
||||||
command accordingly.)
|
|
||||||
|
|
||||||
7. The 'clean' targets also require Unix-style shell, and GNU Sed
|
|
||||||
and 'rm' programs (the latter from Fileutils).
|
|
||||||
|
|
||||||
8. To run the test suite, type "make check". This requires a Unix
|
|
||||||
shell (I used the DJGPP port of Bash 2.03), Perl, Sed, Fileutils
|
shell (I used the DJGPP port of Bash 2.03), Perl, Sed, Fileutils
|
||||||
and Sh-utils.
|
and Sh-utils.
|
||||||
|
|
||||||
|
6. To install copy make.exe to the preferred location.
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
|
||||||
Notes:
|
Notes:
|
||||||
-----
|
-----
|
||||||
@@ -324,7 +280,7 @@ Bug reports:
|
|||||||
|
|
||||||
|
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 1996-2016 Free Software Foundation, Inc.
|
Copyright (C) 1996-2022 Free Software Foundation, Inc.
|
||||||
This file is part of GNU Make.
|
This file is part of GNU Make.
|
||||||
|
|
||||||
GNU Make is free software; you can redistribute it and/or modify it under the
|
GNU Make is free software; you can redistribute it and/or modify it under the
|
||||||
@@ -337,4 +293,4 @@ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|||||||
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License along with
|
You should have received a copy of the GNU General Public License along with
|
||||||
this program. If not, see <http://www.gnu.org/licenses/>.
|
this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
Port of GNU make to OS/2.
|
Port of GNU Make to OS/2.
|
||||||
|
|
||||||
Features of GNU make that do not work under OS/2:
|
Features of GNU Make that do not work under OS/2:
|
||||||
- remote job execution
|
- remote job execution
|
||||||
- dynamic load balancing
|
- dynamic load balancing
|
||||||
|
|
||||||
@@ -9,7 +9,7 @@ Special features of the OS/2 version:
|
|||||||
|
|
||||||
Due to the fact that some people might want to use sh syntax in
|
Due to the fact that some people might want to use sh syntax in
|
||||||
Makefiles while others might want to use OS/2's native shell cmd.exe,
|
Makefiles while others might want to use OS/2's native shell cmd.exe,
|
||||||
GNU make supports both shell types. The following list defines the order
|
GNU Make supports both shell types. The following list defines the order
|
||||||
that is used to determine the shell:
|
that is used to determine the shell:
|
||||||
|
|
||||||
1. The shell specified by the environment variable MAKESHELL.
|
1. The shell specified by the environment variable MAKESHELL.
|
||||||
@@ -37,7 +37,7 @@ I. ***** SPECIAL OPTIONS *****
|
|||||||
cmd or by specifying SHELL=cmd in your Makefile.
|
cmd or by specifying SHELL=cmd in your Makefile.
|
||||||
|
|
||||||
- At compile time you can set CPPFLAGS="-DNO_CHDIR2" to turn off that
|
- At compile time you can set CPPFLAGS="-DNO_CHDIR2" to turn off that
|
||||||
GNU make prints drive letters. This is necessary if you want to run
|
GNU Make prints drive letters. This is necessary if you want to run
|
||||||
the testsuite.
|
the testsuite.
|
||||||
|
|
||||||
|
|
||||||
@@ -49,7 +49,7 @@ A standard Unix like build environment:
|
|||||||
release 2)
|
release 2)
|
||||||
If you use pdksh it is recommended to update to 5.2.14 release 2. Older
|
If you use pdksh it is recommended to update to 5.2.14 release 2. Older
|
||||||
versions may not work! You can get this version at
|
versions may not work! You can get this version at
|
||||||
http://www.math.ohio-state.edu/~ilya/software/os2/pdksh-5.2.14-bin-2.zip
|
https://www.math.ohio-state.edu/~ilya/software/os2/pdksh-5.2.14-bin-2.zip
|
||||||
- GNU file utilities (make sure that install.exe from the file utilities
|
- GNU file utilities (make sure that install.exe from the file utilities
|
||||||
is in front of your PATH before X:\OS2\INSTALL\INSTALL.EXE. I recommend
|
is in front of your PATH before X:\OS2\INSTALL\INSTALL.EXE. I recommend
|
||||||
also to change the filename to ginstall.exe instead of install.exe
|
also to change the filename to ginstall.exe instead of install.exe
|
||||||
@@ -59,7 +59,7 @@ A standard Unix like build environment:
|
|||||||
- gawk
|
- gawk
|
||||||
- grep
|
- grep
|
||||||
- sed
|
- sed
|
||||||
- GNU make 3.79.1 (special OS/2 patched version) or higher
|
- GNU Make 3.79.1 (special OS/2 patched version) or higher
|
||||||
- perl 5.005 or higher
|
- perl 5.005 or higher
|
||||||
- GNU texinfo (you can use 3.1 (gnuinfo.zip), but I recommend 4.0)
|
- GNU texinfo (you can use 3.1 (gnuinfo.zip), but I recommend 4.0)
|
||||||
|
|
||||||
@@ -105,15 +105,15 @@ Note: You can add -DNO_CMD_DEFAULT and -DNO_CHDIR2 to CPPFLAGS.
|
|||||||
|
|
||||||
IV. ***** NLS support *****
|
IV. ***** NLS support *****
|
||||||
|
|
||||||
GNU make has NLS (National Language Support), with the following
|
GNU Make has NLS (National Language Support), with the following
|
||||||
caveats:
|
caveats:
|
||||||
|
|
||||||
a) It will only work with GNU gettext, and
|
a) It will only work with GNU gettext, and
|
||||||
b) GNU gettext support is not included in the GNU make package.
|
b) GNU gettext support is not included in the GNU Make package.
|
||||||
|
|
||||||
Therefore, if you wish to enable the internationalization features of
|
Therefore, if you wish to enable the internationalization features of
|
||||||
GNU make you must install GNU gettext on your system before configuring
|
GNU Make you must install GNU gettext on your system before configuring
|
||||||
GNU make.
|
GNU Make.
|
||||||
|
|
||||||
You can choose the languages to be installed. To install support for
|
You can choose the languages to be installed. To install support for
|
||||||
English, German and French only enter:
|
English, German and French only enter:
|
||||||
@@ -138,7 +138,7 @@ testsuite itself. -DNO_CMD_DEFAULT causes make to use /bin/sh as default
|
|||||||
shell in every case. Normally you could simply set MAKESHELL="/bin/sh"
|
shell in every case. Normally you could simply set MAKESHELL="/bin/sh"
|
||||||
to do this but the testsuite ignores the environment. -DNO_CHDIR2 causes
|
to do this but the testsuite ignores the environment. -DNO_CHDIR2 causes
|
||||||
make not to use drive letters for directory names (i.e. _chdir2() and
|
make not to use drive letters for directory names (i.e. _chdir2() and
|
||||||
_getcwd2() are NOT used). The testsuite interpretes the whole output of
|
_getcwd2() are NOT used). The testsuite interprets the whole output of
|
||||||
make, especially statements like make[1]: Entering directory
|
make, especially statements like make[1]: Entering directory
|
||||||
'C:/somewhere/make-3.79.1/tests' where the testsuite does not expect the
|
'C:/somewhere/make-3.79.1/tests' where the testsuite does not expect the
|
||||||
drive letter. This would be interpreted as an error even if there is
|
drive letter. This would be interpreted as an error even if there is
|
||||||
@@ -160,7 +160,7 @@ from the make source tree.
|
|||||||
|
|
||||||
|
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2003-2016 Free Software Foundation, Inc.
|
Copyright (C) 2003-2022 Free Software Foundation, Inc.
|
||||||
This file is part of GNU Make.
|
This file is part of GNU Make.
|
||||||
|
|
||||||
GNU Make is free software; you can redistribute it and/or modify it under the
|
GNU Make is free software; you can redistribute it and/or modify it under the
|
||||||
@@ -173,4 +173,4 @@ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|||||||
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License along with
|
You should have received a copy of the GNU General Public License along with
|
||||||
this program. If not, see <http://www.gnu.org/licenses/>.
|
this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
90
README.VMS
90
README.VMS
@@ -1,7 +1,7 @@
|
|||||||
Overview: -*-text-mode-*-
|
Overview: -*-text-mode-*-
|
||||||
---------
|
---------
|
||||||
|
|
||||||
This version of GNU make has been tested on:
|
This version of GNU Make has been tested on:
|
||||||
OpenVMS V8.3/V8.4 (Alpha) and V8.4 (Integrity) AND V7.3 (VAX)
|
OpenVMS V8.3/V8.4 (Alpha) and V8.4 (Integrity) AND V7.3 (VAX)
|
||||||
|
|
||||||
This version of GNU Make is intended to be run from DCL to run
|
This version of GNU Make is intended to be run from DCL to run
|
||||||
@@ -11,10 +11,10 @@ Overview: -*-text-mode-*-
|
|||||||
There is an older implementation of GNU Make that was ported to GNV.
|
There is an older implementation of GNU Make that was ported to GNV.
|
||||||
Work is now in progress to merge that port to get a single version
|
Work is now in progress to merge that port to get a single version
|
||||||
of GNU Make available. When that merge is done, GNU Make will auto
|
of GNU Make available. When that merge is done, GNU Make will auto
|
||||||
detect that it is running under a Posix shell and then operate as close to
|
detect that it is running under a POSIX shell and then operate as close to
|
||||||
GNU Make on Unix as possible.
|
GNU Make on Unix as possible.
|
||||||
|
|
||||||
The descriptions below are for running GNU make from DCL or equivalent.
|
The descriptions below are for running GNU Make from DCL or equivalent.
|
||||||
|
|
||||||
Recipe differences:
|
Recipe differences:
|
||||||
-------------------
|
-------------------
|
||||||
@@ -62,15 +62,15 @@ Recipe differences:
|
|||||||
enabled if the GNU Make is set to the older behavior.
|
enabled if the GNU Make is set to the older behavior.
|
||||||
|
|
||||||
The name GNV$MAKE_SHELL_SIM when enabled will cause GNU Make to try to
|
The name GNV$MAKE_SHELL_SIM when enabled will cause GNU Make to try to
|
||||||
simulate a Posix shell more closely. The following behaviors occur:
|
simulate a POSIX shell more closely. The following behaviors occur:
|
||||||
|
|
||||||
* Single quotes are converted to double quotes and any double
|
* Single quotes are converted to double quotes and any double
|
||||||
quotes inside of them are doubled. No environment variable expansion
|
quotes inside of them are doubled. No environment variable expansion
|
||||||
is simulated.
|
is simulated.
|
||||||
* A exit command status will be converted to a Posix Exit
|
* A exit command status will be converted to a POSIX Exit
|
||||||
where 0 is success and non-zero is failure.
|
where 0 is success and non-zero is failure.
|
||||||
* The $ character will cause environment variable expansion.
|
* The $ character will cause environment variable expansion.
|
||||||
* Environent variables can be set on the command line before a command.
|
* Environment variables can be set on the command line before a command.
|
||||||
|
|
||||||
VMS generally uses logical name search lists instead of path variables
|
VMS generally uses logical name search lists instead of path variables
|
||||||
where the resolution is handled by VMS independent of the program. Which
|
where the resolution is handled by VMS independent of the program. Which
|
||||||
@@ -84,11 +84,11 @@ Recipe differences:
|
|||||||
|
|
||||||
The format for recipes are a combination of Unix macros, a subset of
|
The format for recipes are a combination of Unix macros, a subset of
|
||||||
simulated UNIX commands, some shell emulation, and OpenVMS commands.
|
simulated UNIX commands, some shell emulation, and OpenVMS commands.
|
||||||
This makes the resulting makefiles unique to the OpenVMS port of GNU make.
|
This makes the resulting makefiles unique to the OpenVMS port of GNU Make.
|
||||||
|
|
||||||
If you are creating a OpenVMS specific makefile from scratch, you should also
|
If you are creating a OpenVMS specific makefile from scratch, you should also
|
||||||
look at MMK (Madgoat Make) available at https://github.com/endlesssoftware/mmk
|
look at MMK (Madgoat Make) available at https://github.com/endlesssoftware/mmk
|
||||||
MMK uses full OpenVMS syntax and a persistent subprocess is used for the
|
MMK uses full OpenVMS syntax and a persistent sub-process is used for the
|
||||||
recipe lines, allowing multiple line rules.
|
recipe lines, allowing multiple line rules.
|
||||||
|
|
||||||
The default makefile search order is "makefile.vms", "gnumakefile",
|
The default makefile search order is "makefile.vms", "gnumakefile",
|
||||||
@@ -177,7 +177,7 @@ Recipe differences:
|
|||||||
Since the OpenVMS utilities generally expect OpenVMS format paths, you will
|
Since the OpenVMS utilities generally expect OpenVMS format paths, you will
|
||||||
usually have to use OpenVMS format paths for rules and targets.
|
usually have to use OpenVMS format paths for rules and targets.
|
||||||
BUG: Relative OpenVMS paths may not work in targets, especially combined
|
BUG: Relative OpenVMS paths may not work in targets, especially combined
|
||||||
with vpaths. This is because GNU make will just concatenate the directories
|
with vpaths. This is because GNU Make will just concatenate the directories
|
||||||
as it does on Unix.
|
as it does on Unix.
|
||||||
|
|
||||||
The variables $^ and $@ separate files with commas instead of spaces.
|
The variables $^ and $@ separate files with commas instead of spaces.
|
||||||
@@ -207,15 +207,15 @@ foo: $(addsuffix .3,$(subs $(comma),$(space),$^)
|
|||||||
override OpenVMS symbols/logicals.
|
override OpenVMS symbols/logicals.
|
||||||
|
|
||||||
OpenVMS logical and symbols names show up as "environment" using the
|
OpenVMS logical and symbols names show up as "environment" using the
|
||||||
origin function. when the "-e" option is specified, the origion function
|
origin function. when the "-e" option is specified, the origin function
|
||||||
shows them as "environment override". On Posix the test scripts indicate
|
shows them as "environment override". On POSIX the test scripts indicate
|
||||||
that they should show up just as "environment".
|
that they should show up just as "environment".
|
||||||
|
|
||||||
When GNU make reads in a symbol or logical name into the environment, it
|
When GNU Make reads in a symbol or logical name into the environment, it
|
||||||
converts any dollar signs found to double dollar signs for convenience in
|
converts any dollar signs found to double dollar signs for convenience in
|
||||||
using DCL symbols and logical names in recipes. When GNU make exports a
|
using DCL symbols and logical names in recipes. When GNU Make exports a
|
||||||
DCL symbol for a child process, if the first dollar sign found is followed
|
DCL symbol for a child process, if the first dollar sign found is followed
|
||||||
by second dollar sign, then all double dollar signs will be convirted to
|
by second dollar sign, then all double dollar signs will be converted to
|
||||||
single dollar signs.
|
single dollar signs.
|
||||||
|
|
||||||
The variable $(ARCH) is predefined as IA64, ALPHA or VAX respectively.
|
The variable $(ARCH) is predefined as IA64, ALPHA or VAX respectively.
|
||||||
@@ -233,17 +233,17 @@ endif
|
|||||||
|
|
||||||
Empty commands are handled correctly and don't end in a new DCL process.
|
Empty commands are handled correctly and don't end in a new DCL process.
|
||||||
|
|
||||||
The exit command needs to have OpenVMS exit codes. To pass a Posix code
|
The exit command needs to have OpenVMS exit codes. To pass a POSIX code
|
||||||
back to the make script, you need to encode it by multiplying it by 8
|
back to the make script, you need to encode it by multiplying it by 8
|
||||||
and then adding %x1035a002 for a failure code and %x1035a001 for a
|
and then adding %x1035a002 for a failure code and %x1035a001 for a
|
||||||
success. Make will interpret any posix code other than 0 as a failure.
|
success. Make will interpret any POSIX code other than 0 as a failure.
|
||||||
TODO: Add an option have simulate Posix exit commands in recipes.
|
TODO: Add an option have simulate POSIX exit commands in recipes.
|
||||||
|
|
||||||
Lexical functions can be used in pipes to simulate shell file test rules.
|
Lexical functions can be used in pipes to simulate shell file test rules.
|
||||||
|
|
||||||
Example:
|
Example:
|
||||||
|
|
||||||
Posix:
|
POSIX:
|
||||||
b : c ; [ -f $@ ] || echo >> $@
|
b : c ; [ -f $@ ] || echo >> $@
|
||||||
|
|
||||||
OpenVMS:
|
OpenVMS:
|
||||||
@@ -261,16 +261,16 @@ x = %x1035a00a
|
|||||||
|
|
||||||
Runtime issues:
|
Runtime issues:
|
||||||
|
|
||||||
The OpenVMS C Runtime has a convention for encoding a Posix exit status into
|
The OpenVMS C Runtime has a convention for encoding a POSIX exit status into
|
||||||
to OpenVMS exit codes. These status codes will have the hex value of
|
to OpenVMS exit codes. These status codes will have the hex value of
|
||||||
0x35a000. OpenVMS exit code may also have a hex value of %x10000000 set on
|
0x35a000. OpenVMS exit code may also have a hex value of %x10000000 set on
|
||||||
them. This is a flag to tell DCL not to write out the exit code.
|
them. This is a flag to tell DCL not to write out the exit code.
|
||||||
|
|
||||||
To convert an OpenVMS encoded Posix exit status code to the original code
|
To convert an OpenVMS encoded POSIX exit status code to the original code
|
||||||
You subtract %x35a000 and any flags from the OpenVMS code and divide it by 8.
|
You subtract %x35a000 and any flags from the OpenVMS code and divide it by 8.
|
||||||
|
|
||||||
WARNING: Backward-incompatibility!
|
WARNING: Backward-incompatibility!
|
||||||
The make program exit now returns the same encoded Posix exit code as on
|
The make program exit now returns the same encoded POSIX exit code as on
|
||||||
Unix. Previous versions returned the OpenVMS exit status code if that is what
|
Unix. Previous versions returned the OpenVMS exit status code if that is what
|
||||||
caused the recipe to fail.
|
caused the recipe to fail.
|
||||||
TODO: Provide a way for scripts calling make to obtain that OpenVMS status
|
TODO: Provide a way for scripts calling make to obtain that OpenVMS status
|
||||||
@@ -280,11 +280,11 @@ Runtime issues:
|
|||||||
will have the error "-E-" severity set on exit.
|
will have the error "-E-" severity set on exit.
|
||||||
|
|
||||||
MAKE_TROUBLE is returned only if the option "-q" or "--question" is used and
|
MAKE_TROUBLE is returned only if the option "-q" or "--question" is used and
|
||||||
has a Posix value of 1 and an OpenVMS status of %x1035a00a.
|
has a POSIX value of 1 and an OpenVMS status of %x1035a00a.
|
||||||
|
|
||||||
MAKE_FAILURE has a Posix value of 2 and an OpenVMS status of %x1035a012.
|
MAKE_FAILURE has a POSIX value of 2 and an OpenVMS status of %x1035a012.
|
||||||
|
|
||||||
Output from GNU make may have single quotes around some values where on
|
Output from GNU Make may have single quotes around some values where on
|
||||||
other platforms it does not. Also output that would be in double quotes
|
other platforms it does not. Also output that would be in double quotes
|
||||||
on some platforms may show up as single quotes on VMS.
|
on some platforms may show up as single quotes on VMS.
|
||||||
|
|
||||||
@@ -294,10 +294,10 @@ Runtime issues:
|
|||||||
There may be a "Waiting for unfinished jobs..." show up in the output.
|
There may be a "Waiting for unfinished jobs..." show up in the output.
|
||||||
|
|
||||||
Error messages generated by Make or Unix utilities may slightly vary from
|
Error messages generated by Make or Unix utilities may slightly vary from
|
||||||
Posix platforms. Typically the case may be different.
|
POSIX platforms. Typically the case may be different.
|
||||||
|
|
||||||
When make deletes files, on posix platforms it writes out 'rm' and the list
|
When make deletes files, on POSIX platforms it writes out 'rm' and the list
|
||||||
of files. On VMS, only the files are writen out, one per line.
|
of files. On VMS, only the files are written out, one per line.
|
||||||
TODO: VMS
|
TODO: VMS
|
||||||
|
|
||||||
There may be extra leading white space or additional or missing whitespace
|
There may be extra leading white space or additional or missing whitespace
|
||||||
@@ -323,15 +323,15 @@ Runtime issues:
|
|||||||
to override this in your makefile, or whatever).
|
to override this in your makefile, or whatever).
|
||||||
|
|
||||||
|
|
||||||
Unix compatibilty features:
|
Unix compatibility features:
|
||||||
---------------------------
|
----------------------------
|
||||||
|
|
||||||
If the command 'echo' is seen, any single quotes on the line will be
|
If the command 'echo' is seen, any single quotes on the line will be
|
||||||
converted to double quotes.
|
converted to double quotes.
|
||||||
|
|
||||||
The variable $(CD) is implemented as a built in Change Directory
|
The variable $(CD) is implemented as a built in Change Directory
|
||||||
command. This invokes the 'builtin_cd' Executing a 'set default'
|
command. This invokes the 'builtin_cd' Executing a 'set default'
|
||||||
recipe doesn't do the trick, since it only affects the subprocess
|
recipe doesn't do the trick, since it only affects the sub-process
|
||||||
spawned for that command.
|
spawned for that command.
|
||||||
|
|
||||||
The 'builtin_cd' is generally expected to be on its own line.
|
The 'builtin_cd' is generally expected to be on its own line.
|
||||||
@@ -347,13 +347,13 @@ Unix compatibilty features:
|
|||||||
Unix shell style I/O redirection is supported. You can now write lines like:
|
Unix shell style I/O redirection is supported. You can now write lines like:
|
||||||
"<tab>mcr sys$disk:[]program.exe < input.txt > output.txt &> error.txt"
|
"<tab>mcr sys$disk:[]program.exe < input.txt > output.txt &> error.txt"
|
||||||
|
|
||||||
Posix shells have ":" as a null command. These are now handled.
|
POSIX shells have ":" as a null command. These are now handled.
|
||||||
https://savannah.gnu.org/bugs/index.php?41761
|
https://savannah.gnu.org/bugs/index.php?41761
|
||||||
|
|
||||||
A note on appending the redirected output. A simple mechanism is
|
A note on appending the redirected output. A simple mechanism is
|
||||||
implemented to make ">>" work in action lines. In OpenVMS there is no simple
|
implemented to make ">>" work in action lines. In OpenVMS there is no simple
|
||||||
feature like ">>" to have DCL command or program output redirected and
|
feature like ">>" to have DCL command or program output redirected and
|
||||||
appended to a file. GNU make for OpenVMS implements the redirection
|
appended to a file. GNU Make for OpenVMS implements the redirection
|
||||||
of ">>" by using a command procedure.
|
of ">>" by using a command procedure.
|
||||||
|
|
||||||
The current algorithm creates the output file if it does not exist and
|
The current algorithm creates the output file if it does not exist and
|
||||||
@@ -367,10 +367,10 @@ Unix compatibilty features:
|
|||||||
The older implementation wrote the output to a temporary file in
|
The older implementation wrote the output to a temporary file in
|
||||||
in sys$scratch: and then attempted to append the file to the existing file.
|
in sys$scratch: and then attempted to append the file to the existing file.
|
||||||
The temporary file names looked like "CMDxxxxx.". Any time the created
|
The temporary file names looked like "CMDxxxxx.". Any time the created
|
||||||
command procedure can not complete, this happens. Pressing Ctrl+Y to
|
command procedure can not complete, this happens. Pressing CTRL+Y to
|
||||||
abort make is one case.
|
abort make is one case.
|
||||||
|
|
||||||
In case of Ctrl+Y the associated command procedure is left in SYS$SCRATCH:.
|
In case of CTRL+Y the associated command procedure is left in SYS$SCRATCH:.
|
||||||
The command procedures will be named gnv$make_cmd*.com.
|
The command procedures will be named gnv$make_cmd*.com.
|
||||||
|
|
||||||
The CtrlY handler now uses $delprc to delete all children. This way also
|
The CtrlY handler now uses $delprc to delete all children. This way also
|
||||||
@@ -378,12 +378,12 @@ Unix compatibilty features:
|
|||||||
then sends SIGQUIT to itself, which is handled in common code.
|
then sends SIGQUIT to itself, which is handled in common code.
|
||||||
|
|
||||||
Temporary command files are now deleted in the OpenVMS child termination
|
Temporary command files are now deleted in the OpenVMS child termination
|
||||||
handler. That deletes them even if a Ctrl+C was pressed.
|
handler. That deletes them even if a CTRL+C was pressed.
|
||||||
TODO: Does the previous section about >> leaving files still apply?
|
TODO: Does the previous section about >> leaving files still apply?
|
||||||
|
|
||||||
The behavior of pressing Ctrl+C is not changed. It still has only an effect,
|
The behavior of pressing CTRL+C is not changed. It still has only an effect,
|
||||||
after the current action is terminated. If that doesn't happen or takes too
|
after the current action is terminated. If that doesn't happen or takes too
|
||||||
long, Ctrl+Y should be used instead.
|
long, CTRL+Y should be used instead.
|
||||||
|
|
||||||
|
|
||||||
Build Options:
|
Build Options:
|
||||||
@@ -409,7 +409,7 @@ Unimplemented functionality:
|
|||||||
The new feature "Loadable objects" is not yet supported. If you need it,
|
The new feature "Loadable objects" is not yet supported. If you need it,
|
||||||
please send a change request or submit a bug report.
|
please send a change request or submit a bug report.
|
||||||
|
|
||||||
The new option --output-sync (-O) is accepted but has no effect: GNU make
|
The new option --output-sync (-O) is accepted but has no effect: GNU Make
|
||||||
for OpenVMS does not support running multiple commands simultaneously.
|
for OpenVMS does not support running multiple commands simultaneously.
|
||||||
|
|
||||||
|
|
||||||
@@ -421,8 +421,8 @@ Self test failures and todos:
|
|||||||
Need to find a way to set the VMS features before running make as a
|
Need to find a way to set the VMS features before running make as a
|
||||||
child.
|
child.
|
||||||
|
|
||||||
GNU make was not currently translating the OpenVMS encoded POSIX values
|
GNU Make was not currently translating the OpenVMS encoded POSIX values
|
||||||
returned to it back to the Posix values. I have temporarily modified the
|
returned to it back to the POSIX values. I have temporarily modified the
|
||||||
Perl test script to compensate for it. This should be being handled
|
Perl test script to compensate for it. This should be being handled
|
||||||
internally to Make.
|
internally to Make.
|
||||||
TODO: Verify and update the Perl test script.
|
TODO: Verify and update the Perl test script.
|
||||||
@@ -435,7 +435,7 @@ Self test failures and todos:
|
|||||||
Symlink support is not present. Symlinks are supported by OpenVMS 8.3 and
|
Symlink support is not present. Symlinks are supported by OpenVMS 8.3 and
|
||||||
later.
|
later.
|
||||||
|
|
||||||
Error messages should be supressed with the "-" at the beginning of a line.
|
Error messages should be suppressed with the "-" at the beginning of a line.
|
||||||
On openVMS they were showing up. TODO: Is this still an issue?
|
On openVMS they were showing up. TODO: Is this still an issue?
|
||||||
|
|
||||||
The internal vmsify and unixify OpenVMS to/from UNIX are not handling logical
|
The internal vmsify and unixify OpenVMS to/from UNIX are not handling logical
|
||||||
@@ -443,7 +443,7 @@ Self test failures and todos:
|
|||||||
|
|
||||||
|
|
||||||
Build instructions:
|
Build instructions:
|
||||||
------------------
|
-------------------
|
||||||
|
|
||||||
Don't use the HP C V7.2-001 compiler, which has an incompatible change
|
Don't use the HP C V7.2-001 compiler, which has an incompatible change
|
||||||
how __STDC__ is defined. This results at least in compile time warnings.
|
how __STDC__ is defined. This results at least in compile time warnings.
|
||||||
@@ -478,7 +478,7 @@ Running the tests:
|
|||||||
https://sourceforge.net/projects/gnv/files/
|
https://sourceforge.net/projects/gnv/files/
|
||||||
|
|
||||||
As the test scripts need to create some foreign commands that persist
|
As the test scripts need to create some foreign commands that persist
|
||||||
after the test is run, it is recommend that either you use a subprocess or
|
after the test is run, it is recommend that either you use a sub-process or
|
||||||
a dedicated login to run the tests.
|
a dedicated login to run the tests.
|
||||||
|
|
||||||
To get detailed information for running the tests:
|
To get detailed information for running the tests:
|
||||||
@@ -499,12 +499,12 @@ Running the tests:
|
|||||||
$ perl run_make_tests.pl
|
$ perl run_make_tests.pl
|
||||||
|
|
||||||
|
|
||||||
Acknowlegements:
|
Acknowledgments:
|
||||||
----------------
|
----------------
|
||||||
|
|
||||||
See NEWS. for details of past changes.
|
See NEWS. for details of past changes.
|
||||||
|
|
||||||
These are the currently known contributers to this port.
|
These are the currently known contributors to this port.
|
||||||
|
|
||||||
Hartmut Becker
|
Hartmut Becker
|
||||||
John Malmberg
|
John Malmberg
|
||||||
|
|||||||
@@ -1,22 +1,21 @@
|
|||||||
This version of GNU make has been tested on:
|
This version of GNU Make has been tested on:
|
||||||
Microsoft Windows 2000/XP/2003/Vista/7/8/10
|
Microsoft Windows 2000/XP/2003/Vista/7/8/10
|
||||||
It has also been used on Windows 95/98/NT, and on OS/2.
|
It has also been used on Windows 95/98/NT, and on OS/2.
|
||||||
|
|
||||||
It builds with the MinGW port of GCC (tested with GCC 3.4.2, 4.8.1,
|
It builds with the MinGW port of GCC (tested with GCC 3.4.2, 4.8.1,
|
||||||
and 4.9.3).
|
and 4.9.3).
|
||||||
|
|
||||||
It also builds with MSVC 2.x, 4.x, 5.x, 6.x, 2003, and 14 (2015) as
|
It also builds with MSVC 2.x, 4.x, 5.x, 6.x, 2005, 2008, 2010, 2012,
|
||||||
well as with .NET 7.x and .NET 2003.
|
2013, and 2015 as well as with .NET 7.x and .NET 2003.
|
||||||
|
|
||||||
As of version 4.0, a build with Guile is supported (tested with Guile
|
Building with Guile is supported (tested with Guile 2.0.x). To build
|
||||||
2.0.3). To build with Guile, you will need, in addition to Guile
|
with Guile, you will need, in addition to Guile itself, its dependency
|
||||||
itself, its dependency libraries and the pkg-config program. The
|
libraries and the pkg-config program. The latter is used to figure out
|
||||||
latter is used to figure out which compilation and link switches and
|
which compilation and link switches and libraries need to be mentioned
|
||||||
libraries need to be mentioned on the compiler command lines to
|
on the compiler command lines to correctly link with Guile. A Windows
|
||||||
correctly link with Guile. A Windows port of pkg-config can be found
|
port of pkg-config can be found on ezwinports site:
|
||||||
on ezwinports site:
|
|
||||||
|
|
||||||
http://sourceforge.net/projects/ezwinports/
|
https://sourceforge.net/projects/ezwinports/
|
||||||
|
|
||||||
The libraries on which Guile depends can vary depending on your
|
The libraries on which Guile depends can vary depending on your
|
||||||
version and build of Guile. At the very least, the Boehm's GC library
|
version and build of Guile. At the very least, the Boehm's GC library
|
||||||
@@ -26,7 +25,7 @@ also provide you with these dependencies or a URL where to download
|
|||||||
them. A precompiled 32-bit Windows build of Guile is available from
|
them. A precompiled 32-bit Windows build of Guile is available from
|
||||||
the ezwinports site mentioned above.
|
the ezwinports site mentioned above.
|
||||||
|
|
||||||
The Windows port of GNU make is maintained jointly by various people.
|
The Windows port of GNU Make is maintained jointly by various people.
|
||||||
It was originally made by Rob Tulloh.
|
It was originally made by Rob Tulloh.
|
||||||
It is currently maintained by Eli Zaretskii.
|
It is currently maintained by Eli Zaretskii.
|
||||||
|
|
||||||
@@ -34,20 +33,14 @@ It is currently maintained by Eli Zaretskii.
|
|||||||
Do this first, regardless of the build method you choose:
|
Do this first, regardless of the build method you choose:
|
||||||
---------------------------------------------------------
|
---------------------------------------------------------
|
||||||
|
|
||||||
1. Edit config.h.W32 to your liking (especially the few shell-related
|
1. If you have special requirements, edit config.h.W32 to your liking
|
||||||
defines near the end, or HAVE_CASE_INSENSITIVE_FS which corresponds
|
(especially the shell-related defines, or HAVE_CASE_INSENSITIVE_FS which
|
||||||
to './configure --enable-case-insensitive-file-system'). (We don't
|
corresponds to './configure --enable-case-insensitive-file-system'). We
|
||||||
recommend to define HAVE_CASE_INSENSITIVE_FS, but you may wish to
|
don't recommend to define HAVE_CASE_INSENSITIVE_FS, but you may wish to
|
||||||
consider that if you have a lot of files whose names are in upper
|
consider that if you have a lot of files whose names are in upper case,
|
||||||
case, while Makefile rules are written for lower-case versions.)
|
while Makefile rules are written for lower-case versions.
|
||||||
|
|
||||||
|
If you don't have special requirements no changes are needed.
|
||||||
Using make_msvc_net2003.vcproj
|
|
||||||
------------------------------
|
|
||||||
|
|
||||||
2. Open make_msvc_net2003.vcproj in MSVS71 or MSVC71 or any compatible IDE,
|
|
||||||
then build this project as usual. There's also a solution file for
|
|
||||||
Studio 2003.
|
|
||||||
|
|
||||||
|
|
||||||
Building with (MinGW-)GCC using build_w32.bat
|
Building with (MinGW-)GCC using build_w32.bat
|
||||||
@@ -56,51 +49,116 @@ Building with (MinGW-)GCC using build_w32.bat
|
|||||||
2. Open a W32 command prompt for your installed (MinGW-)GCC, setup a
|
2. Open a W32 command prompt for your installed (MinGW-)GCC, setup a
|
||||||
correct PATH and other environment variables for it, then execute ...
|
correct PATH and other environment variables for it, then execute ...
|
||||||
|
|
||||||
build_w32.bat gcc
|
.\build_w32.bat gcc
|
||||||
|
|
||||||
This produces gnumake.exe in the GccRel directory.
|
This produces gnumake.exe in the GccRel directory.
|
||||||
If you want a version of GNU make built with debugging enabled,
|
|
||||||
add the --debug option.
|
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
|
The batch file will probe for Guile installation, and will build
|
||||||
gnumake.exe with Guile if it finds it. If you have Guile
|
gnumake.exe with Guile if it finds it. If you have Guile
|
||||||
installed, but want to build Make without Guile support, type
|
installed, but want to build Make without Guile support, type
|
||||||
|
|
||||||
build_w32.bat --without-guile gcc
|
.\build_w32.bat --without-guile gcc
|
||||||
|
|
||||||
|
|
||||||
Building with (MSVC++-)cl using build_w32.bat or NMakefile
|
Building with (MSVC++-)cl using build_w32.bat
|
||||||
----------------------------------------------------------
|
---------------------------------------------
|
||||||
|
|
||||||
2. Open a W32 command prompt for your installed (MSVC++-)cl, setup a
|
2. Open a command shell, then execute ...
|
||||||
correct PATH and other environment variables for it (usually via
|
|
||||||
executing vcvars32.bat or vsvars32.bat from the cl-installation,
|
|
||||||
e.g. "%VS71COMNTOOLS%vsvars32.bat"; or using a corresponding start
|
|
||||||
menue entry from the cl-installation), then execute EITHER ...
|
|
||||||
|
|
||||||
build_w32.bat
|
.\build_w32.bat
|
||||||
|
|
||||||
This produces gnumake.exe in the WinRel directory.
|
This produces a 64bit Release build of gnumake.exe in .\WinRel, using
|
||||||
If you want a version of GNU make built with debugging enabled,
|
the compiler found on the %Path%. If no compiler is found, the batch
|
||||||
add the --debug option.
|
file will probe your system and choose the newest MSVC version it can
|
||||||
|
find.
|
||||||
|
|
||||||
... OR ...
|
If you want a 32bit version of GNU Make, add the --x86 option.
|
||||||
|
|
||||||
nmake /f NMakefile
|
If you want a Debug build of GNU Make, add the --debug option. Output
|
||||||
|
will go into the .\WinDebug directory.
|
||||||
(this produces WinDebug/make.exe and WinRel/make.exe).
|
|
||||||
|
|
||||||
The batch file will probe for Guile installation, and will build
|
The batch file will probe for Guile installation, and will build
|
||||||
gnumake.exe with Guile if it finds it. If you have Guile
|
gnumake.exe with Guile if it finds it. If Guile is installed,
|
||||||
installed, but want to build Make without Guile support, type
|
but you prefer to build GNU Make without Guile support, add the
|
||||||
|
--without-guile option.
|
||||||
|
|
||||||
|
|
||||||
|
Building with (MinGW-)GCC using GNU Make
|
||||||
|
----------------------------------------
|
||||||
|
|
||||||
|
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 ...
|
||||||
|
|
||||||
|
make -f Basic.mk TOOLCHAIN=gcc
|
||||||
|
|
||||||
|
This produces GccRel\gnumake.exe.
|
||||||
|
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
|
||||||
|
|
||||||
|
The makefile doesn't support Guile integration. Use build_w32.bat
|
||||||
|
if you want to build with Guile support.
|
||||||
|
|
||||||
|
|
||||||
|
Building with (MSVC++-)cl using GNU Make
|
||||||
|
----------------------------------------
|
||||||
|
|
||||||
|
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
|
||||||
|
cl-installation, or using a corresponding start menu entry from the
|
||||||
|
cl-installation), then execute ...
|
||||||
|
|
||||||
|
make -f Basic.mk
|
||||||
|
|
||||||
|
This produces an optimized WinRel/gnumake.exe.
|
||||||
|
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
|
||||||
|
|
||||||
|
The makefile doesn't support Guile integration. Use build_w32.bat
|
||||||
|
if you want to build with Guile support.
|
||||||
|
|
||||||
|
|
||||||
|
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:
|
||||||
|
|
||||||
|
make -f Basic.mk check
|
||||||
|
|
||||||
|
Alternatively if you'd like to run tests by hand, use:
|
||||||
|
|
||||||
|
cd tests
|
||||||
|
.\run_make_tests.bat -make <path-to-make>
|
||||||
|
|
||||||
|
I've found <path-to-make> seems to want forward-slashes in the path.
|
||||||
|
For example if building with .\build_w32.bat non-debug, use:
|
||||||
|
|
||||||
|
cd tests
|
||||||
|
.\run_make_tests.bat -make ../WinRel/gnumake.exe
|
||||||
|
|
||||||
|
I've tested this with the MSYS2 shell and POSIX tools installation
|
||||||
|
that you get by installing Git for Windows.
|
||||||
|
|
||||||
|
|
||||||
build_w32.bat --without-guile
|
|
||||||
|
|
||||||
-------------------
|
-------------------
|
||||||
-- Notes/Caveats --
|
-- Notes/Caveats --
|
||||||
-------------------
|
-------------------
|
||||||
|
|
||||||
GNU make on Windows 32-bit platforms:
|
GNU Make on Windows 32-bit platforms:
|
||||||
|
|
||||||
This version of make is ported natively to Windows32 platforms
|
This version of make is ported natively to Windows32 platforms
|
||||||
(Windows NT 3.51, Windows NT 4.0, Windows 2000, Windows XP,
|
(Windows NT 3.51, Windows NT 4.0, Windows 2000, Windows XP,
|
||||||
@@ -110,11 +168,11 @@ GNU make on Windows 32-bit platforms:
|
|||||||
officially are the MinGW port of GNU GCC, and the various
|
officially are the MinGW port of GNU GCC, and the various
|
||||||
versions of the Microsoft C compiler.
|
versions of the Microsoft C compiler.
|
||||||
|
|
||||||
Do not confuse this port of GNU make with other Windows32 projects
|
Do not confuse this port of GNU Make with other Windows32 projects
|
||||||
which provide a GNU make binary. These are separate projects
|
which provide a GNU Make binary. These are separate projects
|
||||||
and are not connected to this port effort.
|
and are not connected to this port effort.
|
||||||
|
|
||||||
GNU make and sh.exe:
|
GNU Make and sh.exe:
|
||||||
|
|
||||||
This port prefers if you have a working sh.exe somewhere on
|
This port prefers if you have a working sh.exe somewhere on
|
||||||
your system. If you don't have sh.exe, the port falls back to
|
your system. If you don't have sh.exe, the port falls back to
|
||||||
@@ -124,12 +182,12 @@ GNU make and sh.exe:
|
|||||||
|
|
||||||
There are very few true ports of Bourne shell for NT right now.
|
There are very few true ports of Bourne shell for NT right now.
|
||||||
There is a version of GNU bash available from Cygnus "Cygwin"
|
There is a version of GNU bash available from Cygnus "Cygwin"
|
||||||
porting effort (http://www.cygwin.com/).
|
porting effort (https://www.cygwin.com/).
|
||||||
Other possibilities are the MKS version of sh.exe, or building
|
Other possibilities are the MKS version of sh.exe, or building
|
||||||
your own with a package like NutCracker (DataFocus) or Portage
|
your own with a package like NutCracker (DataFocus) or Portage
|
||||||
(Consensys). Also MinGW includes sh (http://mingw.org/).
|
(Consensys). Also MinGW includes sh.
|
||||||
|
|
||||||
GNU make and brain-dead shells (BATCH_MODE_ONLY_SHELL):
|
GNU Make and brain-dead shells (BATCH_MODE_ONLY_SHELL):
|
||||||
|
|
||||||
Some versions of Bourne shell do not behave well when invoked
|
Some versions of Bourne shell do not behave well when invoked
|
||||||
as 'sh -c' from CreateProcess(). The main problem is they seem
|
as 'sh -c' from CreateProcess(). The main problem is they seem
|
||||||
@@ -152,26 +210,24 @@ GNU make and brain-dead shells (BATCH_MODE_ONLY_SHELL):
|
|||||||
|
|
||||||
Support for parallel builds
|
Support for parallel builds
|
||||||
|
|
||||||
Parallel builds (-jN) are supported in this port, with 1
|
Parallel builds (-jN) are supported in this port. The number of
|
||||||
limitation: The number of concurrent processes has a hard
|
concurrent processes has a hard limit of 4095.
|
||||||
limit of 64, due to the way this port implements waiting for
|
|
||||||
its subprocesses.
|
|
||||||
|
|
||||||
GNU make and Cygnus GNU Windows32 tools:
|
GNU Make and Cygnus GNU Windows32 tools:
|
||||||
|
|
||||||
Good news! Make now has native support for Cygwin sh. To enable,
|
Good news! Make now has native support for Cygwin sh. To enable,
|
||||||
define the HAVE_CYGWIN_SHELL in config.h and rebuild make
|
define the HAVE_CYGWIN_SHELL in config.h and rebuild make
|
||||||
from scratch. This version of make tested with B20.1 of Cygwin.
|
from scratch. This version of make tested with B20.1 of Cygwin.
|
||||||
Do not define BATCH_MODE_ONLY_SHELL if you use HAVE_CYGWIN_SHELL.
|
Do not define BATCH_MODE_ONLY_SHELL if you use HAVE_CYGWIN_SHELL.
|
||||||
|
|
||||||
GNU make and the MKS shell:
|
GNU Make and the MKS shell:
|
||||||
|
|
||||||
There is now semi-official support for the MKS shell. To turn this
|
There is now semi-official support for the MKS shell. To turn this
|
||||||
support on, define HAVE_MKS_SHELL in the config.h.W32 before you
|
support on, define HAVE_MKS_SHELL in the config.h.W32 before you
|
||||||
build make. Do not define BATCH_MODE_ONLY_SHELL if you turn
|
build make. Do not define BATCH_MODE_ONLY_SHELL if you turn
|
||||||
on HAVE_MKS_SHELL.
|
on HAVE_MKS_SHELL.
|
||||||
|
|
||||||
GNU make handling of drive letters in pathnames (PATH, vpath, VPATH):
|
GNU Make handling of drive letters in pathnames (PATH, vpath, VPATH):
|
||||||
|
|
||||||
There is a caveat that should be noted with respect to handling
|
There is a caveat that should be noted with respect to handling
|
||||||
single character pathnames on Windows systems. When colon is
|
single character pathnames on Windows systems. When colon is
|
||||||
@@ -209,13 +265,6 @@ GNU make handling of drive letters in pathnames (PATH, vpath, VPATH):
|
|||||||
both Unix and Windows systems, then no ifdef'ing will be
|
both Unix and Windows systems, then no ifdef'ing will be
|
||||||
necessary in the makefile source.
|
necessary in the makefile source.
|
||||||
|
|
||||||
GNU make test suite:
|
|
||||||
|
|
||||||
I verified all functionality with a slightly modified version
|
|
||||||
of make-test-%VERSION% (modifications to get test suite to run
|
|
||||||
on Windows NT). All tests pass in an environment that includes
|
|
||||||
sh.exe. Tests were performed on both Windows NT and Windows 95.
|
|
||||||
|
|
||||||
Pathnames and white space:
|
Pathnames and white space:
|
||||||
|
|
||||||
Unlike Unix, Windows 95/NT systems encourage pathnames which
|
Unlike Unix, Windows 95/NT systems encourage pathnames which
|
||||||
@@ -244,7 +293,7 @@ Pathnames and Case insensitivity:
|
|||||||
the file with other case permutations will succeed (i.e. opening a
|
the file with other case permutations will succeed (i.e. opening a
|
||||||
file named "target" or "TARGET" will open the file "Target").
|
file named "target" or "TARGET" will open the file "Target").
|
||||||
|
|
||||||
By default, GNU make retains its case sensitivity when comparing
|
By default, GNU Make retains its case sensitivity when comparing
|
||||||
target names and existing files or directories. It can be
|
target names and existing files or directories. It can be
|
||||||
configured, however, into a case preserving and case insensitive
|
configured, however, into a case preserving and case insensitive
|
||||||
mode by adding a define for HAVE_CASE_INSENSITIVE_FS to
|
mode by adding a define for HAVE_CASE_INSENSITIVE_FS to
|
||||||
@@ -262,10 +311,10 @@ Pathnames and Case insensitivity:
|
|||||||
SUBDIR/DepTarget: SubDir/TARGET
|
SUBDIR/DepTarget: SubDir/TARGET
|
||||||
cp $^ $@
|
cp $^ $@
|
||||||
|
|
||||||
Reliance on this behavior also eliminates the ability of GNU make
|
Reliance on this behavior also eliminates the ability of GNU Make
|
||||||
to use case in comparison of matching rules. For example, it is
|
to use case in comparison of matching rules. For example, it is
|
||||||
not possible to set up a C++ rule using %.C that is different
|
not possible to set up a C++ rule using %.C that is different
|
||||||
than a C rule using %.c. GNU make will consider these to be the
|
than a C rule using %.c. GNU Make will consider these to be the
|
||||||
same rule and will issue a warning.
|
same rule and will issue a warning.
|
||||||
|
|
||||||
SAMBA/NTFS/VFAT:
|
SAMBA/NTFS/VFAT:
|
||||||
@@ -295,10 +344,10 @@ FAT:
|
|||||||
Bug reports:
|
Bug reports:
|
||||||
|
|
||||||
Please submit bugs via the normal bug reporting mechanism which
|
Please submit bugs via the normal bug reporting mechanism which
|
||||||
is described in the GNU make manual and the base README.
|
is described in the GNU Make manual and the base README.
|
||||||
|
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 1996-2016 Free Software Foundation, Inc.
|
Copyright (C) 1996-2022 Free Software Foundation, Inc.
|
||||||
This file is part of GNU Make.
|
This file is part of GNU Make.
|
||||||
|
|
||||||
GNU Make is free software; you can redistribute it and/or modify it under the
|
GNU Make is free software; you can redistribute it and/or modify it under the
|
||||||
@@ -311,4 +360,4 @@ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|||||||
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License along with
|
You should have received a copy of the GNU General Public License along with
|
||||||
this program. If not, see <http://www.gnu.org/licenses/>.
|
this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
-*-indented-text-*-
|
-*-indented-text-*-
|
||||||
|
|
||||||
GNU make can utilize the Customs library, distributed with Pmake, to
|
GNU Make can utilize the Customs library, distributed with Pmake, to
|
||||||
provide builds distributed across multiple hosts.
|
provide builds distributed across multiple hosts.
|
||||||
|
|
||||||
In order to utilize this capability, you must first download and build
|
In order to utilize this capability, you must first download and build
|
||||||
@@ -21,11 +21,11 @@ please see the pmake and Customs documentation for details. The best
|
|||||||
place to look for instructions is in the pmake-2.1.33/INSTALL file.
|
place to look for instructions is in the pmake-2.1.33/INSTALL file.
|
||||||
|
|
||||||
Note that the 2.1.33 Pmake distribution comes with a set of patches to
|
Note that the 2.1.33 Pmake distribution comes with a set of patches to
|
||||||
GNU make, distributed in the pmake-2.1.33/etc/gnumake/ directory. These
|
GNU Make, distributed in the pmake-2.1.33/etc/gnumake/ directory. These
|
||||||
patches are based on GNU make 3.75 (there are patches for earlier
|
patches are based on GNU Make 3.75 (there are patches for earlier
|
||||||
versions of GNU make, also). The parts of this patchfile which relate
|
versions of GNU Make, also). The parts of this patchfile which relate
|
||||||
directly to Customs support have already been incorporated into this
|
directly to Customs support have already been incorporated into this
|
||||||
version of GNU make, so you should _NOT_ apply the patch file.
|
version of GNU Make, so you should _NOT_ apply the patch file.
|
||||||
|
|
||||||
However, there are a few non-Customs specific (as far as I could tell)
|
However, there are a few non-Customs specific (as far as I could tell)
|
||||||
changes here which are not incorporated (for example, the modification
|
changes here which are not incorporated (for example, the modification
|
||||||
@@ -42,14 +42,14 @@ install' there directly).
|
|||||||
BUILDING GNU MAKE
|
BUILDING GNU MAKE
|
||||||
-----------------
|
-----------------
|
||||||
|
|
||||||
Once you've installed Customs, you can build GNU make to use it. When
|
Once you've installed Customs, you can build GNU Make to use it. When
|
||||||
configuring GNU make, merely use the '--with-customs=DIR' option.
|
configuring GNU Make, merely use the '--with-customs=DIR' option.
|
||||||
Provide the directory containing the 'lib' and 'include/customs'
|
Provide the directory containing the 'lib' and 'include/customs'
|
||||||
subdirectories as DIR. For example, if you installed the customs
|
subdirectories as DIR. For example, if you installed the customs
|
||||||
library in /usr/local/lib and the headers in /usr/local/include/customs,
|
library in /usr/local/lib and the headers in /usr/local/include/customs,
|
||||||
then you'd pass '--with-customs=/usr/local' as an option to configure.
|
then you'd pass '--with-customs=/usr/local' as an option to configure.
|
||||||
|
|
||||||
Run make (or use build.sh) normally to build GNU make as described in
|
Run make (or use build.sh) normally to build GNU Make as described in
|
||||||
the INSTALL file.
|
the INSTALL file.
|
||||||
|
|
||||||
See the documentation for Customs for information on starting and
|
See the documentation for Customs for information on starting and
|
||||||
@@ -83,7 +83,7 @@ PROBLEMS
|
|||||||
|
|
||||||
SunOS 4.1.x:
|
SunOS 4.1.x:
|
||||||
The customs/sprite.h header file #includes the <malloc.h> header
|
The customs/sprite.h header file #includes the <malloc.h> header
|
||||||
files; this conflicts with GNU make's configuration so you'll get a
|
files; this conflicts with GNU Make's configuration so you'll get a
|
||||||
compile error if you use GCC (or any other ANSI-capable C compiler).
|
compile error if you use GCC (or any other ANSI-capable C compiler).
|
||||||
|
|
||||||
I commented out the #include in sprite.h:107:
|
I commented out the #include in sprite.h:107:
|
||||||
@@ -96,7 +96,7 @@ SunOS 4.1.x:
|
|||||||
|
|
||||||
|
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 1998-2016 Free Software Foundation, Inc.
|
Copyright (C) 1998-2022 Free Software Foundation, Inc.
|
||||||
This file is part of GNU Make.
|
This file is part of GNU Make.
|
||||||
|
|
||||||
GNU Make is free software; you can redistribute it and/or modify it under the
|
GNU Make is free software; you can redistribute it and/or modify it under the
|
||||||
@@ -109,4 +109,4 @@ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|||||||
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License along with
|
You should have received a copy of the GNU General Public License along with
|
||||||
this program. If not, see <http://www.gnu.org/licenses/>.
|
this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|||||||
385
README.git
385
README.git
@@ -1,7 +1,7 @@
|
|||||||
-*-text-*-
|
-*-text-*-
|
||||||
|
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2002-2016 Free Software Foundation, Inc.
|
Copyright (C) 2002-2022 Free Software Foundation, Inc.
|
||||||
This file is part of GNU Make.
|
This file is part of GNU Make.
|
||||||
|
|
||||||
GNU Make is free software; you can redistribute it and/or modify it under the
|
GNU Make is free software; you can redistribute it and/or modify it under the
|
||||||
@@ -14,7 +14,7 @@ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|||||||
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License along with
|
You should have received a copy of the GNU General Public License along with
|
||||||
this program. If not, see <http://www.gnu.org/licenses/>.
|
this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
|
|
||||||
Obtaining Git Code
|
Obtaining Git Code
|
||||||
@@ -23,7 +23,7 @@ Obtaining Git Code
|
|||||||
This seems redundant, since if you're reading this you most likely have
|
This seems redundant, since if you're reading this you most likely have
|
||||||
already performed this step; however, for completeness, you can obtain the GNU
|
already performed this step; however, for completeness, you can obtain the GNU
|
||||||
make source code via Git from the FSF's Savannah project
|
make source code via Git from the FSF's Savannah project
|
||||||
<http://savannah.gnu.org/projects/make/>:
|
<https://savannah.gnu.org/projects/make/>:
|
||||||
|
|
||||||
$ git clone git://git.savannah.gnu.org/make.git
|
$ git clone git://git.savannah.gnu.org/make.git
|
||||||
|
|
||||||
@@ -31,10 +31,13 @@ make source code via Git from the FSF's Savannah project
|
|||||||
Changes using Git
|
Changes using Git
|
||||||
-----------------
|
-----------------
|
||||||
|
|
||||||
For non-developers, you can continue to provide patches as before, or if you
|
If you do not have push privileges to the GNU Make Git repository, see the
|
||||||
make a public repository I can pull from that if you prefer.
|
README file section "Submitting Patches" for information.
|
||||||
|
|
||||||
Starting with GNU make 4.0 we no longer keep a separate ChangeLog file in
|
If you have push privileges to the GNU Make Git repository keep this
|
||||||
|
information in mind:
|
||||||
|
|
||||||
|
Starting with GNU Make 4.0 we no longer keep a separate ChangeLog file in
|
||||||
source control. We use the Gnulib git-to-changelog conversion script to
|
source control. We use the Gnulib git-to-changelog conversion script to
|
||||||
convert the Git comments into ChangeLog-style entries for release. As a
|
convert the Git comments into ChangeLog-style entries for release. As a
|
||||||
result, please format your Git comments carefully so they will look clean
|
result, please format your Git comments carefully so they will look clean
|
||||||
@@ -43,117 +46,196 @@ added before it so be sure your comment lines are not longer than 72
|
|||||||
characters; prefer 70 or less. Please use standard ChangeLog formats for
|
characters; prefer 70 or less. Please use standard ChangeLog formats for
|
||||||
your commit messages (sans the leading TAB of course).
|
your commit messages (sans the leading TAB of course).
|
||||||
|
|
||||||
Rule #1: Don't rewrite pushed history (don't use "git push --force").
|
Rule #1: Don't rewrite pushed history on master (no "git push --force").
|
||||||
|
Rule #2: Feel free to rewrite pushed history on personal branches.
|
||||||
|
Rule #3: Squash-merge or rebase + merge --ff-only, rather than merging from
|
||||||
|
personal branches into master.
|
||||||
|
|
||||||
Typical simple workflow might be:
|
Typical simple workflow might be:
|
||||||
|
|
||||||
* Edit files
|
* Edit files / make / make check
|
||||||
* Use "git status" and "git diff" to verify your changes
|
* Use "git status" and "git diff" to verify your changes
|
||||||
* Use "git add" to stage the changes you want to make
|
* Use "git add" to stage the changes you want to make
|
||||||
* Use "git commit" to commit the staged changes to your local repository
|
* Use "git commit" to commit the staged changes to your local repository
|
||||||
* Use "git pull" to accept & merge new changes from the Savannah repository
|
* Use "git pull -r" to accept new changes from the upstream repository
|
||||||
* Use "git push" to push your commits back to the Savannah repository
|
* Use "git push" to push your commits back to the upstream repository
|
||||||
|
|
||||||
For Emacs users, there are many options for Git integration but I strongly
|
For Emacs users, there are many options for Git integration but I strongly
|
||||||
recommend the Magit package: http://www.emacswiki.org/emacs/Magit
|
recommend Magit: https://magit.vc/ It makes the workflow much clearer, and
|
||||||
It makes the workflow much clearer, and has advanced features such as
|
has advanced features such as constructing multiple commits from various files
|
||||||
constructing multiple commits from various files and even from different
|
and even from different diff chunks in the same file. There is a video
|
||||||
diff chunks in the same file. There is a video available which helps a lot.
|
available which helps a lot.
|
||||||
|
|
||||||
|
|
||||||
Coding Standards
|
Coding Standards
|
||||||
----------------
|
----------------
|
||||||
|
|
||||||
GNU make code adheres to the GNU Coding Standards. Please use only spaces and
|
GNU Make code adheres to the GNU Coding Standards. Please use only spaces and
|
||||||
no TAB characters in source code.
|
no TAB characters in source code.
|
||||||
|
|
||||||
Additionally, GNU make is a foundational bootstrap package for the GNU
|
Additionally, GNU Make is a foundational bootstrap package for the GNU
|
||||||
project; as such it is very conservative about language features it expects.
|
project; as such it is conservative about language features it expects.
|
||||||
It should build with any C compiler conforming to the ANSI C89 / ISO C90
|
However, GNU Make does rely on the Gnulib portability library, and Gnulib
|
||||||
standard.
|
currently requires a ISO C99 compiler. So features in ISO C99 can be
|
||||||
|
assumed.
|
||||||
|
|
||||||
|
|
||||||
Building From Git
|
Building From Git for POSIX
|
||||||
-----------------
|
---------------------------
|
||||||
|
|
||||||
To build GNU make from Git, you will need Autoconf, Automake, and
|
To build GNU Make from Git on POSIX systems such as GNU/Linux, you will
|
||||||
Gettext, and any tools that those utilities require (GNU m4, Perl,
|
need to install the following extra software:
|
||||||
etc.). See the configure.ac file to find the minimum versions of each
|
|
||||||
of these tools. You will also need a copy of wget and gnulib.
|
* autoconf >= 2.69
|
||||||
|
* automake >= 1.16.1
|
||||||
|
* gettext
|
||||||
|
* autopoint
|
||||||
|
* pkg-config
|
||||||
|
* texinfo (for makeinfo)
|
||||||
|
* 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.
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
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
|
||||||
|
support).
|
||||||
|
|
||||||
When building from Git you must build in the source directory: "VPATH
|
When building from Git you must build in the source directory: "VPATH
|
||||||
builds" from remote directories are not supported. Once you've created
|
builds" from remote directories are not supported. Once you've created
|
||||||
a distribution, of course, you can unpack it and do a VPATH build from
|
a distribution, of course, you can unpack it and do a VPATH build from
|
||||||
there.
|
there.
|
||||||
|
|
||||||
After checking out the code, you will need to perform these steps to get
|
After checking out the code, you will need to run the bootstrap script:
|
||||||
to the point where you can run "make".
|
|
||||||
|
|
||||||
1) $ autoreconf -i
|
$ ./bootstrap
|
||||||
|
|
||||||
This rebuilds all the things that need rebuilding, installing
|
Alternatively you can just pull content from remote locations with:
|
||||||
missing files as symbolic links.
|
|
||||||
|
|
||||||
You may get warnings here about missing files like README, etc.
|
$ ./autopull.sh
|
||||||
Ignore them, they are harmless.
|
|
||||||
|
|
||||||
2) $ ./configure
|
And/or just re-generate auto-generatable files with:
|
||||||
|
|
||||||
Generate a Makefile
|
$ ./autogen.sh
|
||||||
|
|
||||||
3) $ make update
|
(Running ./bootstrap does both in one step.)
|
||||||
|
|
||||||
Use wget to retrieve various other files that GNU make relies on,
|
|
||||||
but does not keep in its own source tree.
|
|
||||||
|
|
||||||
NB: You may need GNU make to correctly perform this step; if you use
|
|
||||||
a platform-local make you may get problems with missing files in doc/.
|
|
||||||
|
|
||||||
At this point you have successfully brought your Git copy of the GNU
|
At this point you have successfully brought your Git copy of the GNU
|
||||||
make source directory up to the point where it can be treated
|
make source directory up to the point where it can be treated
|
||||||
more-or-less like the official package you would get from ftp.gnu.org.
|
more-or-less like the official package you would get from ftp.gnu.org.
|
||||||
That is, you can just run:
|
That is, you can just run:
|
||||||
|
|
||||||
$ make && make check && make install
|
$ ./configure
|
||||||
|
$ make check
|
||||||
|
|
||||||
to build and install GNU make.
|
to build and test GNU Make.
|
||||||
|
|
||||||
|
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
|
||||||
|
warnings AND enables -Werror to turn warnings into failures.
|
||||||
|
|
||||||
|
If you want to build from Git with "maintainer mode" disabled, add
|
||||||
|
"MAKE_MAINTAINER_MODE=" to the make command line. If you want to turn
|
||||||
|
off the extra warning flags, add "MAKE_CFLAGS=" to the make command
|
||||||
|
line.
|
||||||
|
|
||||||
|
For example:
|
||||||
|
$ ./configure
|
||||||
|
$ make check MAKE_MAINTAINER_MODE= MAKE_CFLAGS=
|
||||||
|
$ make install
|
||||||
|
|
||||||
|
|
||||||
Windows builds from Git
|
Building From Git for Windows
|
||||||
-----------------------
|
-----------------------------
|
||||||
|
|
||||||
If you have a UNIX emulation like CYGWIN you can opt to run the general
|
If you have a UNIX emulation like CYGWIN you can opt to run the general build
|
||||||
build procedure above; it will work. Be sure to read
|
procedure above; it will work. Consult README.W32 for information on options
|
||||||
README.W32.template for information on options you might want to use
|
you might want to use when running ./configure.
|
||||||
when running ./configure.
|
|
||||||
|
|
||||||
If you can't or don't want to do that, then rename the file
|
If you can't or don't want to do that, then first run the .\bootstrap.bat
|
||||||
README.W32.template to README.W32 and follow those instructions.
|
script to "prime" your Git workspace:
|
||||||
|
|
||||||
|
> .\bootstrap.bat
|
||||||
|
|
||||||
|
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
|
Creating a Package
|
||||||
------------------
|
------------------
|
||||||
|
|
||||||
Once you have performed the above steps (including the configuration and
|
Once you have performed the above steps (including the configuration and
|
||||||
build) you can create a GNU make package. This is very simple, just
|
build) you can create a GNU Make package. This is very simple, just
|
||||||
run:
|
run:
|
||||||
|
|
||||||
$ make dist-gzip
|
$ make dist-gzip
|
||||||
|
|
||||||
and, if you like:
|
and, if you like:
|
||||||
|
|
||||||
$ make dist-bzip2
|
$ make dist-lzip
|
||||||
|
|
||||||
Even better, you should run this:
|
Even better, you should run this:
|
||||||
|
|
||||||
$ make distcheck
|
$ make distcheck
|
||||||
|
|
||||||
Which will build both .gz and .bz2 package files, then unpack them into
|
Which will build both .gz and .lz package files, then unpack one into a
|
||||||
a temporary location, try to build them, and repack them, verifying that
|
temporary location, try to build it and repack it, then verifying that
|
||||||
everything works, you get the same results, _and_ no extraneous files
|
everything works, you get the same results, _and_ no extraneous files are
|
||||||
are left over after the "distclean" rule--whew!! Now, _that_ is why
|
left over after the "distclean" rule.
|
||||||
converting to Automake is worth the trouble! A big "huzzah!" to Tom
|
|
||||||
T. and the AutoToolers!
|
This package can be unpacked and built to give a "normal" (non-maintainer
|
||||||
|
mode) result.
|
||||||
|
|
||||||
|
|
||||||
Steps to Release
|
Steps to Release
|
||||||
@@ -171,33 +253,117 @@ consistent (that's why we don't finalize the Git tag, etc. until the end).
|
|||||||
"Fixed Release" ID number.
|
"Fixed Release" ID number.
|
||||||
* Run "make distcheck" to be sure it all works.
|
* Run "make distcheck" to be sure it all works.
|
||||||
* Run "make check-alt-config" to be sure alternative configurations work
|
* Run "make check-alt-config" to be sure alternative configurations work
|
||||||
* Run "make update-makeweb" to get a copy of the GNU make web pages
|
|
||||||
* Run "make update-gnuweb" to get a copy of the GNU website boilerplate pages
|
|
||||||
* Update the web page boilerplate if necessary:
|
|
||||||
../gnu-www/www/server/standards/patch-from-parent ../make-web/make.html \
|
|
||||||
../gnu-www/www/server/standards/boilerplate.html
|
|
||||||
* Run "make gendocs" (requires gnulib) to generate the manual files for
|
|
||||||
the GNU make web pages.
|
|
||||||
* Follow the directions from gendocs for the web page repository
|
|
||||||
* run "make tag-release" to create a Git tag for the release
|
* run "make tag-release" to create a Git tag for the release
|
||||||
* Push everything:
|
* Push everything:
|
||||||
git push --tags origin master
|
git push --tags origin master
|
||||||
|
|
||||||
Manage the Savannah project for GNU make:
|
The safest thing is to create an entirely new repository and build the final
|
||||||
|
package from there:
|
||||||
|
|
||||||
>>> This is only for real releases, not release candidate builds <<<
|
git clone git://git.savannah.gnu.org/make.git make-release
|
||||||
|
cd make-release
|
||||||
|
|
||||||
|
If you don't want to create a new repository then run "git clean -fdx".
|
||||||
|
Then:
|
||||||
|
|
||||||
|
./bootstrap.sh
|
||||||
|
./configure
|
||||||
|
make distcheck
|
||||||
|
|
||||||
|
Perform test builds on whichever systems you have access to.
|
||||||
|
|
||||||
|
Use a previous announcement as a template to create an announcement in a text
|
||||||
|
file then sign it with GPG:
|
||||||
|
|
||||||
|
gpg --clearsign <announcement.txt>
|
||||||
|
|
||||||
|
Or, use your mail client's PGP/GPG signing capabilities.
|
||||||
|
|
||||||
|
NOTE! In order to publish a package on the FSF FTP site you need to have my
|
||||||
|
GPG private key, and my passphrase to unlock it.
|
||||||
|
|
||||||
|
Depending on your distribution (whether GnuPG is integrated with your
|
||||||
|
keyring etc.) the upload operation will either pop up a window asking
|
||||||
|
for the GPG key passphrase one time, or else it will use the CLI to ask
|
||||||
|
for the GPG passphrase _THREE_ times. Sigh.
|
||||||
|
|
||||||
|
|
||||||
|
Publishing a Release Candidate
|
||||||
|
------------------------------
|
||||||
|
|
||||||
|
Usually I publish one or two release candidates for people to test before
|
||||||
|
making an official release. Release candidates use a GNU numbering scheme,
|
||||||
|
which add a ".9x" release number to the PREVIOUS major release. So the first
|
||||||
|
release candidate for GNU Make 4.4 would be GNU Make 4.3.90, the second
|
||||||
|
release candidate would be 4.3.91, etc.
|
||||||
|
|
||||||
|
Upload a release candidate using:
|
||||||
|
|
||||||
|
make upload-alpha
|
||||||
|
|
||||||
|
Announce a release candidate to these mailing lists:
|
||||||
|
|
||||||
|
To: bug-make@gnu.org
|
||||||
|
BCC: help-make@gnu.org, make-w32@gnu.org, make-alpha@gnu.org
|
||||||
|
|
||||||
|
You will have to approve the BCC's on the mailing list admin sites. Send
|
||||||
|
separate copies to (don't use CC as replies will go to these lists):
|
||||||
|
|
||||||
|
* coordinator@translationproject.org
|
||||||
|
* platform-testers@gnu.org
|
||||||
|
|
||||||
|
|
||||||
|
Publishing a Release
|
||||||
|
--------------------
|
||||||
|
|
||||||
|
When publishing a final release there are extra steps that need to be taken:
|
||||||
|
|
||||||
|
* Run "make update-makeweb" to get a copy of the GNU Make web pages
|
||||||
|
* Run "make update-gnuweb" to get a copy of the GNU website boilerplate pages
|
||||||
|
* Update the web page boilerplate if necessary:
|
||||||
|
( cd ~/src/make/make-web \
|
||||||
|
&& ~/src/gnu-www/www/server/standards/patch-from-parent \
|
||||||
|
make.html \
|
||||||
|
~/src/gnu-www/www/server/standards/boilerplate.html )
|
||||||
|
* Run "make gendocs" (requires gnulib) to generate the manual files for
|
||||||
|
the GNU Make web pages.
|
||||||
|
* Follow the directions from gendocs for the web page repository
|
||||||
|
|
||||||
|
Manage the Savannah project for GNU Make:
|
||||||
|
|
||||||
* In Savannah modify the "Value", "Rank", and "Description" values for the
|
* In Savannah modify the "Value", "Rank", and "Description" values for the
|
||||||
current "SCM" entry in both "Component Version" and "Fix Release" fields
|
current "SCM" entry in both "Component Version" and "Fix Release" fields
|
||||||
to refer to the new release. The "Rank" field should be 10 less than the
|
to refer to the new release. The "Rank" field should be 10 less than the
|
||||||
previous release so it orders properly.
|
previous release so it orders properly.
|
||||||
* In Savannah create a new entry for the "Component Version" and "Fix
|
|
||||||
Release" fields:
|
* In Savannah create a new entry for the "Component Version" field:
|
||||||
- Value: SCM
|
- Value: SCM
|
||||||
- Rank: 20
|
- Rank: 20
|
||||||
- Descr: Issues found in code retrieved from Source Code Management (Git), rather than a distributed version. Please include the SHA you are working with.
|
- Descr: Issues found in code retrieved from Source Code Management (Git), rather than a distributed version. Please include the SHA you are working with.
|
||||||
|
|
||||||
- Descr: Fixed in Source Code Management (Git). The fix will be included in the next release of GNU make.
|
* In Savannah create a new entry for the "Fix Release" field:
|
||||||
|
- Value: SCM
|
||||||
|
- Rank: 20
|
||||||
|
- Descr: Fixed in Source Code Management (Git). The fix will be included in the next release of GNU Make.
|
||||||
|
|
||||||
|
Upload a release using:
|
||||||
|
|
||||||
|
make upload-ftp
|
||||||
|
|
||||||
|
Announce a release to these mailing lists:
|
||||||
|
|
||||||
|
To: info-gnu@gnu.org, bug-make@gnu.org
|
||||||
|
BCC: help-make@gnu.org, make-w32@gnu.org, make-alpha@gnu.org
|
||||||
|
|
||||||
|
You will have to approve the BCC's on the mailing list admin sites. Send
|
||||||
|
separate copies to (don't use CC as replies will go to these lists):
|
||||||
|
|
||||||
|
* coordinator@translationproject.org
|
||||||
|
* platform-testers@gnu.org
|
||||||
|
|
||||||
|
Announce on Savannah:
|
||||||
|
|
||||||
|
* Add a news item to the Savannah project site.
|
||||||
|
|
||||||
Start the next release:
|
Start the next release:
|
||||||
|
|
||||||
@@ -206,86 +372,21 @@ Start the next release:
|
|||||||
* Update the Savannah URL for the bugs fixed in the NEWS section.
|
* Update the Savannah URL for the bugs fixed in the NEWS section.
|
||||||
|
|
||||||
|
|
||||||
Publishing a Package
|
|
||||||
--------------------
|
|
||||||
|
|
||||||
In order to publish a package on the FSF FTP site, either the release
|
|
||||||
site ftp://ftp.gnu.org, or the prerelease site ftp://alpha.gnu.org, you
|
|
||||||
first need to have my GPG private key and my passphrase to unlock it.
|
|
||||||
And, you can't have them! So there! But, just so I remember here's
|
|
||||||
what to do:
|
|
||||||
|
|
||||||
Make sure the "Steps to Release" are complete and committed and tagged.
|
|
||||||
|
|
||||||
git clone git://git.savannah.gnu.org/make.git make-release
|
|
||||||
|
|
||||||
cd make-release
|
|
||||||
|
|
||||||
<run the commands above to build the release>
|
|
||||||
|
|
||||||
make upload-alpha # for alpha.gnu.org (pre-releases)
|
|
||||||
-OR-
|
|
||||||
make upload-ftp # for ftp.gnu.org (official releases)
|
|
||||||
|
|
||||||
Depending on your distribution (whether GnuPG is integrated with your keyring
|
|
||||||
etc.) it will either pop up a window asking for your GPG key passphrase one
|
|
||||||
time, or else it will use the CLI to ask for the GPG passphrase _THREE_ times.
|
|
||||||
Sigh.
|
|
||||||
|
|
||||||
|
|
||||||
For both final releases and pre-releases, send an email with the URL of
|
|
||||||
the package to the GNU translation robot to allow the translators to
|
|
||||||
work on it:
|
|
||||||
|
|
||||||
<coordinator@translationproject.org>
|
|
||||||
|
|
||||||
|
|
||||||
Where to Announce
|
|
||||||
-----------------
|
|
||||||
|
|
||||||
Create the announcement in a text file, then sign it with GPG.
|
|
||||||
|
|
||||||
gpg --clearsign <announcement.txt>
|
|
||||||
|
|
||||||
Or, use your mail client's PGP/GPG signing capabilities.
|
|
||||||
|
|
||||||
Announce the release:
|
|
||||||
|
|
||||||
* For release candidate builds:
|
|
||||||
To: bug-make@gnu.org
|
|
||||||
CC: coordinator@translationproject.org
|
|
||||||
BCC: help-make@gnu.org, make-w32@gnu.org, make-alpha@gnu.org
|
|
||||||
|
|
||||||
* For release builds
|
|
||||||
To: info-gnu@gnu.org, bug-make@gnu.org
|
|
||||||
CC: coordinator@translationproject.org
|
|
||||||
BCC: help-make@gnu.org, make-w32@gnu.org, make-alpha@gnu.org
|
|
||||||
|
|
||||||
* Add a news item to the Savannah project site.
|
|
||||||
* Add an update to freecode.com (nee freshmeat.net)
|
|
||||||
|
|
||||||
|
|
||||||
Appendix A - For The Brave
|
Appendix A - For The Brave
|
||||||
--------------------------
|
--------------------------
|
||||||
|
|
||||||
For those of you who trust me implicitly, or are just brave (or
|
For those of you who trust me implicitly, or are just brave (or
|
||||||
foolhardy), here is a canned sequence of commands to build a GNU make
|
foolhardy), here is a canned sequence of commands to build a GNU Make
|
||||||
distribution package from a virgin Git source checkout (assuming all the
|
distribution package from a virgin Git source checkout (assuming all the
|
||||||
prerequisites are available of course).
|
prerequisites are available of course).
|
||||||
|
|
||||||
This list is eminently suitable for a quick swipe o' the mouse and a
|
This list is eminently suitable for a quick swipe o' the mouse and a
|
||||||
swift click o' mouse-2 into an xterm. Go for it!
|
swift click o' mouse-2 into an xterm. Go for it!
|
||||||
|
|
||||||
autoreconf -i
|
For a debugging version:
|
||||||
./configure
|
|
||||||
make update
|
|
||||||
make
|
|
||||||
make check
|
|
||||||
|
|
||||||
Or, for a debugging version:
|
./bootstrap && ./configure CFLAGS=-g && make check
|
||||||
|
|
||||||
autoreconf -i && ./configure CFLAGS=-g && make update && make && make check
|
For an optimized version
|
||||||
|
|
||||||
Or, all-in-one:
|
./bootstrap && ./configure && make check
|
||||||
|
|
||||||
autoreconf -i && ./configure && make update && make && make check
|
|
||||||
|
|||||||
221
README.in
Normal file
221
README.in
Normal file
@@ -0,0 +1,221 @@
|
|||||||
|
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.
|
||||||
|
|
||||||
|
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
|
||||||
|
source distribution, see the README.git file for instructions.
|
||||||
|
|
||||||
|
For source distribution building and installation instructions, see the file
|
||||||
|
INSTALL.
|
||||||
|
|
||||||
|
If you need to build GNU Make and have no other 'make' program to use, you can
|
||||||
|
use the shell script 'build.sh' instead. To do this, first run 'configure' as
|
||||||
|
described in INSTALL. Then, instead of typing 'make' to build the program,
|
||||||
|
type 'sh build.sh'. This 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
|
||||||
|
'build.sh' instead.
|
||||||
|
|
||||||
|
|
||||||
|
GNU Make is free software. See the file COPYING for copying conditions.
|
||||||
|
GNU Make is copyright by the Free Software Foundation. Copyright notices
|
||||||
|
condense sequential years into a range; e.g. "1987-1994" means all years
|
||||||
|
from 1987 to 1994 inclusive.
|
||||||
|
|
||||||
|
Downloading
|
||||||
|
-----------
|
||||||
|
|
||||||
|
GNU Make can be obtained in many different ways. See a description here:
|
||||||
|
|
||||||
|
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.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.
|
||||||
|
|
||||||
|
https://www.gnu.org/
|
||||||
|
https://www.gnu.org/doc/doc.html
|
||||||
|
https://www.gnu.org/manual/manual.html
|
||||||
|
|
||||||
|
|
||||||
|
Development
|
||||||
|
-----------
|
||||||
|
|
||||||
|
GNU Make development is hosted by Savannah, the FSF's online development
|
||||||
|
management tool. Savannah is here:
|
||||||
|
|
||||||
|
https://savannah.gnu.org
|
||||||
|
|
||||||
|
And the GNU Make development page is here:
|
||||||
|
|
||||||
|
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
|
||||||
|
-------------
|
||||||
|
|
||||||
|
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:
|
||||||
|
|
||||||
|
https://savannah.gnu.org/bugs/?group=make
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
|
||||||
|
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
|
||||||
|
server; look here for details:
|
||||||
|
|
||||||
|
https://savannah.gnu.org/git/?group=make
|
||||||
|
|
||||||
|
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
|
||||||
|
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.
|
||||||
|
|
||||||
|
|
||||||
|
System-specific Notes
|
||||||
|
---------------------
|
||||||
|
|
||||||
|
It has been reported that the XLC 1.2 compiler on AIX 3.2 is buggy such
|
||||||
|
that if you compile make with 'cc -O' on AIX 3.2, it will not work
|
||||||
|
correctly. It is said that using 'cc' without '-O' does work.
|
||||||
|
|
||||||
|
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
|
||||||
|
bash or pdksh in order to run "configure". See this message for more
|
||||||
|
information:
|
||||||
|
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.)
|
||||||
|
|
||||||
|
Another potential source of porting problems is the support for large
|
||||||
|
files (LFS) in configure for those operating systems that provide it.
|
||||||
|
Please report any bugs that you find in this area. If you run into
|
||||||
|
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
|
||||||
|
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"
|
||||||
|
and other similar tools (tar, etc.) may not exactly duplicate timestamps
|
||||||
|
with micro- and nano-second granularity on some systems. If your build
|
||||||
|
system contains rules that depend on proper behavior of tools like "cp
|
||||||
|
-p", you should consider using the .LOW_RESOLUTION_TIME pseudo-target to
|
||||||
|
force make to treat them properly. See the manual for details.
|
||||||
|
|
||||||
|
|
||||||
|
Ports
|
||||||
|
-----
|
||||||
|
|
||||||
|
- 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.
|
||||||
|
|
||||||
|
- See README.Amiga for details about GNU Make on AmigaDOS.
|
||||||
|
|
||||||
|
- See README.W32 for details about GNU Make on Windows NT, 95, or 98.
|
||||||
|
|
||||||
|
- See README.DOS for compilation instructions on MS-DOS and MS-Windows
|
||||||
|
using DJGPP tools.
|
||||||
|
|
||||||
|
A precompiled binary of the MSDOS port of GNU Make is available as part
|
||||||
|
of DJGPP; see the WWW page https://www.delorie.com/djgpp/ for more
|
||||||
|
information.
|
||||||
|
|
||||||
|
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
|
||||||
|
it you should start by asking on those mailing lists and forums.
|
||||||
|
|
||||||
|
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-2022 Free Software Foundation, Inc.
|
||||||
|
This file is part of GNU Make.
|
||||||
|
|
||||||
|
GNU Make is free software; you can redistribute it and/or modify it under the
|
||||||
|
terms of the GNU General Public License as published by the Free Software
|
||||||
|
Foundation; either version 3 of the License, or (at your option) any later
|
||||||
|
version.
|
||||||
|
|
||||||
|
GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||||
|
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
||||||
|
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License along with
|
||||||
|
this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
178
README.template
178
README.template
@@ -1,178 +0,0 @@
|
|||||||
This directory contains the %VERSION% release of GNU Make.
|
|
||||||
|
|
||||||
See the file NEWS for the user-visible changes from previous releases.
|
|
||||||
In addition, there have been bugs fixed.
|
|
||||||
|
|
||||||
Please check the system-specific notes below for any caveats related to
|
|
||||||
your operating system.
|
|
||||||
|
|
||||||
For general building and installation instructions, see the file INSTALL.
|
|
||||||
|
|
||||||
If you need to build GNU Make and have no other 'make' program to use,
|
|
||||||
you can use the shell script 'build.sh' instead. To do this, first run
|
|
||||||
'configure' as described in INSTALL. Then, instead of typing 'make' to
|
|
||||||
build the program, type 'sh build.sh'. This should compile the program
|
|
||||||
in the current directory. Then you will have a Make program that you can
|
|
||||||
use for './make install', or whatever else.
|
|
||||||
|
|
||||||
Some systems' Make programs are broken and cannot process the Makefile for
|
|
||||||
GNU Make. If you get errors from your system's Make when building GNU
|
|
||||||
Make, try using 'build.sh' instead.
|
|
||||||
|
|
||||||
|
|
||||||
GNU Make is free software. See the file COPYING for copying conditions.
|
|
||||||
GNU Make is copyright by the Free Software Foundation. Copyright notices
|
|
||||||
condense sequential years into a range; e.g. "1987-1994" means all years
|
|
||||||
from 1987 to 1994 inclusive.
|
|
||||||
|
|
||||||
Downloading
|
|
||||||
-----------
|
|
||||||
|
|
||||||
GNU Make can be obtained in many different ways. See a description here:
|
|
||||||
|
|
||||||
http://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.
|
|
||||||
|
|
||||||
http://www.gnu.org/
|
|
||||||
http://www.gnu.org/doc/doc.html
|
|
||||||
http://www.gnu.org/manual/manual.html
|
|
||||||
|
|
||||||
|
|
||||||
Development
|
|
||||||
-----------
|
|
||||||
|
|
||||||
GNU Make development is hosted by Savannah, the FSF's online development
|
|
||||||
management tool. Savannah is here:
|
|
||||||
|
|
||||||
http://savannah.gnu.org
|
|
||||||
|
|
||||||
And the GNU Make development page is here:
|
|
||||||
|
|
||||||
http://savannah.gnu.org/projects/make/
|
|
||||||
|
|
||||||
You can find most information concerning the development of GNU Make at
|
|
||||||
this site.
|
|
||||||
|
|
||||||
|
|
||||||
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.
|
|
||||||
|
|
||||||
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
|
|
||||||
|
|
||||||
If you need help using GNU make, try these forums:
|
|
||||||
|
|
||||||
help-make@gnu.org
|
|
||||||
help-utils@gnu.org
|
|
||||||
news:gnu.utils.help
|
|
||||||
news:gnu.utils.bug
|
|
||||||
|
|
||||||
|
|
||||||
Git Access
|
|
||||||
----------
|
|
||||||
|
|
||||||
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
|
|
||||||
|
|
||||||
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 hints 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.
|
|
||||||
|
|
||||||
|
|
||||||
System-specific Notes
|
|
||||||
---------------------
|
|
||||||
|
|
||||||
It has been reported that the XLC 1.2 compiler on AIX 3.2 is buggy such
|
|
||||||
that if you compile make with 'cc -O' on AIX 3.2, it will not work
|
|
||||||
correctly. It is said that using 'cc' without '-O' does work.
|
|
||||||
|
|
||||||
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
|
|
||||||
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
|
|
||||||
|
|
||||||
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.)
|
|
||||||
|
|
||||||
Another potential source of porting problems is the support for large
|
|
||||||
files (LFS) in configure for those operating systems that provide it.
|
|
||||||
Please report any bugs that you find in this area. If you run into
|
|
||||||
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
|
|
||||||
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"
|
|
||||||
and other similar tools (tar, etc.) may not exactly duplicate timestamps
|
|
||||||
with micro- and nano-second granularity on some systems. If your build
|
|
||||||
system contains rules that depend on proper behavior of tools like "cp
|
|
||||||
-p", you should consider using the .LOW_RESOLUTION_TIME pseudo-target to
|
|
||||||
force make to treat them properly. See the manual for details.
|
|
||||||
|
|
||||||
|
|
||||||
Ports
|
|
||||||
-----
|
|
||||||
|
|
||||||
- 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.
|
|
||||||
|
|
||||||
- See README.Amiga for details about GNU Make on AmigaDOS.
|
|
||||||
|
|
||||||
- See README.W32 for details about GNU Make on Windows NT, 95, or 98.
|
|
||||||
|
|
||||||
- See README.DOS for compilation instructions on MS-DOS and MS-Windows
|
|
||||||
using DJGPP tools.
|
|
||||||
|
|
||||||
A precompiled binary of the MSDOS port of GNU Make is available as part
|
|
||||||
of DJGPP; see the WWW page http://www.delorie.com/djgpp/ for more
|
|
||||||
information.
|
|
||||||
|
|
||||||
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-2016 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 <http://www.gnu.org/licenses/>.
|
|
||||||
@@ -3,10 +3,10 @@ OPTIMIZE
|
|||||||
NOVERSION
|
NOVERSION
|
||||||
OPTIMIZERTIME
|
OPTIMIZERTIME
|
||||||
OPTIMIZERALIAS
|
OPTIMIZERALIAS
|
||||||
|
DEFINE HAVE_CONFIG_H
|
||||||
DEFINE INCLUDEDIR="include:"
|
DEFINE INCLUDEDIR="include:"
|
||||||
DEFINE LIBDIR="lib:"
|
DEFINE LIBDIR="lib:"
|
||||||
DEFINE NO_ALLOCA
|
DEFINE NO_ALLOCA
|
||||||
DEFINE NO_FLOAT
|
|
||||||
DEFINE NO_ARCHIVES
|
DEFINE NO_ARCHIVES
|
||||||
IGNORE=161
|
IGNORE=161
|
||||||
IGNORE=100
|
IGNORE=100
|
||||||
|
|||||||
@@ -1,218 +0,0 @@
|
|||||||
# -*-Makefile-*- for building GNU make with smake
|
|
||||||
#
|
|
||||||
# NOTE: If you have no 'make' program at all to process this makefile,
|
|
||||||
# run 'build.sh' instead.
|
|
||||||
#
|
|
||||||
# Copyright (C) 1995-2016 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 <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
#
|
|
||||||
# Makefile for GNU Make
|
|
||||||
#
|
|
||||||
|
|
||||||
# Ultrix 2.2 make doesn't expand the value of VPATH.
|
|
||||||
VPATH = /make-%VERSION%/
|
|
||||||
# This must repeat the value, because configure will remove 'VPATH = .'.
|
|
||||||
srcdir = /make-%VERSION%/
|
|
||||||
|
|
||||||
CC = sc
|
|
||||||
RM = delete
|
|
||||||
MAKE = smake
|
|
||||||
|
|
||||||
CFLAGS =
|
|
||||||
CPPFLAGS =
|
|
||||||
LDFLAGS =
|
|
||||||
|
|
||||||
# Define these for your system as follows:
|
|
||||||
# -DNO_ARCHIVES To disable 'ar' archive support.
|
|
||||||
# -DNO_FLOAT To avoid using floating-point numbers.
|
|
||||||
# -DENUM_BITFIELDS If the compiler isn't GCC but groks enum foo:2.
|
|
||||||
# Some compilers apparently accept this
|
|
||||||
# without complaint but produce losing code,
|
|
||||||
# so beware.
|
|
||||||
# NeXT 1.0a uses an old version of GCC, which required -D__inline=inline.
|
|
||||||
# See also 'config.h'.
|
|
||||||
defines =
|
|
||||||
|
|
||||||
# Which flavor of remote job execution support to use.
|
|
||||||
# The code is found in 'remote-$(REMOTE).c'.
|
|
||||||
REMOTE = stub
|
|
||||||
|
|
||||||
# If you are using the GNU C library, or have the GNU getopt functions in
|
|
||||||
# your C library, you can comment these out.
|
|
||||||
GETOPT = getopt.o getopt1.o
|
|
||||||
GETOPT_SRC = $(srcdir)getopt.c $(srcdir)getopt1.c $(srcdir)getopt.h
|
|
||||||
|
|
||||||
# If you are using the GNU C library, or have the GNU glob functions in
|
|
||||||
# your C library, you can comment this out. GNU make uses special hooks
|
|
||||||
# into the glob functions to be more efficient (by using make's directory
|
|
||||||
# cache for globbing), so you must use the GNU functions even if your
|
|
||||||
# system's C library has the 1003.2 glob functions already. Also, the glob
|
|
||||||
# functions in the AIX and HPUX C libraries are said to be buggy.
|
|
||||||
GLOB = Lib glob/glob.lib
|
|
||||||
|
|
||||||
# If your system doesn't have alloca, or the one provided is bad, define this.
|
|
||||||
ALLOCA = alloca.o
|
|
||||||
ALLOCA_SRC = $(srcdir)alloca.c
|
|
||||||
|
|
||||||
# If your system needs extra libraries loaded in, define them here.
|
|
||||||
# System V probably need -lPW for alloca. HP-UX 7.0's alloca in
|
|
||||||
# libPW.a is broken on HP9000s300 and HP9000s400 machines. Use
|
|
||||||
# alloca.c instead on those machines.
|
|
||||||
LOADLIBES =
|
|
||||||
|
|
||||||
# Any extra object files your system needs.
|
|
||||||
extras = amiga.o
|
|
||||||
|
|
||||||
# Common prefix for machine-independent installed files.
|
|
||||||
prefix =
|
|
||||||
# Common prefix for machine-dependent installed files.
|
|
||||||
exec_prefix =
|
|
||||||
|
|
||||||
# Directory to install 'make' in.
|
|
||||||
bindir = sc:c
|
|
||||||
# Directory to find libraries in for '-lXXX'.
|
|
||||||
libdir = lib:
|
|
||||||
# Directory to search by default for included makefiles.
|
|
||||||
includedir = include:
|
|
||||||
# Directory to install the Info files in.
|
|
||||||
infodir = doc:
|
|
||||||
# Directory to install the man page in.
|
|
||||||
mandir = t:
|
|
||||||
# Number to put on the man page filename.
|
|
||||||
manext = 1
|
|
||||||
# Prefix to put on installed 'make' binary file name.
|
|
||||||
binprefix =
|
|
||||||
# Prefix to put on installed 'make' man page file name.
|
|
||||||
manprefix = $(binprefix)
|
|
||||||
|
|
||||||
# Whether or not make needs to be installed setgid.
|
|
||||||
# The value should be either 'true' or 'false'.
|
|
||||||
# On many systems, the getloadavg function (used to implement the '-l'
|
|
||||||
# switch) will not work unless make is installed setgid kmem.
|
|
||||||
install_setgid = false
|
|
||||||
# Install make setgid to this group so it can read /dev/kmem.
|
|
||||||
group = sys
|
|
||||||
|
|
||||||
# Program to install 'make'.
|
|
||||||
INSTALL_PROGRAM = copy
|
|
||||||
# Program to install the man page.
|
|
||||||
INSTALL_DATA = copy
|
|
||||||
# Generic install program.
|
|
||||||
INSTALL = copy
|
|
||||||
|
|
||||||
# Program to format Texinfo source into Info files.
|
|
||||||
MAKEINFO = makeinfo
|
|
||||||
# Program to format Texinfo source into DVI files.
|
|
||||||
TEXI2DVI = texi2dvi
|
|
||||||
|
|
||||||
# Programs to make tags files.
|
|
||||||
ETAGS = etags -w
|
|
||||||
CTAGS = ctags -w
|
|
||||||
|
|
||||||
#guile = guile.o
|
|
||||||
|
|
||||||
objs = commands.o job.o dir.o file.o misc.o main.o read.o remake.o \
|
|
||||||
rule.o implicit.o default.o variable.o expand.o function.o \
|
|
||||||
vpath.o version.o ar.o arscan.o signame.o strcache.o hash.o \
|
|
||||||
output.o remote-$(REMOTE).o $(GLOB) $(GETOPT) $(ALLOCA) \
|
|
||||||
$(extras) $(guile)
|
|
||||||
|
|
||||||
srcs = $(srcdir)commands.c $(srcdir)job.c $(srcdir)dir.c \
|
|
||||||
$(srcdir)file.c $(srcdir)getloadavg.c $(srcdir)misc.c \
|
|
||||||
$(srcdir)main.c $(srcdir)read.c $(srcdir)remake.c \
|
|
||||||
$(srcdir)rule.c $(srcdir)implicit.c $(srcdir)default.c \
|
|
||||||
$(srcdir)variable.c $(srcdir)expand.c $(srcdir)function.c \
|
|
||||||
$(srcdir)vpath.c $(srcdir)version.c $(srcdir)hash.c \
|
|
||||||
$(srcdir)guile.c $(srcdir)remote-$(REMOTE).c \
|
|
||||||
$(srcdir)ar.c $(srcdir)arscan.c $(srcdir)strcache.c \
|
|
||||||
$(srcdir)signame.c $(srcdir)signame.h $(GETOPT_SRC) \
|
|
||||||
$(srcdir)commands.h $(srcdir)dep.h $(srcdir)file.h \
|
|
||||||
$(srcdir)job.h $(srcdir)makeint.h $(srcdir)rule.h \
|
|
||||||
$(srcdir)output.c $(srcdir)output.h \
|
|
||||||
$(srcdir)variable.h $(ALLOCA_SRC) $(srcdir)config.h.in
|
|
||||||
|
|
||||||
|
|
||||||
.SUFFIXES:
|
|
||||||
.SUFFIXES: .o .c .h .ps .dvi .info .texinfo
|
|
||||||
|
|
||||||
all: make
|
|
||||||
info: make.info
|
|
||||||
dvi: make.dvi
|
|
||||||
# Some makes apparently use .PHONY as the default goal if it is before 'all'.
|
|
||||||
.PHONY: all check info dvi
|
|
||||||
|
|
||||||
make.info: make.texinfo
|
|
||||||
$(MAKEINFO) -I$(srcdir) $(srcdir)make.texinfo -o make.info
|
|
||||||
|
|
||||||
make.dvi: make.texinfo
|
|
||||||
$(TEXI2DVI) $(srcdir)make.texinfo
|
|
||||||
|
|
||||||
make.ps: make.dvi
|
|
||||||
dvi2ps make.dvi > make.ps
|
|
||||||
|
|
||||||
make: $(objs) glob/glob.lib
|
|
||||||
$(CC) Link $(LDFLAGS) $(objs) $(LOADLIBES) To make.new
|
|
||||||
-delete quiet make
|
|
||||||
rename make.new make
|
|
||||||
|
|
||||||
# -I. is needed to find config.h in the build directory.
|
|
||||||
.c.o:
|
|
||||||
$(CC) $(defines) IDir "" IDir $(srcdir)glob \
|
|
||||||
$(CPPFLAGS) $(CFLAGS) $< $(OUTPUT_OPTION)
|
|
||||||
|
|
||||||
glob/glob.lib:
|
|
||||||
execute <<
|
|
||||||
cd glob
|
|
||||||
smake
|
|
||||||
<
|
|
||||||
|
|
||||||
tagsrcs = $(srcs) $(srcdir)remote-*.c
|
|
||||||
TAGS: $(tagsrcs)
|
|
||||||
$(ETAGS) $(tagsrcs)
|
|
||||||
tags: $(tagsrcs)
|
|
||||||
$(CTAGS) $(tagsrcs)
|
|
||||||
|
|
||||||
.PHONY: install installdirs
|
|
||||||
install:
|
|
||||||
copy make sc:c
|
|
||||||
|
|
||||||
loadavg: loadavg.c config.h
|
|
||||||
$(CC) $(defines) -DTEST -I. -I$(srcdir) $(CFLAGS) $(LDFLAGS) \
|
|
||||||
loadavg.c $(LOADLIBES) -o $@
|
|
||||||
|
|
||||||
clean: glob-clean
|
|
||||||
-$(RM) -f make loadavg *.o core make.dvi
|
|
||||||
|
|
||||||
distclean: clean glob-realclean
|
|
||||||
-$(RM) -f Makefile config.h config.status build.sh
|
|
||||||
-$(RM) -f config.log config.cache
|
|
||||||
-$(RM) -f TAGS tags
|
|
||||||
-$(RM) -f make.?? make.??s make.log make.toc make.*aux
|
|
||||||
-$(RM) -f loadavg.c
|
|
||||||
|
|
||||||
realclean: distclean
|
|
||||||
-$(RM) -f make.info*
|
|
||||||
|
|
||||||
mostlyclean: clean
|
|
||||||
|
|
||||||
.PHONY: glob-clean glob-realclean
|
|
||||||
|
|
||||||
glob-clean glob-realclean:
|
|
||||||
execute <<
|
|
||||||
cd glob
|
|
||||||
smake $@
|
|
||||||
<
|
|
||||||
@@ -101,7 +101,7 @@ The Rest of the List
|
|||||||
|
|
||||||
|
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 1997-2016 Free Software Foundation, Inc.
|
Copyright (C) 1997-2022 Free Software Foundation, Inc.
|
||||||
This file is part of GNU Make.
|
This file is part of GNU Make.
|
||||||
|
|
||||||
GNU Make is free software; you can redistribute it and/or modify it under the
|
GNU Make is free software; you can redistribute it and/or modify it under the
|
||||||
@@ -114,4 +114,4 @@ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|||||||
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License along with
|
You should have received a copy of the GNU General Public License along with
|
||||||
this program. If not, see <http://www.gnu.org/licenses/>.
|
this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|||||||
503
alloca.c
503
alloca.c
@@ -1,503 +0,0 @@
|
|||||||
/* alloca.c -- allocate automatically reclaimed memory
|
|
||||||
(Mostly) portable public-domain implementation -- D A Gwyn
|
|
||||||
|
|
||||||
This implementation of the PWB library alloca function,
|
|
||||||
which is used to allocate space off the run-time stack so
|
|
||||||
that it is automatically reclaimed upon procedure exit,
|
|
||||||
was inspired by discussions with J. Q. Johnson of Cornell.
|
|
||||||
J.Otto Tennant <jot@cray.com> contributed the Cray support.
|
|
||||||
|
|
||||||
There are some preprocessor constants that can
|
|
||||||
be defined when compiling for your specific system, for
|
|
||||||
improved efficiency; however, the defaults should be okay.
|
|
||||||
|
|
||||||
The general concept of this implementation is to keep
|
|
||||||
track of all alloca-allocated blocks, and reclaim any
|
|
||||||
that are found to be deeper in the stack than the current
|
|
||||||
invocation. This heuristic does not reclaim storage as
|
|
||||||
soon as it becomes invalid, but it will do so eventually.
|
|
||||||
|
|
||||||
As a special case, alloca(0) reclaims storage without
|
|
||||||
allocating any. It is a good idea to use alloca(0) in
|
|
||||||
your main control loop, etc. to force garbage collection. */
|
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
|
||||||
#include <config.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef HAVE_STRING_H
|
|
||||||
#include <string.h>
|
|
||||||
#endif
|
|
||||||
#ifdef HAVE_STDLIB_H
|
|
||||||
#include <stdlib.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef emacs
|
|
||||||
#include "blockinput.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* If compiling with GCC 2, this file's not needed. */
|
|
||||||
#if !defined (__GNUC__) || __GNUC__ < 2
|
|
||||||
|
|
||||||
/* If someone has defined alloca as a macro,
|
|
||||||
there must be some other way alloca is supposed to work. */
|
|
||||||
#ifndef alloca
|
|
||||||
|
|
||||||
#ifdef emacs
|
|
||||||
#ifdef static
|
|
||||||
/* actually, only want this if static is defined as ""
|
|
||||||
-- this is for usg, in which emacs must undefine static
|
|
||||||
in order to make unexec workable
|
|
||||||
*/
|
|
||||||
#ifndef STACK_DIRECTION
|
|
||||||
you
|
|
||||||
lose
|
|
||||||
-- must know STACK_DIRECTION at compile-time
|
|
||||||
#endif /* STACK_DIRECTION undefined */
|
|
||||||
#endif /* static */
|
|
||||||
#endif /* emacs */
|
|
||||||
|
|
||||||
/* If your stack is a linked list of frames, you have to
|
|
||||||
provide an "address metric" ADDRESS_FUNCTION macro. */
|
|
||||||
|
|
||||||
#if defined (CRAY) && defined (CRAY_STACKSEG_END)
|
|
||||||
long i00afunc ();
|
|
||||||
#define ADDRESS_FUNCTION(arg) (char *) i00afunc (&(arg))
|
|
||||||
#else
|
|
||||||
#define ADDRESS_FUNCTION(arg) &(arg)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if __STDC__
|
|
||||||
typedef void *pointer;
|
|
||||||
#else
|
|
||||||
typedef char *pointer;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef NULL
|
|
||||||
#define NULL 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Different portions of Emacs need to call different versions of
|
|
||||||
malloc. The Emacs executable needs alloca to call xmalloc, because
|
|
||||||
ordinary malloc isn't protected from input signals. On the other
|
|
||||||
hand, the utilities in lib-src need alloca to call malloc; some of
|
|
||||||
them are very simple, and don't have an xmalloc routine.
|
|
||||||
|
|
||||||
Non-Emacs programs expect this to call use xmalloc.
|
|
||||||
|
|
||||||
Callers below should use malloc. */
|
|
||||||
|
|
||||||
#ifndef emacs
|
|
||||||
#define malloc xmalloc
|
|
||||||
#endif
|
|
||||||
extern pointer malloc ();
|
|
||||||
|
|
||||||
/* Define STACK_DIRECTION if you know the direction of stack
|
|
||||||
growth for your system; otherwise it will be automatically
|
|
||||||
deduced at run-time.
|
|
||||||
|
|
||||||
STACK_DIRECTION > 0 => grows toward higher addresses
|
|
||||||
STACK_DIRECTION < 0 => grows toward lower addresses
|
|
||||||
STACK_DIRECTION = 0 => direction of growth unknown */
|
|
||||||
|
|
||||||
#ifndef STACK_DIRECTION
|
|
||||||
#define STACK_DIRECTION 0 /* Direction unknown. */
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if STACK_DIRECTION != 0
|
|
||||||
|
|
||||||
#define STACK_DIR STACK_DIRECTION /* Known at compile-time. */
|
|
||||||
|
|
||||||
#else /* STACK_DIRECTION == 0; need run-time code. */
|
|
||||||
|
|
||||||
static int stack_dir; /* 1 or -1 once known. */
|
|
||||||
#define STACK_DIR stack_dir
|
|
||||||
|
|
||||||
static void
|
|
||||||
find_stack_direction (void)
|
|
||||||
{
|
|
||||||
static char *addr = NULL; /* Address of first 'dummy', once known. */
|
|
||||||
auto char dummy; /* To get stack address. */
|
|
||||||
|
|
||||||
if (addr == NULL)
|
|
||||||
{ /* Initial entry. */
|
|
||||||
addr = ADDRESS_FUNCTION (dummy);
|
|
||||||
|
|
||||||
find_stack_direction (); /* Recurse once. */
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
/* Second entry. */
|
|
||||||
if (ADDRESS_FUNCTION (dummy) > addr)
|
|
||||||
stack_dir = 1; /* Stack grew upward. */
|
|
||||||
else
|
|
||||||
stack_dir = -1; /* Stack grew downward. */
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif /* STACK_DIRECTION == 0 */
|
|
||||||
|
|
||||||
/* An "alloca header" is used to:
|
|
||||||
(a) chain together all alloca'ed blocks;
|
|
||||||
(b) keep track of stack depth.
|
|
||||||
|
|
||||||
It is very important that sizeof(header) agree with malloc
|
|
||||||
alignment chunk size. The following default should work okay. */
|
|
||||||
|
|
||||||
#ifndef ALIGN_SIZE
|
|
||||||
#define ALIGN_SIZE sizeof(double)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
typedef union hdr
|
|
||||||
{
|
|
||||||
char align[ALIGN_SIZE]; /* To force sizeof(header). */
|
|
||||||
struct
|
|
||||||
{
|
|
||||||
union hdr *next; /* For chaining headers. */
|
|
||||||
char *deep; /* For stack depth measure. */
|
|
||||||
} h;
|
|
||||||
} header;
|
|
||||||
|
|
||||||
static header *last_alloca_header = NULL; /* -> last alloca header. */
|
|
||||||
|
|
||||||
/* Return a pointer to at least SIZE bytes of storage,
|
|
||||||
which will be automatically reclaimed upon exit from
|
|
||||||
the procedure that called alloca. Originally, this space
|
|
||||||
was supposed to be taken from the current stack frame of the
|
|
||||||
caller, but that method cannot be made to work for some
|
|
||||||
implementations of C, for example under Gould's UTX/32. */
|
|
||||||
|
|
||||||
pointer
|
|
||||||
alloca (unsigned size)
|
|
||||||
{
|
|
||||||
auto char probe; /* Probes stack depth: */
|
|
||||||
register char *depth = ADDRESS_FUNCTION (probe);
|
|
||||||
|
|
||||||
#if STACK_DIRECTION == 0
|
|
||||||
if (STACK_DIR == 0) /* Unknown growth direction. */
|
|
||||||
find_stack_direction ();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Reclaim garbage, defined as all alloca'd storage that
|
|
||||||
was allocated from deeper in the stack than currently. */
|
|
||||||
|
|
||||||
{
|
|
||||||
register header *hp; /* Traverses linked list. */
|
|
||||||
|
|
||||||
#ifdef emacs
|
|
||||||
BLOCK_INPUT;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
for (hp = last_alloca_header; hp != NULL;)
|
|
||||||
if ((STACK_DIR > 0 && hp->h.deep > depth)
|
|
||||||
|| (STACK_DIR < 0 && hp->h.deep < depth))
|
|
||||||
{
|
|
||||||
register header *np = hp->h.next;
|
|
||||||
|
|
||||||
free ((pointer) hp); /* Collect garbage. */
|
|
||||||
|
|
||||||
hp = np; /* -> next header. */
|
|
||||||
}
|
|
||||||
else
|
|
||||||
break; /* Rest are not deeper. */
|
|
||||||
|
|
||||||
last_alloca_header = hp; /* -> last valid storage. */
|
|
||||||
|
|
||||||
#ifdef emacs
|
|
||||||
UNBLOCK_INPUT;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
if (size == 0)
|
|
||||||
return NULL; /* No allocation required. */
|
|
||||||
|
|
||||||
/* Allocate combined header + user data storage. */
|
|
||||||
|
|
||||||
{
|
|
||||||
register pointer new = malloc (sizeof (header) + size);
|
|
||||||
/* Address of header. */
|
|
||||||
|
|
||||||
if (new == 0)
|
|
||||||
abort();
|
|
||||||
|
|
||||||
((header *) new)->h.next = last_alloca_header;
|
|
||||||
((header *) new)->h.deep = depth;
|
|
||||||
|
|
||||||
last_alloca_header = (header *) new;
|
|
||||||
|
|
||||||
/* User storage begins just after header. */
|
|
||||||
|
|
||||||
return (pointer) ((char *) new + sizeof (header));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#if defined (CRAY) && defined (CRAY_STACKSEG_END)
|
|
||||||
|
|
||||||
#ifdef DEBUG_I00AFUNC
|
|
||||||
#include <stdio.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef CRAY_STACK
|
|
||||||
#define CRAY_STACK
|
|
||||||
#ifndef CRAY2
|
|
||||||
/* Stack structures for CRAY-1, CRAY X-MP, and CRAY Y-MP */
|
|
||||||
struct stack_control_header
|
|
||||||
{
|
|
||||||
long shgrow:32; /* Number of times stack has grown. */
|
|
||||||
long shaseg:32; /* Size of increments to stack. */
|
|
||||||
long shhwm:32; /* High water mark of stack. */
|
|
||||||
long shsize:32; /* Current size of stack (all segments). */
|
|
||||||
};
|
|
||||||
|
|
||||||
/* The stack segment linkage control information occurs at
|
|
||||||
the high-address end of a stack segment. (The stack
|
|
||||||
grows from low addresses to high addresses.) The initial
|
|
||||||
part of the stack segment linkage control information is
|
|
||||||
0200 (octal) words. This provides for register storage
|
|
||||||
for the routine which overflows the stack. */
|
|
||||||
|
|
||||||
struct stack_segment_linkage
|
|
||||||
{
|
|
||||||
long ss[0200]; /* 0200 overflow words. */
|
|
||||||
long sssize:32; /* Number of words in this segment. */
|
|
||||||
long ssbase:32; /* Offset to stack base. */
|
|
||||||
long:32;
|
|
||||||
long sspseg:32; /* Offset to linkage control of previous
|
|
||||||
segment of stack. */
|
|
||||||
long:32;
|
|
||||||
long sstcpt:32; /* Pointer to task common address block. */
|
|
||||||
long sscsnm; /* Private control structure number for
|
|
||||||
microtasking. */
|
|
||||||
long ssusr1; /* Reserved for user. */
|
|
||||||
long ssusr2; /* Reserved for user. */
|
|
||||||
long sstpid; /* Process ID for pid based multi-tasking. */
|
|
||||||
long ssgvup; /* Pointer to multitasking thread giveup. */
|
|
||||||
long sscray[7]; /* Reserved for Cray Research. */
|
|
||||||
long ssa0;
|
|
||||||
long ssa1;
|
|
||||||
long ssa2;
|
|
||||||
long ssa3;
|
|
||||||
long ssa4;
|
|
||||||
long ssa5;
|
|
||||||
long ssa6;
|
|
||||||
long ssa7;
|
|
||||||
long sss0;
|
|
||||||
long sss1;
|
|
||||||
long sss2;
|
|
||||||
long sss3;
|
|
||||||
long sss4;
|
|
||||||
long sss5;
|
|
||||||
long sss6;
|
|
||||||
long sss7;
|
|
||||||
};
|
|
||||||
|
|
||||||
#else /* CRAY2 */
|
|
||||||
/* The following structure defines the vector of words
|
|
||||||
returned by the STKSTAT library routine. */
|
|
||||||
struct stk_stat
|
|
||||||
{
|
|
||||||
long now; /* Current total stack size. */
|
|
||||||
long maxc; /* Amount of contiguous space which would
|
|
||||||
be required to satisfy the maximum
|
|
||||||
stack demand to date. */
|
|
||||||
long high_water; /* Stack high-water mark. */
|
|
||||||
long overflows; /* Number of stack overflow ($STKOFEN) calls. */
|
|
||||||
long hits; /* Number of internal buffer hits. */
|
|
||||||
long extends; /* Number of block extensions. */
|
|
||||||
long stko_mallocs; /* Block allocations by $STKOFEN. */
|
|
||||||
long underflows; /* Number of stack underflow calls ($STKRETN). */
|
|
||||||
long stko_free; /* Number of deallocations by $STKRETN. */
|
|
||||||
long stkm_free; /* Number of deallocations by $STKMRET. */
|
|
||||||
long segments; /* Current number of stack segments. */
|
|
||||||
long maxs; /* Maximum number of stack segments so far. */
|
|
||||||
long pad_size; /* Stack pad size. */
|
|
||||||
long current_address; /* Current stack segment address. */
|
|
||||||
long current_size; /* Current stack segment size. This
|
|
||||||
number is actually corrupted by STKSTAT to
|
|
||||||
include the fifteen word trailer area. */
|
|
||||||
long initial_address; /* Address of initial segment. */
|
|
||||||
long initial_size; /* Size of initial segment. */
|
|
||||||
};
|
|
||||||
|
|
||||||
/* The following structure describes the data structure which trails
|
|
||||||
any stack segment. I think that the description in 'asdef' is
|
|
||||||
out of date. I only describe the parts that I am sure about. */
|
|
||||||
|
|
||||||
struct stk_trailer
|
|
||||||
{
|
|
||||||
long this_address; /* Address of this block. */
|
|
||||||
long this_size; /* Size of this block (does not include
|
|
||||||
this trailer). */
|
|
||||||
long unknown2;
|
|
||||||
long unknown3;
|
|
||||||
long link; /* Address of trailer block of previous
|
|
||||||
segment. */
|
|
||||||
long unknown5;
|
|
||||||
long unknown6;
|
|
||||||
long unknown7;
|
|
||||||
long unknown8;
|
|
||||||
long unknown9;
|
|
||||||
long unknown10;
|
|
||||||
long unknown11;
|
|
||||||
long unknown12;
|
|
||||||
long unknown13;
|
|
||||||
long unknown14;
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif /* CRAY2 */
|
|
||||||
#endif /* not CRAY_STACK */
|
|
||||||
|
|
||||||
#ifdef CRAY2
|
|
||||||
/* Determine a "stack measure" for an arbitrary ADDRESS.
|
|
||||||
I doubt that "lint" will like this much. */
|
|
||||||
|
|
||||||
static long
|
|
||||||
i00afunc (long *address)
|
|
||||||
{
|
|
||||||
struct stk_stat status;
|
|
||||||
struct stk_trailer *trailer;
|
|
||||||
long *block, size;
|
|
||||||
long result = 0;
|
|
||||||
|
|
||||||
/* We want to iterate through all of the segments. The first
|
|
||||||
step is to get the stack status structure. We could do this
|
|
||||||
more quickly and more directly, perhaps, by referencing the
|
|
||||||
$LM00 common block, but I know that this works. */
|
|
||||||
|
|
||||||
STKSTAT (&status);
|
|
||||||
|
|
||||||
/* Set up the iteration. */
|
|
||||||
|
|
||||||
trailer = (struct stk_trailer *) (status.current_address
|
|
||||||
+ status.current_size
|
|
||||||
- 15);
|
|
||||||
|
|
||||||
/* There must be at least one stack segment. Therefore it is
|
|
||||||
a fatal error if "trailer" is null. */
|
|
||||||
|
|
||||||
if (trailer == 0)
|
|
||||||
abort ();
|
|
||||||
|
|
||||||
/* Discard segments that do not contain our argument address. */
|
|
||||||
|
|
||||||
while (trailer != 0)
|
|
||||||
{
|
|
||||||
block = (long *) trailer->this_address;
|
|
||||||
size = trailer->this_size;
|
|
||||||
if (block == 0 || size == 0)
|
|
||||||
abort ();
|
|
||||||
trailer = (struct stk_trailer *) trailer->link;
|
|
||||||
if ((block <= address) && (address < (block + size)))
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Set the result to the offset in this segment and add the sizes
|
|
||||||
of all predecessor segments. */
|
|
||||||
|
|
||||||
result = address - block;
|
|
||||||
|
|
||||||
if (trailer == 0)
|
|
||||||
{
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
do
|
|
||||||
{
|
|
||||||
if (trailer->this_size <= 0)
|
|
||||||
abort ();
|
|
||||||
result += trailer->this_size;
|
|
||||||
trailer = (struct stk_trailer *) trailer->link;
|
|
||||||
}
|
|
||||||
while (trailer != 0);
|
|
||||||
|
|
||||||
/* We are done. Note that if you present a bogus address (one
|
|
||||||
not in any segment), you will get a different number back, formed
|
|
||||||
from subtracting the address of the first block. This is probably
|
|
||||||
not what you want. */
|
|
||||||
|
|
||||||
return (result);
|
|
||||||
}
|
|
||||||
|
|
||||||
#else /* not CRAY2 */
|
|
||||||
/* Stack address function for a CRAY-1, CRAY X-MP, or CRAY Y-MP.
|
|
||||||
Determine the number of the cell within the stack,
|
|
||||||
given the address of the cell. The purpose of this
|
|
||||||
routine is to linearize, in some sense, stack addresses
|
|
||||||
for alloca. */
|
|
||||||
|
|
||||||
static long
|
|
||||||
i00afunc (long address)
|
|
||||||
{
|
|
||||||
long stkl = 0;
|
|
||||||
|
|
||||||
long size, pseg, this_segment, stack;
|
|
||||||
long result = 0;
|
|
||||||
|
|
||||||
struct stack_segment_linkage *ssptr;
|
|
||||||
|
|
||||||
/* Register B67 contains the address of the end of the
|
|
||||||
current stack segment. If you (as a subprogram) store
|
|
||||||
your registers on the stack and find that you are past
|
|
||||||
the contents of B67, you have overflowed the segment.
|
|
||||||
|
|
||||||
B67 also points to the stack segment linkage control
|
|
||||||
area, which is what we are really interested in. */
|
|
||||||
|
|
||||||
stkl = CRAY_STACKSEG_END ();
|
|
||||||
ssptr = (struct stack_segment_linkage *) stkl;
|
|
||||||
|
|
||||||
/* If one subtracts 'size' from the end of the segment,
|
|
||||||
one has the address of the first word of the segment.
|
|
||||||
|
|
||||||
If this is not the first segment, 'pseg' will be
|
|
||||||
nonzero. */
|
|
||||||
|
|
||||||
pseg = ssptr->sspseg;
|
|
||||||
size = ssptr->sssize;
|
|
||||||
|
|
||||||
this_segment = stkl - size;
|
|
||||||
|
|
||||||
/* It is possible that calling this routine itself caused
|
|
||||||
a stack overflow. Discard stack segments which do not
|
|
||||||
contain the target address. */
|
|
||||||
|
|
||||||
while (!(this_segment <= address && address <= stkl))
|
|
||||||
{
|
|
||||||
#ifdef DEBUG_I00AFUNC
|
|
||||||
fprintf (stderr, "%011o %011o %011o\n", this_segment, address, stkl);
|
|
||||||
#endif
|
|
||||||
if (pseg == 0)
|
|
||||||
break;
|
|
||||||
stkl = stkl - pseg;
|
|
||||||
ssptr = (struct stack_segment_linkage *) stkl;
|
|
||||||
size = ssptr->sssize;
|
|
||||||
pseg = ssptr->sspseg;
|
|
||||||
this_segment = stkl - size;
|
|
||||||
}
|
|
||||||
|
|
||||||
result = address - this_segment;
|
|
||||||
|
|
||||||
/* If you subtract pseg from the current end of the stack,
|
|
||||||
you get the address of the previous stack segment's end.
|
|
||||||
This seems a little convoluted to me, but I'll bet you save
|
|
||||||
a cycle somewhere. */
|
|
||||||
|
|
||||||
while (pseg != 0)
|
|
||||||
{
|
|
||||||
#ifdef DEBUG_I00AFUNC
|
|
||||||
fprintf (stderr, "%011o %011o\n", pseg, size);
|
|
||||||
#endif
|
|
||||||
stkl = stkl - pseg;
|
|
||||||
ssptr = (struct stack_segment_linkage *) stkl;
|
|
||||||
size = ssptr->sssize;
|
|
||||||
pseg = ssptr->sspseg;
|
|
||||||
result += size;
|
|
||||||
}
|
|
||||||
return (result);
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif /* not CRAY2 */
|
|
||||||
#endif /* CRAY */
|
|
||||||
|
|
||||||
#endif /* no alloca */
|
|
||||||
#endif /* not GCC version 2 */
|
|
||||||
486
autogen.sh
Executable file
486
autogen.sh
Executable file
@@ -0,0 +1,486 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
# Convenience script for regenerating all autogeneratable files that are
|
||||||
|
# omitted from the version control repository. In particular, this script
|
||||||
|
# also regenerates all aclocal.m4, config.h.in, Makefile.in, configure files
|
||||||
|
# with new versions of autoconf or automake.
|
||||||
|
|
||||||
|
# Copyright (C) 2003-2022 Free Software Foundation, Inc.
|
||||||
|
#
|
||||||
|
# This program is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
# Originally written by Paul Eggert. The canonical version of this
|
||||||
|
# script is maintained as top/autogen.sh in gnulib. However, to be
|
||||||
|
# useful to your package, you should place a copy of it under version
|
||||||
|
# control in the top-level directory of your package. The intent is
|
||||||
|
# that all customization can be done with a bootstrap.conf file also
|
||||||
|
# maintained in your version control; gnulib comes with a template
|
||||||
|
# build-aux/bootstrap.conf to get you started.
|
||||||
|
#
|
||||||
|
# Alternatively, you can use an autogen.sh script that is specific
|
||||||
|
# to your package.
|
||||||
|
|
||||||
|
scriptversion=2022-07-24.15; # UTC
|
||||||
|
|
||||||
|
me="$0"
|
||||||
|
medir=`dirname "$me"`
|
||||||
|
|
||||||
|
# Read the function library and the configuration.
|
||||||
|
. "$medir"/bootstrap-funclib.sh
|
||||||
|
|
||||||
|
# Ensure that CDPATH is not set. Otherwise, the output from cd
|
||||||
|
# would cause trouble in at least one use below.
|
||||||
|
(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
|
||||||
|
|
||||||
|
# Environment variables that may be set by the user.
|
||||||
|
: "${AUTOPOINT=autopoint}"
|
||||||
|
: "${AUTORECONF=autoreconf}"
|
||||||
|
|
||||||
|
if test "$vc_ignore" = auto; then
|
||||||
|
vc_ignore=
|
||||||
|
test -d .git && vc_ignore=.gitignore
|
||||||
|
test -d CVS && vc_ignore="$vc_ignore .cvsignore"
|
||||||
|
fi
|
||||||
|
|
||||||
|
usage() {
|
||||||
|
cat <<EOF
|
||||||
|
Usage: $me [OPTION]...
|
||||||
|
Bootstrap this package from the checked-out sources.
|
||||||
|
|
||||||
|
Optional environment variables:
|
||||||
|
GNULIB_SRCDIR Specifies the local directory where gnulib
|
||||||
|
sources reside. Use this if you already
|
||||||
|
have gnulib sources on your machine, and
|
||||||
|
you want to use these sources.
|
||||||
|
|
||||||
|
Options:
|
||||||
|
--copy copy files instead of creating symbolic links
|
||||||
|
--force attempt to bootstrap even if the sources seem
|
||||||
|
not to have been checked out
|
||||||
|
EOF
|
||||||
|
bootstrap_print_option_usage_hook
|
||||||
|
cat <<EOF
|
||||||
|
If the file bootstrap.conf exists in the same directory as this script, its
|
||||||
|
contents are read as shell variables to configure the bootstrap.
|
||||||
|
|
||||||
|
For build prerequisites, environment variables like \$AUTOCONF and \$AMTAR
|
||||||
|
are honored.
|
||||||
|
|
||||||
|
Gnulib sources are assumed to be present:
|
||||||
|
* in \$GNULIB_SRCDIR, if that environment variable is set,
|
||||||
|
* otherwise, in the 'gnulib' submodule, if such a submodule is configured,
|
||||||
|
* otherwise, in the 'gnulib' subdirectory.
|
||||||
|
|
||||||
|
Running without arguments will suffice in most cases.
|
||||||
|
EOF
|
||||||
|
}
|
||||||
|
|
||||||
|
# Parse options.
|
||||||
|
|
||||||
|
# Whether to use copies instead of symlinks.
|
||||||
|
copy=false
|
||||||
|
|
||||||
|
for option
|
||||||
|
do
|
||||||
|
case $option in
|
||||||
|
--help)
|
||||||
|
usage
|
||||||
|
exit;;
|
||||||
|
--version)
|
||||||
|
set -e
|
||||||
|
echo "autogen.sh $scriptversion"
|
||||||
|
echo "$copyright"
|
||||||
|
exit 0
|
||||||
|
;;
|
||||||
|
--force)
|
||||||
|
checkout_only_file=;;
|
||||||
|
--copy)
|
||||||
|
copy=true;;
|
||||||
|
*)
|
||||||
|
bootstrap_option_hook $option || die "$option: unknown option";;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
|
test -z "$GNULIB_SRCDIR" || test -d "$GNULIB_SRCDIR" \
|
||||||
|
|| die "Error: \$GNULIB_SRCDIR environment variable or --gnulib-srcdir option is specified, but does not denote a directory"
|
||||||
|
|
||||||
|
if test -n "$checkout_only_file" && test ! -r "$checkout_only_file"; then
|
||||||
|
die "Running this script from a non-checked-out distribution is risky."
|
||||||
|
fi
|
||||||
|
|
||||||
|
if $use_gnulib; then
|
||||||
|
if test -z "$GNULIB_SRCDIR"; then
|
||||||
|
gnulib_path=$(test -f .gitmodules && git config --file .gitmodules submodule.gnulib.path)
|
||||||
|
test -z "$gnulib_path" && gnulib_path=gnulib
|
||||||
|
GNULIB_SRCDIR=$gnulib_path
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
version_controlled_file() {
|
||||||
|
parent=$1
|
||||||
|
file=$2
|
||||||
|
if test -d .git; then
|
||||||
|
git rm -n "$file" > /dev/null 2>&1
|
||||||
|
elif test -d .svn; then
|
||||||
|
svn log -r HEAD "$file" > /dev/null 2>&1
|
||||||
|
elif test -d CVS; then
|
||||||
|
grep -F "/${file##*/}/" "$parent/CVS/Entries" 2>/dev/null |
|
||||||
|
grep '^/[^/]*/[0-9]' > /dev/null
|
||||||
|
else
|
||||||
|
warn_ "no version control for $file?"
|
||||||
|
false
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# Strip blank and comment lines to leave significant entries.
|
||||||
|
gitignore_entries() {
|
||||||
|
sed '/^#/d; /^$/d' "$@"
|
||||||
|
}
|
||||||
|
|
||||||
|
# If $STR is not already on a line by itself in $FILE, insert it at the start.
|
||||||
|
# Entries are inserted at the start of the ignore list to ensure existing
|
||||||
|
# entries starting with ! are not overridden. Such entries support
|
||||||
|
# whitelisting exceptions after a more generic blacklist pattern.
|
||||||
|
insert_if_absent() {
|
||||||
|
file=$1
|
||||||
|
str=$2
|
||||||
|
test -f $file || touch $file
|
||||||
|
test -r $file || die "Error: failed to read ignore file: $file"
|
||||||
|
duplicate_entries=$(gitignore_entries $file | sort | uniq -d)
|
||||||
|
if [ "$duplicate_entries" ] ; then
|
||||||
|
die "Error: Duplicate entries in $file: " $duplicate_entries
|
||||||
|
fi
|
||||||
|
linesold=$(gitignore_entries $file | wc -l)
|
||||||
|
linesnew=$( { echo "$str"; cat $file; } | gitignore_entries | sort -u | wc -l)
|
||||||
|
if [ $linesold != $linesnew ] ; then
|
||||||
|
{ echo "$str" | cat - $file > $file.bak && mv $file.bak $file; } \
|
||||||
|
|| die "insert_if_absent $file $str: failed"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# Adjust $PATTERN for $VC_IGNORE_FILE and insert it with
|
||||||
|
# insert_if_absent.
|
||||||
|
insert_vc_ignore() {
|
||||||
|
vc_ignore_file="$1"
|
||||||
|
pattern="$2"
|
||||||
|
case $vc_ignore_file in
|
||||||
|
*.gitignore)
|
||||||
|
# A .gitignore entry that does not start with '/' applies
|
||||||
|
# recursively to subdirectories, so prepend '/' to every
|
||||||
|
# .gitignore entry.
|
||||||
|
pattern=$(echo "$pattern" | sed s,^,/,);;
|
||||||
|
esac
|
||||||
|
insert_if_absent "$vc_ignore_file" "$pattern"
|
||||||
|
}
|
||||||
|
|
||||||
|
symlink_to_dir()
|
||||||
|
{
|
||||||
|
src=$1/$2
|
||||||
|
dst=${3-$2}
|
||||||
|
|
||||||
|
test -f "$src" && {
|
||||||
|
|
||||||
|
# If the destination directory doesn't exist, create it.
|
||||||
|
# This is required at least for "lib/uniwidth/cjk.h".
|
||||||
|
dst_dir=$(dirname "$dst")
|
||||||
|
if ! test -d "$dst_dir"; then
|
||||||
|
mkdir -p "$dst_dir"
|
||||||
|
|
||||||
|
# If we've just created a directory like lib/uniwidth,
|
||||||
|
# tell version control system(s) it's ignorable.
|
||||||
|
# FIXME: for now, this does only one level
|
||||||
|
parent=$(dirname "$dst_dir")
|
||||||
|
for dot_ig in x $vc_ignore; do
|
||||||
|
test $dot_ig = x && continue
|
||||||
|
ig=$parent/$dot_ig
|
||||||
|
insert_vc_ignore $ig "${dst_dir##*/}"
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
|
if $copy; then
|
||||||
|
{
|
||||||
|
test ! -h "$dst" || {
|
||||||
|
echo "$me: rm -f $dst" &&
|
||||||
|
rm -f "$dst"
|
||||||
|
}
|
||||||
|
} &&
|
||||||
|
test -f "$dst" &&
|
||||||
|
cmp -s "$src" "$dst" || {
|
||||||
|
echo "$me: cp -fp $src $dst" &&
|
||||||
|
cp -fp "$src" "$dst"
|
||||||
|
}
|
||||||
|
else
|
||||||
|
# Leave any existing symlink alone, if it already points to the source,
|
||||||
|
# so that broken build tools that care about symlink times
|
||||||
|
# aren't confused into doing unnecessary builds. Conversely, if the
|
||||||
|
# existing symlink's timestamp is older than the source, make it afresh,
|
||||||
|
# so that broken tools aren't confused into skipping needed builds. See
|
||||||
|
# <https://lists.gnu.org/r/bug-gnulib/2011-05/msg00326.html>.
|
||||||
|
test -h "$dst" &&
|
||||||
|
src_ls=$(ls -diL "$src" 2>/dev/null) && set $src_ls && src_i=$1 &&
|
||||||
|
dst_ls=$(ls -diL "$dst" 2>/dev/null) && set $dst_ls && dst_i=$1 &&
|
||||||
|
test "$src_i" = "$dst_i" &&
|
||||||
|
both_ls=$(ls -dt "$src" "$dst") &&
|
||||||
|
test "X$both_ls" = "X$dst$nl$src" || {
|
||||||
|
dot_dots=
|
||||||
|
case $src in
|
||||||
|
/*) ;;
|
||||||
|
*)
|
||||||
|
case /$dst/ in
|
||||||
|
*//* | */../* | */./* | /*/*/*/*/*/)
|
||||||
|
die "invalid symlink calculation: $src -> $dst";;
|
||||||
|
/*/*/*/*/) dot_dots=../../../;;
|
||||||
|
/*/*/*/) dot_dots=../../;;
|
||||||
|
/*/*/) dot_dots=../;;
|
||||||
|
esac;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
echo "$me: ln -fs $dot_dots$src $dst" &&
|
||||||
|
ln -fs "$dot_dots$src" "$dst"
|
||||||
|
}
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# Die if there is no AC_CONFIG_AUX_DIR($build_aux) line in configure.ac.
|
||||||
|
found_aux_dir=no
|
||||||
|
grep '^[ ]*AC_CONFIG_AUX_DIR(\['"$build_aux"'])' configure.ac \
|
||||||
|
>/dev/null && found_aux_dir=yes
|
||||||
|
grep '^[ ]*AC_CONFIG_AUX_DIR('"$build_aux"')' configure.ac \
|
||||||
|
>/dev/null && found_aux_dir=yes
|
||||||
|
test $found_aux_dir = yes \
|
||||||
|
|| die "configure.ac lacks 'AC_CONFIG_AUX_DIR([$build_aux])'; add it"
|
||||||
|
|
||||||
|
# If $build_aux doesn't exist, create it now, otherwise some bits
|
||||||
|
# below will malfunction. If creating it, also mark it as ignored.
|
||||||
|
if test ! -d $build_aux; then
|
||||||
|
mkdir $build_aux
|
||||||
|
for dot_ig in x $vc_ignore; do
|
||||||
|
test $dot_ig = x && continue
|
||||||
|
insert_vc_ignore $dot_ig $build_aux
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
|
check_build_prerequisites false
|
||||||
|
|
||||||
|
use_libtool=0
|
||||||
|
# We'd like to use grep -E, to see if any of LT_INIT,
|
||||||
|
# AC_PROG_LIBTOOL, AM_PROG_LIBTOOL is used in configure.ac,
|
||||||
|
# but that's not portable enough (e.g., for Solaris).
|
||||||
|
grep '^[ ]*A[CM]_PROG_LIBTOOL' configure.ac >/dev/null \
|
||||||
|
&& use_libtool=1
|
||||||
|
grep '^[ ]*LT_INIT' configure.ac >/dev/null \
|
||||||
|
&& use_libtool=1
|
||||||
|
if test $use_libtool = 1; then
|
||||||
|
find_tool LIBTOOLIZE glibtoolize libtoolize
|
||||||
|
fi
|
||||||
|
|
||||||
|
if $use_gnulib; then
|
||||||
|
gnulib_tool=$GNULIB_SRCDIR/gnulib-tool
|
||||||
|
<$gnulib_tool || exit $?
|
||||||
|
fi
|
||||||
|
|
||||||
|
# NOTE: we have to be careful to run both autopoint and libtoolize
|
||||||
|
# before gnulib-tool, since gnulib-tool is likely to provide newer
|
||||||
|
# versions of files "installed" by these two programs.
|
||||||
|
# Then, *after* gnulib-tool (see below), we have to be careful to
|
||||||
|
# run autoreconf in such a way that it does not run either of these
|
||||||
|
# two just-pre-run programs.
|
||||||
|
|
||||||
|
# Import from gettext.
|
||||||
|
with_gettext=yes
|
||||||
|
grep '^[ ]*AM_GNU_GETTEXT_VERSION(' configure.ac >/dev/null || \
|
||||||
|
with_gettext=no
|
||||||
|
|
||||||
|
if test $with_gettext = yes || test $use_libtool = 1; then
|
||||||
|
|
||||||
|
tempbase=.bootstrap$$
|
||||||
|
trap "rm -f $tempbase.0 $tempbase.1" 1 2 13 15
|
||||||
|
|
||||||
|
> $tempbase.0 > $tempbase.1 &&
|
||||||
|
find . ! -type d -print | sort > $tempbase.0 || exit
|
||||||
|
|
||||||
|
if test $with_gettext = yes; then
|
||||||
|
# Released autopoint has the tendency to install macros that have been
|
||||||
|
# obsoleted in current gnulib, so run this before gnulib-tool.
|
||||||
|
echo "$0: $AUTOPOINT --force"
|
||||||
|
$AUTOPOINT --force || exit
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Autoreconf runs aclocal before libtoolize, which causes spurious
|
||||||
|
# warnings if the initial aclocal is confused by the libtoolized
|
||||||
|
# (or worse out-of-date) macro directory.
|
||||||
|
# libtoolize 1.9b added the --install option; but we support back
|
||||||
|
# to libtoolize 1.5.22, where the install action was default.
|
||||||
|
if test $use_libtool = 1; then
|
||||||
|
install=
|
||||||
|
case $($LIBTOOLIZE --help) in
|
||||||
|
*--install*) install=--install ;;
|
||||||
|
esac
|
||||||
|
echo "running: $LIBTOOLIZE $install --copy"
|
||||||
|
$LIBTOOLIZE $install --copy
|
||||||
|
fi
|
||||||
|
|
||||||
|
find . ! -type d -print | sort >$tempbase.1
|
||||||
|
old_IFS=$IFS
|
||||||
|
IFS=$nl
|
||||||
|
for file in $(comm -13 $tempbase.0 $tempbase.1); do
|
||||||
|
IFS=$old_IFS
|
||||||
|
parent=${file%/*}
|
||||||
|
version_controlled_file "$parent" "$file" || {
|
||||||
|
for dot_ig in x $vc_ignore; do
|
||||||
|
test $dot_ig = x && continue
|
||||||
|
ig=$parent/$dot_ig
|
||||||
|
insert_vc_ignore "$ig" "${file##*/}"
|
||||||
|
done
|
||||||
|
}
|
||||||
|
done
|
||||||
|
IFS=$old_IFS
|
||||||
|
|
||||||
|
rm -f $tempbase.0 $tempbase.1
|
||||||
|
trap - 1 2 13 15
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Import from gnulib.
|
||||||
|
|
||||||
|
if $use_gnulib; then
|
||||||
|
gnulib_tool_options="\
|
||||||
|
--no-changelog\
|
||||||
|
--aux-dir=$build_aux\
|
||||||
|
--doc-base=$doc_base\
|
||||||
|
--lib=$gnulib_name\
|
||||||
|
--m4-base=$m4_base/\
|
||||||
|
--source-base=$source_base/\
|
||||||
|
--tests-base=$tests_base\
|
||||||
|
--local-dir=$local_gl_dir\
|
||||||
|
$gnulib_tool_option_extras\
|
||||||
|
"
|
||||||
|
if test $use_libtool = 1; then
|
||||||
|
case "$gnulib_tool_options " in
|
||||||
|
*' --libtool '*) ;;
|
||||||
|
*) gnulib_tool_options="$gnulib_tool_options --libtool" ;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
echo "$0: $gnulib_tool $gnulib_tool_options --import ..."
|
||||||
|
$gnulib_tool $gnulib_tool_options --import $gnulib_modules \
|
||||||
|
|| die "gnulib-tool failed"
|
||||||
|
|
||||||
|
for file in $gnulib_files; do
|
||||||
|
symlink_to_dir "$GNULIB_SRCDIR" $file \
|
||||||
|
|| die "failed to symlink $file"
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
|
bootstrap_post_import_hook \
|
||||||
|
|| die "bootstrap_post_import_hook failed"
|
||||||
|
|
||||||
|
# Remove any dangling symlink matching "*.m4" or "*.[ch]" in some
|
||||||
|
# gnulib-populated directories. Such .m4 files would cause aclocal to fail.
|
||||||
|
# The following requires GNU find 4.2.3 or newer. Considering the usual
|
||||||
|
# portability constraints of this script, that may seem a very demanding
|
||||||
|
# requirement, but it should be ok. Ignore any failure, which is fine,
|
||||||
|
# since this is only a convenience to help developers avoid the relatively
|
||||||
|
# unusual case in which a symlinked-to .m4 file is git-removed from gnulib
|
||||||
|
# between successive runs of this script.
|
||||||
|
find "$m4_base" "$source_base" \
|
||||||
|
-depth \( -name '*.m4' -o -name '*.[ch]' \) \
|
||||||
|
-type l -xtype l -delete > /dev/null 2>&1
|
||||||
|
|
||||||
|
# Invoke autoreconf with --force --install to ensure upgrades of tools
|
||||||
|
# such as ylwrap.
|
||||||
|
AUTORECONFFLAGS="--verbose --install --force -I $m4_base $ACLOCAL_FLAGS"
|
||||||
|
|
||||||
|
# Some systems (RHEL 5) are using ancient autotools, for which the
|
||||||
|
# --no-recursive option had not been invented. Detect that lack and
|
||||||
|
# omit the option when it's not supported. FIXME in 2017: remove this
|
||||||
|
# hack when RHEL 5 autotools are updated, or when they become irrelevant.
|
||||||
|
case $($AUTORECONF --help) in
|
||||||
|
*--no-recursive*) AUTORECONFFLAGS="$AUTORECONFFLAGS --no-recursive";;
|
||||||
|
esac
|
||||||
|
|
||||||
|
# Tell autoreconf not to invoke autopoint or libtoolize; they were run above.
|
||||||
|
echo "running: AUTOPOINT=true LIBTOOLIZE=true $AUTORECONF $AUTORECONFFLAGS"
|
||||||
|
AUTOPOINT=true LIBTOOLIZE=true $AUTORECONF $AUTORECONFFLAGS \
|
||||||
|
|| die "autoreconf failed"
|
||||||
|
|
||||||
|
# Get some extra files from gnulib, overriding existing files.
|
||||||
|
for file in $gnulib_extra_files; do
|
||||||
|
case $file in
|
||||||
|
*/INSTALL) dst=INSTALL;;
|
||||||
|
build-aux/*) dst=$build_aux/${file#build-aux/};;
|
||||||
|
*) dst=$file;;
|
||||||
|
esac
|
||||||
|
symlink_to_dir "$GNULIB_SRCDIR" $file $dst \
|
||||||
|
|| die "failed to symlink $file"
|
||||||
|
done
|
||||||
|
|
||||||
|
if test $with_gettext = yes; then
|
||||||
|
# Create gettext configuration.
|
||||||
|
echo "$0: Creating po/Makevars from po/Makevars.template ..."
|
||||||
|
rm -f po/Makevars
|
||||||
|
sed '
|
||||||
|
/^EXTRA_LOCALE_CATEGORIES *=/s/=.*/= '"$EXTRA_LOCALE_CATEGORIES"'/
|
||||||
|
/^COPYRIGHT_HOLDER *=/s/=.*/= '"$COPYRIGHT_HOLDER"'/
|
||||||
|
/^MSGID_BUGS_ADDRESS *=/s|=.*|= '"$MSGID_BUGS_ADDRESS"'|
|
||||||
|
/^XGETTEXT_OPTIONS *=/{
|
||||||
|
s/$/ \\/
|
||||||
|
a\
|
||||||
|
'"$XGETTEXT_OPTIONS"' $${end_of_xgettext_options+}
|
||||||
|
}
|
||||||
|
' po/Makevars.template >po/Makevars \
|
||||||
|
|| die 'cannot generate po/Makevars'
|
||||||
|
|
||||||
|
# If the 'gettext' module is in use, grab the latest Makefile.in.in.
|
||||||
|
# If only the 'gettext-h' module is in use, assume autopoint already
|
||||||
|
# put the correct version of this file into place.
|
||||||
|
case $gnulib_modules in
|
||||||
|
*gettext-h*) ;;
|
||||||
|
*gettext*)
|
||||||
|
cp $GNULIB_SRCDIR/build-aux/po/Makefile.in.in po/Makefile.in.in \
|
||||||
|
|| die "cannot create po/Makefile.in.in"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
if test -d runtime-po; then
|
||||||
|
# Similarly for runtime-po/Makevars, but not quite the same.
|
||||||
|
rm -f runtime-po/Makevars
|
||||||
|
sed '
|
||||||
|
/^DOMAIN *=.*/s/=.*/= '"$package"'-runtime/
|
||||||
|
/^subdir *=.*/s/=.*/= runtime-po/
|
||||||
|
/^MSGID_BUGS_ADDRESS *=/s/=.*/= bug-'"$package"'@gnu.org/
|
||||||
|
/^XGETTEXT_OPTIONS *=/{
|
||||||
|
s/$/ \\/
|
||||||
|
a\
|
||||||
|
'"$XGETTEXT_OPTIONS_RUNTIME"' $${end_of_xgettext_options+}
|
||||||
|
}
|
||||||
|
' po/Makevars.template >runtime-po/Makevars \
|
||||||
|
|| die 'cannot generate runtime-po/Makevars'
|
||||||
|
|
||||||
|
# Copy identical files from po to runtime-po.
|
||||||
|
(cd po && cp -p Makefile.in.in *-quot *.header *.sed *.sin ../runtime-po)
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
bootstrap_epilogue
|
||||||
|
|
||||||
|
echo "$0: done. Now you can run './configure'."
|
||||||
|
|
||||||
|
# ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
# Local Variables:
|
||||||
|
# eval: (add-hook 'before-save-hook 'time-stamp)
|
||||||
|
# time-stamp-start: "scriptversion="
|
||||||
|
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
||||||
|
# time-stamp-time-zone: "UTC0"
|
||||||
|
# time-stamp-end: "; # UTC"
|
||||||
|
# End:
|
||||||
273
autopull.sh
Executable file
273
autopull.sh
Executable file
@@ -0,0 +1,273 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
# Convenience script for fetching auxiliary files that are omitted from
|
||||||
|
# the version control repository of this package.
|
||||||
|
|
||||||
|
# Copyright (C) 2003-2022 Free Software Foundation, Inc.
|
||||||
|
#
|
||||||
|
# This program is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
# Originally written by Paul Eggert. The canonical version of this
|
||||||
|
# script is maintained as top/autopull.sh in gnulib. However, to be
|
||||||
|
# useful to your package, you should place a copy of it under version
|
||||||
|
# control in the top-level directory of your package. The intent is
|
||||||
|
# that all customization can be done with a bootstrap.conf file also
|
||||||
|
# maintained in your version control; gnulib comes with a template
|
||||||
|
# build-aux/bootstrap.conf to get you started.
|
||||||
|
#
|
||||||
|
# Alternatively, you can use an autopull.sh script that is specific
|
||||||
|
# to your package.
|
||||||
|
|
||||||
|
scriptversion=2022-07-24.15; # UTC
|
||||||
|
|
||||||
|
me="$0"
|
||||||
|
medir=`dirname "$me"`
|
||||||
|
|
||||||
|
# Read the function library and the configuration.
|
||||||
|
. "$medir"/bootstrap-funclib.sh
|
||||||
|
|
||||||
|
# Ensure that CDPATH is not set. Otherwise, the output from cd
|
||||||
|
# would cause trouble in at least one use below.
|
||||||
|
(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
|
||||||
|
|
||||||
|
usage() {
|
||||||
|
cat <<EOF
|
||||||
|
Usage: $me [OPTION]...
|
||||||
|
Bootstrap this package from the checked-out sources.
|
||||||
|
|
||||||
|
Optional environment variables:
|
||||||
|
GNULIB_SRCDIR Specifies the local directory where gnulib
|
||||||
|
sources reside. Use this if you already
|
||||||
|
have gnulib sources on your machine, and
|
||||||
|
you want to use these sources.
|
||||||
|
GNULIB_REFDIR Specifies the local directory where a gnulib
|
||||||
|
repository (with a .git subdirectory) resides.
|
||||||
|
Use this if you already have gnulib sources
|
||||||
|
and history on your machine, and do not want
|
||||||
|
to waste your bandwidth downloading them again.
|
||||||
|
GNULIB_URL Cloneable URL of the gnulib repository.
|
||||||
|
|
||||||
|
Options:
|
||||||
|
--bootstrap-sync if this bootstrap script is not identical to
|
||||||
|
the version in the local gnulib sources,
|
||||||
|
update this script, and then restart it with
|
||||||
|
/bin/sh or the shell \$CONFIG_SHELL
|
||||||
|
--no-bootstrap-sync do not check whether bootstrap is out of sync
|
||||||
|
--force attempt to bootstrap even if the sources seem
|
||||||
|
not to have been checked out
|
||||||
|
--no-git do not use git to update gnulib. Requires that
|
||||||
|
\$GNULIB_SRCDIR or the --gnulib-srcdir option
|
||||||
|
points to a gnulib repository with the correct
|
||||||
|
revision
|
||||||
|
--skip-po do not download po files
|
||||||
|
EOF
|
||||||
|
bootstrap_print_option_usage_hook
|
||||||
|
cat <<EOF
|
||||||
|
If the file bootstrap.conf exists in the same directory as this script, its
|
||||||
|
contents are read as shell variables to configure the bootstrap.
|
||||||
|
|
||||||
|
For build prerequisites, environment variables like \$AUTOCONF and \$AMTAR
|
||||||
|
are honored.
|
||||||
|
|
||||||
|
Gnulib sources can be fetched in various ways:
|
||||||
|
|
||||||
|
* If the environment variable GNULIB_SRCDIR is set (either as an
|
||||||
|
environment variable or via the --gnulib-srcdir option), then sources
|
||||||
|
are fetched from that local directory. If it is a git repository and
|
||||||
|
the configuration variable GNULIB_REVISION is set in bootstrap.conf,
|
||||||
|
then that revision is checked out.
|
||||||
|
|
||||||
|
* Otherwise, if this package is in a git repository with a 'gnulib'
|
||||||
|
submodule configured, then that submodule is initialized and updated
|
||||||
|
and sources are fetched from there. If GNULIB_REFDIR is set (either
|
||||||
|
as an environment variable or via the --gnulib-refdir option) and is
|
||||||
|
a git repository, then it is used as a reference.
|
||||||
|
|
||||||
|
* Otherwise, if the 'gnulib' directory does not exist, Gnulib sources
|
||||||
|
are cloned into that directory using git from \$GNULIB_URL, defaulting
|
||||||
|
to $default_gnulib_url.
|
||||||
|
If the configuration variable GNULIB_REVISION is set in bootstrap.conf,
|
||||||
|
then that revision is checked out.
|
||||||
|
|
||||||
|
* Otherwise, the existing Gnulib sources in the 'gnulib' directory are
|
||||||
|
used. If it is a git repository and the configuration variable
|
||||||
|
GNULIB_REVISION is set in bootstrap.conf, then that revision is
|
||||||
|
checked out.
|
||||||
|
|
||||||
|
If you maintain a package and want to pin a particular revision of the
|
||||||
|
Gnulib sources that has been tested with your package, then there are
|
||||||
|
two possible approaches: either configure a 'gnulib' submodule with the
|
||||||
|
appropriate revision, or set GNULIB_REVISION (and if necessary
|
||||||
|
GNULIB_URL) in bootstrap.conf.
|
||||||
|
|
||||||
|
Running without arguments will suffice in most cases.
|
||||||
|
EOF
|
||||||
|
}
|
||||||
|
|
||||||
|
# Parse options.
|
||||||
|
|
||||||
|
# Use git to update gnulib sources
|
||||||
|
use_git=true
|
||||||
|
|
||||||
|
for option
|
||||||
|
do
|
||||||
|
case $option in
|
||||||
|
--help)
|
||||||
|
usage
|
||||||
|
exit;;
|
||||||
|
--version)
|
||||||
|
set -e
|
||||||
|
echo "autopull.sh $scriptversion"
|
||||||
|
echo "$copyright"
|
||||||
|
exit 0
|
||||||
|
;;
|
||||||
|
--skip-po)
|
||||||
|
SKIP_PO=t;;
|
||||||
|
--force)
|
||||||
|
checkout_only_file=;;
|
||||||
|
--bootstrap-sync)
|
||||||
|
bootstrap_sync=true;;
|
||||||
|
--no-bootstrap-sync)
|
||||||
|
bootstrap_sync=false;;
|
||||||
|
--no-git)
|
||||||
|
use_git=false;;
|
||||||
|
*)
|
||||||
|
bootstrap_option_hook $option || die "$option: unknown option";;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
|
$use_git || test -n "$GNULIB_SRCDIR" \
|
||||||
|
|| die "Error: --no-git requires \$GNULIB_SRCDIR environment variable or --gnulib-srcdir option"
|
||||||
|
test -z "$GNULIB_SRCDIR" || test -d "$GNULIB_SRCDIR" \
|
||||||
|
|| die "Error: \$GNULIB_SRCDIR environment variable or --gnulib-srcdir option is specified, but does not denote a directory"
|
||||||
|
|
||||||
|
if test -n "$checkout_only_file" && test ! -r "$checkout_only_file"; then
|
||||||
|
die "Running this script from a non-checked-out distribution is risky."
|
||||||
|
fi
|
||||||
|
|
||||||
|
check_build_prerequisites $use_git
|
||||||
|
|
||||||
|
if $use_gnulib || $bootstrap_sync; then
|
||||||
|
prepare_GNULIB_SRCDIR
|
||||||
|
if $bootstrap_sync; then
|
||||||
|
upgrade_bootstrap
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Find sha1sum, named gsha1sum on MacPorts, shasum on Mac OS X 10.6.
|
||||||
|
# Also find the compatible sha1 utility on the BSDs
|
||||||
|
if test x"$SKIP_PO" = x; then
|
||||||
|
find_tool SHA1SUM sha1sum gsha1sum shasum sha1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# See if we can use gnulib's git-merge-changelog merge driver.
|
||||||
|
if $use_git && test -d .git && check_exists git; then
|
||||||
|
if git config merge.merge-changelog.driver >/dev/null ; then
|
||||||
|
:
|
||||||
|
elif check_exists git-merge-changelog; then
|
||||||
|
echo "$0: initializing git-merge-changelog driver"
|
||||||
|
git config merge.merge-changelog.name 'GNU-style ChangeLog merge driver'
|
||||||
|
git config merge.merge-changelog.driver 'git-merge-changelog %O %A %B'
|
||||||
|
else
|
||||||
|
echo "$0: consider installing git-merge-changelog from gnulib"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
# ----------------------------- Get translations. -----------------------------
|
||||||
|
|
||||||
|
download_po_files() {
|
||||||
|
subdir=$1
|
||||||
|
domain=$2
|
||||||
|
echo "$me: getting translations into $subdir for $domain..."
|
||||||
|
cmd=$(printf "$po_download_command_format" "$subdir" "$domain")
|
||||||
|
eval "$cmd"
|
||||||
|
}
|
||||||
|
|
||||||
|
# Mirror .po files to $po_dir/.reference and copy only the new
|
||||||
|
# or modified ones into $po_dir. Also update $po_dir/LINGUAS.
|
||||||
|
# Note po files that exist locally only are left in $po_dir but will
|
||||||
|
# not be included in LINGUAS and hence will not be distributed.
|
||||||
|
update_po_files() {
|
||||||
|
# Directory containing primary .po files.
|
||||||
|
# Overwrite them only when we're sure a .po file is new.
|
||||||
|
po_dir=$1
|
||||||
|
domain=$2
|
||||||
|
|
||||||
|
# Mirror *.po files into this dir.
|
||||||
|
# Usually contains *.s1 checksum files.
|
||||||
|
ref_po_dir="$po_dir/.reference"
|
||||||
|
|
||||||
|
test -d $ref_po_dir || mkdir $ref_po_dir || return
|
||||||
|
download_po_files $ref_po_dir $domain \
|
||||||
|
&& ls "$ref_po_dir"/*.po 2>/dev/null |
|
||||||
|
sed 's|.*/||; s|\.po$||' > "$po_dir/LINGUAS" || return
|
||||||
|
|
||||||
|
langs=$(cd $ref_po_dir && echo *.po | sed 's/\.po//g')
|
||||||
|
test "$langs" = '*' && langs=x
|
||||||
|
for po in $langs; do
|
||||||
|
case $po in x) continue;; esac
|
||||||
|
new_po="$ref_po_dir/$po.po"
|
||||||
|
cksum_file="$ref_po_dir/$po.s1"
|
||||||
|
if ! test -f "$cksum_file" ||
|
||||||
|
! test -f "$po_dir/$po.po" ||
|
||||||
|
! $SHA1SUM -c "$cksum_file" < "$new_po" > /dev/null 2>&1; then
|
||||||
|
echo "$me: updated $po_dir/$po.po..."
|
||||||
|
cp "$new_po" "$po_dir/$po.po" \
|
||||||
|
&& $SHA1SUM < "$new_po" > "$cksum_file" || return
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
case $SKIP_PO in
|
||||||
|
'')
|
||||||
|
if test -d po; then
|
||||||
|
update_po_files po $package || exit
|
||||||
|
fi
|
||||||
|
|
||||||
|
if test -d runtime-po; then
|
||||||
|
update_po_files runtime-po $package-runtime || exit
|
||||||
|
fi;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
# -----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
bootstrap_post_pull_hook \
|
||||||
|
|| die "bootstrap_post_pull_hook failed"
|
||||||
|
|
||||||
|
# Don't proceed if there are uninitialized submodules. In particular,
|
||||||
|
# autogen.sh will remove dangling links, which might be links into
|
||||||
|
# uninitialized submodules.
|
||||||
|
# But it's OK if the 'gnulib' submodule is uninitialized, as long as
|
||||||
|
# GNULIB_SRCDIR is set.
|
||||||
|
if $use_git; then
|
||||||
|
# Uninitialized submodules are listed with an initial dash.
|
||||||
|
uninitialized=`git submodule | grep '^-' | awk '{ print $2 }'`
|
||||||
|
if test -n "$GNULIB_SRCDIR"; then
|
||||||
|
uninitialized=`echo "$uninitialized" | grep -v '^gnulib$'`
|
||||||
|
fi
|
||||||
|
if test -n "$uninitialized"; then
|
||||||
|
die "Some git submodules are not initialized: "`echo "$uninitialized" | tr '\n' ',' | sed -e 's|,$|.|'`" Either use option '--no-git', or run 'git submodule update --init' and bootstrap again."
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "$0: done. Now you can run './autogen.sh'."
|
||||||
|
|
||||||
|
# ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
# Local Variables:
|
||||||
|
# eval: (add-hook 'before-save-hook 'time-stamp)
|
||||||
|
# time-stamp-start: "scriptversion="
|
||||||
|
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
||||||
|
# time-stamp-time-zone: "UTC0"
|
||||||
|
# time-stamp-end: "; # UTC"
|
||||||
|
# End:
|
||||||
214
bootstrap
Executable file
214
bootstrap
Executable file
@@ -0,0 +1,214 @@
|
|||||||
|
#! /bin/sh
|
||||||
|
# Bootstrap this package from checked-out sources.
|
||||||
|
|
||||||
|
# Copyright (C) 2003-2022 Free Software Foundation, Inc.
|
||||||
|
#
|
||||||
|
# This program is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
# Originally written by Paul Eggert. The canonical version of this
|
||||||
|
# script is maintained as top/bootstrap 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.
|
||||||
|
|
||||||
|
# Please report bugs or propose patches to bug-gnulib@gnu.org.
|
||||||
|
|
||||||
|
scriptversion=2022-07-29.23; # UTC
|
||||||
|
|
||||||
|
me="$0"
|
||||||
|
medir=`dirname "$me"`
|
||||||
|
|
||||||
|
# Read the function library and the configuration.
|
||||||
|
. "$medir"/bootstrap-funclib.sh
|
||||||
|
|
||||||
|
usage() {
|
||||||
|
cat <<EOF
|
||||||
|
Usage: $me [OPTION]...
|
||||||
|
Bootstrap this package from the checked-out sources.
|
||||||
|
|
||||||
|
Optional environment variables:
|
||||||
|
GNULIB_SRCDIR Specifies the local directory where gnulib
|
||||||
|
sources reside. Use this if you already
|
||||||
|
have gnulib sources on your machine, and
|
||||||
|
do not want to waste your bandwidth downloading
|
||||||
|
them again.
|
||||||
|
GNULIB_URL Cloneable URL of the gnulib repository.
|
||||||
|
|
||||||
|
Options:
|
||||||
|
--gnulib-srcdir=DIRNAME specify the local directory where gnulib
|
||||||
|
sources reside. Use this if you already
|
||||||
|
have gnulib sources on your machine, and
|
||||||
|
you want to use these sources. Defaults
|
||||||
|
to \$GNULIB_SRCDIR
|
||||||
|
--gnulib-refdir=DIRNAME specify the local directory where a gnulib
|
||||||
|
repository (with a .git subdirectory) resides.
|
||||||
|
Use this if you already have gnulib sources
|
||||||
|
and history on your machine, and do not want
|
||||||
|
to waste your bandwidth downloading them again.
|
||||||
|
Defaults to \$GNULIB_REFDIR
|
||||||
|
--bootstrap-sync if this bootstrap script is not identical to
|
||||||
|
the version in the local gnulib sources,
|
||||||
|
update this script, and then restart it with
|
||||||
|
/bin/sh or the shell \$CONFIG_SHELL
|
||||||
|
--no-bootstrap-sync do not check whether bootstrap is out of sync
|
||||||
|
--copy copy files instead of creating symbolic links
|
||||||
|
--force attempt to bootstrap even if the sources seem
|
||||||
|
not to have been checked out
|
||||||
|
--no-git do not use git to update gnulib. Requires that
|
||||||
|
\$GNULIB_SRCDIR or the --gnulib-srcdir option
|
||||||
|
points to a gnulib repository with the correct
|
||||||
|
revision
|
||||||
|
--skip-po do not download po files
|
||||||
|
EOF
|
||||||
|
bootstrap_print_option_usage_hook
|
||||||
|
cat <<EOF
|
||||||
|
If the file bootstrap.conf exists in the same directory as this script, its
|
||||||
|
contents are read as shell variables to configure the bootstrap.
|
||||||
|
|
||||||
|
For build prerequisites, environment variables like \$AUTOCONF and \$AMTAR
|
||||||
|
are honored.
|
||||||
|
|
||||||
|
Gnulib sources can be fetched in various ways:
|
||||||
|
|
||||||
|
* If the environment variable GNULIB_SRCDIR is set (either as an
|
||||||
|
environment variable or via the --gnulib-srcdir option), then sources
|
||||||
|
are fetched from that local directory. If it is a git repository and
|
||||||
|
the configuration variable GNULIB_REVISION is set in bootstrap.conf,
|
||||||
|
then that revision is checked out.
|
||||||
|
|
||||||
|
* Otherwise, if this package is in a git repository with a 'gnulib'
|
||||||
|
submodule configured, then that submodule is initialized and updated
|
||||||
|
and sources are fetched from there. If GNULIB_REFDIR is set (either
|
||||||
|
as an environment variable or via the --gnulib-refdir option) and is
|
||||||
|
a git repository, then it is used as a reference.
|
||||||
|
|
||||||
|
* Otherwise, if the 'gnulib' directory does not exist, Gnulib sources
|
||||||
|
are cloned into that directory using git from \$GNULIB_URL, defaulting
|
||||||
|
to $default_gnulib_url.
|
||||||
|
If the configuration variable GNULIB_REVISION is set in bootstrap.conf,
|
||||||
|
then that revision is checked out.
|
||||||
|
|
||||||
|
* Otherwise, the existing Gnulib sources in the 'gnulib' directory are
|
||||||
|
used. If it is a git repository and the configuration variable
|
||||||
|
GNULIB_REVISION is set in bootstrap.conf, then that revision is
|
||||||
|
checked out.
|
||||||
|
|
||||||
|
If you maintain a package and want to pin a particular revision of the
|
||||||
|
Gnulib sources that has been tested with your package, then there are
|
||||||
|
two possible approaches: either configure a 'gnulib' submodule with the
|
||||||
|
appropriate revision, or set GNULIB_REVISION (and if necessary
|
||||||
|
GNULIB_URL) in bootstrap.conf.
|
||||||
|
|
||||||
|
Running without arguments will suffice in most cases.
|
||||||
|
EOF
|
||||||
|
}
|
||||||
|
|
||||||
|
# Parse options.
|
||||||
|
|
||||||
|
# Whether to use copies instead of symlinks.
|
||||||
|
copy=false
|
||||||
|
|
||||||
|
# Use git to update gnulib sources
|
||||||
|
use_git=true
|
||||||
|
|
||||||
|
for option
|
||||||
|
do
|
||||||
|
case $option in
|
||||||
|
--help)
|
||||||
|
usage
|
||||||
|
exit;;
|
||||||
|
--version)
|
||||||
|
set -e
|
||||||
|
echo "bootstrap $scriptversion"
|
||||||
|
echo "$copyright"
|
||||||
|
exit 0
|
||||||
|
;;
|
||||||
|
--gnulib-srcdir=*)
|
||||||
|
GNULIB_SRCDIR=${option#--gnulib-srcdir=};;
|
||||||
|
--gnulib-refdir=*)
|
||||||
|
GNULIB_REFDIR=${option#--gnulib-refdir=};;
|
||||||
|
--skip-po)
|
||||||
|
SKIP_PO=t;;
|
||||||
|
--force)
|
||||||
|
checkout_only_file=;;
|
||||||
|
--copy)
|
||||||
|
copy=true;;
|
||||||
|
--bootstrap-sync)
|
||||||
|
bootstrap_sync=true;;
|
||||||
|
--no-bootstrap-sync)
|
||||||
|
bootstrap_sync=false;;
|
||||||
|
--no-git)
|
||||||
|
use_git=false;;
|
||||||
|
*)
|
||||||
|
bootstrap_option_hook $option || die "$option: unknown option";;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
|
$use_git || test -n "$GNULIB_SRCDIR" \
|
||||||
|
|| die "Error: --no-git requires \$GNULIB_SRCDIR environment variable or --gnulib-srcdir option"
|
||||||
|
test -z "$GNULIB_SRCDIR" || test -d "$GNULIB_SRCDIR" \
|
||||||
|
|| die "Error: \$GNULIB_SRCDIR environment variable or --gnulib-srcdir option is specified, but does not denote a directory"
|
||||||
|
|
||||||
|
if test -n "$checkout_only_file" && test ! -r "$checkout_only_file"; then
|
||||||
|
die "Bootstrapping from a non-checked-out distribution is risky."
|
||||||
|
fi
|
||||||
|
|
||||||
|
check_build_prerequisites $use_git
|
||||||
|
|
||||||
|
if ! test -f "$medir"/bootstrap-funclib.sh; then
|
||||||
|
# We have only completed the first phase of an upgrade from a bootstrap
|
||||||
|
# version < 2022-07-24. Need to do the second phase now.
|
||||||
|
bootstrap_sync=true
|
||||||
|
fi
|
||||||
|
|
||||||
|
if $bootstrap_sync; then
|
||||||
|
prepare_GNULIB_SRCDIR
|
||||||
|
upgrade_bootstrap
|
||||||
|
# Since we have now upgraded if needed, no need to try it a second time below.
|
||||||
|
bootstrap_sync=false
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "$0: Bootstrapping from checked-out $package sources..."
|
||||||
|
|
||||||
|
# Pass GNULIB_SRCDIR to autopull.sh and autogen.sh.
|
||||||
|
export GNULIB_SRCDIR
|
||||||
|
|
||||||
|
# Pass GNULIB_REFDIR to autopull.sh.
|
||||||
|
export GNULIB_REFDIR
|
||||||
|
|
||||||
|
if $use_git || test -z "$SKIP_PO"; then
|
||||||
|
"$medir"/autopull.sh \
|
||||||
|
`if $bootstrap_sync; then echo ' --bootstrap-sync'; else echo ' --no-bootstrap-sync'; fi` \
|
||||||
|
`if test -z "$checkout_only_file"; then echo ' --force'; fi` \
|
||||||
|
`if ! $use_git; then echo ' --no-git'; fi` \
|
||||||
|
`if test -n "$SKIP_PO"; then echo ' --skip-po'; fi` \
|
||||||
|
|| die "autopull.sh failed."
|
||||||
|
fi
|
||||||
|
|
||||||
|
"$medir"/autogen.sh \
|
||||||
|
`if $copy; then echo ' --copy'; fi` \
|
||||||
|
`if test -z "$checkout_only_file"; then echo ' --force'; fi` \
|
||||||
|
|| die "autogen.sh failed."
|
||||||
|
|
||||||
|
# ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
# Local Variables:
|
||||||
|
# eval: (add-hook 'before-save-hook 'time-stamp)
|
||||||
|
# time-stamp-start: "scriptversion="
|
||||||
|
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
||||||
|
# time-stamp-time-zone: "UTC0"
|
||||||
|
# time-stamp-end: "; # UTC"
|
||||||
|
# End:
|
||||||
594
bootstrap-funclib.sh
Normal file
594
bootstrap-funclib.sh
Normal file
@@ -0,0 +1,594 @@
|
|||||||
|
# A library of shell functions for autopull.sh, autogen.sh, and bootstrap.
|
||||||
|
|
||||||
|
# Copyright (C) 2003-2022 Free Software Foundation, Inc.
|
||||||
|
#
|
||||||
|
# This program is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
# Originally written by Paul Eggert. The canonical version of this
|
||||||
|
# script is maintained as top/bootstrap-funclib.sh in gnulib. However,
|
||||||
|
# to be useful to your package, you should place a copy of it under
|
||||||
|
# version control in the top-level directory of your package. The
|
||||||
|
# intent is that all customization can be done with a bootstrap.conf
|
||||||
|
# file also maintained in your version control; gnulib comes with a
|
||||||
|
# template build-aux/bootstrap.conf to get you started.
|
||||||
|
|
||||||
|
scriptversion=2022-07-24.15; # UTC
|
||||||
|
|
||||||
|
nl='
|
||||||
|
'
|
||||||
|
|
||||||
|
# Ensure file names are sorted consistently across platforms.
|
||||||
|
LC_ALL=C
|
||||||
|
export LC_ALL
|
||||||
|
|
||||||
|
# Honor $PERL, but work even if there is none.
|
||||||
|
PERL="${PERL-perl}"
|
||||||
|
|
||||||
|
default_gnulib_url=https://git.savannah.gnu.org/git/gnulib.git
|
||||||
|
|
||||||
|
# Copyright year, for the --version output.
|
||||||
|
copyright_year=`echo "$scriptversion" | sed -e 's/[^0-9].*//'`
|
||||||
|
copyright="Copyright (C) ${copyright_year} Free Software Foundation, Inc.
|
||||||
|
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
|
||||||
|
This is free software: you are free to change and redistribute it.
|
||||||
|
There is NO WARRANTY, to the extent permitted by law."
|
||||||
|
|
||||||
|
# warnf_ FORMAT-STRING ARG1...
|
||||||
|
warnf_ ()
|
||||||
|
{
|
||||||
|
warnf_format_=$1
|
||||||
|
shift
|
||||||
|
nl='
|
||||||
|
'
|
||||||
|
case $* in
|
||||||
|
*$nl*) me_=$(printf "$me"|tr "$nl|" '??')
|
||||||
|
printf "$warnf_format_" "$@" | sed "s|^|$me_: |" ;;
|
||||||
|
*) printf "$me: $warnf_format_" "$@" ;;
|
||||||
|
esac >&2
|
||||||
|
}
|
||||||
|
|
||||||
|
# warn_ WORD1...
|
||||||
|
warn_ ()
|
||||||
|
{
|
||||||
|
# If IFS does not start with ' ', set it and emit the warning in a subshell.
|
||||||
|
case $IFS in
|
||||||
|
' '*) warnf_ '%s\n' "$*";;
|
||||||
|
*) (IFS=' '; warn_ "$@");;
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
|
# die WORD1...
|
||||||
|
die() { warn_ "$@"; exit 1; }
|
||||||
|
|
||||||
|
# ------------------------------ Configuration. ------------------------------
|
||||||
|
|
||||||
|
# Directory that contains package-specific gnulib modules and/or overrides.
|
||||||
|
local_gl_dir=gl
|
||||||
|
|
||||||
|
# Name of the Makefile.am
|
||||||
|
# XXX Not used.
|
||||||
|
gnulib_mk=gnulib.mk
|
||||||
|
|
||||||
|
# List of gnulib modules needed.
|
||||||
|
gnulib_modules=
|
||||||
|
|
||||||
|
# Any gnulib files needed that are not in modules.
|
||||||
|
gnulib_files=
|
||||||
|
|
||||||
|
# A function to be called for each unrecognized option. Returns 0 if
|
||||||
|
# the option in $1 has been processed by the function. Returns 1 if
|
||||||
|
# the option has not been processed by the function. Override it via
|
||||||
|
# your own definition in bootstrap.conf
|
||||||
|
bootstrap_option_hook() { return 1; }
|
||||||
|
|
||||||
|
# A function to be called in order to print the --help information
|
||||||
|
# corresponding to user-defined command-line options.
|
||||||
|
bootstrap_print_option_usage_hook() { :; }
|
||||||
|
|
||||||
|
# A function to be called at the end of autopull.sh.
|
||||||
|
# Override it via your own definition in bootstrap.conf.
|
||||||
|
bootstrap_post_pull_hook() { :; }
|
||||||
|
|
||||||
|
# A function to be called right after gnulib-tool is run.
|
||||||
|
# Override it via your own definition in bootstrap.conf.
|
||||||
|
bootstrap_post_import_hook() { :; }
|
||||||
|
|
||||||
|
# A function to be called after everything else in this script.
|
||||||
|
# Override it via your own definition in bootstrap.conf.
|
||||||
|
bootstrap_epilogue() { :; }
|
||||||
|
|
||||||
|
# The command to download all .po files for a specified domain into a
|
||||||
|
# specified directory. Fill in the first %s with the destination
|
||||||
|
# directory and the second with the domain name.
|
||||||
|
po_download_command_format=\
|
||||||
|
"wget --mirror --level=1 -nd -nv -A.po -P '%s' \
|
||||||
|
https://translationproject.org/latest/%s/"
|
||||||
|
|
||||||
|
# Prefer a non-empty tarname (4th argument of AC_INIT if given), else
|
||||||
|
# fall back to the package name (1st argument with munging).
|
||||||
|
extract_package_name='
|
||||||
|
/^AC_INIT(\[*/{
|
||||||
|
s///
|
||||||
|
/^[^,]*,[^,]*,[^,]*,[ []*\([^][ ,)]\)/{
|
||||||
|
s//\1/
|
||||||
|
s/[],)].*//
|
||||||
|
p
|
||||||
|
q
|
||||||
|
}
|
||||||
|
s/[],)].*//
|
||||||
|
s/^GNU //
|
||||||
|
y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/
|
||||||
|
s/[^abcdefghijklmnopqrstuvwxyz0123456789_]/-/g
|
||||||
|
p
|
||||||
|
}
|
||||||
|
'
|
||||||
|
package=$(${AUTOCONF:-autoconf} --trace AC_INIT:\$4 configure.ac 2>/dev/null)
|
||||||
|
if test -z "$package"; then
|
||||||
|
package=$(sed -n "$extract_package_name" configure.ac) \
|
||||||
|
|| die 'cannot find package name in configure.ac'
|
||||||
|
fi
|
||||||
|
gnulib_name=lib$package
|
||||||
|
|
||||||
|
build_aux=build-aux
|
||||||
|
source_base=lib
|
||||||
|
m4_base=m4
|
||||||
|
doc_base=doc
|
||||||
|
tests_base=tests
|
||||||
|
gnulib_extra_files="
|
||||||
|
build-aux/install-sh
|
||||||
|
build-aux/mdate-sh
|
||||||
|
build-aux/texinfo.tex
|
||||||
|
build-aux/depcomp
|
||||||
|
build-aux/config.guess
|
||||||
|
build-aux/config.sub
|
||||||
|
doc/INSTALL
|
||||||
|
"
|
||||||
|
|
||||||
|
# Additional gnulib-tool options to use. Use "\newline" to break lines.
|
||||||
|
gnulib_tool_option_extras=
|
||||||
|
|
||||||
|
# Other locale categories that need message catalogs.
|
||||||
|
EXTRA_LOCALE_CATEGORIES=
|
||||||
|
|
||||||
|
# Additional xgettext options to use. Use "\\\newline" to break lines.
|
||||||
|
XGETTEXT_OPTIONS='\\\
|
||||||
|
--flag=_:1:pass-c-format\\\
|
||||||
|
--flag=N_:1:pass-c-format\\\
|
||||||
|
--flag=error:3:c-format --flag=error_at_line:5:c-format\\\
|
||||||
|
'
|
||||||
|
|
||||||
|
# Package bug report address and copyright holder for gettext files
|
||||||
|
COPYRIGHT_HOLDER='Free Software Foundation, Inc.'
|
||||||
|
MSGID_BUGS_ADDRESS=bug-$package@gnu.org
|
||||||
|
|
||||||
|
# Files we don't want to import.
|
||||||
|
# XXX Not used.
|
||||||
|
excluded_files=
|
||||||
|
|
||||||
|
# File that should exist in the top directory of a checked out hierarchy,
|
||||||
|
# but not in a distribution tarball.
|
||||||
|
checkout_only_file=README-hacking
|
||||||
|
|
||||||
|
# Set this to '.cvsignore .gitignore' in bootstrap.conf if you want
|
||||||
|
# those files to be generated in directories like lib/, m4/, and po/.
|
||||||
|
# Or set it to 'auto' to make this script select which to use based
|
||||||
|
# on which version control system (if any) is used in the source directory.
|
||||||
|
vc_ignore=auto
|
||||||
|
|
||||||
|
# Set this to true in bootstrap.conf to enable --bootstrap-sync by
|
||||||
|
# default.
|
||||||
|
bootstrap_sync=false
|
||||||
|
|
||||||
|
# Override the default configuration, if necessary.
|
||||||
|
# Make sure that bootstrap.conf is sourced from the current directory
|
||||||
|
# if we were invoked as "sh bootstrap".
|
||||||
|
conffile=`dirname "$me"`/bootstrap.conf
|
||||||
|
test -r "$conffile" && . "$conffile"
|
||||||
|
|
||||||
|
# ------------------------- Build-time prerequisites -------------------------
|
||||||
|
|
||||||
|
check_exists() {
|
||||||
|
if test "$1" = "--verbose"; then
|
||||||
|
($2 --version </dev/null) >/dev/null 2>&1
|
||||||
|
if test $? -ge 126; then
|
||||||
|
# If not found, run with diagnostics as one may be
|
||||||
|
# presented with env variables to set to find the right version
|
||||||
|
($2 --version </dev/null)
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
($1 --version </dev/null) >/dev/null 2>&1
|
||||||
|
fi
|
||||||
|
|
||||||
|
test $? -lt 126
|
||||||
|
}
|
||||||
|
|
||||||
|
# Note this deviates from the version comparison in automake
|
||||||
|
# in that it treats 1.5 < 1.5.0, and treats 1.4.4a < 1.4-p3a
|
||||||
|
# but this should suffice as we won't be specifying old
|
||||||
|
# version formats or redundant trailing .0 in bootstrap.conf.
|
||||||
|
# If we did want full compatibility then we should probably
|
||||||
|
# use m4_version_compare from autoconf.
|
||||||
|
sort_ver() { # sort -V is not generally available
|
||||||
|
ver1="$1"
|
||||||
|
ver2="$2"
|
||||||
|
|
||||||
|
# split on '.' and compare each component
|
||||||
|
i=1
|
||||||
|
while : ; do
|
||||||
|
p1=$(echo "$ver1" | cut -d. -f$i)
|
||||||
|
p2=$(echo "$ver2" | cut -d. -f$i)
|
||||||
|
if [ ! "$p1" ]; then
|
||||||
|
echo "$1 $2"
|
||||||
|
break
|
||||||
|
elif [ ! "$p2" ]; then
|
||||||
|
echo "$2 $1"
|
||||||
|
break
|
||||||
|
elif [ ! "$p1" = "$p2" ]; then
|
||||||
|
if [ "$p1" -gt "$p2" ] 2>/dev/null; then # numeric comparison
|
||||||
|
echo "$2 $1"
|
||||||
|
elif [ "$p2" -gt "$p1" ] 2>/dev/null; then # numeric comparison
|
||||||
|
echo "$1 $2"
|
||||||
|
else # numeric, then lexicographic comparison
|
||||||
|
lp=$(printf "%s\n%s\n" "$p1" "$p2" | LANG=C sort -n | tail -n1)
|
||||||
|
if [ "$lp" = "$p2" ]; then
|
||||||
|
echo "$1 $2"
|
||||||
|
else
|
||||||
|
echo "$2 $1"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
i=$(($i+1))
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
get_version_sed='
|
||||||
|
# Move version to start of line.
|
||||||
|
s/.*[v ]\([0-9]\)/\1/
|
||||||
|
|
||||||
|
# Skip lines that do not start with version.
|
||||||
|
/^[0-9]/!d
|
||||||
|
|
||||||
|
# Remove characters after the version.
|
||||||
|
s/[^.a-z0-9-].*//
|
||||||
|
|
||||||
|
# The first component must be digits only.
|
||||||
|
s/^\([0-9]*\)[a-z-].*/\1/
|
||||||
|
|
||||||
|
#the following essentially does s/5.005/5.5/
|
||||||
|
s/\.0*\([1-9]\)/.\1/g
|
||||||
|
p
|
||||||
|
q'
|
||||||
|
|
||||||
|
get_version() {
|
||||||
|
app=$1
|
||||||
|
|
||||||
|
$app --version >/dev/null 2>&1 || { $app --version; return 1; }
|
||||||
|
|
||||||
|
$app --version 2>&1 | sed -n "$get_version_sed"
|
||||||
|
}
|
||||||
|
|
||||||
|
check_versions() {
|
||||||
|
ret=0
|
||||||
|
|
||||||
|
while read app req_ver; do
|
||||||
|
# We only need libtoolize from the libtool package.
|
||||||
|
if test "$app" = libtool; then
|
||||||
|
app=libtoolize
|
||||||
|
fi
|
||||||
|
# Exempt git if git is not needed.
|
||||||
|
if test "$app" = git; then
|
||||||
|
$check_git || continue
|
||||||
|
fi
|
||||||
|
# Honor $APP variables ($TAR, $AUTOCONF, etc.)
|
||||||
|
appvar=$(echo $app | LC_ALL=C tr '[a-z]-' '[A-Z]_')
|
||||||
|
test "$appvar" = TAR && appvar=AMTAR
|
||||||
|
case $appvar in
|
||||||
|
GZIP) ;; # Do not use $GZIP: it contains gzip options.
|
||||||
|
PERL::*) ;; # Keep perl modules as-is
|
||||||
|
*) eval "app=\${$appvar-$app}" ;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
# Handle the still-experimental Automake-NG programs specially.
|
||||||
|
# They remain named as the mainstream Automake programs ("automake",
|
||||||
|
# and "aclocal") to avoid gratuitous incompatibilities with
|
||||||
|
# pre-existing usages (by, say, autoreconf, or custom autogen.sh
|
||||||
|
# scripts), but correctly identify themselves (as being part of
|
||||||
|
# "GNU automake-ng") when asked their version.
|
||||||
|
case $app in
|
||||||
|
automake-ng|aclocal-ng)
|
||||||
|
app=${app%-ng}
|
||||||
|
($app --version | grep '(GNU automake-ng)') >/dev/null 2>&1 || {
|
||||||
|
warn_ "Error: '$app' not found or not from Automake-NG"
|
||||||
|
ret=1
|
||||||
|
continue
|
||||||
|
} ;;
|
||||||
|
# Another check is for perl modules. These can be written as
|
||||||
|
# e.g. perl::XML::XPath in case of XML::XPath module, etc.
|
||||||
|
perl::*)
|
||||||
|
# Extract module name
|
||||||
|
app="${app#perl::}"
|
||||||
|
if ! $PERL -m"$app" -e 'exit 0' >/dev/null 2>&1; then
|
||||||
|
warn_ "Error: perl module '$app' not found"
|
||||||
|
ret=1
|
||||||
|
fi
|
||||||
|
continue
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
if [ "$req_ver" = "-" ]; then
|
||||||
|
# Merely require app to exist; not all prereq apps are well-behaved
|
||||||
|
# so we have to rely on $? rather than get_version.
|
||||||
|
if ! check_exists --verbose $app; then
|
||||||
|
warn_ "Error: '$app' not found"
|
||||||
|
ret=1
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
# Require app to produce a new enough version string.
|
||||||
|
inst_ver=$(get_version $app)
|
||||||
|
if [ ! "$inst_ver" ]; then
|
||||||
|
warn_ "Error: '$app' not found"
|
||||||
|
ret=1
|
||||||
|
else
|
||||||
|
latest_ver=$(sort_ver $req_ver $inst_ver | cut -d' ' -f2)
|
||||||
|
if [ ! "$latest_ver" = "$inst_ver" ]; then
|
||||||
|
warnf_ '%s\n' \
|
||||||
|
"Error: '$app' version == $inst_ver is too old" \
|
||||||
|
" '$app' version >= $req_ver is required"
|
||||||
|
ret=1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
return $ret
|
||||||
|
}
|
||||||
|
|
||||||
|
print_versions() {
|
||||||
|
echo "Program Min_version"
|
||||||
|
echo "----------------------"
|
||||||
|
printf %s "$buildreq"
|
||||||
|
echo "----------------------"
|
||||||
|
# can't depend on column -t
|
||||||
|
}
|
||||||
|
|
||||||
|
# check_build_prerequisites check_git
|
||||||
|
check_build_prerequisites()
|
||||||
|
{
|
||||||
|
check_git="$1"
|
||||||
|
|
||||||
|
# gnulib-tool requires at least automake and autoconf.
|
||||||
|
# If either is not listed, add it (with minimum version) as a prerequisite.
|
||||||
|
case $buildreq in
|
||||||
|
*automake*) ;;
|
||||||
|
*) buildreq="automake 1.9
|
||||||
|
$buildreq" ;;
|
||||||
|
esac
|
||||||
|
case $buildreq in
|
||||||
|
*autoconf*) ;;
|
||||||
|
*) buildreq="autoconf 2.59
|
||||||
|
$buildreq" ;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
# When we can deduce that gnulib-tool will require patch,
|
||||||
|
# and when patch is not already listed as a prerequisite, add it, too.
|
||||||
|
if test -d "$local_gl_dir" \
|
||||||
|
&& ! find "$local_gl_dir" -name '*.diff' -exec false {} +; then
|
||||||
|
case $buildreq in
|
||||||
|
*patch*) ;;
|
||||||
|
*) buildreq="patch -
|
||||||
|
$buildreq" ;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
|
||||||
|
if ! printf '%s' "$buildreq" | check_versions; then
|
||||||
|
echo >&2
|
||||||
|
if test -f README-prereq; then
|
||||||
|
die "See README-prereq for how to get the prerequisite programs"
|
||||||
|
else
|
||||||
|
die "Please install the prerequisite programs"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Warn the user if autom4te appears to be broken; this causes known
|
||||||
|
# issues with at least gettext 0.18.3.
|
||||||
|
probe=$(echo 'm4_quote([hi])' | autom4te -l M4sugar -t 'm4_quote:$%' -)
|
||||||
|
if test "x$probe" != xhi; then
|
||||||
|
warn_ "WARNING: your autom4te wrapper eats stdin;"
|
||||||
|
warn_ "if bootstrap fails, consider upgrading your autotools"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# find_tool ENVVAR NAMES...
|
||||||
|
# -------------------------
|
||||||
|
# Search for a required program. Use the value of ENVVAR, if set,
|
||||||
|
# otherwise find the first of the NAMES that can be run.
|
||||||
|
# If found, set ENVVAR to the program name, die otherwise.
|
||||||
|
#
|
||||||
|
# FIXME: code duplication, see also gnu-web-doc-update.
|
||||||
|
find_tool ()
|
||||||
|
{
|
||||||
|
find_tool_envvar=$1
|
||||||
|
shift
|
||||||
|
find_tool_names=$@
|
||||||
|
eval "find_tool_res=\$$find_tool_envvar"
|
||||||
|
if test x"$find_tool_res" = x; then
|
||||||
|
for i; do
|
||||||
|
if check_exists $i; then
|
||||||
|
find_tool_res=$i
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
if test x"$find_tool_res" = x; then
|
||||||
|
warn_ "one of these is required: $find_tool_names;"
|
||||||
|
die "alternatively set $find_tool_envvar to a compatible tool"
|
||||||
|
fi
|
||||||
|
eval "$find_tool_envvar=\$find_tool_res"
|
||||||
|
eval "export $find_tool_envvar"
|
||||||
|
}
|
||||||
|
|
||||||
|
# --------------------- Preparing GNULIB_SRCDIR for use. ---------------------
|
||||||
|
# This is part of autopull.sh, but bootstrap needs it too, for self-upgrading.
|
||||||
|
|
||||||
|
cleanup_gnulib() {
|
||||||
|
status=$?
|
||||||
|
# XXX It's a bad idea to erase the submodule directory if it contains local
|
||||||
|
# modifications.
|
||||||
|
rm -fr "$gnulib_path"
|
||||||
|
exit $status
|
||||||
|
}
|
||||||
|
|
||||||
|
git_modules_config () {
|
||||||
|
test -f .gitmodules && git config --file .gitmodules "$@"
|
||||||
|
}
|
||||||
|
|
||||||
|
prepare_GNULIB_SRCDIR ()
|
||||||
|
{
|
||||||
|
if test -n "$GNULIB_SRCDIR"; then
|
||||||
|
# Use GNULIB_SRCDIR directly.
|
||||||
|
# We already checked that $GNULIB_SRCDIR references a directory.
|
||||||
|
# Verify that it contains a gnulib checkout.
|
||||||
|
test -f "$GNULIB_SRCDIR/gnulib-tool" \
|
||||||
|
|| die "Error: --gnulib-srcdir or \$GNULIB_SRCDIR is specified, but does not contain gnulib-tool"
|
||||||
|
elif $use_git; then
|
||||||
|
gnulib_path=$(git_modules_config submodule.gnulib.path)
|
||||||
|
test -z "$gnulib_path" && gnulib_path=gnulib
|
||||||
|
|
||||||
|
# Get gnulib files. Populate $gnulib_path, possibly updating a
|
||||||
|
# submodule, for use in the rest of the script.
|
||||||
|
|
||||||
|
if test -n "$GNULIB_REFDIR" && test -d "$GNULIB_REFDIR"/.git \
|
||||||
|
&& git_modules_config submodule.gnulib.url >/dev/null; then
|
||||||
|
# Use GNULIB_REFDIR as a reference.
|
||||||
|
echo "$0: getting gnulib files..."
|
||||||
|
if git submodule -h|grep -- --reference > /dev/null; then
|
||||||
|
# Prefer the one-liner available in git 1.6.4 or newer.
|
||||||
|
git submodule update --init --reference "$GNULIB_REFDIR" \
|
||||||
|
"$gnulib_path" || exit $?
|
||||||
|
else
|
||||||
|
# This fallback allows at least git 1.5.5.
|
||||||
|
if test -f "$gnulib_path"/gnulib-tool; then
|
||||||
|
# Since file already exists, assume submodule init already complete.
|
||||||
|
git submodule update -- "$gnulib_path" || exit $?
|
||||||
|
else
|
||||||
|
# Older git can't clone into an empty directory.
|
||||||
|
rmdir "$gnulib_path" 2>/dev/null
|
||||||
|
git clone --reference "$GNULIB_REFDIR" \
|
||||||
|
"$(git_modules_config submodule.gnulib.url)" "$gnulib_path" \
|
||||||
|
&& git submodule init -- "$gnulib_path" \
|
||||||
|
&& git submodule update -- "$gnulib_path" \
|
||||||
|
|| exit $?
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
# GNULIB_REFDIR is not set or not usable. Ignore it.
|
||||||
|
if git_modules_config submodule.gnulib.url >/dev/null; then
|
||||||
|
echo "$0: getting gnulib files..."
|
||||||
|
git submodule init -- "$gnulib_path" || exit $?
|
||||||
|
git submodule update -- "$gnulib_path" || exit $?
|
||||||
|
|
||||||
|
elif [ ! -d "$gnulib_path" ]; then
|
||||||
|
echo "$0: getting gnulib files..."
|
||||||
|
|
||||||
|
trap cleanup_gnulib 1 2 13 15
|
||||||
|
|
||||||
|
shallow=
|
||||||
|
if test -z "$GNULIB_REVISION"; then
|
||||||
|
if git clone -h 2>&1 | grep -- --depth > /dev/null; then
|
||||||
|
shallow='--depth 2'
|
||||||
|
fi
|
||||||
|
git clone $shallow ${GNULIB_URL:-$default_gnulib_url} "$gnulib_path" \
|
||||||
|
|| cleanup_gnulib
|
||||||
|
else
|
||||||
|
if git fetch -h 2>&1 | grep -- --depth > /dev/null; then
|
||||||
|
shallow='--depth 2'
|
||||||
|
fi
|
||||||
|
mkdir -p "$gnulib_path"
|
||||||
|
# Only want a shallow checkout of $GNULIB_REVISION, but git does not
|
||||||
|
# support cloning by commit hash. So attempt a shallow fetch by commit
|
||||||
|
# hash to minimize the amount of data downloaded and changes needed to
|
||||||
|
# be processed, which can drastically reduce download and processing
|
||||||
|
# time for checkout. If the fetch by commit fails, a shallow fetch can
|
||||||
|
# not be performed because we do not know what the depth of the commit
|
||||||
|
# is without fetching all commits. So fallback to fetching all commits.
|
||||||
|
git -C "$gnulib_path" init
|
||||||
|
git -C "$gnulib_path" remote add origin \
|
||||||
|
${GNULIB_URL:-$default_gnulib_url}
|
||||||
|
git -C "$gnulib_path" fetch $shallow origin "$GNULIB_REVISION" \
|
||||||
|
|| git -C "$gnulib_path" fetch origin \
|
||||||
|
|| cleanup_gnulib
|
||||||
|
git -C "$gnulib_path" reset --hard FETCH_HEAD
|
||||||
|
fi
|
||||||
|
|
||||||
|
trap - 1 2 13 15
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
GNULIB_SRCDIR=$gnulib_path
|
||||||
|
# Verify that the submodule contains a gnulib checkout.
|
||||||
|
test -f "$gnulib_path/gnulib-tool" \
|
||||||
|
|| die "Error: $gnulib_path is supposed to contain a gnulib checkout, but does not contain gnulib-tool"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# XXX Should this be done if $use_git is false?
|
||||||
|
if test -d "$GNULIB_SRCDIR"/.git && test -n "$GNULIB_REVISION" \
|
||||||
|
&& ! git_modules_config submodule.gnulib.url >/dev/null; then
|
||||||
|
(cd "$GNULIB_SRCDIR" && git checkout "$GNULIB_REVISION") || cleanup_gnulib
|
||||||
|
fi
|
||||||
|
|
||||||
|
# $GNULIB_SRCDIR now points to the version of gnulib to use, and
|
||||||
|
# we no longer need to use git or $gnulib_path below here.
|
||||||
|
}
|
||||||
|
|
||||||
|
# -------- Upgrading bootstrap to the version found in GNULIB_SRCDIR. --------
|
||||||
|
|
||||||
|
upgrade_bootstrap ()
|
||||||
|
{
|
||||||
|
{ cmp -s "$medir"/bootstrap "$GNULIB_SRCDIR/top/bootstrap" \
|
||||||
|
&& cmp -s "$medir"/bootstrap-funclib.sh "$GNULIB_SRCDIR/top/bootstrap-funclib.sh" \
|
||||||
|
&& cmp -s "$medir"/autopull.sh "$GNULIB_SRCDIR/top/autopull.sh" \
|
||||||
|
&& cmp -s "$medir"/autogen.sh "$GNULIB_SRCDIR/top/autogen.sh"; \
|
||||||
|
} || {
|
||||||
|
echo "$0: updating bootstrap & companions and restarting..."
|
||||||
|
case $(sh -c 'echo "$1"' -- a) in
|
||||||
|
a) ignored=--;;
|
||||||
|
*) ignored=ignored;;
|
||||||
|
esac
|
||||||
|
exec sh -c \
|
||||||
|
'{ if test -f "$1"; then cp "$1" "$3"; else cp "$2" "$3"; fi; } && { if test -f "$4"; then cp "$4" "$5"; else rm -f "$5"; fi; } && { if test -f "$6"; then cp "$6" "$7"; else rm -f "$7"; fi; } && { if test -f "$8"; then cp "$8" "$9"; else rm -f "$9"; fi; } && shift && shift && shift && shift && shift && shift && shift && shift && shift && exec "${CONFIG_SHELL-/bin/sh}" "$@"' \
|
||||||
|
$ignored \
|
||||||
|
"$GNULIB_SRCDIR/top/bootstrap" "$GNULIB_SRCDIR/build-aux/bootstrap" "$medir/bootstrap" \
|
||||||
|
"$GNULIB_SRCDIR/top/bootstrap-funclib.sh" "$medir/bootstrap-funclib.sh" \
|
||||||
|
"$GNULIB_SRCDIR/top/autopull.sh" "$medir/autopull.sh" \
|
||||||
|
"$GNULIB_SRCDIR/top/autogen.sh" "$medir/autogen.sh" \
|
||||||
|
"$0" "$@" --no-bootstrap-sync
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
if test x"$gnulib_modules$gnulib_files$gnulib_extra_files" = x; then
|
||||||
|
use_gnulib=false
|
||||||
|
else
|
||||||
|
use_gnulib=true
|
||||||
|
fi
|
||||||
|
|
||||||
|
# ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
# Local Variables:
|
||||||
|
# eval: (add-hook 'before-save-hook 'time-stamp)
|
||||||
|
# time-stamp-start: "scriptversion="
|
||||||
|
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
||||||
|
# time-stamp-time-zone: "UTC0"
|
||||||
|
# time-stamp-end: "; # UTC"
|
||||||
|
# End:
|
||||||
91
bootstrap.bat
Normal file
91
bootstrap.bat
Normal file
@@ -0,0 +1,91 @@
|
|||||||
|
@echo off
|
||||||
|
:: Copyright (C) 2018-2022 Free Software Foundation, Inc.
|
||||||
|
:: This file is part of GNU Make.
|
||||||
|
::
|
||||||
|
:: GNU Make is free software; you can redistribute it and/or modify it under
|
||||||
|
:: the terms of the GNU General Public License as published by the Free
|
||||||
|
:: Software Foundation; either version 3 of the License, or (at your option)
|
||||||
|
:: any later version.
|
||||||
|
::
|
||||||
|
:: GNU Make is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
:: ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
:: FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for.
|
||||||
|
:: more details.
|
||||||
|
::
|
||||||
|
:: You should have received a copy of the GNU General Public License along
|
||||||
|
:: with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
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
|
||||||
|
call :Download lib intprops-internal.h
|
||||||
|
|
||||||
|
echo -- Configuring the workspace
|
||||||
|
copy /Y gl\lib\*.* lib > nul
|
||||||
|
|
||||||
|
:: Create a sed script to convert templates
|
||||||
|
if exist convert.sed del /Q convert.sed
|
||||||
|
echo s,@PACKAGE@,make,g > convert.sed
|
||||||
|
if ERRORLEVEL 1 goto Failed
|
||||||
|
echo s,@PACKAGE_BUGREPORT@,bug-make@gnu.org,g >> convert.sed
|
||||||
|
if ERRORLEVEL 1 goto Failed
|
||||||
|
echo s,@PACKAGE_NAME@,GNU Make,g >> convert.sed
|
||||||
|
if ERRORLEVEL 1 goto Failed
|
||||||
|
echo s,@PACKAGE_TARNAME@,make,g >> convert.sed
|
||||||
|
if ERRORLEVEL 1 goto Failed
|
||||||
|
echo s,@PACKAGE_URL@,https://www.gnu.org/software/make/,g >> convert.sed
|
||||||
|
sed -n "s/^AC_INIT(\[GNU.Make\],\[\([0-9.]*\)\].*/s,@PACKAGE_VERSION@,\1,g/p" configure.ac >> convert.sed
|
||||||
|
if ERRORLEVEL 1 goto Failed
|
||||||
|
sed -z -e s/\\\n//g -e "s/[ \t][ \t]*/ /g" -e "s, [^ ]*\.h,,g" -e "s,src/,$(src),g" -e "s,lib/,$(lib),g" Makefile.am | sed -n "s/^\([A-Za-z0-9]*\)_SRCS *= *\(.*\)/s,%%\1_SOURCES%%,\2,/p" >> convert.sed
|
||||||
|
if ERRORLEVEL 1 goto Failed
|
||||||
|
|
||||||
|
echo - Creating Basic.mk
|
||||||
|
sed -f convert.sed Basic.mk.template > Basic.mk
|
||||||
|
if ERRORLEVEL 1 goto Failed
|
||||||
|
echo - Creating src\mkconfig.h
|
||||||
|
sed -f convert.sed src\mkconfig.h.in > src\mkconfig.h
|
||||||
|
if ERRORLEVEL 1 goto Failed
|
||||||
|
|
||||||
|
echo - Creating src\gmk-default.h
|
||||||
|
echo static const char *const GUILE_module_defn = ^" \ > src\gmk-default.h
|
||||||
|
sed -e "s/;.*//" -e "/^[ \t]*$/d" -e "s/\"/\\\\\"/g" -e "s/$/ \\\/" src\gmk-default.scm >> src\gmk-default.h
|
||||||
|
if ERRORLEVEL 1 goto Failed
|
||||||
|
echo ^";>> src\gmk-default.h
|
||||||
|
|
||||||
|
echo.
|
||||||
|
echo Done. Run build_w32.bat to build GNU make.
|
||||||
|
goto :EOF
|
||||||
|
|
||||||
|
:Download
|
||||||
|
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
|
||||||
|
|
||||||
|
:Failed
|
||||||
|
echo *** Bootstrap failed.
|
||||||
|
echo Resolve the issue, or use the configured source in the release tarball
|
||||||
|
exit /b 1
|
||||||
65
bootstrap.conf
Normal file
65
bootstrap.conf
Normal file
@@ -0,0 +1,65 @@
|
|||||||
|
# Bootstrap configuration. -*-shell-script-*-
|
||||||
|
|
||||||
|
# Copyright (C) 2018-2022 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
|
||||||
|
# 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/>.
|
||||||
|
|
||||||
|
# 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-202207
|
||||||
|
|
||||||
|
# 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.
|
||||||
|
XGETTEXT_OPTIONS='\\\
|
||||||
|
--from-code=UTF-8\\\
|
||||||
|
--flag=_:1:pass-c-format\\\
|
||||||
|
--flag=N_:1:pass-c-format\\\
|
||||||
|
--flag=DB:2:c-format --flag=DBF:2:c-format --flag=DBS:2:c-format\\\
|
||||||
|
--flag=O:3:c-format --flag=OSN:3:c-format --flag=ONS:3:c-format\\\
|
||||||
|
--flag=OS:3:c-format --flag=OSS:3:c-format --flag=OSSS:3:c-format\\\
|
||||||
|
--flag=ON:3:c-format --flag=ONN:3:c-format\\\
|
||||||
|
'
|
||||||
|
|
||||||
|
# We manage our own .gitignore files
|
||||||
|
vc_ignore=
|
||||||
|
|
||||||
|
# Build prerequisites
|
||||||
|
buildreq="\
|
||||||
|
autoconf 2.69
|
||||||
|
automake 1.16.1
|
||||||
|
"
|
||||||
|
|
||||||
|
gnulib_name=libgnu
|
||||||
|
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
|
||||||
|
fdl
|
||||||
|
findprog-in
|
||||||
|
getloadavg
|
||||||
|
host-cpu-c-abi
|
||||||
|
largefile
|
||||||
|
make-glob
|
||||||
|
make-macros"
|
||||||
38
build.cfg.in
Normal file
38
build.cfg.in
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
# Configuration for building GNU Make in the absence of any 'make' program.
|
||||||
|
# @configure_input@
|
||||||
|
|
||||||
|
# Copyright (C) 1993-2022 Free Software Foundation, Inc.
|
||||||
|
# This file is part of GNU Make.
|
||||||
|
#
|
||||||
|
# GNU Make is free software; you can redistribute it and/or modify it under
|
||||||
|
# the terms of the GNU General Public License as published by the Free Software
|
||||||
|
# Foundation; either version 3 of the License, or (at your option) any later
|
||||||
|
# version.
|
||||||
|
#
|
||||||
|
# GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||||
|
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||||
|
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
||||||
|
# details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License along with
|
||||||
|
# this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
# See Makefile.in for comments describing these variables.
|
||||||
|
|
||||||
|
top_srcdir='@top_srcdir@'
|
||||||
|
|
||||||
|
prefix='@prefix@'
|
||||||
|
exec_prefix=`eval echo @exec_prefix@`
|
||||||
|
|
||||||
|
CC='@CC@'
|
||||||
|
AR='@AR@'
|
||||||
|
CFLAGS='@CFLAGS@ @GUILE_CFLAGS@'
|
||||||
|
CPPFLAGS='@CPPFLAGS@'
|
||||||
|
DEFS='@DEFS@'
|
||||||
|
ARFLAGS='@ARFLAGS@'
|
||||||
|
LDFLAGS='@AM_LDFLAGS@ @LDFLAGS@'
|
||||||
|
ALLOCA='@ALLOCA@'
|
||||||
|
LOADLIBES='@LIBS@ @GUILE_LIBS@ @LIBINTL@'
|
||||||
|
REMOTE='@REMOTE@'
|
||||||
|
OBJEXT='@OBJEXT@'
|
||||||
|
EXEEXT='@EXEEXT@'
|
||||||
182
build.sh
Executable file
182
build.sh
Executable file
@@ -0,0 +1,182 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
# Shell script to build GNU Make in the absence of any 'make' program.
|
||||||
|
|
||||||
|
# Copyright (C) 1993-2022 Free Software Foundation, Inc.
|
||||||
|
# This file is part of GNU Make.
|
||||||
|
#
|
||||||
|
# GNU Make is free software; you can redistribute it and/or modify it under
|
||||||
|
# the terms of the GNU General Public License as published by the Free Software
|
||||||
|
# Foundation; either version 3 of the License, or (at your option) any later
|
||||||
|
# version.
|
||||||
|
#
|
||||||
|
# GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||||
|
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||||
|
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
||||||
|
# details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License along with
|
||||||
|
# this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
# 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"
|
||||||
|
|
||||||
|
# Directory to find libraries in for '-lXXX'.
|
||||||
|
libdir=$exec_prefix/lib
|
||||||
|
# Directory to search by default for included makefiles.
|
||||||
|
includedir=$prefix/include
|
||||||
|
|
||||||
|
localedir=$prefix/share/locale
|
||||||
|
|
||||||
|
defines="-DLOCALEDIR=\"$localedir\" -DLIBDIR=\"$libdir\" -DINCLUDEDIR=\"$includedir\""
|
||||||
|
|
||||||
|
# Look up a make variable value.
|
||||||
|
# It can handle simple recursion where variables are separate words.
|
||||||
|
# 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")
|
||||||
|
for w in $v; do
|
||||||
|
case $w in
|
||||||
|
(\$[\(\{]*[\)\}]) w=${w#\$[\(\{]}; w=$(get_mk_var "$file" "${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%/*}" || 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.
|
||||||
|
# $out will be empty if no conversion was needed.
|
||||||
|
convert ()
|
||||||
|
{
|
||||||
|
out=
|
||||||
|
base=$1
|
||||||
|
var="GENERATE_$(echo $base | tr 'a-z./+' A-Z__X)"
|
||||||
|
|
||||||
|
# Is this file disabled?
|
||||||
|
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
|
||||||
|
out="$OUTLIB/$base"
|
||||||
|
mkdir -p "${out%/*}"
|
||||||
|
|
||||||
|
# First perform the normal replacements, using config.status
|
||||||
|
sed -e 's|@GUARD_PREFIX@|GL|g' \
|
||||||
|
-e 's/@GNULIB_UNISTD_H_GETOPT@/0/g' \
|
||||||
|
"$in" > "${out}_"
|
||||||
|
./config.status --file "${out}__:${out}_"
|
||||||
|
int="${out}__"
|
||||||
|
|
||||||
|
# Then see if there any files we need to include. Unfortunately there's no
|
||||||
|
# algorithmic conversion so we just have to hard-code it.
|
||||||
|
incls=$(sed -n 's/.*definitions* of \(_[^ $]*\).*/\1/p' "$in")
|
||||||
|
|
||||||
|
for inc in $incls; do
|
||||||
|
case $inc in
|
||||||
|
(_GL_FUNCDECL_RPL) fn=$(get_mk_var lib/Makefile CXXDEFS_H) ;;
|
||||||
|
(_GL_ARG_NONNULL) fn=$(get_mk_var lib/Makefile ARG_NONNULL_H) ;;
|
||||||
|
(_GL_WARN_ON_USE) fn=$(get_mk_var lib/Makefile WARN_ON_USE_H) ;;
|
||||||
|
(_Noreturn) fn=$(get_mk_var lib/Makefile _NORETURN_H) ;;
|
||||||
|
(*) echo "Unknown file replacement: $inc"; exit 1 ;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
fn="$top_srcdir/lib/${fn##*/}"
|
||||||
|
test -f "$fn" || { echo "Missing file: $fn"; exit 1; }
|
||||||
|
|
||||||
|
sed "/definitions* of $inc/r $fn" "$int" > "${int}_"
|
||||||
|
int=${int}_
|
||||||
|
done
|
||||||
|
|
||||||
|
# Done!
|
||||||
|
mv "$int" "$out"
|
||||||
|
}
|
||||||
|
|
||||||
|
# Get source files provided from gnulib and convert to object files
|
||||||
|
LIBOBJS=
|
||||||
|
for lo in $( (get_mk_var lib/Makefile libgnu_a_OBJECTS; get_mk_var lib/Makefile libgnu_a_LIBADD) | sed "s=\$[\(\{]OBJEXT[\)\}]=$OBJEXT=g"); do
|
||||||
|
LIBOBJS="${LIBOBJS:+$LIBOBJS }lib/$lo"
|
||||||
|
done
|
||||||
|
|
||||||
|
# Get object files from the Makefile
|
||||||
|
OBJS=$(get_mk_var Makefile make_OBJECTS | sed "s=\$[\(\{]OBJEXT[\)\}]=$OBJEXT=g")
|
||||||
|
|
||||||
|
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 || die "Compilation failed."
|
||||||
|
|
||||||
|
echo "creating libgnu.a..."
|
||||||
|
$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 || die "Compilation failed."
|
||||||
|
|
||||||
|
# Link all the objects together.
|
||||||
|
echo "linking make..."
|
||||||
|
$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.
|
||||||
@@ -1,81 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
# Shell script to build GNU Make in the absence of any 'make' program.
|
|
||||||
# @configure_input@
|
|
||||||
|
|
||||||
# Copyright (C) 1993-2016 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 <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
# See Makefile.in for comments describing these variables.
|
|
||||||
|
|
||||||
srcdir='@srcdir@'
|
|
||||||
CC='@CC@'
|
|
||||||
CFLAGS='@CFLAGS@ @GUILE_CFLAGS@'
|
|
||||||
CPPFLAGS='@CPPFLAGS@'
|
|
||||||
LDFLAGS='@AM_LDFLAGS@ @LDFLAGS@'
|
|
||||||
ALLOCA='@ALLOCA@'
|
|
||||||
LOADLIBES='@LIBS@ @GUILE_LIBS@ @LIBINTL@'
|
|
||||||
eval extras=\'@LIBOBJS@\'
|
|
||||||
REMOTE='@REMOTE@'
|
|
||||||
GLOBLIB='@GLOBLIB@'
|
|
||||||
PATH_SEPARATOR='@PATH_SEPARATOR@'
|
|
||||||
OBJEXT='@OBJEXT@'
|
|
||||||
EXEEXT='@EXEEXT@'
|
|
||||||
|
|
||||||
# Common prefix for machine-independent installed files.
|
|
||||||
prefix='@prefix@'
|
|
||||||
# Common prefix for machine-dependent installed files.
|
|
||||||
exec_prefix=`eval echo @exec_prefix@`
|
|
||||||
# Directory to find libraries in for '-lXXX'.
|
|
||||||
libdir=${exec_prefix}/lib
|
|
||||||
# Directory to search by default for included makefiles.
|
|
||||||
includedir=${prefix}/include
|
|
||||||
|
|
||||||
localedir=${prefix}/share/locale
|
|
||||||
aliaspath=${localedir}${PATH_SEPARATOR}.
|
|
||||||
|
|
||||||
defines="-DLOCALEDIR=\"${localedir}\" -DLIBDIR=\"${libdir}\" -DINCLUDEDIR=\"${includedir}\""' @DEFS@'
|
|
||||||
|
|
||||||
# Exit as soon as any command fails.
|
|
||||||
set -e
|
|
||||||
|
|
||||||
# These are all the objects we need to link together.
|
|
||||||
objs="%objs% remote-${REMOTE}.${OBJEXT} ${extras} ${ALLOCA}"
|
|
||||||
|
|
||||||
if [ x"$GLOBLIB" != x ]; then
|
|
||||||
objs="$objs %globobjs%"
|
|
||||||
globinc=-I${srcdir}/glob
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Compile the source files into those objects.
|
|
||||||
for file in `echo ${objs} | sed 's/\.'${OBJEXT}'/.c/g'`; do
|
|
||||||
echo compiling ${file}...
|
|
||||||
$CC $defines $CPPFLAGS $CFLAGS \
|
|
||||||
-c -I. -I${srcdir} ${globinc} ${srcdir}/$file
|
|
||||||
done
|
|
||||||
|
|
||||||
# The object files were actually all put in the current directory.
|
|
||||||
# Remove the source directory names from the list.
|
|
||||||
srcobjs="$objs"
|
|
||||||
objs=
|
|
||||||
for obj in $srcobjs; do
|
|
||||||
objs="$objs `basename $obj`"
|
|
||||||
done
|
|
||||||
|
|
||||||
# Link all the objects together.
|
|
||||||
echo linking make...
|
|
||||||
$CC $CFLAGS $LDFLAGS $objs $LOADLIBES -o makenew${EXEEXT}
|
|
||||||
echo done
|
|
||||||
mv -f makenew${EXEEXT} make${EXEEXT}
|
|
||||||
432
build_w32.bat
Executable file → Normal file
432
build_w32.bat
Executable file → Normal file
@@ -1,80 +1,220 @@
|
|||||||
@echo off
|
@echo off
|
||||||
rem Copyright (C) 1996-2016 Free Software Foundation, Inc.
|
:: Copyright (C) 1996-2022 Free Software Foundation, Inc.
|
||||||
rem This file is part of GNU Make.
|
:: This file is part of GNU Make.
|
||||||
rem
|
::
|
||||||
rem GNU Make is free software; you can redistribute it and/or modify it under
|
:: GNU Make is free software; you can redistribute it and/or modify it under
|
||||||
rem the terms of the GNU General Public License as published by the Free
|
:: the terms of the GNU General Public License as published by the Free
|
||||||
rem Software Foundation; either version 3 of the License, or (at your option)
|
:: Software Foundation; either version 3 of the License, or (at your option)
|
||||||
rem any later version.
|
:: any later version.
|
||||||
rem
|
::
|
||||||
rem GNU Make is distributed in the hope that it will be useful, but WITHOUT
|
:: GNU Make is distributed in the hope that it will be useful, but WITHOUT
|
||||||
rem ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
:: ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
rem FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for.
|
:: FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for.
|
||||||
rem more details.
|
:: more details.
|
||||||
rem
|
::
|
||||||
rem You should have received a copy of the GNU General Public License along
|
:: You should have received a copy of the GNU General Public License along
|
||||||
rem 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" (
|
||||||
|
set "RECURSEME=%~0"
|
||||||
|
%ComSpec% /s /c ""%~0" %*"
|
||||||
|
goto :EOF
|
||||||
|
)
|
||||||
|
|
||||||
call :Reset
|
call :Reset
|
||||||
|
|
||||||
if "%1" == "-h" goto Usage
|
if "%1" == "-h" goto Usage
|
||||||
if "%1" == "--help" goto Usage
|
if "%1" == "--help" goto Usage
|
||||||
|
|
||||||
|
echo.
|
||||||
|
echo Creating GNU Make for Windows 9X/NT/2K/XP/Vista/7/8/10
|
||||||
|
echo.
|
||||||
|
|
||||||
set MAKE=gnumake
|
set MAKE=gnumake
|
||||||
set GUILE=Y
|
set GUILE=Y
|
||||||
set COMPILER=msvc
|
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
|
||||||
|
) else (
|
||||||
|
set MAINT=N
|
||||||
|
)
|
||||||
|
|
||||||
:ParseSW
|
:ParseSW
|
||||||
|
if "%1" == "--verbose" goto SetVerbose
|
||||||
if "%1" == "--debug" goto SetDebug
|
if "%1" == "--debug" goto SetDebug
|
||||||
if "%1" == "--without-guile" goto NoGuile
|
if "%1" == "--without-guile" goto NoGuile
|
||||||
|
if "%1" == "--x86" goto Set32Bit
|
||||||
if "%1" == "gcc" goto SetCC
|
if "%1" == "gcc" goto SetCC
|
||||||
|
if "%1" == "tcc" goto SetTCC
|
||||||
if "%1" == "" goto DoneSW
|
if "%1" == "" goto DoneSW
|
||||||
|
goto Usage
|
||||||
|
|
||||||
|
:SetVerbose
|
||||||
|
set VERBOSE=Y
|
||||||
|
shift
|
||||||
|
goto ParseSW
|
||||||
|
|
||||||
:SetDebug
|
:SetDebug
|
||||||
set DEBUG=Y
|
set DEBUG=Y
|
||||||
|
echo - Building without compiler optimizations
|
||||||
shift
|
shift
|
||||||
goto ParseSW
|
goto ParseSW
|
||||||
|
|
||||||
:NoGuile
|
:NoGuile
|
||||||
set GUILE=N
|
set GUILE=N
|
||||||
echo Building without Guile
|
echo - Building without Guile
|
||||||
|
shift
|
||||||
|
goto ParseSW
|
||||||
|
|
||||||
|
:Set32Bit
|
||||||
|
set ARCH=x86
|
||||||
|
echo - Building 32bit GNU Make
|
||||||
shift
|
shift
|
||||||
goto ParseSW
|
goto ParseSW
|
||||||
|
|
||||||
:SetCC
|
:SetCC
|
||||||
set COMPILER=gcc
|
set COMPILER=gcc
|
||||||
echo Building with GCC
|
set O=o
|
||||||
|
echo - Building with GCC
|
||||||
|
shift
|
||||||
|
goto ParseSW
|
||||||
|
|
||||||
|
:SetTCC
|
||||||
|
set COMPILER=tcc
|
||||||
|
set O=o
|
||||||
|
echo - Building with TinyC
|
||||||
shift
|
shift
|
||||||
goto ParseSW
|
goto ParseSW
|
||||||
|
|
||||||
rem Build with Guile is supported only on NT and later versions
|
|
||||||
:DoneSW
|
:DoneSW
|
||||||
echo.
|
if "%MAINT%" == "Y" echo - Enabling maintainer mode
|
||||||
echo Creating GNU Make for Windows 9X/NT/2K/XP/Vista/7/8
|
|
||||||
if "%DEBUG%" == "Y" echo Building without compiler optimizations
|
|
||||||
|
|
||||||
if "%COMPILER%" == "gcc" goto GccBuild
|
if "%COMPILER%" == "gcc" goto FindGcc
|
||||||
|
if "%COMPILER%" == "tcc" goto FindTcc
|
||||||
|
|
||||||
|
:: Find a compiler. Visual Studio requires a lot of effort to locate :-/.
|
||||||
|
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 (
|
||||||
|
set InstallPath=%%i
|
||||||
|
)
|
||||||
|
set "VSVARS=%InstallPath%\VC\Auxiliary\Build\vcvarsall.bat"
|
||||||
|
call :CheckMSVC
|
||||||
|
if not ERRORLEVEL 1 goto FoundMSVC
|
||||||
|
|
||||||
|
:: No "vswhere" or it can't find a compiler. Go old-school.
|
||||||
|
:LegacyVS
|
||||||
|
set "VSVARS=%VS150COMNTOOLS%\..\..\VC\vcvarsall.bat"
|
||||||
|
call :CheckMSVC
|
||||||
|
if not ERRORLEVEL 1 goto FoundMSVC
|
||||||
|
|
||||||
|
set "VSVARS=%VS140COMNTOOLS%\..\..\VC\vcvarsall.bat"
|
||||||
|
call :CheckMSVC
|
||||||
|
if not ERRORLEVEL 1 goto FoundMSVC
|
||||||
|
|
||||||
|
set "VSVARS=%VS120COMNTOOLS%\..\..\VC\vcvarsall.bat"
|
||||||
|
call :CheckMSVC
|
||||||
|
if not ERRORLEVEL 1 goto FoundMSVC
|
||||||
|
|
||||||
|
set "VSVARS=%VS110COMNTOOLS%\..\..\VC\vcvarsall.bat"
|
||||||
|
call :CheckMSVC
|
||||||
|
if not ERRORLEVEL 1 goto FoundMSVC
|
||||||
|
|
||||||
|
set "VSVARS=%VS100COMNTOOLS%\..\..\VC\vcvarsall.bat"
|
||||||
|
call :CheckMSVC
|
||||||
|
if not ERRORLEVEL 1 goto FoundMSVC
|
||||||
|
|
||||||
|
set "VSVARS=%VS90COMNTOOLS%\..\..\VC\vcvarsall.bat"
|
||||||
|
call :CheckMSVC
|
||||||
|
if not ERRORLEVEL 1 goto FoundMSVC
|
||||||
|
|
||||||
|
set "VSVARS=%VS80COMNTOOLS%\..\..\VC\vcvarsall.bat"
|
||||||
|
call :CheckMSVC
|
||||||
|
if not ERRORLEVEL 1 goto FoundMSVC
|
||||||
|
|
||||||
|
set "VSVARS=%VS71COMNTOOLS%\..\..\VC\vcvarsall.bat"
|
||||||
|
call :CheckMSVC
|
||||||
|
if not ERRORLEVEL 1 goto FoundMSVC
|
||||||
|
|
||||||
|
set "VSVARS=%VS70COMNTOOLS%\..\..\VC\vcvarsall.bat"
|
||||||
|
call :CheckMSVC
|
||||||
|
if not ERRORLEVEL 1 goto FoundMSVC
|
||||||
|
|
||||||
|
set "VSVARS=%V6TOOLS%\VC98\Bin\vcvars32.bat"
|
||||||
|
call :CheckMSVC
|
||||||
|
if not ERRORLEVEL 1 goto FoundMSVC
|
||||||
|
|
||||||
|
set "VSVARS=%V6TOOLS%\VC97\Bin\vcvars32.bat"
|
||||||
|
call :CheckMSVC
|
||||||
|
if not ERRORLEVEL 1 goto FoundMSVC
|
||||||
|
|
||||||
|
set "VSVARS=%V5TOOLS%\VC\Bin\vcvars32.bat"
|
||||||
|
call :CheckMSVC
|
||||||
|
if not ERRORLEVEL 1 goto FoundMSVC
|
||||||
|
|
||||||
|
:: We did not find anything--fail
|
||||||
|
echo No MSVC compiler available.
|
||||||
|
echo Please run vcvarsall.bat and/or configure your Path.
|
||||||
|
exit 1
|
||||||
|
|
||||||
|
:FoundMSVC
|
||||||
set OUTDIR=.\WinRel
|
set OUTDIR=.\WinRel
|
||||||
|
set LNKOUT=./WinRel
|
||||||
set "OPTS=/O2 /D NDEBUG"
|
set "OPTS=/O2 /D NDEBUG"
|
||||||
set LINKOPTS=
|
set LINKOPTS=
|
||||||
if "%DEBUG%" == "Y" set OUTDIR=.\WinDebug
|
if "%DEBUG%" == "Y" set OUTDIR=.\WinDebug
|
||||||
|
if "%DEBUG%" == "Y" set LNKOUT=./WinDebug
|
||||||
if "%DEBUG%" == "Y" set "OPTS=/Zi /Od /D _DEBUG"
|
if "%DEBUG%" == "Y" set "OPTS=/Zi /Od /D _DEBUG"
|
||||||
if "%DEBUG%" == "Y" set LINKOPTS=/DEBUG
|
if "%DEBUG%" == "Y" set LINKOPTS=/DEBUG
|
||||||
call :Build
|
if "%MAINT%" == "Y" set "OPTS=%OPTS% /D MAKE_MAINTAINER_MODE"
|
||||||
goto Done
|
:: Show the compiler version that we found
|
||||||
|
:: Unfortunately this also shows a "usage" note; I can't find anything better.
|
||||||
|
echo.
|
||||||
|
call %COMPILER%
|
||||||
|
goto Build
|
||||||
|
|
||||||
:GccBuild
|
:FindGcc
|
||||||
set OUTDIR=.\GccRel
|
set OUTDIR=.\GccRel
|
||||||
|
set LNKOUT=./GccRel
|
||||||
set OPTS=-O2
|
set OPTS=-O2
|
||||||
|
set DIRENT=N
|
||||||
if "%DEBUG%" == "Y" set OPTS=-O0
|
if "%DEBUG%" == "Y" set OPTS=-O0
|
||||||
if "%DEBUG%" == "Y" set OUTDIR=.\GccDebug
|
if "%DEBUG%" == "Y" set OUTDIR=.\GccDebug
|
||||||
call :Build
|
if "%DEBUG%" == "Y" set LNKOUT=./GccDebug
|
||||||
goto Done
|
if "%MAINT%" == "Y" set "OPTS=%OPTS% -DMAKE_MAINTAINER_MODE"
|
||||||
|
:: Show the compiler version that we found
|
||||||
|
echo.
|
||||||
|
call %COMPILER% --version
|
||||||
|
if not ERRORLEVEL 1 goto Build
|
||||||
|
echo No %COMPILER% found.
|
||||||
|
exit 1
|
||||||
|
|
||||||
:Done
|
:FindTcc
|
||||||
call :Reset
|
set OUTDIR=.\TccRel
|
||||||
goto :EOF
|
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
|
||||||
|
|
||||||
:Build
|
:Build
|
||||||
:: Clean the directory if it exists
|
:: Clean the directory if it exists
|
||||||
@@ -82,160 +222,225 @@ if exist %OUTDIR%\nul rmdir /S /Q %OUTDIR%
|
|||||||
|
|
||||||
:: Recreate it
|
:: Recreate it
|
||||||
mkdir %OUTDIR%
|
mkdir %OUTDIR%
|
||||||
mkdir %OUTDIR%\glob
|
mkdir %OUTDIR%\src
|
||||||
mkdir %OUTDIR%\w32
|
mkdir %OUTDIR%\src\w32
|
||||||
mkdir %OUTDIR%\w32\compat
|
mkdir %OUTDIR%\src\w32\compat
|
||||||
mkdir %OUTDIR%\w32\subproc
|
mkdir %OUTDIR%\src\w32\subproc
|
||||||
|
mkdir %OUTDIR%\lib
|
||||||
|
|
||||||
if "%GUILE%" == "Y" call :ChkGuile
|
if "%GUILE%" == "Y" call :ChkGuile
|
||||||
|
|
||||||
|
if not exist src\config.h.W32 goto NotConfig
|
||||||
|
|
||||||
echo.
|
echo.
|
||||||
echo Compiling %OUTDIR% version
|
echo Compiling %OUTDIR% version
|
||||||
|
|
||||||
if exist config.h.W32.template call :ConfigSCM
|
copy src\config.h.W32 %OUTDIR%\src\config.h
|
||||||
copy config.h.W32 %OUTDIR%\config.h
|
|
||||||
|
|
||||||
call :Compile ar
|
copy lib\glob.in.h %OUTDIR%\lib\glob.h
|
||||||
call :Compile arscan
|
copy lib\fnmatch.in.h %OUTDIR%\lib\fnmatch.h
|
||||||
call :Compile commands
|
|
||||||
call :Compile default
|
|
||||||
call :Compile dir
|
|
||||||
call :Compile expand
|
|
||||||
call :Compile file
|
|
||||||
call :Compile function
|
|
||||||
call :Compile getloadavg
|
|
||||||
call :Compile getopt
|
|
||||||
call :Compile getopt1
|
|
||||||
call :Compile glob\fnmatch
|
|
||||||
call :Compile glob\glob
|
|
||||||
call :Compile guile GUILE
|
|
||||||
call :Compile hash
|
|
||||||
call :Compile implicit
|
|
||||||
call :Compile job
|
|
||||||
call :Compile load
|
|
||||||
call :Compile loadapi
|
|
||||||
call :Compile main GUILE
|
|
||||||
call :Compile misc
|
|
||||||
call :Compile output
|
|
||||||
call :Compile read
|
|
||||||
call :Compile remake
|
|
||||||
call :Compile remote-stub
|
|
||||||
call :Compile rule
|
|
||||||
call :Compile signame
|
|
||||||
call :Compile strcache
|
|
||||||
call :Compile variable
|
|
||||||
call :Compile version
|
|
||||||
call :Compile vpath
|
|
||||||
call :Compile w32\compat\posixfcn
|
|
||||||
call :Compile w32\pathstuff
|
|
||||||
call :Compile w32\subproc\misc
|
|
||||||
call :Compile w32\subproc\sub_proc
|
|
||||||
call :Compile w32\subproc\w32err
|
|
||||||
call :Compile w32\w32os
|
|
||||||
|
|
||||||
if not "%COMPILER%" == "gcc" call :Compile w32\compat\dirent
|
if exist %OUTDIR%\link.sc del %OUTDIR%\link.sc
|
||||||
|
|
||||||
|
call :Compile src/ar
|
||||||
|
call :Compile src/arscan
|
||||||
|
call :Compile src/commands
|
||||||
|
call :Compile src/default
|
||||||
|
call :Compile src/dir
|
||||||
|
call :Compile src/expand
|
||||||
|
call :Compile src/file
|
||||||
|
call :Compile src/function
|
||||||
|
call :Compile src/getopt
|
||||||
|
call :Compile src/getopt1
|
||||||
|
call :Compile src/guile GUILE
|
||||||
|
call :Compile src/hash
|
||||||
|
call :Compile src/implicit
|
||||||
|
call :Compile src/job
|
||||||
|
call :Compile src/load
|
||||||
|
call :Compile src/loadapi
|
||||||
|
call :Compile src/main GUILE
|
||||||
|
call :Compile src/misc
|
||||||
|
call :Compile src/output
|
||||||
|
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
|
||||||
|
call :Compile src/version
|
||||||
|
call :Compile src/vpath
|
||||||
|
call :Compile src/w32/pathstuff
|
||||||
|
call :Compile src/w32/w32os
|
||||||
|
call :Compile src/w32/compat/posixfcn
|
||||||
|
call :Compile src/w32/subproc/misc
|
||||||
|
call :Compile src/w32/subproc/sub_proc
|
||||||
|
call :Compile src/w32/subproc/w32err
|
||||||
|
call :Compile lib/fnmatch
|
||||||
|
call :Compile lib/glob
|
||||||
|
call :Compile lib/getloadavg
|
||||||
|
|
||||||
|
:: Compile dirent unless it is supported by compiler library (like with gcc).
|
||||||
|
if "%DIRENT%" == "Y" call :Compile src\w32\compat\dirent
|
||||||
|
|
||||||
call :Link
|
call :Link
|
||||||
|
|
||||||
echo.
|
echo.
|
||||||
if not exist %OUTDIR%\%MAKE%.exe echo %OUTDIR% build FAILED!
|
if exist %OUTDIR%\%MAKE%.exe goto Success
|
||||||
if exist %OUTDIR%\%MAKE%.exe echo %OUTDIR% build succeeded.
|
echo %OUTDIR% build FAILED!
|
||||||
|
exit 1
|
||||||
|
|
||||||
|
:Success
|
||||||
|
echo %OUTDIR% build succeeded.
|
||||||
|
if exist Basic.mk copy /Y Basic.mk Makefile
|
||||||
|
if not exist tests\config-flags.pm copy /Y tests\config-flags.pm.W32 tests\config-flags.pm
|
||||||
|
call :Reset
|
||||||
goto :EOF
|
goto :EOF
|
||||||
|
|
||||||
|
::
|
||||||
|
:: Subroutines
|
||||||
|
::
|
||||||
|
|
||||||
:Compile
|
:Compile
|
||||||
|
if "%VERBOSE%" == "N" echo - Compiling %1.c
|
||||||
|
echo %LNKOUT%/%1.%O% >>%OUTDIR%\link.sc
|
||||||
set EXTRAS=
|
set EXTRAS=
|
||||||
if "%2" == "GUILE" set "EXTRAS=%GUILECFLAGS%"
|
if "%2" == "GUILE" set "EXTRAS=%GUILECFLAGS%"
|
||||||
|
if exist "%OUTDIR%\%1.%O%" del "%OUTDIR%\%1.%O%"
|
||||||
if "%COMPILER%" == "gcc" goto GccCompile
|
if "%COMPILER%" == "gcc" goto GccCompile
|
||||||
|
if "%COMPILER%" == "tcc" goto TccCompile
|
||||||
|
|
||||||
:: MSVC Compile
|
:: MSVC Compile
|
||||||
echo on
|
if "%VERBOSE%" == "Y" echo on
|
||||||
cl.exe /nologo /MT /W4 /GX /YX %OPTS% /I %OUTDIR% /I . /I glob /I w32/include /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR%OUTDIR% /Fp%OUTDIR%\%MAKE%.pch /Fo%OUTDIR%\%1.obj /Fd%OUTDIR%\%MAKE%.pdb %EXTRAS% /c %1.c
|
call %COMPILER% /nologo /MT /W4 /EHsc %OPTS% /I %OUTDIR%/src /I src /I %OUTDIR%/lib /I lib /I src/w32/include /D _CONSOLE /D HAVE_CONFIG_H /FR%OUTDIR% /Fp%OUTDIR%\%MAKE%.pch /Fo%OUTDIR%\%1.%O% /Fd%OUTDIR%\%MAKE%.pdb %EXTRAS% /c %1.c
|
||||||
@echo off
|
@echo off
|
||||||
echo %OUTDIR%\%1.obj >>%OUTDIR%\link.sc
|
goto CompileDone
|
||||||
goto :EOF
|
|
||||||
|
|
||||||
:GccCompile
|
:GccCompile
|
||||||
:: GCC Compile
|
:: GCC Compile
|
||||||
echo on
|
if "%VERBOSE%" == "Y" echo on
|
||||||
gcc -mthreads -Wall -gdwarf-2 -g3 %OPTS% -I%OUTDIR% -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H %EXTRAS% -o %OUTDIR%\%1.o -c %1.c
|
call %COMPILER% -mthreads -Wall -std=gnu99 -gdwarf-2 -g3 %OPTS% -I%OUTDIR%/src -I./src -I%OUTDIR%/lib -I./lib -I./src/w32/include -DHAVE_CONFIG_H %EXTRAS% -o %OUTDIR%/%1.%O% -c %1.c
|
||||||
@echo off
|
@echo off
|
||||||
|
goto CompileDone
|
||||||
|
|
||||||
|
:TccCompile
|
||||||
|
:: TCC Compile
|
||||||
|
if "%VERBOSE%" == "Y" echo on
|
||||||
|
call %COMPILER% -mthreads -Wall -std=c11 %OPTS% -I%OUTDIR%/src -I./src -I%OUTDIR%/lib -I./lib -I./src/w32/include -D_cdecl= -D_MSC_VER -DHAVE_CONFIG_H %EXTRAS% -o %OUTDIR%/%1.%O% -c %1.c
|
||||||
|
@echo off
|
||||||
|
goto CompileDone
|
||||||
|
|
||||||
|
:CompileDone
|
||||||
|
if not exist "%OUTDIR%\%1.%O%" exit 1
|
||||||
goto :EOF
|
goto :EOF
|
||||||
|
|
||||||
:Link
|
:Link
|
||||||
echo Linking %OUTDIR%/%MAKE%.exe
|
echo.
|
||||||
|
echo - Linking %LNKOUT%/%MAKE%.exe
|
||||||
if "%COMPILER%" == "gcc" goto GccLink
|
if "%COMPILER%" == "gcc" goto GccLink
|
||||||
|
if "%COMPILER%" == "tcc" goto TccLink
|
||||||
|
|
||||||
:: MSVC Link
|
:: MSVC Link
|
||||||
echo %GUILELIBS% kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib >>%OUTDIR%\link.sc
|
echo %GUILELIBS% kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib >>%OUTDIR%\link.sc
|
||||||
echo on
|
if "%VERBOSE%" == "Y" echo on
|
||||||
link.exe /NOLOGO /SUBSYSTEM:console /PDB:%OUTDIR%\%MAKE%.pdb %LINKOPTS% /OUT:%OUTDIR%\%MAKE%.exe @%OUTDIR%\link.sc
|
call link.exe /NOLOGO /SUBSYSTEM:console /PDB:%LNKOUT%\%MAKE%.pdb %LINKOPTS% /OUT:%LNKOUT%\%MAKE%.exe @%LNKOUT%\link.sc
|
||||||
@echo off
|
@echo off
|
||||||
goto :EOF
|
goto :EOF
|
||||||
|
|
||||||
:GccLink
|
:GccLink
|
||||||
:: GCC Link
|
:: GCC Link
|
||||||
echo on
|
if "%VERBOSE%" == "Y" echo on
|
||||||
gcc -mthreads -gdwarf-2 -g3 -o %OUTDIR%\%MAKE%.exe %OUTDIR%\variable.o %OUTDIR%\rule.o %OUTDIR%\remote-stub.o %OUTDIR%\commands.o %OUTDIR%\file.o %OUTDIR%\getloadavg.o %OUTDIR%\default.o %OUTDIR%\signame.o %OUTDIR%\expand.o %OUTDIR%\dir.o %OUTDIR%\main.o %OUTDIR%\getopt1.o %OUTDIR%\guile.o %OUTDIR%\job.o %OUTDIR%\output.o %OUTDIR%\read.o %OUTDIR%\version.o %OUTDIR%\getopt.o %OUTDIR%\arscan.o %OUTDIR%\remake.o %OUTDIR%\misc.o %OUTDIR%\hash.o %OUTDIR%\strcache.o %OUTDIR%\ar.o %OUTDIR%\function.o %OUTDIR%\vpath.o %OUTDIR%\implicit.o %OUTDIR%\loadapi.o %OUTDIR%\load.o %OUTDIR%\glob\glob.o %OUTDIR%\glob\fnmatch.o %OUTDIR%\w32\pathstuff.o %OUTDIR%\w32\compat\posixfcn.o %OUTDIR%\w32\w32os.o %OUTDIR%\w32\subproc\misc.o %OUTDIR%\w32\subproc\sub_proc.o %OUTDIR%\w32\subproc\w32err.o %GUILELIBS% -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -luuid -lodbc32 -lodbccp32 -Wl,--out-implib=%OUTDIR%\libgnumake-1.dll.a
|
echo %GUILELIBS% -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -luuid -lodbc32 -lodbccp32 >>%OUTDIR%\link.sc
|
||||||
|
call %COMPILER% -mthreads -gdwarf-2 -g3 %OPTS% -o %LNKOUT%/%MAKE%.exe @%LNKOUT%/link.sc -Wl,--out-implib=%LNKOUT%/libgnumake-1.dll.a
|
||||||
@echo off
|
@echo off
|
||||||
goto :EOF
|
goto :EOF
|
||||||
|
|
||||||
:ConfigSCM
|
:TccLink
|
||||||
echo Generating config from SCM templates
|
:: TCC Link
|
||||||
sed -n "s/^AC_INIT(\[GNU make\],\[\([^]]\+\)\].*/s,%%VERSION%%,\1,g/p" configure.ac > %OUTDIR%\config.h.W32.sed
|
if "%VERBOSE%" == "Y" echo on
|
||||||
echo s,%%PACKAGE%%,make,g >> %OUTDIR%\config.h.W32.sed
|
echo %GUILELIBS% -lkernel32 -luser32 -lgdi32 -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -lodbc32 -lodbccp32 >>%OUTDIR%\link.sc
|
||||||
sed -f %OUTDIR%\config.h.W32.sed config.h.W32.template > config.h.W32
|
call %COMPILER% -mthreads %OPTS% -o %LNKOUT%/%MAKE%.exe @%LNKOUT%/link.sc
|
||||||
echo static const char *const GUILE_module_defn = ^" \> gmk-default.h
|
@echo off
|
||||||
sed -e "s/;.*//" -e "/^[ \t]*$/d" -e "s/\"/\\\\\"/g" -e "s/$/ \\\/" gmk-default.scm >> gmk-default.h
|
|
||||||
echo ^";>> gmk-default.h
|
|
||||||
goto :EOF
|
goto :EOF
|
||||||
|
|
||||||
:ChkGuile
|
:ChkGuile
|
||||||
|
:: Build with Guile is supported only on NT and later versions
|
||||||
if not "%OS%" == "Windows_NT" goto NoGuile
|
if not "%OS%" == "Windows_NT" goto NoGuile
|
||||||
pkg-config --help > %OUTDIR%\guile.tmp 2> NUL
|
call pkg-config --help > %OUTDIR%\guile.tmp 2> NUL
|
||||||
if ERRORLEVEL 1 goto NoPkgCfg
|
if ERRORLEVEL 1 goto NoPkgCfg
|
||||||
|
|
||||||
echo Checking for Guile 2.0
|
set PKGMSC=
|
||||||
if not "%COMPILER%" == "gcc" set PKGMSC=--msvc-syntax
|
if not "%COMPILER%" == "gcc" set PKGMSC=--msvc-syntax
|
||||||
pkg-config --cflags --short-errors "guile-2.0" > %OUTDIR%\guile.tmp
|
|
||||||
if not ERRORLEVEL 1 set /P GUILECFLAGS= < %OUTDIR%\guile.tmp
|
|
||||||
|
|
||||||
pkg-config --libs --static --short-errors %PKGMSC% "guile-2.0" > %OUTDIR%\guile.tmp
|
echo Checking for Guile 2.0
|
||||||
if not ERRORLEVEL 1 set /P GUILELIBS= < %OUTDIR%\guile.tmp
|
call pkg-config --cflags --short-errors "guile-2.0" > %OUTDIR%\gl-c2.tmp 2> NUL
|
||||||
|
if not ERRORLEVEL 1 set /P GUILECFLAGS= < %OUTDIR%\gl-c2.tmp
|
||||||
|
|
||||||
|
call pkg-config --libs --static --short-errors %PKGMSC% "guile-2.0" > %OUTDIR%\gl-l2.tmp 2> NUL
|
||||||
|
if not ERRORLEVEL 1 set /P GUILELIBS= < %OUTDIR%\gl-l2.tmp
|
||||||
|
|
||||||
if not "%GUILECFLAGS%" == "" goto GuileDone
|
if not "%GUILECFLAGS%" == "" goto GuileDone
|
||||||
|
|
||||||
echo Checking for Guile 1.8
|
echo Checking for Guile 1.8
|
||||||
pkg-config --cflags --short-errors "guile-1.8" > %OUTDIR%\guile.tmp
|
call pkg-config --cflags --short-errors "guile-1.8" > %OUTDIR%\gl-c18.tmp 2> NUL
|
||||||
if not ERRORLEVEL 1 set /P GUILECFLAGS= < %OUTDIR%\guile.tmp
|
if not ERRORLEVEL 1 set /P GUILECFLAGS= < %OUTDIR%\gl-c18.tmp
|
||||||
|
|
||||||
pkg-config --libs --static --short-errors %PKGMSC% "guile-1.8" > %OUTDIR%\guile.tmp
|
call pkg-config --libs --static --short-errors %PKGMSC% "guile-1.8" > %OUTDIR%\gl-l18.tmp 2> NUL
|
||||||
if not ERRORLEVEL 1 set /P GUILELIBS= < %OUTDIR%\guile.tmp
|
if not ERRORLEVEL 1 set /P GUILELIBS= < %OUTDIR%\gl-l18.tmp
|
||||||
|
|
||||||
if not "%GUILECFLAGS%" == "" goto GuileDone
|
if not "%GUILECFLAGS%" == "" goto GuileDone
|
||||||
|
|
||||||
echo No Guile found, building without Guile
|
echo - No Guile found, building without Guile
|
||||||
goto GuileDone
|
goto GuileDone
|
||||||
|
|
||||||
:NoPkgCfg
|
:NoPkgCfg
|
||||||
echo pkg-config not found, building without Guile
|
echo - pkg-config not found, building without Guile
|
||||||
|
|
||||||
:GuileDone
|
:GuileDone
|
||||||
if "%GUILECFLAGS%" == "" goto :EOF
|
if "%GUILECFLAGS%" == "" goto :EOF
|
||||||
|
|
||||||
echo Guile found, building with Guile
|
echo - Guile found: building with Guile
|
||||||
set "GUILECFLAGS=%GUILECFLAGS% -DHAVE_GUILE"
|
set "GUILECFLAGS=%GUILECFLAGS% -DHAVE_GUILE"
|
||||||
goto :EOF
|
goto :EOF
|
||||||
|
|
||||||
|
:FindVswhere
|
||||||
|
set VSWHERE=vswhere
|
||||||
|
call "%VSWHERE%" -help >nul 2>&1
|
||||||
|
if not ERRORLEVEL 1 exit /b 0
|
||||||
|
set "VSWHERE=C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere"
|
||||||
|
call "%VSWHERE%" -help >nul 2>&1
|
||||||
|
if ERRORLEVEL 1 exit /b 1
|
||||||
|
goto :EOF
|
||||||
|
|
||||||
|
:CheckMSVC
|
||||||
|
if not exist "%VSVARS%" exit /b 1
|
||||||
|
call "%VSVARS%" %ARCH%
|
||||||
|
if ERRORLEVEL 1 exit /b 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
|
:Usage
|
||||||
echo Usage: %0 [options] [gcc]
|
echo Usage: %0 [options] [gcc] OR [tcc]
|
||||||
echo Options:
|
echo Options:
|
||||||
echo. --debug For GCC only, make a debug build
|
|
||||||
echo. (MSVC build always makes both debug and release)
|
|
||||||
echo. --without-guile Do not compile Guile support even if found
|
echo. --without-guile Do not compile Guile support even if found
|
||||||
|
echo. --debug Make a Debug build--default is Release
|
||||||
|
echo. --x86 Make a 32bit binary--default is 64bit
|
||||||
echo. --help Display these instructions and exit
|
echo. --help Display these instructions and exit
|
||||||
|
echo.
|
||||||
|
echo. "gcc" means compile with GCC, "tcc" means compile with Tiny C's TCC
|
||||||
goto :EOF
|
goto :EOF
|
||||||
|
|
||||||
:Reset
|
:Reset
|
||||||
|
set ARCH=
|
||||||
set COMPILER=
|
set COMPILER=
|
||||||
set DEBUG=
|
set DEBUG=
|
||||||
set GUILE=
|
set GUILE=
|
||||||
@@ -244,7 +449,10 @@ set GUILELIBS=
|
|||||||
set LINKOPTS=
|
set LINKOPTS=
|
||||||
set MAKE=
|
set MAKE=
|
||||||
set NOGUILE=
|
set NOGUILE=
|
||||||
|
set O=
|
||||||
set OPTS=
|
set OPTS=
|
||||||
set OUTDIR=
|
set OUTDIR=
|
||||||
|
set LNKOUT=
|
||||||
set PKGMSC=
|
set PKGMSC=
|
||||||
|
set VSVARS=
|
||||||
goto :EOF
|
goto :EOF
|
||||||
|
|||||||
97
builddos.bat
Normal file
97
builddos.bat
Normal file
@@ -0,0 +1,97 @@
|
|||||||
|
@echo off
|
||||||
|
rem Copyright (C) 1998-2022 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
|
||||||
|
rem the terms of the GNU General Public License as published by the Free
|
||||||
|
rem Software Foundation; either version 3 of the License, or (at your option)
|
||||||
|
rem any later version.
|
||||||
|
rem
|
||||||
|
rem GNU Make is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
rem ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
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 <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
echo Building Make for MSDOS with DJGPP
|
||||||
|
|
||||||
|
rem The SmallEnv trick protects against too small environment block,
|
||||||
|
rem in which case the values will be truncated and the whole thing
|
||||||
|
rem goes awry. COMMAND.COM will say "Out of environment space", but
|
||||||
|
rem many people don't care, so we force them to care by refusing to go.
|
||||||
|
|
||||||
|
rem Where is the srcdir?
|
||||||
|
set XSRC=.
|
||||||
|
if not "%XSRC%"=="." goto SmallEnv
|
||||||
|
if "%1%"=="" goto SrcDone
|
||||||
|
if "%1%"=="." goto SrcDone
|
||||||
|
set XSRC=%1
|
||||||
|
|
||||||
|
if not "%XSRC%"=="%1" goto SmallEnv
|
||||||
|
|
||||||
|
:SrcDone
|
||||||
|
|
||||||
|
if not exist src mkdir src
|
||||||
|
if not exist lib mkdir lib
|
||||||
|
|
||||||
|
copy /Y %XSRC%\src\configh.dos .\src\config.h
|
||||||
|
|
||||||
|
copy /Y %XSRC%\lib\glob.in.h .\lib\glob.h
|
||||||
|
copy /Y %XSRC%\lib\fnmatch.in.h .\lib\fnmatch.h
|
||||||
|
|
||||||
|
rem Echo ON so they will see what is going on.
|
||||||
|
@echo on
|
||||||
|
gcc -c -I./src -I%XSRC%/src -I./lib -I%XSRC%/lib -DHAVE_CONFIG_H -O2 -g %XSRC%/src/commands.c -o commands.o
|
||||||
|
gcc -c -I./src -I%XSRC%/src -I./lib -I%XSRC%/lib -DHAVE_CONFIG_H -O2 -g %XSRC%/src/output.c -o output.o
|
||||||
|
gcc -c -I./src -I%XSRC%/src -I./lib -I%XSRC%/lib -DHAVE_CONFIG_H -O2 -g %XSRC%/src/job.c -o job.o
|
||||||
|
gcc -c -I./src -I%XSRC%/src -I./lib -I%XSRC%/lib -DHAVE_CONFIG_H -O2 -g %XSRC%/src/dir.c -o dir.o
|
||||||
|
gcc -c -I./src -I%XSRC%/src -I./lib -I%XSRC%/lib -DHAVE_CONFIG_H -O2 -g %XSRC%/src/file.c -o file.o
|
||||||
|
gcc -c -I./src -I%XSRC%/src -I./lib -I%XSRC%/lib -DHAVE_CONFIG_H -O2 -g %XSRC%/src/misc.c -o misc.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 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
|
||||||
|
gcc -c -I./src -I%XSRC%/src -I./lib -I%XSRC%/lib -DHAVE_CONFIG_H -O2 -g %XSRC%/src/strcache.c -o strcache.o
|
||||||
|
gcc -c -I./src -I%XSRC%/src -I./lib -I%XSRC%/lib -DHAVE_CONFIG_H -O2 -g %XSRC%/src/version.c -o version.o
|
||||||
|
gcc -c -I./src -I%XSRC%/src -I./lib -I%XSRC%/lib -DHAVE_CONFIG_H -O2 -g %XSRC%/src/ar.c -o ar.o
|
||||||
|
gcc -c -I./src -I%XSRC%/src -I./lib -I%XSRC%/lib -DHAVE_CONFIG_H -O2 -g %XSRC%/src/arscan.c -o arscan.o
|
||||||
|
gcc -c -I./src -I%XSRC%/src -I./lib -I%XSRC%/lib -DHAVE_CONFIG_H -O2 -g %XSRC%/src/signame.c -o signame.o
|
||||||
|
gcc -c -I./src -I%XSRC%/src -I./lib -I%XSRC%/lib -DHAVE_CONFIG_H -O2 -g %XSRC%/src/remote-stub.c -o remote-stub.o
|
||||||
|
gcc -c -I./src -I%XSRC%/src -I./lib -I%XSRC%/lib -DHAVE_CONFIG_H -O2 -g %XSRC%/src/getopt.c -o getopt.o
|
||||||
|
gcc -c -I./src -I%XSRC%/src -I./lib -I%XSRC%/lib -DHAVE_CONFIG_H -O2 -g %XSRC%/src/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 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.$$$
|
||||||
|
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.$$$
|
||||||
|
@echo off
|
||||||
|
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 %XSRC%\Basic.mk Makefile
|
||||||
|
goto End
|
||||||
|
|
||||||
|
:SmallEnv
|
||||||
|
echo Your environment is too small. Please enlarge it and run me again.
|
||||||
|
|
||||||
|
:End
|
||||||
|
set XRSC=
|
||||||
|
@echo on
|
||||||
12
config/.gitignore
vendored
12
config/.gitignore
vendored
@@ -1,12 +0,0 @@
|
|||||||
ar-lib
|
|
||||||
compile
|
|
||||||
config.guess
|
|
||||||
config.rpath
|
|
||||||
config.sub
|
|
||||||
depcomp
|
|
||||||
install-sh
|
|
||||||
mdate-sh
|
|
||||||
missing
|
|
||||||
texinfo.tex
|
|
||||||
*.m4
|
|
||||||
!dospaths.m4
|
|
||||||
@@ -1,49 +0,0 @@
|
|||||||
2012-01-15 Paul Smith <psmith@gnu.org>
|
|
||||||
|
|
||||||
* dospaths.m4: Use AC_LANG_PROGRAM to encapsulate the test code.
|
|
||||||
Fixes Savannah bug #35256. Patch from Sebastian Pipping.
|
|
||||||
|
|
||||||
2006-03-09 Paul Smith <psmith@gnu.org>
|
|
||||||
|
|
||||||
* dospaths.m4: Add MSYS to the list of targets allowing DOS-style
|
|
||||||
pathnames. Reported by David Ergo <david.ergo@alterface.com>.
|
|
||||||
|
|
||||||
2005-07-01 Paul D. Smith <psmith@gnu.org>
|
|
||||||
|
|
||||||
* Makefile.am (EXTRA_DIST): Added more M4 files to EXTRA_DIST, so
|
|
||||||
users can re-run aclocal.
|
|
||||||
|
|
||||||
2003-04-30 Paul D. Smith <psmith@gnu.org>
|
|
||||||
|
|
||||||
* dospaths.m4: New macro to test for DOS-style pathnames, based on
|
|
||||||
coreutils 5.0 "dos.m4" by Jim Meyering.
|
|
||||||
|
|
||||||
2002-04-21 gettextize <bug-gnu-gettext@gnu.org>
|
|
||||||
|
|
||||||
* codeset.m4: New file, from gettext-0.11.1.
|
|
||||||
* gettext.m4: New file, from gettext-0.11.1.
|
|
||||||
* glibc21.m4: New file, from gettext-0.11.1.
|
|
||||||
* iconv.m4: New file, from gettext-0.11.1.
|
|
||||||
* isc-posix.m4: New file, from gettext-0.11.1.
|
|
||||||
* lcmessage.m4: New file, from gettext-0.11.1.
|
|
||||||
* lib-ld.m4: New file, from gettext-0.11.1.
|
|
||||||
* lib-link.m4: New file, from gettext-0.11.1.
|
|
||||||
* lib-prefix.m4: New file, from gettext-0.11.1.
|
|
||||||
* progtest.m4: New file, from gettext-0.11.1.
|
|
||||||
* Makefile.am: New file.
|
|
||||||
|
|
||||||
|
|
||||||
Copyright (C) 2002-2016 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 <http://www.gnu.org/licenses/>.
|
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
# -*-Makefile-*-, or close enough
|
|
||||||
# Copyright (C) 2002-2016 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 <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
# Autoconf / automake know how to handle this directory.
|
|
||||||
259
configure.ac
259
configure.ac
@@ -1,6 +1,6 @@
|
|||||||
# Process this file with autoconf to produce a configure script.
|
# Process this file with autoconf to produce a configure script.
|
||||||
#
|
#
|
||||||
# Copyright (C) 1993-2016 Free Software Foundation, Inc.
|
# Copyright (C) 1993-2022 Free Software Foundation, Inc.
|
||||||
# This file is part of GNU Make.
|
# This file is part of GNU Make.
|
||||||
#
|
#
|
||||||
# GNU Make is free software; you can redistribute it and/or modify it under
|
# GNU Make is free software; you can redistribute it and/or modify it under
|
||||||
@@ -14,26 +14,34 @@
|
|||||||
# details.
|
# details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License along with
|
# You should have received a copy of the GNU General Public License along with
|
||||||
# this program. If not, see <http://www.gnu.org/licenses/>.
|
# this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
AC_INIT([GNU make],[4.1.90],[bug-make@gnu.org])
|
AC_INIT([GNU Make],[4.4],[bug-make@gnu.org])
|
||||||
|
|
||||||
AC_PREREQ([2.69])
|
AC_PREREQ([2.69])
|
||||||
|
|
||||||
# Autoconf setup
|
# Autoconf setup
|
||||||
AC_CONFIG_AUX_DIR([config])
|
AC_CONFIG_AUX_DIR([build-aux])
|
||||||
AC_CONFIG_SRCDIR([vpath.c])
|
AC_CONFIG_SRCDIR([src/vpath.c])
|
||||||
AC_CONFIG_HEADERS([config.h])
|
AC_CONFIG_HEADERS([src/config.h])
|
||||||
|
|
||||||
|
AC_CONFIG_LIBOBJ_DIR([lib])
|
||||||
|
|
||||||
# Automake setup
|
# Automake setup
|
||||||
# We have to enable "foreign" because ChangeLog is auto-generated
|
# We have to enable "foreign" because ChangeLog is auto-generated
|
||||||
# We cannot enable -Werror because gettext 0.18.1 has invalid content
|
# Automake 1.15 and gnulib don't get along: gnulib has some strange error
|
||||||
# When we update gettext to 0.18.3 or better we can add it again.
|
# in the way it handles getloadavg.c which causes make distcheck to fail.
|
||||||
AM_INIT_AUTOMAKE([1.15 foreign -Werror -Wall])
|
# https://lists.gnu.org/archive/html/bug-gnulib/2018-06/msg00024.html
|
||||||
|
AM_INIT_AUTOMAKE([1.16.1 foreign -Werror -Wall])
|
||||||
|
|
||||||
# Checks for programs.
|
# Checks for programs.
|
||||||
AC_USE_SYSTEM_EXTENSIONS
|
AC_USE_SYSTEM_EXTENSIONS
|
||||||
AC_PROG_CC
|
AC_PROG_CC
|
||||||
|
|
||||||
|
# Configure gnulib
|
||||||
|
gl_EARLY
|
||||||
|
gl_INIT
|
||||||
|
|
||||||
AC_PROG_INSTALL
|
AC_PROG_INSTALL
|
||||||
AC_PROG_RANLIB
|
AC_PROG_RANLIB
|
||||||
AC_PROG_CPP
|
AC_PROG_CPP
|
||||||
@@ -41,46 +49,38 @@ AC_CHECK_PROG([AR], [ar], [ar], [ar])
|
|||||||
# Perl is needed for the test suite (only)
|
# Perl is needed for the test suite (only)
|
||||||
AC_CHECK_PROG([PERL], [perl], [perl], [perl])
|
AC_CHECK_PROG([PERL], [perl], [perl], [perl])
|
||||||
|
|
||||||
# Needed for w32/Makefile.am
|
|
||||||
AM_PROG_AR
|
|
||||||
|
|
||||||
# Specialized system macros
|
# Specialized system macros
|
||||||
AC_CANONICAL_HOST
|
AC_CANONICAL_HOST
|
||||||
AC_AIX
|
AC_C_BIGENDIAN
|
||||||
AC_ISC_POSIX
|
|
||||||
AC_MINIX
|
|
||||||
|
|
||||||
# Enable gettext, in "external" mode.
|
# Enable gettext, in "external" mode.
|
||||||
AM_GNU_GETTEXT_VERSION([0.19.4])
|
AM_GNU_GETTEXT_VERSION([0.19.4])
|
||||||
AM_GNU_GETTEXT([external])
|
AM_GNU_GETTEXT([external])
|
||||||
|
|
||||||
# This test must come as early as possible after the compiler configuration
|
|
||||||
# tests, because the choice of the file model can (in principle) affect
|
|
||||||
# whether functions and headers are available, whether they work, etc.
|
|
||||||
AC_SYS_LARGEFILE
|
|
||||||
|
|
||||||
# Checks for libraries.
|
# Checks for libraries.
|
||||||
|
AC_SEARCH_LIBS([strerror],[cposix])
|
||||||
AC_SEARCH_LIBS([getpwnam], [sun])
|
AC_SEARCH_LIBS([getpwnam], [sun])
|
||||||
|
|
||||||
# Checks for header files.
|
|
||||||
AC_HEADER_STDC
|
|
||||||
AC_HEADER_DIRENT
|
AC_HEADER_DIRENT
|
||||||
AC_HEADER_STAT
|
AC_HEADER_STAT
|
||||||
AC_HEADER_TIME
|
|
||||||
AC_CHECK_HEADERS([stdlib.h locale.h unistd.h limits.h fcntl.h string.h \
|
AC_CHECK_HEADERS([stdlib.h locale.h unistd.h limits.h fcntl.h string.h \
|
||||||
memory.h sys/param.h sys/resource.h sys/time.h sys/timeb.h \
|
memory.h sys/param.h sys/resource.h sys/timeb.h sys/time.h \
|
||||||
sys/select.h])
|
sys/select.h sys/file.h spawn.h])
|
||||||
|
|
||||||
AM_PROG_CC_C_O
|
AM_PROG_CC_C_O
|
||||||
AC_C_CONST
|
AC_C_CONST
|
||||||
AC_TYPE_SIGNAL
|
|
||||||
AC_TYPE_UID_T
|
AC_TYPE_UID_T
|
||||||
AC_TYPE_PID_T
|
AC_TYPE_PID_T
|
||||||
AC_TYPE_OFF_T
|
AC_TYPE_OFF_T
|
||||||
AC_TYPE_SIZE_T
|
AC_TYPE_SIZE_T
|
||||||
AC_TYPE_SSIZE_T
|
AC_TYPE_SSIZE_T
|
||||||
|
AC_TYPE_INTMAX_T
|
||||||
AC_TYPE_UINTMAX_T
|
AC_TYPE_UINTMAX_T
|
||||||
|
|
||||||
|
# Check for sig_atomic_t
|
||||||
|
gt_TYPE_SIG_ATOMIC_T
|
||||||
|
|
||||||
# Find out whether our struct stat returns nanosecond resolution timestamps.
|
# Find out whether our struct stat returns nanosecond resolution timestamps.
|
||||||
|
|
||||||
AC_STRUCT_ST_MTIM_NSEC
|
AC_STRUCT_ST_MTIM_NSEC
|
||||||
@@ -109,9 +109,6 @@ AS_IF([test "$make_cv_file_timestamp_hi_res" = yes],
|
|||||||
])
|
])
|
||||||
])
|
])
|
||||||
|
|
||||||
# Check for DOS-style pathnames.
|
|
||||||
pds_AC_DOS_PATHS
|
|
||||||
|
|
||||||
# See if we have a standard version of gettimeofday(). Since actual
|
# See if we have a standard version of gettimeofday(). Since actual
|
||||||
# implementations can differ, just make sure we have the most common
|
# implementations can differ, just make sure we have the most common
|
||||||
# one.
|
# one.
|
||||||
@@ -121,8 +118,8 @@ AC_CACHE_CHECK([for standard gettimeofday], [ac_cv_func_gettimeofday],
|
|||||||
int main ()
|
int main ()
|
||||||
{
|
{
|
||||||
struct timeval t; t.tv_sec = -1; t.tv_usec = -1;
|
struct timeval t; t.tv_sec = -1; t.tv_usec = -1;
|
||||||
exit (gettimeofday (&t, 0) != 0
|
return gettimeofday (&t, 0) != 0
|
||||||
|| t.tv_sec < 0 || t.tv_usec < 0);
|
|| t.tv_sec < 0 || t.tv_usec < 0;
|
||||||
}]])],
|
}]])],
|
||||||
[ac_cv_func_gettimeofday=yes],
|
[ac_cv_func_gettimeofday=yes],
|
||||||
[ac_cv_func_gettimeofday=no],
|
[ac_cv_func_gettimeofday=no],
|
||||||
@@ -132,11 +129,12 @@ AS_IF([test "$ac_cv_func_gettimeofday" = yes],
|
|||||||
[Define to 1 if you have a standard gettimeofday function])
|
[Define to 1 if you have a standard gettimeofday function])
|
||||||
])
|
])
|
||||||
|
|
||||||
AC_CHECK_FUNCS([strdup strndup mkstemp mktemp fdopen fileno \
|
AC_CHECK_FUNCS([strtoll strdup strndup stpcpy memrchr mempcpy umask mkstemp \
|
||||||
dup dup2 getcwd realpath sigsetmask sigaction \
|
mktemp fdopen dup dup2 getcwd realpath sigsetmask sigaction \
|
||||||
getgroups seteuid setegid setlinebuf setreuid setregid \
|
getgroups seteuid setegid setlinebuf setreuid setregid \
|
||||||
getrlimit setrlimit setvbuf pipe strerror strsignal \
|
mkfifo getrlimit setrlimit setvbuf pipe strerror strsignal \
|
||||||
lstat readlink atexit isatty ttyname pselect])
|
lstat readlink atexit isatty ttyname pselect posix_spawn \
|
||||||
|
posix_spawnattr_setsigmask])
|
||||||
|
|
||||||
# We need to check declarations, not just existence, because on Tru64 this
|
# We need to check declarations, not just existence, because on Tru64 this
|
||||||
# function is not declared without special flags, which themselves cause
|
# function is not declared without special flags, which themselves cause
|
||||||
@@ -146,8 +144,6 @@ AC_CHECK_DECLS([bsd_signal], [], [], [[#define _GNU_SOURCE 1
|
|||||||
|
|
||||||
AC_FUNC_FORK
|
AC_FUNC_FORK
|
||||||
|
|
||||||
AC_FUNC_SETVBUF_REVERSED
|
|
||||||
|
|
||||||
# Rumor has it that strcasecmp lives in -lresolv on some odd systems.
|
# Rumor has it that strcasecmp lives in -lresolv on some odd systems.
|
||||||
# It doesn't hurt much to use our own if we can't find it so I don't
|
# It doesn't hurt much to use our own if we can't find it so I don't
|
||||||
# make the effort here.
|
# make the effort here.
|
||||||
@@ -155,47 +151,64 @@ AC_CHECK_FUNCS([strcasecmp strncasecmp strcmpi strncmpi stricmp strnicmp])
|
|||||||
|
|
||||||
# strcoll() is used by the GNU glob library
|
# strcoll() is used by the GNU glob library
|
||||||
AC_FUNC_STRCOLL
|
AC_FUNC_STRCOLL
|
||||||
|
|
||||||
AC_FUNC_ALLOCA
|
|
||||||
AC_FUNC_CLOSEDIR_VOID
|
AC_FUNC_CLOSEDIR_VOID
|
||||||
|
|
||||||
|
# dir.c and our glob.c use dirent.d_type if available
|
||||||
|
AC_STRUCT_DIRENT_D_TYPE
|
||||||
|
|
||||||
# See if the user wants to add (or not) GNU Guile support
|
# See if the user wants to add (or not) GNU Guile support
|
||||||
PKG_PROG_PKG_CONFIG
|
|
||||||
AC_ARG_WITH([guile], [AS_HELP_STRING([--with-guile],
|
AC_ARG_WITH([guile], [AS_HELP_STRING([--with-guile],
|
||||||
[Support GNU Guile for embedded scripting])])
|
[Support GNU Guile for embedded scripting])])
|
||||||
|
|
||||||
# For some strange reason, at least on Ubuntu, each version of Guile
|
# Annoyingly, each version of Guile comes with it's own PC file so we have to
|
||||||
# comes with it's own PC file so we have to specify them as individual
|
# specify them as individual packages. Ugh.
|
||||||
# packages. Ugh.
|
PKG_PROG_PKG_CONFIG
|
||||||
|
|
||||||
AS_IF([test "x$with_guile" != xno],
|
AS_IF([test "x$with_guile" != xno],
|
||||||
[ PKG_CHECK_MODULES([GUILE], [guile-2.0], [have_guile=yes],
|
[ guile_versions="3.0 2.2 2.0 1.8"
|
||||||
[PKG_CHECK_MODULES([GUILE], [guile-1.8], [have_guile=yes],
|
guile_version=no
|
||||||
[have_guile=no])])
|
have_guile=no
|
||||||
])
|
AC_MSG_CHECKING([for GNU Guile])
|
||||||
|
for v in $guile_versions; do
|
||||||
AS_IF([test "$have_guile" = yes],
|
PKG_CHECK_EXISTS([guile-$v], [guile_version=$v; have_guile=yes; break], [])
|
||||||
[AC_DEFINE([HAVE_GUILE], [1], [Embed GNU Guile support])])
|
done
|
||||||
|
AC_MSG_RESULT([$guile_version])
|
||||||
AM_CONDITIONAL([HAVE_GUILE], [test "$have_guile" = yes])
|
AS_IF([test "$have_guile" = yes],
|
||||||
|
[ PKG_CHECK_MODULES(GUILE, [guile-$guile_version])
|
||||||
AC_FUNC_GETLOADAVG
|
# Unfortunately pkg doesn't help in multi-arch environments where the
|
||||||
|
# package is installed for some architectures but not others; we need
|
||||||
# AC_FUNC_GETLOADAVG is documented to set the NLIST_STRUCT value, but it
|
# to try to link.
|
||||||
# doesn't. So, we will.
|
keep_CPPFLAGS="$CPPFLAGS"
|
||||||
|
keep_LIBS="$LIBS"
|
||||||
AS_IF([test "$ac_cv_header_nlist_h" = yes],
|
CPPFLAGS="$CPPFLAGS $GUILE_CFLAGS"
|
||||||
[ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <nlist.h>]],
|
LIBS="$LIBS $GUILE_LIBS"
|
||||||
[[struct nlist nl;
|
AC_CHECK_HEADER([libguile.h],
|
||||||
nl.n_name = "string";
|
[AC_DEFINE([HAVE_GUILE], [1], [Embed GNU Guile support])],
|
||||||
return 0;]])],
|
[have_guile=no],
|
||||||
[make_cv_nlist_struct=yes],
|
[/* Avoid configuration error warnings. */])
|
||||||
[make_cv_nlist_struct=no])
|
AS_IF([test "$have_guile" = yes],
|
||||||
AS_IF([test "$make_cv_nlist_struct" = yes],
|
[ AC_MSG_CHECKING([whether we can link GNU Guile])
|
||||||
[ AC_DEFINE([NLIST_STRUCT], [1],
|
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
|
||||||
[Define to 1 if struct nlist.n_name is a pointer rather than an array.])
|
#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"])
|
||||||
|
|
||||||
AC_CHECK_DECLS([sys_siglist, _sys_siglist, __sys_siglist], , ,
|
AC_CHECK_DECLS([sys_siglist, _sys_siglist, __sys_siglist], , ,
|
||||||
[AC_INCLUDES_DEFAULT
|
[AC_INCLUDES_DEFAULT
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
@@ -247,8 +260,7 @@ AS_IF([test "$PATH_SEPARATOR" = ';'],
|
|||||||
AC_SUBST([REMOTE]) REMOTE=stub
|
AC_SUBST([REMOTE]) REMOTE=stub
|
||||||
use_customs=false
|
use_customs=false
|
||||||
AC_ARG_WITH([customs],
|
AC_ARG_WITH([customs],
|
||||||
[AC_HELP_STRING([--with-customs=DIR],
|
[AS_HELP_STRING([--with-customs=DIR],[enable remote jobs via Customs--see README.customs])],
|
||||||
[enable remote jobs via Customs--see README.customs])],
|
|
||||||
[ AS_CASE([$withval], [n|no], [:],
|
[ AS_CASE([$withval], [n|no], [:],
|
||||||
[make_cppflags="$CPPFLAGS"
|
[make_cppflags="$CPPFLAGS"
|
||||||
AS_CASE([$withval],
|
AS_CASE([$withval],
|
||||||
@@ -271,14 +283,12 @@ AM_CONDITIONAL([USE_CUSTOMS], [test "$use_customs" = true])
|
|||||||
# See if the user asked to handle case insensitive file systems.
|
# See if the user asked to handle case insensitive file systems.
|
||||||
AH_TEMPLATE([HAVE_CASE_INSENSITIVE_FS], [Use case insensitive file names])
|
AH_TEMPLATE([HAVE_CASE_INSENSITIVE_FS], [Use case insensitive file names])
|
||||||
AC_ARG_ENABLE([case-insensitive-file-system],
|
AC_ARG_ENABLE([case-insensitive-file-system],
|
||||||
AC_HELP_STRING([--enable-case-insensitive-file-system],
|
AS_HELP_STRING([--enable-case-insensitive-file-system],[assume file systems are case insensitive]),
|
||||||
[assume file systems are case insensitive]),
|
|
||||||
[AS_IF([test "$enableval" = yes], [AC_DEFINE([HAVE_CASE_INSENSITIVE_FS])])])
|
[AS_IF([test "$enableval" = yes], [AC_DEFINE([HAVE_CASE_INSENSITIVE_FS])])])
|
||||||
|
|
||||||
# See if we can handle the job server feature, and if the user wants it.
|
# See if we can handle the job server feature, and if the user wants it.
|
||||||
AC_ARG_ENABLE([job-server],
|
AC_ARG_ENABLE([job-server],
|
||||||
AC_HELP_STRING([--disable-job-server],
|
AS_HELP_STRING([--disable-job-server],[disallow recursive make communication during -jN]),
|
||||||
[disallow recursive make communication during -jN]),
|
|
||||||
[make_cv_job_server="$enableval" user_job_server="$enableval"],
|
[make_cv_job_server="$enableval" user_job_server="$enableval"],
|
||||||
[make_cv_job_server="yes"])
|
[make_cv_job_server="yes"])
|
||||||
|
|
||||||
@@ -316,8 +326,7 @@ AC_CHECK_DECLS([dlopen, dlsym, dlerror], [], [],
|
|||||||
[[#include <dlfcn.h>]])
|
[[#include <dlfcn.h>]])
|
||||||
|
|
||||||
AC_ARG_ENABLE([load],
|
AC_ARG_ENABLE([load],
|
||||||
AC_HELP_STRING([--disable-load],
|
AS_HELP_STRING([--disable-load],[disable support for the 'load' operation]),
|
||||||
[disable support for the 'load' operation]),
|
|
||||||
[make_cv_load="$enableval" user_load="$enableval"],
|
[make_cv_load="$enableval" user_load="$enableval"],
|
||||||
[make_cv_load="yes"])
|
[make_cv_load="yes"])
|
||||||
|
|
||||||
@@ -364,6 +373,38 @@ AS_IF([test "$ac_cv_func_lstat" = yes && test "$ac_cv_func_readlink" = yes],
|
|||||||
[Define to 1 to enable symbolic link timestamp checking.])
|
[Define to 1 to enable symbolic link timestamp checking.])
|
||||||
])
|
])
|
||||||
|
|
||||||
|
# Use posix_spawn if we have support and the user didn't disable it
|
||||||
|
|
||||||
|
AC_ARG_ENABLE([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"])
|
||||||
|
|
||||||
|
AS_CASE([/$ac_cv_header_spawn/$ac_cv_func_posix_spawn/],
|
||||||
|
[*/no/*], [make_cv_posix_spawn=no])
|
||||||
|
|
||||||
|
AS_IF([test "$make_cv_posix_spawn" = yes],
|
||||||
|
AC_CACHE_CHECK([for posix_spawn that fails synchronously],
|
||||||
|
[make_cv_synchronous_posix_spawn],
|
||||||
|
[make_cv_synchronous_posix_spawn=no
|
||||||
|
AC_RUN_IFELSE([AC_LANG_SOURCE([[
|
||||||
|
#include <errno.h>
|
||||||
|
#include <spawn.h>
|
||||||
|
extern char **environ;
|
||||||
|
int main () {
|
||||||
|
char path[[]] = "./xxx-non-existent";
|
||||||
|
char *argv[[]] = {path, 0};
|
||||||
|
return posix_spawn (0, path, 0, 0, argv, environ) == ENOENT ? 0 : 1;
|
||||||
|
}]])],
|
||||||
|
[make_cv_synchronous_posix_spawn=yes],
|
||||||
|
[make_cv_synchronous_posix_spawn=no],
|
||||||
|
[make_cv_synchronous_posix_spawn="no (cross-compiling)"])]))
|
||||||
|
|
||||||
|
AS_CASE([/$user_posix_spawn/$make_cv_posix_spawn/$make_cv_synchronous_posix_spawn/],
|
||||||
|
[*/no/*], [make_cv_posix_spawn=no],
|
||||||
|
[AC_DEFINE(USE_POSIX_SPAWN, 1, [Define to 1 to use posix_spawn().])
|
||||||
|
])
|
||||||
|
|
||||||
# Find the SCCS commands, so we can include them in our default rules.
|
# Find the SCCS commands, so we can include them in our default rules.
|
||||||
|
|
||||||
AC_CACHE_CHECK([for location of SCCS get command], [make_cv_path_sccs_get], [
|
AC_CACHE_CHECK([for location of SCCS get command], [make_cv_path_sccs_get], [
|
||||||
@@ -391,33 +432,6 @@ AS_IF([(/usr/sccs/admin -n s.conftest || admin -n s.conftest) >/dev/null 2>&1 &&
|
|||||||
])
|
])
|
||||||
rm -f s.conftest conftoast
|
rm -f s.conftest conftoast
|
||||||
|
|
||||||
# Check the system to see if it provides GNU glob. If not, use our
|
|
||||||
# local version.
|
|
||||||
AC_CACHE_CHECK([if system libc has GNU glob], [make_cv_sys_gnu_glob],
|
|
||||||
[ AC_EGREP_CPP([gnu glob],[
|
|
||||||
#include <features.h>
|
|
||||||
#include <glob.h>
|
|
||||||
#include <fnmatch.h>
|
|
||||||
|
|
||||||
#define GLOB_INTERFACE_VERSION 1
|
|
||||||
#if !defined _LIBC && defined __GNU_LIBRARY__ && __GNU_LIBRARY__ > 1
|
|
||||||
# include <gnu-versions.h>
|
|
||||||
# if _GNU_GLOB_INTERFACE_VERSION == GLOB_INTERFACE_VERSION
|
|
||||||
gnu glob
|
|
||||||
# endif
|
|
||||||
#endif],
|
|
||||||
[make_cv_sys_gnu_glob=yes],
|
|
||||||
[make_cv_sys_gnu_glob=no])])
|
|
||||||
AS_IF([test "$make_cv_sys_gnu_glob" = no],
|
|
||||||
[ GLOBINC='-I$(srcdir)/glob'
|
|
||||||
GLOBLIB=glob/libglob.a
|
|
||||||
])
|
|
||||||
AC_SUBST([GLOBINC])
|
|
||||||
AC_SUBST([GLOBLIB])
|
|
||||||
|
|
||||||
# Tell automake about this, so it can build the right .c files.
|
|
||||||
AM_CONDITIONAL([USE_LOCAL_GLOB], [test "$make_cv_sys_gnu_glob" = no])
|
|
||||||
|
|
||||||
# Let the makefile know what our build host is
|
# Let the makefile know what our build host is
|
||||||
|
|
||||||
AC_DEFINE_UNQUOTED([MAKE_HOST],["$host"],[Build host information.])
|
AC_DEFINE_UNQUOTED([MAKE_HOST],["$host"],[Build host information.])
|
||||||
@@ -431,13 +445,21 @@ AS_CASE([$host],
|
|||||||
[*-*-mingw32],
|
[*-*-mingw32],
|
||||||
[AM_CONDITIONAL([WINDOWSENV], [true])
|
[AM_CONDITIONAL([WINDOWSENV], [true])
|
||||||
w32_target_env=yes
|
w32_target_env=yes
|
||||||
AC_DEFINE([WINDOWS32], [1], [Use platform specific coding])
|
AC_DEFINE([WINDOWS32], [1], [Build for the WINDOWS32 API.])
|
||||||
AC_DEFINE([HAVE_DOS_PATHS], [1], [Use platform specific coding])
|
AC_DEFINE([HAVE_DOS_PATHS], [1], [Support DOS-style pathnames.])
|
||||||
])
|
])
|
||||||
|
|
||||||
AC_DEFINE_UNQUOTED([PATH_SEPARATOR_CHAR],['$PATH_SEPARATOR'],
|
AC_DEFINE_UNQUOTED([PATH_SEPARATOR_CHAR],['$PATH_SEPARATOR'],
|
||||||
[Define to the character that separates directories in PATH.])
|
[Define to the character that separates directories in PATH.])
|
||||||
|
|
||||||
|
AC_DEFINE_UNQUOTED([HAVE_DECL_GETLOADAVG],[$HAVE_DECL_GETLOADAVG],
|
||||||
|
[Define to 1 if you have the declaration of 'getloadavg'.])
|
||||||
|
|
||||||
|
# Remember that we ran configure to generate config.h
|
||||||
|
|
||||||
|
AC_DEFINE([MK_CONFIGURE], [1],
|
||||||
|
[Define to 1 if config.h is generated by running the configure script.])
|
||||||
|
|
||||||
# Include the Maintainer's Makefile section, if it's here.
|
# Include the Maintainer's Makefile section, if it's here.
|
||||||
|
|
||||||
MAINT_MAKEFILE=/dev/null
|
MAINT_MAKEFILE=/dev/null
|
||||||
@@ -500,21 +522,30 @@ AS_IF([test "x$make_cv_load" = xno && test "x$user_load" = xyes],
|
|||||||
echo
|
echo
|
||||||
])
|
])
|
||||||
|
|
||||||
|
AS_IF([test "x$make_cv_posix_spawn" = xno && test "x$user_posix_spawn" = xyes],
|
||||||
|
[ echo
|
||||||
|
echo "WARNING: posix_spawn() is not supported on this system."
|
||||||
|
echo
|
||||||
|
])
|
||||||
|
|
||||||
|
# autoconf initializes $prefix to NONE.
|
||||||
|
AM_CONDITIONAL([KNOWN_PREFIX],
|
||||||
|
[test "x$prefix" = xNONE -o "x$prefix" = x/usr/local \
|
||||||
|
-o "x$prefix" = x/usr/gnu -o "x$prefix" = x/usr])
|
||||||
|
|
||||||
# Specify what files are to be created.
|
# Specify what files are to be created.
|
||||||
AC_CONFIG_FILES([Makefile glob/Makefile po/Makefile.in config/Makefile \
|
AC_CONFIG_FILES([build.cfg tests/config-flags.pm \
|
||||||
doc/Makefile w32/Makefile 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!
|
# OK, do it!
|
||||||
|
|
||||||
AC_OUTPUT
|
AC_OUTPUT
|
||||||
|
|
||||||
# We only generate the build.sh if we have a build.sh.in; we won't have
|
|
||||||
# one before we've created a distribution.
|
|
||||||
AS_IF([test -f "$srcdir/build.sh.in"],
|
|
||||||
[ ./config.status --file build.sh
|
|
||||||
chmod +x build.sh
|
|
||||||
])
|
|
||||||
|
|
||||||
dnl Local Variables:
|
dnl Local Variables:
|
||||||
dnl comment-start: "dnl "
|
dnl comment-start: "dnl "
|
||||||
dnl comment-end: ""
|
dnl comment-end: ""
|
||||||
|
|||||||
@@ -1,60 +0,0 @@
|
|||||||
@echo off
|
|
||||||
rem Copyright (C) 1994-2016 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
|
|
||||||
rem the terms of the GNU General Public License as published by the Free
|
|
||||||
rem Software Foundation; either version 3 of the License, or (at your option)
|
|
||||||
rem any later version.
|
|
||||||
rem
|
|
||||||
rem GNU Make is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
rem ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
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/>.
|
|
||||||
|
|
||||||
echo Configuring MAKE for DJGPP
|
|
||||||
|
|
||||||
rem The SmallEnv trick protects against too small environment block,
|
|
||||||
rem in which case the values will be truncated and the whole thing
|
|
||||||
rem goes awry. COMMAND.COM will say "Out of environment space", but
|
|
||||||
rem many people don't care, so we force them to care by refusing to go.
|
|
||||||
|
|
||||||
rem Where is the srcdir?
|
|
||||||
set XSRC=.
|
|
||||||
if not "%XSRC%"=="." goto SmallEnv
|
|
||||||
if "%1%"=="" goto SrcDone
|
|
||||||
set XSRC=%1
|
|
||||||
if not "%XSRC%"=="%1" goto SmallEnv
|
|
||||||
|
|
||||||
:SrcDone
|
|
||||||
|
|
||||||
update %XSRC%/configh.dos ./config.h
|
|
||||||
|
|
||||||
rem Do they have Make?
|
|
||||||
redir -o junk.$$$ -eo make -n -f NUL
|
|
||||||
rem REDIR will return 1 if it cannot run Make.
|
|
||||||
rem If it can run Make, it will usually return 2,
|
|
||||||
rem but 0 is also OK with us.
|
|
||||||
if errorlevel 2 goto MakeOk
|
|
||||||
if not errorlevel 1 goto MakeOk
|
|
||||||
if exist junk.$$$ del junk.$$$
|
|
||||||
echo No Make program found--use DOSBUILD.BAT to build Make.
|
|
||||||
goto End
|
|
||||||
|
|
||||||
rem They do have Make. Generate the Makefile.
|
|
||||||
|
|
||||||
:MakeOk
|
|
||||||
del junk.$$$
|
|
||||||
update %XSRC%/Makefile.DOS ./Makefile
|
|
||||||
echo Done.
|
|
||||||
if not "%XSRC%"=="." echo Invoke Make thus: "make srcdir=%XSRC%"
|
|
||||||
goto End
|
|
||||||
|
|
||||||
:SmallEnv
|
|
||||||
echo Your environment is too small. Please enlarge it and run me again.
|
|
||||||
|
|
||||||
:End
|
|
||||||
set XRSC=
|
|
||||||
1
doc/.gitignore
vendored
1
doc/.gitignore
vendored
@@ -1,4 +1,5 @@
|
|||||||
manual/
|
manual/
|
||||||
|
make.t2p/
|
||||||
gendocs_template
|
gendocs_template
|
||||||
fdl.texi
|
fdl.texi
|
||||||
make-stds.texi
|
make-stds.texi
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
# -*-Makefile-*-, or close enough
|
# -*-Makefile-*-, or close enough
|
||||||
# Copyright (C) 2000-2016 Free Software Foundation, Inc.
|
# Copyright (C) 2000-2022 Free Software Foundation, Inc.
|
||||||
# This file is part of GNU Make.
|
# This file is part of GNU Make.
|
||||||
#
|
#
|
||||||
# GNU Make is free software; you can redistribute it and/or modify it under
|
# GNU Make is free software; you can redistribute it and/or modify it under
|
||||||
@@ -13,7 +13,7 @@
|
|||||||
# details.
|
# details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License along with
|
# You should have received a copy of the GNU General Public License along with
|
||||||
# this program. If not, see <http://www.gnu.org/licenses/>.
|
# this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
TEXI2HTML = texi2html
|
TEXI2HTML = texi2html
|
||||||
TEXI2HTML_FLAGS = -split_chapter
|
TEXI2HTML_FLAGS = -split_chapter
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
.TH MAKE 1 "28 February 2016" "GNU" "User Commands"
|
.TH MAKE 1 "31 May 2022" "GNU" "User Commands"
|
||||||
.SH NAME
|
.SH NAME
|
||||||
make \- GNU make utility to maintain groups of programs
|
make \- GNU make utility to maintain groups of programs
|
||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
@@ -26,9 +26,9 @@ To prepare to use
|
|||||||
.BR make ,
|
.BR make ,
|
||||||
you must write a file called the
|
you must write a file called the
|
||||||
.I makefile
|
.I makefile
|
||||||
that describes the relationships among files in your program, and the states
|
that describes the relationships among files in your program, and provides
|
||||||
the commands for updating each file. In a program, typically the executable
|
commands for updating each file. In a program, typically the executable file
|
||||||
file is updated from object files, which are in turn made by compiling source
|
is updated from object files, which are in turn made by compiling source
|
||||||
files.
|
files.
|
||||||
.LP
|
.LP
|
||||||
Once a suitable makefile exists, each time you change some source files,
|
Once a suitable makefile exists, each time you change some source files,
|
||||||
@@ -48,10 +48,10 @@ files, it issues the commands recorded in the makefile.
|
|||||||
.B make
|
.B make
|
||||||
executes commands in the
|
executes commands in the
|
||||||
.I makefile
|
.I makefile
|
||||||
to update one or more target
|
to update one or more
|
||||||
.IR names ,
|
.IR targets ,
|
||||||
where
|
where
|
||||||
.I name
|
.I target
|
||||||
is typically a program.
|
is typically a program.
|
||||||
If no
|
If no
|
||||||
.B \-f
|
.B \-f
|
||||||
@@ -130,26 +130,37 @@ are omitted, then the behavior is the same as if
|
|||||||
.B \-d
|
.B \-d
|
||||||
was specified.
|
was specified.
|
||||||
.I FLAGS
|
.I FLAGS
|
||||||
may be
|
may be any or all of the following names, comma- or space-separated. Only the
|
||||||
.I a
|
first character is significant: the rest may be omitted:
|
||||||
|
.I all
|
||||||
for all debugging output (same as using
|
for all debugging output (same as using
|
||||||
.BR \-d ),
|
.BR \-d ),
|
||||||
.I b
|
.I basic
|
||||||
for basic debugging,
|
for basic debugging,
|
||||||
.I v
|
.I verbose
|
||||||
for more verbose basic debugging,
|
for more verbose basic debugging,
|
||||||
.I i
|
.I implicit
|
||||||
for showing implicit rules,
|
for showing implicit rule search operations,
|
||||||
.I j
|
.I jobs
|
||||||
for details on invocation of commands, and
|
for details on invocation of commands,
|
||||||
.I m
|
.I makefile
|
||||||
for debugging while remaking makefiles. Use
|
for debugging while remaking makefiles,
|
||||||
.I n
|
.I print
|
||||||
|
shows all recipes that are run even if they are silent, and
|
||||||
|
.I why
|
||||||
|
shows the reason
|
||||||
|
.BR make
|
||||||
|
decided to rebuild each target. Use
|
||||||
|
.I none
|
||||||
to disable all previous debugging flags.
|
to disable all previous debugging flags.
|
||||||
.TP 0.5i
|
.TP 0.5i
|
||||||
\fB\-e\fR, \fB\-\-environment\-overrides\fR
|
\fB\-e\fR, \fB\-\-environment\-overrides\fR
|
||||||
Give variables taken from the environment precedence
|
Give variables taken from the environment precedence over variables
|
||||||
over variables from makefiles.
|
from makefiles.
|
||||||
|
.TP 0.5i
|
||||||
|
\fB\-E\fR \fIstring\fR, \fB\-\-eval\fR \fIstring\fR
|
||||||
|
Interpret \fIstring\fR using the \fBeval\fR function, before parsing any
|
||||||
|
makefiles.
|
||||||
.TP 0.5i
|
.TP 0.5i
|
||||||
\fB\-f\fR \fIfile\fR, \fB\-\-file\fR=\fIfile\fR, \fB\-\-makefile\fR=\fIFILE\fR
|
\fB\-f\fR \fIfile\fR, \fB\-\-file\fR=\fIfile\fR, \fB\-\-makefile\fR=\fIFILE\fR
|
||||||
Use
|
Use
|
||||||
@@ -194,6 +205,16 @@ option is given without an argument,
|
|||||||
.BR make
|
.BR make
|
||||||
will not limit the number of jobs that can run simultaneously.
|
will not limit the number of jobs that can run simultaneously.
|
||||||
.TP 0.5i
|
.TP 0.5i
|
||||||
|
\fB\--jobserver-style=\fR\fIstyle\fR
|
||||||
|
The style of jobserver to use. The
|
||||||
|
.I style
|
||||||
|
may be one of
|
||||||
|
.BR fifo ,
|
||||||
|
.BR pipe ,
|
||||||
|
or
|
||||||
|
.B sem
|
||||||
|
(Windows only).
|
||||||
|
.TP 0.5i
|
||||||
\fB\-k\fR, \fB\-\-keep\-going\fR
|
\fB\-k\fR, \fB\-\-keep\-going\fR
|
||||||
Continue as much as possible after an error.
|
Continue as much as possible after an error.
|
||||||
While the target that failed, and those that depend on it, cannot
|
While the target that failed, and those that depend on it, cannot
|
||||||
@@ -270,19 +291,13 @@ Don't define any built\-in variables.
|
|||||||
\fB\-s\fR, \fB\-\-silent\fR, \fB\-\-quiet\fR
|
\fB\-s\fR, \fB\-\-silent\fR, \fB\-\-quiet\fR
|
||||||
Silent operation; do not print the commands as they are executed.
|
Silent operation; do not print the commands as they are executed.
|
||||||
.TP 0.5i
|
.TP 0.5i
|
||||||
|
.B \-\-no\-silent
|
||||||
|
Cancel the effect of the \fB\-s\fR option.
|
||||||
|
.TP 0.5i
|
||||||
\fB\-S\fR, \fB\-\-no\-keep\-going\fR, \fB\-\-stop\fR
|
\fB\-S\fR, \fB\-\-no\-keep\-going\fR, \fB\-\-stop\fR
|
||||||
Cancel the effect of the
|
Cancel the effect of the
|
||||||
.B \-k
|
.B \-k
|
||||||
option.
|
option.
|
||||||
This is never necessary except in a recursive
|
|
||||||
.B make
|
|
||||||
where
|
|
||||||
.B \-k
|
|
||||||
might be inherited from the top-level
|
|
||||||
.B make
|
|
||||||
via MAKEFLAGS or if you set
|
|
||||||
.B \-k
|
|
||||||
in MAKEFLAGS in your environment.
|
|
||||||
.TP 0.5i
|
.TP 0.5i
|
||||||
\fB\-t\fR, \fB\-\-touch\fR
|
\fB\-t\fR, \fB\-\-touch\fR
|
||||||
Touch files (mark them up to date without really changing them)
|
Touch files (mark them up to date without really changing them)
|
||||||
@@ -314,6 +329,26 @@ Turn off
|
|||||||
.BR \-w ,
|
.BR \-w ,
|
||||||
even if it was turned on implicitly.
|
even if it was turned on implicitly.
|
||||||
.TP 0.5i
|
.TP 0.5i
|
||||||
|
.BI \-\-shuffle "[=MODE]"
|
||||||
|
Enable shuffling of goal and prerequisite ordering.
|
||||||
|
.I MODE
|
||||||
|
is one of
|
||||||
|
.I none
|
||||||
|
to disable shuffle mode,
|
||||||
|
.I random
|
||||||
|
to shuffle prerequisites in random order,
|
||||||
|
.I reverse
|
||||||
|
to consider prerequisites in reverse order, or an integer
|
||||||
|
.I <seed>
|
||||||
|
which enables
|
||||||
|
.I random
|
||||||
|
mode with a specific
|
||||||
|
.I seed
|
||||||
|
value. If
|
||||||
|
.I MODE
|
||||||
|
is omitted the default is
|
||||||
|
.IR random .
|
||||||
|
.TP 0.5i
|
||||||
\fB\-W\fR \fIfile\fR, \fB\-\-what\-if\fR=\fIfile\fR, \fB\-\-new\-file\fR=\fIfile\fR, \fB\-\-assume\-new\fR=\fIfile\fR
|
\fB\-W\fR \fIfile\fR, \fB\-\-what\-if\fR=\fIfile\fR, \fB\-\-new\-file\fR=\fIfile\fR, \fB\-\-assume\-new\fR=\fIfile\fR
|
||||||
Pretend that the target
|
Pretend that the target
|
||||||
.I file
|
.I file
|
||||||
@@ -363,7 +398,7 @@ This manual page contributed by Dennis Morse of Stanford University.
|
|||||||
Further updates contributed by Mike Frysinger. It has been reworked by Roland
|
Further updates contributed by Mike Frysinger. It has been reworked by Roland
|
||||||
McGrath. Maintained by Paul Smith.
|
McGrath. Maintained by Paul Smith.
|
||||||
.SH "COPYRIGHT"
|
.SH "COPYRIGHT"
|
||||||
Copyright \(co 1992-1993, 1996-2016 Free Software Foundation, Inc.
|
Copyright \(co 1992-1993, 1996-2022 Free Software Foundation, Inc.
|
||||||
This file is part of
|
This file is part of
|
||||||
.IR "GNU make" .
|
.IR "GNU make" .
|
||||||
.LP
|
.LP
|
||||||
@@ -378,4 +413,4 @@ A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
|||||||
.LP
|
.LP
|
||||||
You should have received a copy of the GNU General Public License along with
|
You should have received a copy of the GNU General Public License along with
|
||||||
this program. If not, see
|
this program. If not, see
|
||||||
.IR http://www.gnu.org/licenses/ .
|
.IR https://www.gnu.org/licenses/ .
|
||||||
2253
doc/make.texi
2253
doc/make.texi
File diff suppressed because it is too large
Load Diff
65
dosbuild.bat
65
dosbuild.bat
@@ -1,65 +0,0 @@
|
|||||||
@echo off
|
|
||||||
rem Copyright (C) 1998-2016 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
|
|
||||||
rem the terms of the GNU General Public License as published by the Free
|
|
||||||
rem Software Foundation; either version 3 of the License, or (at your option)
|
|
||||||
rem any later version.
|
|
||||||
rem
|
|
||||||
rem GNU Make is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
rem ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
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/>.
|
|
||||||
|
|
||||||
echo Building Make for MSDOS
|
|
||||||
|
|
||||||
rem Echo ON so they will see what is going on.
|
|
||||||
@echo on
|
|
||||||
gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g commands.c -o commands.o
|
|
||||||
gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g output.c -o output.o
|
|
||||||
gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g job.c -o job.o
|
|
||||||
gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g dir.c -o dir.o
|
|
||||||
gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g file.c -o file.o
|
|
||||||
gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g misc.c -o misc.o
|
|
||||||
gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g main.c -o main.o
|
|
||||||
gcc -c -I. -I./glob -DHAVE_CONFIG_H -DINCLUDEDIR=\"c:/djgpp/include\" -O2 -g read.c -o read.o
|
|
||||||
gcc -c -I. -I./glob -DHAVE_CONFIG_H -DLIBDIR=\"c:/djgpp/lib\" -O2 -g remake.c -o remake.o
|
|
||||||
gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g rule.c -o rule.o
|
|
||||||
gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g implicit.c -o implicit.o
|
|
||||||
gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g default.c -o default.o
|
|
||||||
gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g variable.c -o variable.o
|
|
||||||
gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g expand.c -o expand.o
|
|
||||||
gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g function.c -o function.o
|
|
||||||
gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g vpath.c -o vpath.o
|
|
||||||
gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g hash.c -o hash.o
|
|
||||||
gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g strcache.c -o strcache.o
|
|
||||||
gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g version.c -o version.o
|
|
||||||
gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g ar.c -o ar.o
|
|
||||||
gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g arscan.c -o arscan.o
|
|
||||||
gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g signame.c -o signame.o
|
|
||||||
gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g remote-stub.c -o remote-stub.o
|
|
||||||
gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g getopt.c -o getopt.o
|
|
||||||
gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g getopt1.c -o getopt1.o
|
|
||||||
@cd glob
|
|
||||||
@if exist libglob.a del libglob.a
|
|
||||||
gcc -I. -c -DHAVE_CONFIG_H -I.. -O2 -g glob.c -o glob.o
|
|
||||||
gcc -I. -c -DHAVE_CONFIG_H -I.. -O2 -g fnmatch.c -o fnmatch.o
|
|
||||||
ar rv libglob.a glob.o fnmatch.o
|
|
||||||
@echo off
|
|
||||||
cd ..
|
|
||||||
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.$$$
|
|
||||||
echo glob/libglob.a >> respf.$$$
|
|
||||||
rem gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g guile.c -o guile.o
|
|
||||||
rem echo guile.o >> respf.$$$
|
|
||||||
@echo Linking...
|
|
||||||
@echo on
|
|
||||||
gcc -o make.new @respf.$$$
|
|
||||||
@if exist make.exe echo Make.exe is now built!
|
|
||||||
@if not exist make.exe echo Make.exe build failed...
|
|
||||||
@if exist make.exe del respf.$$$
|
|
||||||
1026
getloadavg.c
1026
getloadavg.c
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
|
||||||
@@ -117,7 +117,7 @@ extern int errno;
|
|||||||
|
|
||||||
/* When used in the GNU libc the symbol _DIRENT_HAVE_D_TYPE is available
|
/* When used in the GNU libc the symbol _DIRENT_HAVE_D_TYPE is available
|
||||||
if the `d_type' member for `struct dirent' is available. */
|
if the `d_type' member for `struct dirent' is available. */
|
||||||
#ifdef _DIRENT_HAVE_D_TYPE
|
#if defined(_DIRENT_HAVE_D_TYPE) || defined(HAVE_STRUCT_DIRENT_D_TYPE)
|
||||||
# define HAVE_D_TYPE 1
|
# define HAVE_D_TYPE 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -226,9 +226,6 @@ extern char *alloca ();
|
|||||||
# endif /* Not _AIX. */
|
# endif /* Not _AIX. */
|
||||||
# endif /* sparc or HAVE_ALLOCA_H. */
|
# endif /* sparc or HAVE_ALLOCA_H. */
|
||||||
# endif /* GCC. */
|
# endif /* GCC. */
|
||||||
|
|
||||||
# define __alloca alloca
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef __GNU_LIBRARY__
|
#ifndef __GNU_LIBRARY__
|
||||||
@@ -283,6 +280,14 @@ extern char *alloca ();
|
|||||||
#endif
|
#endif
|
||||||
#include <glob.h>
|
#include <glob.h>
|
||||||
|
|
||||||
|
#if !defined __alloca
|
||||||
|
# define __alloca alloca
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if !defined __stat
|
||||||
|
# define __stat stat
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_GETLOGIN_R
|
#ifdef HAVE_GETLOGIN_R
|
||||||
extern int getlogin_r __P ((char *, size_t));
|
extern int getlogin_r __P ((char *, size_t));
|
||||||
#else
|
#else
|
||||||
@@ -369,7 +374,7 @@ glob (pattern, flags, errfunc, pglob)
|
|||||||
const char *dirname;
|
const char *dirname;
|
||||||
size_t dirlen;
|
size_t dirlen;
|
||||||
int status;
|
int status;
|
||||||
int oldcount;
|
size_t oldcount;
|
||||||
|
|
||||||
if (pattern == NULL || pglob == NULL || (flags & ~__GLOB_FLAGS) != 0)
|
if (pattern == NULL || pglob == NULL || (flags & ~__GLOB_FLAGS) != 0)
|
||||||
{
|
{
|
||||||
@@ -389,7 +394,7 @@ glob (pattern, flags, errfunc, pglob)
|
|||||||
{
|
{
|
||||||
/* Allocate working buffer large enough for our work. Note that
|
/* Allocate working buffer large enough for our work. Note that
|
||||||
we have at least an opening and closing brace. */
|
we have at least an opening and closing brace. */
|
||||||
int firstc;
|
size_t firstc;
|
||||||
char *alt_start;
|
char *alt_start;
|
||||||
const char *p;
|
const char *p;
|
||||||
const char *next;
|
const char *next;
|
||||||
@@ -860,7 +865,7 @@ glob (pattern, flags, errfunc, pglob)
|
|||||||
have to glob for the directory, and then glob for
|
have to glob for the directory, and then glob for
|
||||||
the pattern in each directory found. */
|
the pattern in each directory found. */
|
||||||
glob_t dirs;
|
glob_t dirs;
|
||||||
register int i;
|
register size_t i;
|
||||||
|
|
||||||
status = glob (dirname,
|
status = glob (dirname,
|
||||||
((flags & (GLOB_ERR | GLOB_NOCHECK | GLOB_NOESCAPE))
|
((flags & (GLOB_ERR | GLOB_NOCHECK | GLOB_NOESCAPE))
|
||||||
@@ -1010,7 +1015,7 @@ glob (pattern, flags, errfunc, pglob)
|
|||||||
if (dirlen > 0)
|
if (dirlen > 0)
|
||||||
{
|
{
|
||||||
/* Stick the directory on the front of each name. */
|
/* Stick the directory on the front of each name. */
|
||||||
int ignore = oldcount;
|
size_t ignore = oldcount;
|
||||||
|
|
||||||
if ((flags & GLOB_DOOFFS) && ignore < pglob->gl_offs)
|
if ((flags & GLOB_DOOFFS) && ignore < pglob->gl_offs)
|
||||||
ignore = pglob->gl_offs;
|
ignore = pglob->gl_offs;
|
||||||
@@ -1028,7 +1033,7 @@ glob (pattern, flags, errfunc, pglob)
|
|||||||
if (flags & GLOB_MARK)
|
if (flags & GLOB_MARK)
|
||||||
{
|
{
|
||||||
/* Append slashes to directory names. */
|
/* Append slashes to directory names. */
|
||||||
int i;
|
size_t i;
|
||||||
struct stat st;
|
struct stat st;
|
||||||
for (i = oldcount; i < pglob->gl_pathc; ++i)
|
for (i = oldcount; i < pglob->gl_pathc; ++i)
|
||||||
if (((flags & GLOB_ALTDIRFUNC)
|
if (((flags & GLOB_ALTDIRFUNC)
|
||||||
@@ -1072,7 +1077,7 @@ globfree (pglob)
|
|||||||
{
|
{
|
||||||
if (pglob->gl_pathv != NULL)
|
if (pglob->gl_pathv != NULL)
|
||||||
{
|
{
|
||||||
register int i;
|
register size_t i;
|
||||||
for (i = 0; i < pglob->gl_pathc; ++i)
|
for (i = 0; i < pglob->gl_pathc; ++i)
|
||||||
if (pglob->gl_pathv[i] != NULL)
|
if (pglob->gl_pathv[i] != NULL)
|
||||||
free ((__ptr_t) pglob->gl_pathv[i]);
|
free ((__ptr_t) pglob->gl_pathv[i]);
|
||||||
@@ -1330,7 +1335,7 @@ glob_in_dir (pattern, directory, flags, errfunc, pglob)
|
|||||||
/* If we shall match only directories use the information
|
/* If we shall match only directories use the information
|
||||||
provided by the dirent call if possible. */
|
provided by the dirent call if possible. */
|
||||||
if ((flags & GLOB_ONLYDIR)
|
if ((flags & GLOB_ONLYDIR)
|
||||||
&& d->d_type != DT_UNKNOWN && d->d_type != DT_DIR)
|
&& d->d_type != DT_UNKNOWN && d->d_type != DT_DIR && d->d_type != DT_LNK)
|
||||||
continue;
|
continue;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -1413,7 +1418,7 @@ glob_in_dir (pattern, directory, flags, errfunc, pglob)
|
|||||||
|
|
||||||
memory_error:
|
memory_error:
|
||||||
{
|
{
|
||||||
int save = errno;
|
save = errno;
|
||||||
if (flags & GLOB_ALTDIRFUNC)
|
if (flags & GLOB_ALTDIRFUNC)
|
||||||
(*pglob->gl_closedir) (stream);
|
(*pglob->gl_closedir) (stream);
|
||||||
else
|
else
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
dnl acinclude.m4 -- Extra macros needed for GNU make.
|
dnl acinclude.m4 -- Extra macros needed for GNU make.
|
||||||
dnl
|
dnl
|
||||||
dnl Automake will incorporate this into its generated aclocal.m4.
|
dnl Automake will incorporate this into its generated aclocal.m4.
|
||||||
dnl Copyright (C) 1998-2016 Free Software Foundation, Inc.
|
dnl Copyright (C) 1998-2022 Free Software Foundation, Inc.
|
||||||
dnl This file is part of GNU Make.
|
dnl This file is part of GNU Make.
|
||||||
dnl
|
dnl
|
||||||
dnl GNU Make is free software; you can redistribute it and/or modify it under
|
dnl GNU Make is free software; you can redistribute it and/or modify it under
|
||||||
@@ -15,7 +15,7 @@ dnl FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for.
|
|||||||
dnl more details.
|
dnl more details.
|
||||||
dnl
|
dnl
|
||||||
dnl You should have received a copy of the GNU General Public License along
|
dnl You should have received a copy of the GNU General Public License along
|
||||||
dnl with this program. If not, see <http://www.gnu.org/licenses/>.
|
dnl with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
dnl ---------------------------------------------------------------------------
|
dnl ---------------------------------------------------------------------------
|
||||||
dnl Got this from the lynx 2.8 distribution.
|
dnl Got this from the lynx 2.8 distribution.
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
# Test if the system uses DOS-style pathnames (drive specs and backslashes)
|
# Test if the system uses DOS-style pathnames (drive specs and backslashes)
|
||||||
# By Paul Smith <psmith@gnu.org>. Based on dos.m4 by Jim Meyering.
|
# By Paul Smith <psmith@gnu.org>. Based on dos.m4 by Jim Meyering.
|
||||||
#
|
#
|
||||||
# Copyright (C) 1993-2016 Free Software Foundation, Inc.
|
# Copyright (C) 1993-2022 Free Software Foundation, Inc.
|
||||||
# This file is part of GNU Make.
|
# This file is part of GNU Make.
|
||||||
#
|
#
|
||||||
# GNU Make is free software; you can redistribute it and/or modify it under
|
# GNU Make is free software; you can redistribute it and/or modify it under
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
# details.
|
# details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License along with
|
# You should have received a copy of the GNU General Public License along with
|
||||||
# this program. If not, see <http://www.gnu.org/licenses/>.
|
# this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
AC_DEFUN([pds_AC_DOS_PATHS], [
|
AC_DEFUN([pds_AC_DOS_PATHS], [
|
||||||
AC_CACHE_CHECK([whether system uses MSDOS-style paths], [ac_cv_dos_paths], [
|
AC_CACHE_CHECK([whether system uses MSDOS-style paths], [ac_cv_dos_paths], [
|
||||||
216
gl/m4/getloadavg.m4
Normal file
216
gl/m4/getloadavg.m4
Normal file
@@ -0,0 +1,216 @@
|
|||||||
|
# Check for getloadavg.
|
||||||
|
|
||||||
|
# Copyright (C) 1992-1996, 1999-2000, 2002-2003, 2006, 2008-2022 Free Software
|
||||||
|
# Foundation, Inc.
|
||||||
|
|
||||||
|
# This file is free software; the Free Software Foundation
|
||||||
|
# gives unlimited permission to copy and/or distribute it,
|
||||||
|
# with or without modifications, as long as this notice is preserved.
|
||||||
|
|
||||||
|
#serial 10
|
||||||
|
|
||||||
|
# Autoconf defines AC_FUNC_GETLOADAVG, but that is obsolescent.
|
||||||
|
# New applications should use gl_GETLOADAVG instead.
|
||||||
|
|
||||||
|
# gl_GETLOADAVG
|
||||||
|
# -------------
|
||||||
|
AC_DEFUN([gl_GETLOADAVG],
|
||||||
|
[AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
|
||||||
|
|
||||||
|
# Persuade glibc <stdlib.h> to declare getloadavg().
|
||||||
|
AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
|
||||||
|
|
||||||
|
gl_save_LIBS=$LIBS
|
||||||
|
|
||||||
|
# getloadavg is present in libc on glibc >= 2.2, Mac OS X, FreeBSD >= 2.0,
|
||||||
|
# NetBSD >= 0.9, OpenBSD >= 2.0, Solaris >= 7.
|
||||||
|
HAVE_GETLOADAVG=1
|
||||||
|
AC_CHECK_FUNC([getloadavg], [],
|
||||||
|
[gl_func_getloadavg_done=no
|
||||||
|
|
||||||
|
# Some systems with -lutil have (and need) -lkvm as well, some do not.
|
||||||
|
# On Solaris, -lkvm requires nlist from -lelf, so check that first
|
||||||
|
# to get the right answer into the cache.
|
||||||
|
# For kstat on solaris, we need to test for libelf and libkvm to force the
|
||||||
|
# definition of SVR4 below.
|
||||||
|
if test $gl_func_getloadavg_done = no; then
|
||||||
|
AC_CHECK_LIB([elf], [elf_begin], [LIBS="-lelf $LIBS"])
|
||||||
|
AC_CHECK_LIB([kvm], [kvm_open], [LIBS="-lkvm $LIBS"])
|
||||||
|
# Check for the 4.4BSD definition of getloadavg.
|
||||||
|
AC_CHECK_LIB([util], [getloadavg],
|
||||||
|
[LIBS="-lutil $LIBS" gl_func_getloadavg_done=yes])
|
||||||
|
fi
|
||||||
|
|
||||||
|
if test $gl_func_getloadavg_done = no; then
|
||||||
|
# There is a commonly available library for RS/6000 AIX.
|
||||||
|
# Since it is not a standard part of AIX, it might be installed locally.
|
||||||
|
gl_getloadavg_LIBS=$LIBS
|
||||||
|
if test $cross_compiling != yes; then
|
||||||
|
LIBS="-L/usr/local/lib $LIBS"
|
||||||
|
fi
|
||||||
|
AC_CHECK_LIB([getloadavg], [getloadavg],
|
||||||
|
[LIBS="-lgetloadavg $LIBS" gl_func_getloadavg_done=yes],
|
||||||
|
[LIBS=$gl_getloadavg_LIBS])
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Set up the replacement function if necessary.
|
||||||
|
if test $gl_func_getloadavg_done = no; then
|
||||||
|
HAVE_GETLOADAVG=0
|
||||||
|
|
||||||
|
# Solaris has libkstat which does not require root.
|
||||||
|
AC_CHECK_LIB([kstat], [kstat_open])
|
||||||
|
test $ac_cv_lib_kstat_kstat_open = yes && gl_func_getloadavg_done=yes
|
||||||
|
|
||||||
|
# AIX has libperfstat which does not require root
|
||||||
|
if test $gl_func_getloadavg_done = no; then
|
||||||
|
AC_CHECK_LIB([perfstat], [perfstat_cpu_total])
|
||||||
|
test $ac_cv_lib_perfstat_perfstat_cpu_total = yes && gl_func_getloadavg_done=yes
|
||||||
|
fi
|
||||||
|
|
||||||
|
if test $gl_func_getloadavg_done = no; then
|
||||||
|
AC_CHECK_HEADER([sys/dg_sys_info.h],
|
||||||
|
[gl_func_getloadavg_done=yes
|
||||||
|
AC_DEFINE([DGUX], [1], [Define to 1 for DGUX with <sys/dg_sys_info.h>.])
|
||||||
|
AC_CHECK_LIB([dgc], [dg_sys_info])])
|
||||||
|
fi
|
||||||
|
fi])
|
||||||
|
|
||||||
|
if test "x$gl_save_LIBS" = x; then
|
||||||
|
GETLOADAVG_LIBS=$LIBS
|
||||||
|
else
|
||||||
|
GETLOADAVG_LIBS=`echo "$LIBS" | sed "s!$gl_save_LIBS!!"`
|
||||||
|
fi
|
||||||
|
LIBS=$gl_save_LIBS
|
||||||
|
|
||||||
|
AC_SUBST([GETLOADAVG_LIBS])dnl
|
||||||
|
|
||||||
|
# Test whether the system declares getloadavg. Solaris has the function
|
||||||
|
# but declares it in <sys/loadavg.h>, not <stdlib.h>.
|
||||||
|
AC_CHECK_HEADERS([sys/loadavg.h])
|
||||||
|
if test $ac_cv_header_sys_loadavg_h = yes; then
|
||||||
|
HAVE_SYS_LOADAVG_H=1
|
||||||
|
else
|
||||||
|
HAVE_SYS_LOADAVG_H=0
|
||||||
|
fi
|
||||||
|
AC_CHECK_DECL([getloadavg], [], [HAVE_DECL_GETLOADAVG=0],
|
||||||
|
[[#if HAVE_SYS_LOADAVG_H
|
||||||
|
/* OpenIndiana has a bug: <sys/time.h> must be included before
|
||||||
|
<sys/loadavg.h>. */
|
||||||
|
# include <sys/time.h>
|
||||||
|
# include <sys/loadavg.h>
|
||||||
|
#endif
|
||||||
|
#include <stdlib.h>]])
|
||||||
|
])# gl_GETLOADAVG
|
||||||
|
|
||||||
|
|
||||||
|
# gl_PREREQ_GETLOADAVG
|
||||||
|
# --------------------
|
||||||
|
# Set up the AC_LIBOBJ replacement of 'getloadavg'.
|
||||||
|
AC_DEFUN([gl_PREREQ_GETLOADAVG],
|
||||||
|
[
|
||||||
|
# Figure out what our getloadavg.c needs.
|
||||||
|
|
||||||
|
AC_CHECK_HEADERS_ONCE([sys/param.h unistd.h])
|
||||||
|
|
||||||
|
# On HPUX9, an unprivileged user can get load averages this way.
|
||||||
|
if test $gl_func_getloadavg_done = no; then
|
||||||
|
AC_CHECK_FUNCS([pstat_getdynamic], [gl_func_getloadavg_done=yes])
|
||||||
|
fi
|
||||||
|
|
||||||
|
# We cannot check for <dwarf.h>, because Solaris 2 does not use dwarf (it
|
||||||
|
# uses stabs), but it is still SVR4. We cannot check for <elf.h> because
|
||||||
|
# Irix 4.0.5F has the header but not the library.
|
||||||
|
if test $gl_func_getloadavg_done = no && test "$ac_cv_lib_elf_elf_begin" = yes \
|
||||||
|
&& test "$ac_cv_lib_kvm_kvm_open" = yes; then
|
||||||
|
gl_func_getloadavg_done=yes
|
||||||
|
AC_DEFINE([SVR4], [1], [Define to 1 on System V Release 4.])
|
||||||
|
fi
|
||||||
|
|
||||||
|
if test $gl_func_getloadavg_done = no; then
|
||||||
|
AC_CHECK_HEADER([inq_stats/cpustats.h],
|
||||||
|
[gl_func_getloadavg_done=yes
|
||||||
|
AC_DEFINE([UMAX], [1], [Define to 1 for Encore UMAX.])
|
||||||
|
AC_DEFINE([UMAX4_3], [1],
|
||||||
|
[Define to 1 for Encore UMAX 4.3 that has <inq_status/cpustats.h>
|
||||||
|
instead of <sys/cpustats.h>.])])
|
||||||
|
fi
|
||||||
|
|
||||||
|
if test $gl_func_getloadavg_done = no; then
|
||||||
|
AC_CHECK_HEADER([sys/cpustats.h],
|
||||||
|
[gl_func_getloadavg_done=yes; AC_DEFINE([UMAX])])
|
||||||
|
fi
|
||||||
|
|
||||||
|
if test $gl_func_getloadavg_done = no; then
|
||||||
|
AC_CHECK_HEADERS([mach/mach.h])
|
||||||
|
fi
|
||||||
|
|
||||||
|
AC_CHECK_HEADERS([nlist.h],
|
||||||
|
[AC_CHECK_MEMBERS([struct nlist.n_un.n_name],
|
||||||
|
[], [],
|
||||||
|
[#include <nlist.h>])
|
||||||
|
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <nlist.h>]],
|
||||||
|
[[struct nlist x;
|
||||||
|
#ifdef HAVE_STRUCT_NLIST_N_UN_N_NAME
|
||||||
|
x.n_un.n_name = "";
|
||||||
|
#else
|
||||||
|
x.n_name = "";
|
||||||
|
#endif]])],
|
||||||
|
[AC_DEFINE([N_NAME_POINTER], [1],
|
||||||
|
[Define to 1 if the nlist n_name member is a pointer])])
|
||||||
|
])dnl
|
||||||
|
])# gl_PREREQ_GETLOADAVG
|
||||||
|
|
||||||
|
# ---- GNU make
|
||||||
|
# These macros are imported from stdlib which we don't want to include
|
||||||
|
# Only the getloadavg content is imported.
|
||||||
|
|
||||||
|
AC_DEFUN_ONCE([gl_STDLIB_H],
|
||||||
|
[
|
||||||
|
AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
|
||||||
|
|
||||||
|
dnl Check for declarations of anything we want to poison if the
|
||||||
|
dnl corresponding gnulib module is not in use, and which is not
|
||||||
|
dnl guaranteed by C89.
|
||||||
|
gl_WARN_ON_USE_PREPARE([[#include <stdlib.h>
|
||||||
|
#if HAVE_SYS_LOADAVG_H
|
||||||
|
/* OpenIndiana has a bug: <sys/time.h> must be included before
|
||||||
|
<sys/loadavg.h>. */
|
||||||
|
# include <sys/time.h>
|
||||||
|
# include <sys/loadavg.h>
|
||||||
|
#endif
|
||||||
|
#if HAVE_RANDOM_H
|
||||||
|
# include <random.h>
|
||||||
|
#endif
|
||||||
|
]], [getloadavg])
|
||||||
|
])
|
||||||
|
|
||||||
|
# gl_STDLIB_MODULE_INDICATOR([modulename])
|
||||||
|
# sets the shell variable that indicates the presence of the given module
|
||||||
|
# to a C preprocessor expression that will evaluate to 1.
|
||||||
|
# This macro invocation must not occur in macros that are AC_REQUIREd.
|
||||||
|
AC_DEFUN([gl_STDLIB_MODULE_INDICATOR],
|
||||||
|
[
|
||||||
|
dnl Ensure to expand the default settings once only.
|
||||||
|
gl_STDLIB_H_REQUIRE_DEFAULTS
|
||||||
|
gl_MODULE_INDICATOR_SET_VARIABLE([$1])
|
||||||
|
dnl Define it also as a C macro, for the benefit of the unit tests.
|
||||||
|
gl_MODULE_INDICATOR_FOR_TESTS([$1])
|
||||||
|
])
|
||||||
|
|
||||||
|
# Initializes the default values for AC_SUBSTed shell variables.
|
||||||
|
# This macro must not be AC_REQUIREd. It must only be invoked, and only
|
||||||
|
# outside of macros or in macros that are not AC_REQUIREd.
|
||||||
|
AC_DEFUN([gl_STDLIB_H_REQUIRE_DEFAULTS],
|
||||||
|
[
|
||||||
|
m4_defun(GL_MODULE_INDICATOR_PREFIX[_STDLIB_H_MODULE_INDICATOR_DEFAULTS], [
|
||||||
|
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETLOADAVG])
|
||||||
|
])
|
||||||
|
m4_require(GL_MODULE_INDICATOR_PREFIX[_STDLIB_H_MODULE_INDICATOR_DEFAULTS])
|
||||||
|
AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_DEFUN([gl_STDLIB_H_DEFAULTS],
|
||||||
|
[
|
||||||
|
dnl Assume proper GNU behavior unless another module says otherwise.
|
||||||
|
HAVE_DECL_GETLOADAVG=1; AC_SUBST([HAVE_DECL_GETLOADAVG])
|
||||||
|
])
|
||||||
24
gl/modules/concat-filename
Normal file
24
gl/modules/concat-filename
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
Description:
|
||||||
|
Construct a full filename by concatenating a directory name, a relative
|
||||||
|
filename, and a suffix.
|
||||||
|
|
||||||
|
Files:
|
||||||
|
lib/concat-filename.h
|
||||||
|
lib/concat-filename.c
|
||||||
|
|
||||||
|
Depends-on:
|
||||||
|
filename
|
||||||
|
|
||||||
|
configure.ac:
|
||||||
|
|
||||||
|
Makefile.am:
|
||||||
|
lib_SOURCES += concat-filename.c
|
||||||
|
|
||||||
|
Include:
|
||||||
|
"concat-filename.h"
|
||||||
|
|
||||||
|
License:
|
||||||
|
LGPLv2+
|
||||||
|
|
||||||
|
Maintainer:
|
||||||
|
all
|
||||||
28
gl/modules/findprog-in
Normal file
28
gl/modules/findprog-in
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
Description:
|
||||||
|
Locating a program in a given path.
|
||||||
|
|
||||||
|
Files:
|
||||||
|
lib/findprog.h
|
||||||
|
lib/findprog-in.c
|
||||||
|
m4/findprog-in.m4
|
||||||
|
m4/eaccess.m4
|
||||||
|
|
||||||
|
Depends-on:
|
||||||
|
stdbool
|
||||||
|
filename
|
||||||
|
concat-filename
|
||||||
|
|
||||||
|
configure.ac:
|
||||||
|
gl_FINDPROG_IN
|
||||||
|
|
||||||
|
Makefile.am:
|
||||||
|
lib_SOURCES += findprog.h findprog-in.c
|
||||||
|
|
||||||
|
Include:
|
||||||
|
"findprog.h"
|
||||||
|
|
||||||
|
License:
|
||||||
|
LGPLv2+
|
||||||
|
|
||||||
|
Maintainer:
|
||||||
|
all
|
||||||
40
gl/modules/getloadavg
Normal file
40
gl/modules/getloadavg
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
Description:
|
||||||
|
Return the current system load averages.
|
||||||
|
|
||||||
|
Files:
|
||||||
|
lib/getloadavg.c
|
||||||
|
m4/getloadavg.m4
|
||||||
|
|
||||||
|
Depends-on:
|
||||||
|
snippet/warn-on-use
|
||||||
|
extensions
|
||||||
|
intprops [test $HAVE_GETLOADAVG = 0]
|
||||||
|
stdbool [test $HAVE_GETLOADAVG = 0]
|
||||||
|
|
||||||
|
configure.ac:
|
||||||
|
gl_STDLIB_H
|
||||||
|
gl_STDLIB_H_REQUIRE_DEFAULTS
|
||||||
|
AC_REQUIRE([AC_CANONICAL_HOST])
|
||||||
|
gl_GETLOADAVG
|
||||||
|
gl_CONDITIONAL([GL_COND_OBJ_GETLOADAVG], [test $HAVE_GETLOADAVG = 0])
|
||||||
|
AM_COND_IF([GL_COND_OBJ_GETLOADAVG], [
|
||||||
|
gl_PREREQ_GETLOADAVG
|
||||||
|
])
|
||||||
|
gl_STDLIB_MODULE_INDICATOR([getloadavg])
|
||||||
|
|
||||||
|
Makefile.am:
|
||||||
|
if GL_COND_OBJ_GETLOADAVG
|
||||||
|
lib_SOURCES += getloadavg.c
|
||||||
|
endif
|
||||||
|
|
||||||
|
Include:
|
||||||
|
<stdlib.h>
|
||||||
|
|
||||||
|
Link:
|
||||||
|
$(GETLOADAVG_LIBS)
|
||||||
|
|
||||||
|
License:
|
||||||
|
GPL
|
||||||
|
|
||||||
|
Maintainer:
|
||||||
|
Jim Meyering
|
||||||
74
gl/modules/make-glob
Normal file
74
gl/modules/make-glob
Normal file
@@ -0,0 +1,74 @@
|
|||||||
|
Description:
|
||||||
|
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
|
||||||
|
# local version.
|
||||||
|
AC_CACHE_CHECK([if system libc has GNU glob], [make_cv_sys_gnu_glob],
|
||||||
|
[ AC_EGREP_CPP([gnu glob],[
|
||||||
|
#include <features.h>
|
||||||
|
#include <glob.h>
|
||||||
|
#include <fnmatch.h>
|
||||||
|
|
||||||
|
#if !defined _LIBC && defined __GNU_LIBRARY__ && __GNU_LIBRARY__ > 1
|
||||||
|
# include <gnu-versions.h>
|
||||||
|
# if _GNU_GLOB_INTERFACE_VERSION == 1 || _GNU_GLOB_INTERFACE_VERSION == 2
|
||||||
|
gnu glob
|
||||||
|
# endif
|
||||||
|
#endif],
|
||||||
|
[make_cv_sys_gnu_glob=yes],
|
||||||
|
[make_cv_sys_gnu_glob=no])])
|
||||||
|
|
||||||
|
# Tell automake about this, so it can build the right .c files.
|
||||||
|
AM_CONDITIONAL([USE_SYSTEM_GLOB], [test "$make_cv_sys_gnu_glob" = yes])
|
||||||
|
|
||||||
|
# Tell build.sh which to use
|
||||||
|
USE_SYSTEM_GLOB="$make_cv_sys_gnu_glob"
|
||||||
|
AC_SUBST([USE_SYSTEM_GLOB])
|
||||||
|
|
||||||
|
Makefile.am:
|
||||||
|
if !USE_SYSTEM_GLOB
|
||||||
|
libgnu_a_SOURCES += fnmatch.c
|
||||||
|
|
||||||
|
BUILT_SOURCES += fnmatch.h
|
||||||
|
|
||||||
|
fnmatch.h: fnmatch.in.h $(top_builddir)/config.status
|
||||||
|
$(AM_V_GEN)rm -f $@-t $@ && \
|
||||||
|
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
|
||||||
|
cat $(srcdir)/fnmatch.in.h; \
|
||||||
|
} > $@-t && \
|
||||||
|
mv -f $@-t $@
|
||||||
|
|
||||||
|
MOSTLYCLEANFILES += fnmatch.h fnmatch.h-t
|
||||||
|
|
||||||
|
libgnu_a_SOURCES += glob.c
|
||||||
|
|
||||||
|
BUILT_SOURCES += glob.h
|
||||||
|
|
||||||
|
glob.h: glob.in.h $(top_builddir)/config.status
|
||||||
|
$(AM_V_GEN)rm -f $@-t $@ && \
|
||||||
|
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
|
||||||
|
cat $(srcdir)/glob.in.h; \
|
||||||
|
} > $@-t && \
|
||||||
|
mv -f $@-t $@
|
||||||
|
|
||||||
|
MOSTLYCLEANFILES += glob.h glob.h-t
|
||||||
|
endif
|
||||||
|
|
||||||
|
EXTRA_DIST += fnmatch.in.h glob.in.h
|
||||||
|
|
||||||
|
Include:
|
||||||
|
<glob.h>
|
||||||
|
|
||||||
|
License:
|
||||||
|
LGPLv2+
|
||||||
|
|
||||||
|
Maintainer:
|
||||||
|
all, glibc
|
||||||
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
|
||||||
481
glob/COPYING.LIB
481
glob/COPYING.LIB
@@ -1,481 +0,0 @@
|
|||||||
GNU LIBRARY GENERAL PUBLIC LICENSE
|
|
||||||
Version 2, June 1991
|
|
||||||
|
|
||||||
Copyright (C) 1991 Free Software Foundation, Inc.
|
|
||||||
675 Mass Ave, Cambridge, MA 02139, USA
|
|
||||||
Everyone is permitted to copy and distribute verbatim copies
|
|
||||||
of this license document, but changing it is not allowed.
|
|
||||||
|
|
||||||
[This is the first released version of the library GPL. It is
|
|
||||||
numbered 2 because it goes with version 2 of the ordinary GPL.]
|
|
||||||
|
|
||||||
Preamble
|
|
||||||
|
|
||||||
The licenses for most software are designed to take away your
|
|
||||||
freedom to share and change it. By contrast, the GNU General Public
|
|
||||||
Licenses are intended to guarantee your freedom to share and change
|
|
||||||
free software--to make sure the software is free for all its users.
|
|
||||||
|
|
||||||
This license, the Library General Public License, applies to some
|
|
||||||
specially designated Free Software Foundation software, and to any
|
|
||||||
other libraries whose authors decide to use it. You can use it for
|
|
||||||
your libraries, too.
|
|
||||||
|
|
||||||
When we speak of free software, we are referring to freedom, not
|
|
||||||
price. Our General Public Licenses are designed to make sure that you
|
|
||||||
have the freedom to distribute copies of free software (and charge for
|
|
||||||
this service if you wish), that you receive source code or can get it
|
|
||||||
if you want it, that you can change the software or use pieces of it
|
|
||||||
in new free programs; and that you know you can do these things.
|
|
||||||
|
|
||||||
To protect your rights, we need to make restrictions that forbid
|
|
||||||
anyone to deny you these rights or to ask you to surrender the rights.
|
|
||||||
These restrictions translate to certain responsibilities for you if
|
|
||||||
you distribute copies of the library, or if you modify it.
|
|
||||||
|
|
||||||
For example, if you distribute copies of the library, whether gratis
|
|
||||||
or for a fee, you must give the recipients all the rights that we gave
|
|
||||||
you. You must make sure that they, too, receive or can get the source
|
|
||||||
code. If you link a program with the library, you must provide
|
|
||||||
complete object files to the recipients so that they can relink them
|
|
||||||
with the library, after making changes to the library and recompiling
|
|
||||||
it. And you must show them these terms so they know their rights.
|
|
||||||
|
|
||||||
Our method of protecting your rights has two steps: (1) copyright
|
|
||||||
the library, and (2) offer you this license which gives you legal
|
|
||||||
permission to copy, distribute and/or modify the library.
|
|
||||||
|
|
||||||
Also, for each distributor's protection, we want to make certain
|
|
||||||
that everyone understands that there is no warranty for this free
|
|
||||||
library. If the library is modified by someone else and passed on, we
|
|
||||||
want its recipients to know that what they have is not the original
|
|
||||||
version, so that any problems introduced by others will not reflect on
|
|
||||||
the original authors' reputations.
|
|
||||||
|
|
||||||
Finally, any free program is threatened constantly by software
|
|
||||||
patents. We wish to avoid the danger that companies distributing free
|
|
||||||
software will individually obtain patent licenses, thus in effect
|
|
||||||
transforming the program into proprietary software. To prevent this,
|
|
||||||
we have made it clear that any patent must be licensed for everyone's
|
|
||||||
free use or not licensed at all.
|
|
||||||
|
|
||||||
Most GNU software, including some libraries, is covered by the ordinary
|
|
||||||
GNU General Public License, which was designed for utility programs. This
|
|
||||||
license, the GNU Library General Public License, applies to certain
|
|
||||||
designated libraries. This license is quite different from the ordinary
|
|
||||||
one; be sure to read it in full, and don't assume that anything in it is
|
|
||||||
the same as in the ordinary license.
|
|
||||||
|
|
||||||
The reason we have a separate public license for some libraries is that
|
|
||||||
they blur the distinction we usually make between modifying or adding to a
|
|
||||||
program and simply using it. Linking a program with a library, without
|
|
||||||
changing the library, is in some sense simply using the library, and is
|
|
||||||
analogous to running a utility program or application program. However, in
|
|
||||||
a textual and legal sense, the linked executable is a combined work, a
|
|
||||||
derivative of the original library, and the ordinary General Public License
|
|
||||||
treats it as such.
|
|
||||||
|
|
||||||
Because of this blurred distinction, using the ordinary General
|
|
||||||
Public License for libraries did not effectively promote software
|
|
||||||
sharing, because most developers did not use the libraries. We
|
|
||||||
concluded that weaker conditions might promote sharing better.
|
|
||||||
|
|
||||||
However, unrestricted linking of non-free programs would deprive the
|
|
||||||
users of those programs of all benefit from the free status of the
|
|
||||||
libraries themselves. This Library General Public License is intended to
|
|
||||||
permit developers of non-free programs to use free libraries, while
|
|
||||||
preserving your freedom as a user of such programs to change the free
|
|
||||||
libraries that are incorporated in them. (We have not seen how to achieve
|
|
||||||
this as regards changes in header files, but we have achieved it as regards
|
|
||||||
changes in the actual functions of the Library.) The hope is that this
|
|
||||||
will lead to faster development of free libraries.
|
|
||||||
|
|
||||||
The precise terms and conditions for copying, distribution and
|
|
||||||
modification follow. Pay close attention to the difference between a
|
|
||||||
"work based on the library" and a "work that uses the library". The
|
|
||||||
former contains code derived from the library, while the latter only
|
|
||||||
works together with the library.
|
|
||||||
|
|
||||||
Note that it is possible for a library to be covered by the ordinary
|
|
||||||
General Public License rather than by this special one.
|
|
||||||
|
|
||||||
GNU LIBRARY GENERAL PUBLIC LICENSE
|
|
||||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
|
||||||
|
|
||||||
0. This License Agreement applies to any software library which
|
|
||||||
contains a notice placed by the copyright holder or other authorized
|
|
||||||
party saying it may be distributed under the terms of this Library
|
|
||||||
General Public License (also called "this License"). Each licensee is
|
|
||||||
addressed as "you".
|
|
||||||
|
|
||||||
A "library" means a collection of software functions and/or data
|
|
||||||
prepared so as to be conveniently linked with application programs
|
|
||||||
(which use some of those functions and data) to form executables.
|
|
||||||
|
|
||||||
The "Library", below, refers to any such software library or work
|
|
||||||
which has been distributed under these terms. A "work based on the
|
|
||||||
Library" means either the Library or any derivative work under
|
|
||||||
copyright law: that is to say, a work containing the Library or a
|
|
||||||
portion of it, either verbatim or with modifications and/or translated
|
|
||||||
straightforwardly into another language. (Hereinafter, translation is
|
|
||||||
included without limitation in the term "modification".)
|
|
||||||
|
|
||||||
"Source code" for a work means the preferred form of the work for
|
|
||||||
making modifications to it. For a library, complete source code means
|
|
||||||
all the source code for all modules it contains, plus any associated
|
|
||||||
interface definition files, plus the scripts used to control compilation
|
|
||||||
and installation of the library.
|
|
||||||
|
|
||||||
Activities other than copying, distribution and modification are not
|
|
||||||
covered by this License; they are outside its scope. The act of
|
|
||||||
running a program using the Library is not restricted, and output from
|
|
||||||
such a program is covered only if its contents constitute a work based
|
|
||||||
on the Library (independent of the use of the Library in a tool for
|
|
||||||
writing it). Whether that is true depends on what the Library does
|
|
||||||
and what the program that uses the Library does.
|
|
||||||
|
|
||||||
1. You may copy and distribute verbatim copies of the Library's
|
|
||||||
complete source code as you receive it, in any medium, provided that
|
|
||||||
you conspicuously and appropriately publish on each copy an
|
|
||||||
appropriate copyright notice and disclaimer of warranty; keep intact
|
|
||||||
all the notices that refer to this License and to the absence of any
|
|
||||||
warranty; and distribute a copy of this License along with the
|
|
||||||
Library.
|
|
||||||
|
|
||||||
You may charge a fee for the physical act of transferring a copy,
|
|
||||||
and you may at your option offer warranty protection in exchange for a
|
|
||||||
fee.
|
|
||||||
|
|
||||||
2. You may modify your copy or copies of the Library or any portion
|
|
||||||
of it, thus forming a work based on the Library, and copy and
|
|
||||||
distribute such modifications or work under the terms of Section 1
|
|
||||||
above, provided that you also meet all of these conditions:
|
|
||||||
|
|
||||||
a) The modified work must itself be a software library.
|
|
||||||
|
|
||||||
b) You must cause the files modified to carry prominent notices
|
|
||||||
stating that you changed the files and the date of any change.
|
|
||||||
|
|
||||||
c) You must cause the whole of the work to be licensed at no
|
|
||||||
charge to all third parties under the terms of this License.
|
|
||||||
|
|
||||||
d) If a facility in the modified Library refers to a function or a
|
|
||||||
table of data to be supplied by an application program that uses
|
|
||||||
the facility, other than as an argument passed when the facility
|
|
||||||
is invoked, then you must make a good faith effort to ensure that,
|
|
||||||
in the event an application does not supply such function or
|
|
||||||
table, the facility still operates, and performs whatever part of
|
|
||||||
its purpose remains meaningful.
|
|
||||||
|
|
||||||
(For example, a function in a library to compute square roots has
|
|
||||||
a purpose that is entirely well-defined independent of the
|
|
||||||
application. Therefore, Subsection 2d requires that any
|
|
||||||
application-supplied function or table used by this function must
|
|
||||||
be optional: if the application does not supply it, the square
|
|
||||||
root function must still compute square roots.)
|
|
||||||
|
|
||||||
These requirements apply to the modified work as a whole. If
|
|
||||||
identifiable sections of that work are not derived from the Library,
|
|
||||||
and can be reasonably considered independent and separate works in
|
|
||||||
themselves, then this License, and its terms, do not apply to those
|
|
||||||
sections when you distribute them as separate works. But when you
|
|
||||||
distribute the same sections as part of a whole which is a work based
|
|
||||||
on the Library, the distribution of the whole must be on the terms of
|
|
||||||
this License, whose permissions for other licensees extend to the
|
|
||||||
entire whole, and thus to each and every part regardless of who wrote
|
|
||||||
it.
|
|
||||||
|
|
||||||
Thus, it is not the intent of this section to claim rights or contest
|
|
||||||
your rights to work written entirely by you; rather, the intent is to
|
|
||||||
exercise the right to control the distribution of derivative or
|
|
||||||
collective works based on the Library.
|
|
||||||
|
|
||||||
In addition, mere aggregation of another work not based on the Library
|
|
||||||
with the Library (or with a work based on the Library) on a volume of
|
|
||||||
a storage or distribution medium does not bring the other work under
|
|
||||||
the scope of this License.
|
|
||||||
|
|
||||||
3. You may opt to apply the terms of the ordinary GNU General Public
|
|
||||||
License instead of this License to a given copy of the Library. To do
|
|
||||||
this, you must alter all the notices that refer to this License, so
|
|
||||||
that they refer to the ordinary GNU General Public License, version 2,
|
|
||||||
instead of to this License. (If a newer version than version 2 of the
|
|
||||||
ordinary GNU General Public License has appeared, then you can specify
|
|
||||||
that version instead if you wish.) Do not make any other change in
|
|
||||||
these notices.
|
|
||||||
|
|
||||||
Once this change is made in a given copy, it is irreversible for
|
|
||||||
that copy, so the ordinary GNU General Public License applies to all
|
|
||||||
subsequent copies and derivative works made from that copy.
|
|
||||||
|
|
||||||
This option is useful when you wish to copy part of the code of
|
|
||||||
the Library into a program that is not a library.
|
|
||||||
|
|
||||||
4. You may copy and distribute the Library (or a portion or
|
|
||||||
derivative of it, under Section 2) in object code or executable form
|
|
||||||
under the terms of Sections 1 and 2 above provided that you accompany
|
|
||||||
it with the complete corresponding machine-readable source code, which
|
|
||||||
must be distributed under the terms of Sections 1 and 2 above on a
|
|
||||||
medium customarily used for software interchange.
|
|
||||||
|
|
||||||
If distribution of object code is made by offering access to copy
|
|
||||||
from a designated place, then offering equivalent access to copy the
|
|
||||||
source code from the same place satisfies the requirement to
|
|
||||||
distribute the source code, even though third parties are not
|
|
||||||
compelled to copy the source along with the object code.
|
|
||||||
|
|
||||||
5. A program that contains no derivative of any portion of the
|
|
||||||
Library, but is designed to work with the Library by being compiled or
|
|
||||||
linked with it, is called a "work that uses the Library". Such a
|
|
||||||
work, in isolation, is not a derivative work of the Library, and
|
|
||||||
therefore falls outside the scope of this License.
|
|
||||||
|
|
||||||
However, linking a "work that uses the Library" with the Library
|
|
||||||
creates an executable that is a derivative of the Library (because it
|
|
||||||
contains portions of the Library), rather than a "work that uses the
|
|
||||||
library". The executable is therefore covered by this License.
|
|
||||||
Section 6 states terms for distribution of such executables.
|
|
||||||
|
|
||||||
When a "work that uses the Library" uses material from a header file
|
|
||||||
that is part of the Library, the object code for the work may be a
|
|
||||||
derivative work of the Library even though the source code is not.
|
|
||||||
Whether this is true is especially significant if the work can be
|
|
||||||
linked without the Library, or if the work is itself a library. The
|
|
||||||
threshold for this to be true is not precisely defined by law.
|
|
||||||
|
|
||||||
If such an object file uses only numerical parameters, data
|
|
||||||
structure layouts and accessors, and small macros and small inline
|
|
||||||
functions (ten lines or less in length), then the use of the object
|
|
||||||
file is unrestricted, regardless of whether it is legally a derivative
|
|
||||||
work. (Executables containing this object code plus portions of the
|
|
||||||
Library will still fall under Section 6.)
|
|
||||||
|
|
||||||
Otherwise, if the work is a derivative of the Library, you may
|
|
||||||
distribute the object code for the work under the terms of Section 6.
|
|
||||||
Any executables containing that work also fall under Section 6,
|
|
||||||
whether or not they are linked directly with the Library itself.
|
|
||||||
|
|
||||||
6. As an exception to the Sections above, you may also compile or
|
|
||||||
link a "work that uses the Library" with the Library to produce a
|
|
||||||
work containing portions of the Library, and distribute that work
|
|
||||||
under terms of your choice, provided that the terms permit
|
|
||||||
modification of the work for the customer's own use and reverse
|
|
||||||
engineering for debugging such modifications.
|
|
||||||
|
|
||||||
You must give prominent notice with each copy of the work that the
|
|
||||||
Library is used in it and that the Library and its use are covered by
|
|
||||||
this License. You must supply a copy of this License. If the work
|
|
||||||
during execution displays copyright notices, you must include the
|
|
||||||
copyright notice for the Library among them, as well as a reference
|
|
||||||
directing the user to the copy of this License. Also, you must do one
|
|
||||||
of these things:
|
|
||||||
|
|
||||||
a) Accompany the work with the complete corresponding
|
|
||||||
machine-readable source code for the Library including whatever
|
|
||||||
changes were used in the work (which must be distributed under
|
|
||||||
Sections 1 and 2 above); and, if the work is an executable linked
|
|
||||||
with the Library, with the complete machine-readable "work that
|
|
||||||
uses the Library", as object code and/or source code, so that the
|
|
||||||
user can modify the Library and then relink to produce a modified
|
|
||||||
executable containing the modified Library. (It is understood
|
|
||||||
that the user who changes the contents of definitions files in the
|
|
||||||
Library will not necessarily be able to recompile the application
|
|
||||||
to use the modified definitions.)
|
|
||||||
|
|
||||||
b) Accompany the work with a written offer, valid for at
|
|
||||||
least three years, to give the same user the materials
|
|
||||||
specified in Subsection 6a, above, for a charge no more
|
|
||||||
than the cost of performing this distribution.
|
|
||||||
|
|
||||||
c) If distribution of the work is made by offering access to copy
|
|
||||||
from a designated place, offer equivalent access to copy the above
|
|
||||||
specified materials from the same place.
|
|
||||||
|
|
||||||
d) Verify that the user has already received a copy of these
|
|
||||||
materials or that you have already sent this user a copy.
|
|
||||||
|
|
||||||
For an executable, the required form of the "work that uses the
|
|
||||||
Library" must include any data and utility programs needed for
|
|
||||||
reproducing the executable from it. However, as a special exception,
|
|
||||||
the source code distributed need not include anything that is normally
|
|
||||||
distributed (in either source or binary form) with the major
|
|
||||||
components (compiler, kernel, and so on) of the operating system on
|
|
||||||
which the executable runs, unless that component itself accompanies
|
|
||||||
the executable.
|
|
||||||
|
|
||||||
It may happen that this requirement contradicts the license
|
|
||||||
restrictions of other proprietary libraries that do not normally
|
|
||||||
accompany the operating system. Such a contradiction means you cannot
|
|
||||||
use both them and the Library together in an executable that you
|
|
||||||
distribute.
|
|
||||||
|
|
||||||
7. You may place library facilities that are a work based on the
|
|
||||||
Library side-by-side in a single library together with other library
|
|
||||||
facilities not covered by this License, and distribute such a combined
|
|
||||||
library, provided that the separate distribution of the work based on
|
|
||||||
the Library and of the other library facilities is otherwise
|
|
||||||
permitted, and provided that you do these two things:
|
|
||||||
|
|
||||||
a) Accompany the combined library with a copy of the same work
|
|
||||||
based on the Library, uncombined with any other library
|
|
||||||
facilities. This must be distributed under the terms of the
|
|
||||||
Sections above.
|
|
||||||
|
|
||||||
b) Give prominent notice with the combined library of the fact
|
|
||||||
that part of it is a work based on the Library, and explaining
|
|
||||||
where to find the accompanying uncombined form of the same work.
|
|
||||||
|
|
||||||
8. You may not copy, modify, sublicense, link with, or distribute
|
|
||||||
the Library except as expressly provided under this License. Any
|
|
||||||
attempt otherwise to copy, modify, sublicense, link with, or
|
|
||||||
distribute the Library is void, and will automatically terminate your
|
|
||||||
rights under this License. However, parties who have received copies,
|
|
||||||
or rights, from you under this License will not have their licenses
|
|
||||||
terminated so long as such parties remain in full compliance.
|
|
||||||
|
|
||||||
9. You are not required to accept this License, since you have not
|
|
||||||
signed it. However, nothing else grants you permission to modify or
|
|
||||||
distribute the Library or its derivative works. These actions are
|
|
||||||
prohibited by law if you do not accept this License. Therefore, by
|
|
||||||
modifying or distributing the Library (or any work based on the
|
|
||||||
Library), you indicate your acceptance of this License to do so, and
|
|
||||||
all its terms and conditions for copying, distributing or modifying
|
|
||||||
the Library or works based on it.
|
|
||||||
|
|
||||||
10. Each time you redistribute the Library (or any work based on the
|
|
||||||
Library), the recipient automatically receives a license from the
|
|
||||||
original licensor to copy, distribute, link with or modify the Library
|
|
||||||
subject to these terms and conditions. You may not impose any further
|
|
||||||
restrictions on the recipients' exercise of the rights granted herein.
|
|
||||||
You are not responsible for enforcing compliance by third parties to
|
|
||||||
this License.
|
|
||||||
|
|
||||||
11. If, as a consequence of a court judgment or allegation of patent
|
|
||||||
infringement or for any other reason (not limited to patent issues),
|
|
||||||
conditions are imposed on you (whether by court order, agreement or
|
|
||||||
otherwise) that contradict the conditions of this License, they do not
|
|
||||||
excuse you from the conditions of this License. If you cannot
|
|
||||||
distribute so as to satisfy simultaneously your obligations under this
|
|
||||||
License and any other pertinent obligations, then as a consequence you
|
|
||||||
may not distribute the Library at all. For example, if a patent
|
|
||||||
license would not permit royalty-free redistribution of the Library by
|
|
||||||
all those who receive copies directly or indirectly through you, then
|
|
||||||
the only way you could satisfy both it and this License would be to
|
|
||||||
refrain entirely from distribution of the Library.
|
|
||||||
|
|
||||||
If any portion of this section is held invalid or unenforceable under any
|
|
||||||
particular circumstance, the balance of the section is intended to apply,
|
|
||||||
and the section as a whole is intended to apply in other circumstances.
|
|
||||||
|
|
||||||
It is not the purpose of this section to induce you to infringe any
|
|
||||||
patents or other property right claims or to contest validity of any
|
|
||||||
such claims; this section has the sole purpose of protecting the
|
|
||||||
integrity of the free software distribution system which is
|
|
||||||
implemented by public license practices. Many people have made
|
|
||||||
generous contributions to the wide range of software distributed
|
|
||||||
through that system in reliance on consistent application of that
|
|
||||||
system; it is up to the author/donor to decide if he or she is willing
|
|
||||||
to distribute software through any other system and a licensee cannot
|
|
||||||
impose that choice.
|
|
||||||
|
|
||||||
This section is intended to make thoroughly clear what is believed to
|
|
||||||
be a consequence of the rest of this License.
|
|
||||||
|
|
||||||
12. If the distribution and/or use of the Library is restricted in
|
|
||||||
certain countries either by patents or by copyrighted interfaces, the
|
|
||||||
original copyright holder who places the Library under this License may add
|
|
||||||
an explicit geographical distribution limitation excluding those countries,
|
|
||||||
so that distribution is permitted only in or among countries not thus
|
|
||||||
excluded. In such case, this License incorporates the limitation as if
|
|
||||||
written in the body of this License.
|
|
||||||
|
|
||||||
13. The Free Software Foundation may publish revised and/or new
|
|
||||||
versions of the Library General Public License from time to time.
|
|
||||||
Such new versions will be similar in spirit to the present version,
|
|
||||||
but may differ in detail to address new problems or concerns.
|
|
||||||
|
|
||||||
Each version is given a distinguishing version number. If the Library
|
|
||||||
specifies a version number of this License which applies to it and
|
|
||||||
"any later version", you have the option of following the terms and
|
|
||||||
conditions either of that version or of any later version published by
|
|
||||||
the Free Software Foundation. If the Library does not specify a
|
|
||||||
license version number, you may choose any version ever published by
|
|
||||||
the Free Software Foundation.
|
|
||||||
|
|
||||||
14. If you wish to incorporate parts of the Library into other free
|
|
||||||
programs whose distribution conditions are incompatible with these,
|
|
||||||
write to the author to ask for permission. For software which is
|
|
||||||
copyrighted by the Free Software Foundation, write to the Free
|
|
||||||
Software Foundation; we sometimes make exceptions for this. Our
|
|
||||||
decision will be guided by the two goals of preserving the free status
|
|
||||||
of all derivatives of our free software and of promoting the sharing
|
|
||||||
and reuse of software generally.
|
|
||||||
|
|
||||||
NO WARRANTY
|
|
||||||
|
|
||||||
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
|
|
||||||
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
|
|
||||||
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
|
|
||||||
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
|
|
||||||
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
|
|
||||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
||||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
|
|
||||||
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
|
|
||||||
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
|
||||||
|
|
||||||
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
|
|
||||||
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
|
|
||||||
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
|
|
||||||
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
|
|
||||||
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
|
|
||||||
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
|
|
||||||
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
|
|
||||||
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
|
|
||||||
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
|
|
||||||
DAMAGES.
|
|
||||||
|
|
||||||
END OF TERMS AND CONDITIONS
|
|
||||||
|
|
||||||
Appendix: How to Apply These Terms to Your New Libraries
|
|
||||||
|
|
||||||
If you develop a new library, and you want it to be of the greatest
|
|
||||||
possible use to the public, we recommend making it free software that
|
|
||||||
everyone can redistribute and change. You can do so by permitting
|
|
||||||
redistribution under these terms (or, alternatively, under the terms of the
|
|
||||||
ordinary General Public License).
|
|
||||||
|
|
||||||
To apply these terms, attach the following notices to the library. It is
|
|
||||||
safest to attach them to the start of each source file to most effectively
|
|
||||||
convey the exclusion of warranty; and each file should have at least the
|
|
||||||
"copyright" line and a pointer to where the full notice is found.
|
|
||||||
|
|
||||||
<one line to give the library's name and a brief idea of what it does.>
|
|
||||||
Copyright (C) <year> <name of author>
|
|
||||||
|
|
||||||
This library is free software; you can redistribute it and/or
|
|
||||||
modify it under the terms of the GNU Library General Public
|
|
||||||
License as published by the Free Software Foundation; either
|
|
||||||
version 2 of the License, or (at your option) any later version.
|
|
||||||
|
|
||||||
This library is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
Library General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU Library General Public
|
|
||||||
License along with this library; if not, write to the Free
|
|
||||||
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
||||||
|
|
||||||
Also add information on how to contact you by electronic and paper mail.
|
|
||||||
|
|
||||||
You should also get your employer (if you work as a programmer) or your
|
|
||||||
school, if any, to sign a "copyright disclaimer" for the library, if
|
|
||||||
necessary. Here is a sample; alter the names:
|
|
||||||
|
|
||||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the
|
|
||||||
library `Frob' (a library for tweaking knobs) written by James Random Hacker.
|
|
||||||
|
|
||||||
<signature of Ty Coon>, 1 April 1990
|
|
||||||
Ty Coon, President of Vice
|
|
||||||
|
|
||||||
That's all there is to it!
|
|
||||||
191
glob/ChangeLog
191
glob/ChangeLog
@@ -1,191 +0,0 @@
|
|||||||
2013-10-20 Paul Smith <psmith@gnu.org>
|
|
||||||
|
|
||||||
* glob.c (glob): Cherry-pick a471e96a5352a5f0bde6d32dd36d33524811a2b1
|
|
||||||
from git://sourceware.org/git/glibc.git to fix SV 18123,
|
|
||||||
https://sourceware.org/bugzilla/show_bug.cgi?id=10278
|
|
||||||
|
|
||||||
2008-09-28 Juan Manuel Guerrero <juan.guerrero@gmx.de>
|
|
||||||
|
|
||||||
* glob.c (my_realloc) [__DJGPP__]: Don't define, and don't
|
|
||||||
redefine realloc to call it, since the DJGPP's realloc handles
|
|
||||||
NULL pointers correctly.
|
|
||||||
|
|
||||||
2007-12-22 Juan Manuel Guerrero <juan.guerrero@gmx.de> (tiny change)
|
|
||||||
|
|
||||||
* glob.c [__GNU_LIBRARY__ && __DJGPP__]: Add a realloc
|
|
||||||
declaration that matches the one in the DJGPP libc.
|
|
||||||
|
|
||||||
2006-02-24 Eli Zaretskii <eliz@gnu.org>
|
|
||||||
|
|
||||||
* glob.c (my_malloc) [WINDOWS32]: Provide a full ISO C prototype,
|
|
||||||
to avoid compiler warnings.
|
|
||||||
|
|
||||||
2005-06-25 Paul D. Smith <psmith@gnu.org>
|
|
||||||
|
|
||||||
* fnmatch.h, glob.h [WINDOWS32]: Fix ifdefs in headers.
|
|
||||||
Fixes Savannah bug #13477.
|
|
||||||
|
|
||||||
2005-03-11 Paul D. Smith <psmith@gnu.org>
|
|
||||||
|
|
||||||
* glob.c (glob_in_dir): Change FNM_CASEFOLD to be enabled if
|
|
||||||
HAVE_CASE_INSENSITIVE_FS is defined.
|
|
||||||
|
|
||||||
2003-01-30 Paul D. Smith <psmith@gnu.org>
|
|
||||||
|
|
||||||
* glob.h: Patch for FreeBSD by Mike Barcroft <mike@freebsd.org>
|
|
||||||
Reported by Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>. On
|
|
||||||
FreeBSD, declare __size_t to simply size_t.
|
|
||||||
|
|
||||||
2002-04-22 Paul D. Smith <psmith@gnu.org>
|
|
||||||
|
|
||||||
* Makefile.am: Use automake 1.6.
|
|
||||||
Use new automake condition USE_LOCAL_GLOB to decide whether or not
|
|
||||||
to build the local GNU glob library or use the system one.
|
|
||||||
|
|
||||||
1999-09-12 Paul D. Smith <psmith@gnu.org>
|
|
||||||
|
|
||||||
* fnmatch.c: Last GLIBC version wouldn't compile outside of GLIBC
|
|
||||||
(undefined reference to internal_function). Update to the latest
|
|
||||||
version
|
|
||||||
|
|
||||||
1999-09-11 Paul Eggert <eggert@twinsun.com>
|
|
||||||
|
|
||||||
* glob.h (glob): If #defining to glob64, do this before
|
|
||||||
declaring it, so that all declarations and uses match, and
|
|
||||||
do not declare glob64, to avoid a declaration clash.
|
|
||||||
(globfree): Likewise with globfree64.
|
|
||||||
|
|
||||||
1999-09-08 Eli Zaretskii <eliz@is.elta.co.il>
|
|
||||||
|
|
||||||
* glob.c (prefix_array) [__MSDOS__,WINDOWS32]: Keep the trailing
|
|
||||||
slash unless DIRNAME is just "x:/".
|
|
||||||
|
|
||||||
1999-09-06 Paul D. Smith <psmith@gnu.org>
|
|
||||||
|
|
||||||
* fnmatch.c: Update to latest version from GLIBC.
|
|
||||||
|
|
||||||
1999-07-21 Paul D. Smith <psmith@gnu.org>
|
|
||||||
|
|
||||||
* glob.c, glob.h, fnmatch.c, fnmatch.h: Update to latest version
|
|
||||||
from GLIBC.
|
|
||||||
|
|
||||||
* fnmatch.c (internal_fnmatch): Use K&R definition syntax, not ANSI.
|
|
||||||
(__strchrnul): This won't exist outside GLIBC, so create one.
|
|
||||||
|
|
||||||
* glob.c: Move getlogin{,_r} prototypes below glob.h to get __P()
|
|
||||||
macro.
|
|
||||||
|
|
||||||
1998-08-05 Paul D. Smith <psmith@gnu.org>
|
|
||||||
|
|
||||||
* configure.in: Remove; configuration for glob is handled by the
|
|
||||||
make configure.in.
|
|
||||||
|
|
||||||
1998-07-29 Paul D. Smith <psmith@gnu.org>
|
|
||||||
|
|
||||||
* glob.c, fnmatch.c: New versions from the GLIBC folks (Ulrich
|
|
||||||
Drepper). Fixes a bug reported by Eli Zaretski. Integrates
|
|
||||||
DOS/Windows32 support.
|
|
||||||
|
|
||||||
1998-07-27 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
|
|
||||||
|
|
||||||
* glob.c (glob): Cast away const on assignment of pattern to dirname.
|
|
||||||
Cast the return type of __alloca() for traditional C compilers.
|
|
||||||
|
|
||||||
1998-07-23 Paul D. Smith <psmith@gnu.org>
|
|
||||||
|
|
||||||
* glob.c, fnmatch.c: New versions of these files from the GLIBC
|
|
||||||
folks (Ulrich Drepper). Had to re-integrate some DOS/Windows
|
|
||||||
code.
|
|
||||||
|
|
||||||
1998-07-10 Paul D. Smith <psmith@gnu.org>
|
|
||||||
|
|
||||||
* glob.c (glob_in_dir): If no meta chars exist in PATTERN and
|
|
||||||
GLOB_NOCHECK is present, don't look for the file--whether it's
|
|
||||||
found or not, we'll always return it, so why bother searching?
|
|
||||||
|
|
||||||
Also, if we are searching and there are no meta chars, don't
|
|
||||||
bother trying fnmatch() if the strcmp() fails.
|
|
||||||
|
|
||||||
1998-05-30 Eli Zaretskii <eliz@is.elta.co.il>
|
|
||||||
|
|
||||||
* glob.c (glob) [__MSDOS__, WINDOWS32]: Compute the directory and
|
|
||||||
filename parts of the pattern correctly when it includes a drive
|
|
||||||
spec. Disallow wildcards in the drive spec. Prevent recursion
|
|
||||||
when dirname is of the form "d:/" or "d:".
|
|
||||||
(prefix_array) [__MSDOS__, WINDOWS32]: Don't append a slash to
|
|
||||||
"d:/" and "d:".
|
|
||||||
|
|
||||||
1998-05-13 Paul D. Smith <psmith@gnu.org>
|
|
||||||
|
|
||||||
* SMakefile, Makefile.ami, glob.c, glob.h, fnmatch.c: Updated from
|
|
||||||
the latest glibc version.
|
|
||||||
|
|
||||||
1998-04-17 Paul D. Smith <psmith@gnu.org>
|
|
||||||
|
|
||||||
* configure.in: Create a config.h file instead of setting things
|
|
||||||
on the compile line. This is because when build.sh runs it merely
|
|
||||||
passes -DHAVE_CONFIG_H to the glob files, just as it does to the
|
|
||||||
make files.
|
|
||||||
* config.h.in: Created by autoheader.
|
|
||||||
|
|
||||||
Tue Aug 12 10:52:34 1997 Paul D. Smith <psmith@baynetworks.com>
|
|
||||||
|
|
||||||
* configure.in: Require autoconf 2.12.
|
|
||||||
|
|
||||||
* glob: Updates from latest GNU libc glob code.
|
|
||||||
|
|
||||||
* glob.c,glob.h,fnmatch.h: Change all WIN32 references to WINDOWS32.
|
|
||||||
|
|
||||||
* glob.h: OSF4 defines macros in such a way that GLOB_ALTDIRFUNC
|
|
||||||
is not defined. Added a test to the #if which defines it if
|
|
||||||
_GNU_SOURCE is defined; that's set by both glob.c and GNU make.
|
|
||||||
|
|
||||||
* glob.c: SunOS4 w/ cc needs #include <stdio.h>, since assert.h
|
|
||||||
requires stderr but doesn't include stdio.h :-/.
|
|
||||||
(next_brace_sub): De-protoize function definition.
|
|
||||||
(glob): Cast __alloca(); on SunOS4 it uses the default return type
|
|
||||||
of int.
|
|
||||||
(glob): Irix defines getlogin_r() to return a char*; move the
|
|
||||||
extern for that into the _LIBC area since it isn't used except in
|
|
||||||
LIBC anyway. Likewise, move extern getlogin() into the "else".
|
|
||||||
|
|
||||||
Sat Jul 20 21:55:31 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
|
|
||||||
|
|
||||||
Win32 hacks from <Rob_Tulloh@tivoli.com>.
|
|
||||||
* posix/glob.c [WIN32]: Don't include <pwd.h>; don't use d_ino;
|
|
||||||
use void * for my_realloc; include <malloc.h> for alloca.
|
|
||||||
(glob) [WIN32]: Use "c:/users/default" for ~ if no HOME variable.
|
|
||||||
* posix/fnmatch.h [WIN32]: Use prototypes even if [!__STDC__].
|
|
||||||
* posix/glob.h: Likewise.
|
|
||||||
|
|
||||||
Fri Jul 19 16:56:41 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
|
|
||||||
|
|
||||||
* posix/glob.h [!_AMIGA && !VMS]: Check this instead of just [!_AMIGA]
|
|
||||||
for `struct stat;' forward decl.
|
|
||||||
|
|
||||||
Sat Jun 22 10:44:09 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
|
|
||||||
|
|
||||||
* posix/glob.c: Include <alloca.h> only [HAVE_ALLOCA_H], not [sparc].
|
|
||||||
|
|
||||||
Fri Jun 21 00:27:51 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
|
|
||||||
|
|
||||||
* posix/fnmatch.c (fnmatch): Fix \*[*?]+ case to increment name ptr
|
|
||||||
only for ?s, not for *s. Fix from Chet Ramey.
|
|
||||||
|
|
||||||
|
|
||||||
Copyright (C) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
|
|
||||||
1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 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 <http://www.gnu.org/licenses/>.
|
|
||||||
@@ -1,30 +0,0 @@
|
|||||||
# -*-Makefile-*-, or close enough
|
|
||||||
# Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
|
||||||
# 2003, 2004, 2005, 2006, 2007 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 <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
AUTOMAKE_OPTIONS = foreign
|
|
||||||
|
|
||||||
# Only build the library when the system doesn't already have GNU glob.
|
|
||||||
if USE_LOCAL_GLOB
|
|
||||||
noinst_LIBRARIES = libglob.a
|
|
||||||
endif
|
|
||||||
|
|
||||||
libglob_a_SOURCES = glob.c glob.h fnmatch.c fnmatch.h
|
|
||||||
|
|
||||||
|
|
||||||
EXTRA_DIST = COPYING.LIB Makefile.ami SCOPTIONS SMakefile \
|
|
||||||
configure.bat
|
|
||||||
@@ -1,67 +0,0 @@
|
|||||||
# Makefile for standalone libglob.a (fnmatch, glob). -*-Makefile-*-
|
|
||||||
# Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
|
|
||||||
# 2005, 2006, 2007 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 <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
# Ultrix 2.2 make doesn't expand the value of VPATH.
|
|
||||||
VPATH = /glob/
|
|
||||||
# This must repeat the value, because configure will remove `VPATH = .'.
|
|
||||||
srcdir = /glob/
|
|
||||||
|
|
||||||
CC = sc
|
|
||||||
RM = delete
|
|
||||||
CPPFLAGS =
|
|
||||||
CFLAGS =
|
|
||||||
|
|
||||||
# Information determined by configure.
|
|
||||||
DEFS = Define HAVE_HEADER_STDC Define HAVE_UNISTD_H Define HAVE_STRING_H \
|
|
||||||
Define HAVE_DIRENT_H
|
|
||||||
|
|
||||||
# How to invoke ar.
|
|
||||||
AR = join
|
|
||||||
ARFLAGS = as
|
|
||||||
|
|
||||||
# How to invoke ranlib.
|
|
||||||
RANLIB = ;
|
|
||||||
|
|
||||||
.PHONY: all
|
|
||||||
all: glob.lib
|
|
||||||
|
|
||||||
glob.lib : glob.o fnmatch.o
|
|
||||||
$(AR) $(ARFLAGS) $@ glob.o fnmatch.o
|
|
||||||
$(RANLIB) $@
|
|
||||||
|
|
||||||
# For some reason, Unix make wants the dependencies on the source files.
|
|
||||||
# Otherwise it refuses to use an implicit rule!
|
|
||||||
# And, get this: it doesn't work to use $(srcdir)foo.c!!
|
|
||||||
glob.o: $(srcdir)glob.h $(srcdir)fnmatch.h glob.c
|
|
||||||
fnmatch.o: $(srcdir)fnmatch.h fnmatch.c
|
|
||||||
|
|
||||||
OUTPUT_OPTION =
|
|
||||||
.c.o:
|
|
||||||
$(CC) IDir "" \
|
|
||||||
$(DEFS) $(CPPFLAGS) $(CFLAGS) $< $(OUTPUT_OPTION)
|
|
||||||
|
|
||||||
.PHONY: clean realclean glob-clean glob-realclean distclean
|
|
||||||
clean glob-clean:
|
|
||||||
-$(RM) glob.lib "#?.o" core
|
|
||||||
distclean glob-realclean: clean
|
|
||||||
-$(RM) TAGS tags Makefile config.status config.h config.log
|
|
||||||
realcean: distclean
|
|
||||||
|
|
||||||
# For inside the C library.
|
|
||||||
glob.tar glob.tar.Z:
|
|
||||||
$(MAKE) -C .. $@
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
ERRORREXX
|
|
||||||
OPTIMIZE
|
|
||||||
NOVERSION
|
|
||||||
OPTIMIZERTIME
|
|
||||||
OPTIMIZERALIAS
|
|
||||||
DEFINE INCLUDEDIR="include:"
|
|
||||||
DEFINE LIBDIR="lib:"
|
|
||||||
DEFINE NO_ALLOCA
|
|
||||||
DEFINE NO_FLOAT
|
|
||||||
DEFINE NO_ARCHIVES
|
|
||||||
IGNORE=161
|
|
||||||
IGNORE=100
|
|
||||||
STARTUP=cres
|
|
||||||
@@ -1,67 +0,0 @@
|
|||||||
# Makefile for standalone distribution of libglob.a (fnmatch, glob).
|
|
||||||
# Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
|
|
||||||
# 2005, 2006, 2007 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 <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
# Ultrix 2.2 make doesn't expand the value of VPATH.
|
|
||||||
VPATH = /glob/
|
|
||||||
# This must repeat the value, because configure will remove `VPATH = .'.
|
|
||||||
srcdir = /glob/
|
|
||||||
|
|
||||||
CC = sc
|
|
||||||
CPPFLAGS =
|
|
||||||
CFLAGS =
|
|
||||||
MAKE = smake
|
|
||||||
RM = delete
|
|
||||||
|
|
||||||
# Information determined by configure.
|
|
||||||
DEFS = Define HAVE_HEADER_STDC Define HAVE_UNISTD_H Define HAVE_STRING_H \
|
|
||||||
Define HAVE_DIRENT_H
|
|
||||||
|
|
||||||
# How to invoke ar.
|
|
||||||
AR = join
|
|
||||||
ARFLAGS = as
|
|
||||||
|
|
||||||
# How to invoke ranlib.
|
|
||||||
RANLIB = ;
|
|
||||||
|
|
||||||
.PHONY: all
|
|
||||||
all: glob.lib
|
|
||||||
|
|
||||||
glob.lib : glob.o fnmatch.o
|
|
||||||
$(AR) $(ARFLAGS) $@ glob.o fnmatch.o
|
|
||||||
$(RANLIB) $@
|
|
||||||
|
|
||||||
# For some reason, Unix make wants the dependencies on the source files.
|
|
||||||
# Otherwise it refuses to use an implicit rule!
|
|
||||||
# And, get this: it doesn't work to use $(srcdir)foo.c!!
|
|
||||||
glob.o: $(srcdir)glob.h $(srcdir)fnmatch.h glob.c
|
|
||||||
fnmatch.o: $(srcdir)fnmatch.h fnmatch.c
|
|
||||||
|
|
||||||
.c.o:
|
|
||||||
$(CC) IDir "" \
|
|
||||||
$(DEFS) $(CPPFLAGS) $(CFLAGS) $< $(OUTPUT_OPTION)
|
|
||||||
|
|
||||||
.PHONY: clean realclean glob-clean glob-realclean distclean
|
|
||||||
clean glob-clean:
|
|
||||||
-$(RM) -f glob.lib *.o core
|
|
||||||
distclean glob-realclean: clean
|
|
||||||
-$(RM) -f TAGS tags Makefile config.status config.h config.log
|
|
||||||
realcean: distclean
|
|
||||||
|
|
||||||
# For inside the C library.
|
|
||||||
glob.tar glob.tar.Z:
|
|
||||||
$(MAKE) -C .. $@
|
|
||||||
@@ -1,43 +0,0 @@
|
|||||||
@echo off
|
|
||||||
rem Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
|
|
||||||
rem 2004, 2005, 2006, 2007 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
|
|
||||||
rem the terms of the GNU General Public License as published by the Free
|
|
||||||
rem Software Foundation; either version 3 of the License, or (at your option)
|
|
||||||
rem any later version.
|
|
||||||
rem
|
|
||||||
rem GNU Make is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
rem ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
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/>.
|
|
||||||
|
|
||||||
echo Configuring glob for DJGPP
|
|
||||||
rem This batch file assumes a unix-type "sed" program
|
|
||||||
|
|
||||||
echo # Makefile generated by "configure.bat"> Makefile
|
|
||||||
|
|
||||||
if exist config.sed del config.sed
|
|
||||||
|
|
||||||
echo "s/@srcdir@/./ ">> config.sed
|
|
||||||
echo "s/@CC@/gcc/ ">> config.sed
|
|
||||||
echo "s/@CFLAGS@/-O2 -g/ ">> config.sed
|
|
||||||
echo "s/@CPPFLAGS@/-DHAVE_CONFIG_H -I../ ">> config.sed
|
|
||||||
echo "s/@AR@/ar/ ">> config.sed
|
|
||||||
echo "s/@RANLIB@/ranlib/ ">> config.sed
|
|
||||||
echo "s/@LDFLAGS@// ">> config.sed
|
|
||||||
echo "s/@DEFS@// ">> config.sed
|
|
||||||
echo "s/@ALLOCA@// ">> config.sed
|
|
||||||
echo "s/@LIBS@// ">> config.sed
|
|
||||||
echo "s/@LIBOBJS@// ">> config.sed
|
|
||||||
echo "s/^Makefile *:/_Makefile:/ ">> config.sed
|
|
||||||
echo "s/^config.h *:/_config.h:/ ">> config.sed
|
|
||||||
|
|
||||||
sed -e "s/^\"//" -e "s/\"$//" -e "s/[ ]*$//" config.sed > config2.sed
|
|
||||||
sed -f config2.sed Makefile.in >> Makefile
|
|
||||||
del config.sed
|
|
||||||
del config2.sed
|
|
||||||
159
job.h
159
job.h
@@ -1,159 +0,0 @@
|
|||||||
/* Definitions for managing subprocesses in GNU Make.
|
|
||||||
Copyright (C) 1992-2016 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 <http://www.gnu.org/licenses/>. */
|
|
||||||
|
|
||||||
#include "output.h"
|
|
||||||
|
|
||||||
#ifdef HAVE_FCNTL_H
|
|
||||||
# include <fcntl.h>
|
|
||||||
#else
|
|
||||||
# include <sys/file.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* How to set close-on-exec for a file descriptor. */
|
|
||||||
|
|
||||||
#if !defined(F_SETFD) || !defined(F_GETFD)
|
|
||||||
# ifdef WINDOWS32
|
|
||||||
# define CLOSE_ON_EXEC(_d) process_noinherit(_d)
|
|
||||||
# else
|
|
||||||
# define CLOSE_ON_EXEC(_d)
|
|
||||||
# endif
|
|
||||||
#else
|
|
||||||
# ifndef FD_CLOEXEC
|
|
||||||
# define FD_CLOEXEC 1
|
|
||||||
# endif
|
|
||||||
# define CLOSE_ON_EXEC(_d) (void) fcntl ((_d), F_SETFD, FD_CLOEXEC)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef NO_OUTPUT_SYNC
|
|
||||||
# define RECORD_SYNC_MUTEX(m) \
|
|
||||||
O (error, NILF, \
|
|
||||||
_("-O[TYPE] (--output-sync[=TYPE]) is not configured for this build."));
|
|
||||||
#else
|
|
||||||
# ifdef WINDOWS32
|
|
||||||
/* For emulations in w32/compat/posixfcn.c. */
|
|
||||||
# define F_GETFD 1
|
|
||||||
# define F_SETLKW 2
|
|
||||||
/* Implementation note: None of the values of l_type below can be zero
|
|
||||||
-- they are compared with a static instance of the struct, so zero
|
|
||||||
means unknown/invalid, see w32/compat/posixfcn.c. */
|
|
||||||
# define F_WRLCK 1
|
|
||||||
# define F_UNLCK 2
|
|
||||||
|
|
||||||
struct flock
|
|
||||||
{
|
|
||||||
short l_type;
|
|
||||||
short l_whence;
|
|
||||||
off_t l_start;
|
|
||||||
off_t l_len;
|
|
||||||
pid_t l_pid;
|
|
||||||
};
|
|
||||||
|
|
||||||
/* This type is actually a HANDLE, but we want to avoid including
|
|
||||||
windows.h as much as possible. */
|
|
||||||
typedef intptr_t sync_handle_t;
|
|
||||||
|
|
||||||
/* Public functions emulated/provided in posixfcn.c. */
|
|
||||||
int fcntl (intptr_t fd, int cmd, ...);
|
|
||||||
intptr_t create_mutex (void);
|
|
||||||
int same_stream (FILE *f1, FILE *f2);
|
|
||||||
|
|
||||||
# define RECORD_SYNC_MUTEX(m) record_sync_mutex(m)
|
|
||||||
void record_sync_mutex (const char *str);
|
|
||||||
void prepare_mutex_handle_string (intptr_t hdl);
|
|
||||||
# else /* !WINDOWS32 */
|
|
||||||
|
|
||||||
typedef int sync_handle_t; /* file descriptor */
|
|
||||||
|
|
||||||
# define RECORD_SYNC_MUTEX(m) (void)(m)
|
|
||||||
|
|
||||||
# endif
|
|
||||||
#endif /* !NO_OUTPUT_SYNC */
|
|
||||||
|
|
||||||
/* Structure describing a running or dead child process. */
|
|
||||||
|
|
||||||
struct child
|
|
||||||
{
|
|
||||||
struct child *next; /* Link in the chain. */
|
|
||||||
|
|
||||||
struct file *file; /* File being remade. */
|
|
||||||
|
|
||||||
char **environment; /* Environment for commands. */
|
|
||||||
char *sh_batch_file; /* Script file for shell commands */
|
|
||||||
char **command_lines; /* Array of variable-expanded cmd lines. */
|
|
||||||
char *command_ptr; /* Ptr into command_lines[command_line]. */
|
|
||||||
|
|
||||||
#ifdef VMS
|
|
||||||
char *comname; /* Temporary command file name */
|
|
||||||
int efn; /* Completion event flag number */
|
|
||||||
int cstatus; /* Completion status */
|
|
||||||
int vms_launch_status; /* non-zero if lib$spawn, etc failed */
|
|
||||||
#endif
|
|
||||||
|
|
||||||
unsigned int command_line; /* Index into command_lines. */
|
|
||||||
struct output output; /* Output for this child. */
|
|
||||||
pid_t pid; /* Child process's ID number. */
|
|
||||||
unsigned int remote:1; /* Nonzero if executing remotely. */
|
|
||||||
unsigned int noerror:1; /* Nonzero if commands contained a '-'. */
|
|
||||||
unsigned int good_stdin:1; /* Nonzero if this child has a good stdin. */
|
|
||||||
unsigned int deleted:1; /* Nonzero if targets have been deleted. */
|
|
||||||
unsigned int recursive:1; /* Nonzero for recursive command ('+' etc.) */
|
|
||||||
unsigned int dontcare:1; /* Saved dontcare flag. */
|
|
||||||
};
|
|
||||||
|
|
||||||
extern struct child *children;
|
|
||||||
|
|
||||||
/* A signal handler for SIGCHLD, if needed. */
|
|
||||||
RETSIGTYPE 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);
|
|
||||||
|
|
||||||
char **construct_command_argv (char *line, char **restp, struct file *file,
|
|
||||||
int cmd_flags, char** batch_file);
|
|
||||||
|
|
||||||
#ifdef VMS
|
|
||||||
int child_execute_job (struct child *child, char *argv);
|
|
||||||
#else
|
|
||||||
# define FD_STDIN (fileno (stdin))
|
|
||||||
# define FD_STDOUT (fileno (stdout))
|
|
||||||
# define FD_STDERR (fileno (stderr))
|
|
||||||
int child_execute_job (struct output *out, int good_stdin, char **argv, char **envp);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef _AMIGA
|
|
||||||
void exec_command (char **argv) __attribute__ ((noreturn));
|
|
||||||
#elif defined(__EMX__)
|
|
||||||
int exec_command (char **argv, char **envp);
|
|
||||||
#else
|
|
||||||
void exec_command (char **argv, char **envp) __attribute__ ((noreturn));
|
|
||||||
#endif
|
|
||||||
|
|
||||||
extern unsigned int job_slots_used;
|
|
||||||
|
|
||||||
void block_sigs (void);
|
|
||||||
#ifdef POSIX
|
|
||||||
void unblock_sigs (void);
|
|
||||||
#else
|
|
||||||
#ifdef HAVE_SIGSETMASK
|
|
||||||
extern int fatal_signal_mask;
|
|
||||||
#define unblock_sigs() sigsetmask (0)
|
|
||||||
#else
|
|
||||||
#define unblock_sigs()
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
extern unsigned int jobserver_tokens;
|
|
||||||
394
maintMakefile
394
maintMakefile
@@ -2,98 +2,96 @@
|
|||||||
# 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.
|
# tree, not a dist copy.
|
||||||
|
|
||||||
|
# --------------------- #
|
||||||
|
# Updating everything. #
|
||||||
|
# --------------------- #
|
||||||
|
|
||||||
|
.PHONY: update
|
||||||
|
update:
|
||||||
|
|
||||||
BUGLIST := bug-make@gnu.org
|
BUGLIST := bug-make@gnu.org
|
||||||
|
|
||||||
# These are related to my personal setup.
|
# These are related to my personal setup.
|
||||||
GPG_FINGERPRINT := 6338B6D4
|
GPG_KEYID := 80CB727A20C79BB2
|
||||||
|
|
||||||
# SRCROOTDIR is just a handy location to keep source files in
|
# SRCROOTDIR is just a handy location to keep source files in
|
||||||
SRCROOTDIR ?= $(HOME)/src
|
SRCROOTDIR ?= $(HOME)/src
|
||||||
|
|
||||||
# Where the gnulib project has been locally cloned
|
|
||||||
GNULIBDIR ?= $(SRCROOTDIR)/gnulib
|
|
||||||
|
|
||||||
# Where to put the CVS checkout of the GNU web repository
|
# Where to put the CVS checkout of the GNU web repository
|
||||||
GNUWEBDIR ?= $(SRCROOTDIR)/gnu-www
|
GNUWEBDIR ?= $(SRCROOTDIR)/gnu-www
|
||||||
|
|
||||||
# Where to put the CVS checkout of the GNU make web repository
|
# Where to put the CVS checkout of the GNU make web repository
|
||||||
MAKEWEBDIR ?= $(SRCROOTDIR)/make/make-web
|
MAKEWEBDIR ?= $(SRCROOTDIR)/make/make-web
|
||||||
|
|
||||||
|
# Enable Perl warnings for the test suite
|
||||||
|
PERLFLAGS := -w
|
||||||
|
|
||||||
# We like mondo-warnings!
|
# We like mondo-warnings!
|
||||||
AM_CFLAGS += -Wall -Wwrite-strings -Wextra -Wdeclaration-after-statement -Wshadow -Wpointer-arith -Wbad-function-cast
|
# Also force comments to be preserved. This helps when using ccache, in
|
||||||
|
# combination with GCC 7's implicit-fallthrough warning.
|
||||||
|
MAKE_CFLAGS := -C -Wall -Wextra -Werror -Wwrite-strings -Wshadow \
|
||||||
|
-Wdeclaration-after-statement -Wbad-function-cast -Wformat-security \
|
||||||
|
-Wtype-limits -Wunused-but-set-parameter -Wlogical-op -Wpointer-arith \
|
||||||
|
-Wignored-qualifiers -Wformat-signedness -Wduplicated-cond
|
||||||
|
|
||||||
|
AM_CFLAGS += $(MAKE_CFLAGS)
|
||||||
|
|
||||||
|
# Unfortunately the Guile headers are sometimes broken. Convince GCC
|
||||||
|
# to treat them as system headers so warnings are ignored.
|
||||||
|
GUILE_CFLAGS := $(patsubst -I%,-isystem %,$(GUILE_CFLAGS))
|
||||||
|
|
||||||
MAKE_MAINTAINER_MODE := -DMAKE_MAINTAINER_MODE
|
MAKE_MAINTAINER_MODE := -DMAKE_MAINTAINER_MODE
|
||||||
AM_CPPFLAGS += $(MAKE_MAINTAINER_MODE)
|
AM_CPPFLAGS += $(MAKE_MAINTAINER_MODE)
|
||||||
|
|
||||||
# I want this one but I have to wait for the const cleanup!
|
|
||||||
# -Wwrite-strings
|
|
||||||
|
|
||||||
# Find the glob source files... this might be dangerous, but we're maintainers!
|
|
||||||
globsrc := $(wildcard glob/*.c)
|
|
||||||
globhdr := $(wildcard glob/*.h)
|
|
||||||
|
|
||||||
TEMPLATES = README README.DOS README.W32 README.OS2 \
|
|
||||||
config.ami configh.dos config.h.W32 config.h-vms
|
|
||||||
MTEMPLATES = Makefile.DOS SMakefile
|
|
||||||
|
|
||||||
# These are built as a side-effect of the dist rule
|
|
||||||
#all-am: $(TEMPLATES) $(MTEMPLATES) build.sh.in
|
|
||||||
|
|
||||||
# Create preprocessor output files--GCC specific!
|
# Create preprocessor output files--GCC specific!
|
||||||
%.i : %.c
|
%.i : %.c
|
||||||
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) -E -dD -o $@ $<
|
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) -E -dD -o $@ $<
|
||||||
|
|
||||||
# General rule for turning a .template into a regular file.
|
# Create the mkconfig.h file for non-POSIX config headers
|
||||||
#
|
|
||||||
$(TEMPLATES) : % : %.template Makefile
|
all: src/mkconfig.h
|
||||||
rm -f $@
|
src/mkconfig.h: src/mkconfig.h.in config.status
|
||||||
sed -e 's@%VERSION%@$(VERSION)@g' \
|
./config.status --header=$@
|
||||||
-e 's@%PACKAGE%@$(PACKAGE)@g' \
|
|
||||||
$< > $@
|
# Build the README
|
||||||
chmod a-w $@
|
|
||||||
|
all: README
|
||||||
|
README : README.in config.status
|
||||||
|
./config.status --file=$@
|
||||||
|
|
||||||
# Construct Makefiles by adding on dependencies, etc.
|
# Construct Makefiles by adding on dependencies, etc.
|
||||||
#
|
#
|
||||||
$(MTEMPLATES) : % : %.template .dep_segment Makefile
|
cvt = $(patsubst $1/%,$$($1)%,$(filter %.c,$2))
|
||||||
|
Basic.mk: Basic.mk.template .dep_segment Makefile
|
||||||
rm -f $@
|
rm -f $@
|
||||||
sed -e 's@%VERSION%@$(VERSION)@g' \
|
sed -e 's@%make_SOURCES%@$(call cvt,src,$(make_SRCS))@g' \
|
||||||
-e 's@%PROGRAMS%@$(bin_PROGRAMS)@g' \
|
-e 's@%w32_SOURCES%@$(call cvt,src,$(w32_SRCS))@g' \
|
||||||
-e 's@%SOURCES%@$(filter-out remote-%,$(make_SOURCES)) remote-$$(REMOTE).c@g' \
|
-e 's@%vms_SOURCES%@$(call cvt,src,$(vms_SRCS))@g' \
|
||||||
-e 's@%OBJECTS%@$(filter-out remote-%,$(make_OBJECTS)) remote-$$(REMOTE).o@g' \
|
-e 's@%amiga_SOURCES%@$(call cvt,src,$(amiga_SRCS))@g' \
|
||||||
-e 's@%GLOB_SOURCES%@$(globsrc) $(globhdr)@g' \
|
-e 's@%loadavg_SOURCES%@$(call cvt,lib,$(loadavg_SRCS))@g' \
|
||||||
-e 's@%GLOB_OBJECTS%@$(globsrc:glob/%.c=%.o)@g' \
|
-e 's@%alloca_SOURCES%@$(call cvt,lib,$(alloca_SRCS))@g' \
|
||||||
|
-e 's@%glob_SOURCES%@$(call cvt,lib,$(glob_SRCS))@g' \
|
||||||
$< > $@
|
$< > $@
|
||||||
echo >>$@; echo '# --------------- DEPENDENCIES' >>$@; echo '#' >>$@; \
|
echo >>$@; echo '# --------------- DEPENDENCIES' >>$@; echo '#' >>$@; \
|
||||||
cat $(word 2,$^) >>$@
|
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/alloca.h@@g' \
|
||||||
|
-e 's@$$(SRCDIR)/lib/stdbool.h@@g' \
|
||||||
|
$(word 2,$^) >>$@
|
||||||
chmod a-w $@
|
chmod a-w $@
|
||||||
|
|
||||||
NMakefile: NMakefile.template .dep_segment Makefile
|
|
||||||
rm -f $@
|
|
||||||
cp $< $@
|
|
||||||
echo >>$@; echo '# --------------- DEPENDENCIES' >>$@; echo '#' >>$@; \
|
|
||||||
sed 's/^\([^ ]*\)\.o:/$$(OUTDIR)\/\1.obj:/' $(word 2,$^) >>$@
|
|
||||||
chmod a-w $@
|
|
||||||
|
|
||||||
# Construct build.sh.in
|
# Use automake to build a dependency list file, for Makebase.mk.
|
||||||
#
|
#
|
||||||
build.sh.in: build.template Makefile
|
# Automake used to have a --generate-deps flag but it's gone now, so we have
|
||||||
rm -f $@
|
|
||||||
sed -e 's@%objs%@$(patsubst %.o,%.$${OBJEXT},$(filter-out remote-%,$(make_OBJECTS)))@g' \
|
|
||||||
-e 's@%globobjs%@$(patsubst %.c,%.$${OBJEXT},$(globsrc))@g' \
|
|
||||||
$< > $@
|
|
||||||
chmod a-w+x $@
|
|
||||||
|
|
||||||
|
|
||||||
# Use automake to build a dependency list file, for "foreign" makefiles like
|
|
||||||
# Makefile.DOS.
|
|
||||||
#
|
|
||||||
# Automake used to have a --generate-deps flag, but it's gone now, so we have
|
|
||||||
# to do it ourselves.
|
# to do it ourselves.
|
||||||
#
|
#
|
||||||
DEP_FILES := $(wildcard $(DEPDIR)/*.Po)
|
DEP_FILES := $(wildcard src/$(DEPDIR)/*.Po)
|
||||||
.dep_segment: Makefile.am maintMakefile $(DEP_FILES)
|
.dep_segment: Makefile.am maintMakefile $(DEP_FILES)
|
||||||
rm -f $@
|
rm -f $@
|
||||||
(for f in $(DEPDIR)/*.Po; do \
|
(for f in src/$(DEPDIR)/*.Po; do \
|
||||||
echo ""; \
|
echo ""; \
|
||||||
echo "# $$f"; \
|
echo "# $$f"; \
|
||||||
sed -e '/^[^:]*\.[ch] *:/d' \
|
sed -e '/^[^:]*\.[ch] *:/d' \
|
||||||
@@ -115,14 +113,16 @@ GIT := git
|
|||||||
git-clean:
|
git-clean:
|
||||||
-$(GIT) clean -fdX
|
-$(GIT) clean -fdX
|
||||||
git-very-clean: git-clean
|
git-very-clean: git-clean
|
||||||
-$(GIT) clean -fd
|
-$(GIT) clean -fdx
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## ---------------------- ##
|
## ---------------------- ##
|
||||||
## Generating ChangeLog. ##
|
## Generating ChangeLog. ##
|
||||||
## ---------------------- ##
|
## ---------------------- ##
|
||||||
|
|
||||||
|
# Where the gnulib project has been locally cloned
|
||||||
|
GNULIBDIR ?= $(or $(wildcard $(GNULIB_SRCDIR)),./gnulib)
|
||||||
|
|
||||||
gl2cl-date := 2013-10-10
|
gl2cl-date := 2013-10-10
|
||||||
gl2cl := $(GNULIBDIR)/build-aux/gitlog-to-changelog
|
gl2cl := $(GNULIBDIR)/build-aux/gitlog-to-changelog
|
||||||
|
|
||||||
@@ -134,17 +134,18 @@ ChangeLog: .check-git-HEAD
|
|||||||
echo "WARNING: $(gl2cl) is not available. No $@ generated."; \
|
echo "WARNING: $(gl2cl) is not available. No $@ generated."; \
|
||||||
fi
|
fi
|
||||||
|
|
||||||
.PHONY: .check-git-HEAD
|
.check-git-HEAD: FORCE
|
||||||
.check-git-HEAD:
|
|
||||||
sha="`git rev-parse HEAD`"; \
|
sha="`git rev-parse HEAD`"; \
|
||||||
[ -f '$@' ] && [ "`cat '$@' 2>/dev/null`" = "$$sha" ] \
|
test -f '$@' && [ "`cat '$@' 2>/dev/null`" = "$$sha" ] \
|
||||||
|| echo "$$sha" > '$@'
|
|| echo "$$sha" > '$@'
|
||||||
|
|
||||||
|
.PHONY: FORCE
|
||||||
|
FORCE:;@:
|
||||||
|
|
||||||
## ---------------- ##
|
## ---------------- ##
|
||||||
## Updating files. ##
|
## Updating files. ##
|
||||||
## ---------------- ##
|
## ---------------- ##
|
||||||
|
RSYNC = rsync -Lrtvz
|
||||||
WGET = wget --passive-ftp -np -nv
|
WGET = wget --passive-ftp -np -nv
|
||||||
ftp-gnu = ftp://ftp.gnu.org/gnu
|
ftp-gnu = ftp://ftp.gnu.org/gnu
|
||||||
|
|
||||||
@@ -158,101 +159,192 @@ move_if_change = if test -r $(target) && cmp -s $(target).t $(target); then \
|
|||||||
# Updating PO files. #
|
# Updating PO files. #
|
||||||
# ------------------- #
|
# ------------------- #
|
||||||
|
|
||||||
|
# NOTE: This is handled by the bootstrap script now
|
||||||
|
|
||||||
|
#update: po-update
|
||||||
|
update: po-check
|
||||||
|
|
||||||
# PO archive mirrors --- Be careful; some might not be fully populated!
|
# PO archive mirrors --- Be careful; some might not be fully populated!
|
||||||
# ftp://ftp.unex.es/pub/gnu-i18n/po/maint/
|
# ftp://ftp.unex.es/pub/gnu-i18n/po/maint/
|
||||||
# http://translation.sf.net/maint/
|
|
||||||
# ftp://tiger.informatik.hu-berlin.de/pub/po/maint/
|
# ftp://tiger.informatik.hu-berlin.de/pub/po/maint/
|
||||||
|
|
||||||
po_wget_flags = --recursive --level=1 --no-directories --no-check-certificate
|
po_wget_flags = --recursive --level=1 --no-directories --no-check-certificate
|
||||||
po_repo = http://translationproject.org/latest/$(PACKAGE)
|
po_repo = https://translationproject.org/latest/$(PACKAGE)
|
||||||
|
po_sync = translationproject.org::tp/latest/$(PACKAGE)/
|
||||||
|
|
||||||
.PHONY: do-po-update po-update
|
.PHONY: do-po-update po-update
|
||||||
do-po-update:
|
do-po-update:
|
||||||
tmppo="/tmp/po-$(PACKAGE)-$(VERSION).$$$$" \
|
tmppo="/tmp/po-$(PACKAGE)-$(PACKAGE_VERSION).$$$$" \
|
||||||
&& rm -rf "$$tmppo" \
|
&& rm -rf "$$tmppo" \
|
||||||
&& mkdir "$$tmppo" \
|
&& mkdir "$$tmppo" \
|
||||||
&& (cd "$$tmppo" \
|
&& $(RSYNC) $(po_sync) "$$tmppo" \
|
||||||
&& $(WGET) $(po_wget_flags) -A '*.po' $(po_repo)) \
|
|
||||||
&& cp "$$tmppo"/*.po $(top_srcdir)/po \
|
&& cp "$$tmppo"/*.po $(top_srcdir)/po \
|
||||||
&& rm -rf "$$tmppo"
|
&& rm -rf "$$tmppo"
|
||||||
cd po && $(MAKE) update-po
|
cd po && $(MAKE) update-po
|
||||||
$(MAKE) po-check
|
$(MAKE) po-check
|
||||||
|
|
||||||
po-update:
|
po-update:
|
||||||
[ -d "po" ] && $(MAKE) do-po-update
|
test -d "po" && $(MAKE) do-po-update
|
||||||
|
|
||||||
# -------------------------- #
|
# -------------------------- #
|
||||||
# Updating GNU build files. #
|
# Updating GNU build files. #
|
||||||
# -------------------------- #
|
# -------------------------- #
|
||||||
|
|
||||||
|
# Note: this is handled by the bootstrap script now
|
||||||
|
#update: scm-update
|
||||||
|
|
||||||
|
.PHONY: scm-update
|
||||||
|
scm-update: get-build-aux/texinfo.tex get-build-aux/config.guess \
|
||||||
|
get-build-aux/config.sub get-doc/make-stds.texi get-doc/fdl.texi
|
||||||
|
|
||||||
# The following pseudo table associates a local directory and a URL
|
# The following pseudo table associates a local directory and a URL
|
||||||
# with each of the files that belongs to some other package and is
|
# with each of the files that belongs to some other package and is
|
||||||
# regularly updated from the specified URL.
|
# regularly updated from the specified URL.
|
||||||
|
|
||||||
cvs-url = http://savannah.gnu.org/cgi-bin/viewcvs/~checkout~
|
cvs-url = https://savannah.gnu.org/cgi-bin/viewcvs/~checkout~
|
||||||
git-url = http://git.savannah.gnu.org/cgit
|
git-url = https://git.savannah.gnu.org/cgit
|
||||||
target = $(patsubst get-%,%,$@)
|
target = $(patsubst get-%,%,$@)
|
||||||
|
|
||||||
config-url = $(git-url)/config.git/plain/$(patsubst get-config/%,%,$@)
|
config-url = $(git-url)/config.git/plain/$(patsubst get-build-aux/%,%,$@)
|
||||||
get-config/config.guess get-config/config.sub:
|
get-build-aux/config.guess get-build-aux/config.sub:
|
||||||
@echo $(WGET) $(config-url) -O $(target) \
|
@echo Retrieving $(target) from $(config-url)
|
||||||
&& $(WGET) $(config-url) -O $(target).t \
|
$(WGET) $(config-url) -O $(target).t \
|
||||||
&& $(move_if_change)
|
&& $(move_if_change)
|
||||||
|
|
||||||
gnulib-url = $(git-url)/gnulib.git/plain/build-aux/$(patsubst get-config/%,%,$@)
|
gnulib-url = $(git-url)/gnulib.git/plain/build-aux/$(patsubst get-build-aux/%,%,$@)
|
||||||
get-config/texinfo.tex:
|
get-build-aux/texinfo.tex:
|
||||||
@echo $(WGET) $(gnulib-url) -O $(target) \
|
@echo Retrieving $(target) from $(gnulib-url)
|
||||||
&& $(WGET) $(gnulib-url) -O $(target).t \
|
$(WGET) $(gnulib-url) -O $(target).t \
|
||||||
&& $(move_if_change)
|
&& $(move_if_change)
|
||||||
|
|
||||||
gnustandards-url = $(cvs-url)/gnustandards/gnustandards/$(patsubst get-doc/%,%,$@)
|
gnustandards-url = $(cvs-url)/gnustandards/gnustandards/$(patsubst get-doc/%,%,$@)
|
||||||
get-doc/make-stds.texi get-doc/fdl.texi:
|
get-doc/make-stds.texi get-doc/fdl.texi:
|
||||||
@echo $(WGET) $(gnustandards-url) -O $(target) \
|
@echo Retrieving $(target) from $(gnustandards-url)
|
||||||
&& $(WGET) $(gnustandards-url) -O $(target).t \
|
$(WGET) $(gnustandards-url) -O $(target).t \
|
||||||
&& $(move_if_change)
|
&& $(move_if_change)
|
||||||
|
|
||||||
.PHONY: scm-update
|
|
||||||
scm-update: get-config/texinfo.tex get-config/config.guess get-config/config.sub get-doc/make-stds.texi get-doc/fdl.texi
|
|
||||||
|
|
||||||
|
# ---------------------------- #
|
||||||
|
# Extra configuration checks. #
|
||||||
|
# ---------------------------- #
|
||||||
|
|
||||||
# --------------------- #
|
# Make the dist file contents more regular, if we're using GNU tar.
|
||||||
# Updating everything. #
|
# Suggested by Tzvetelin Katchov <katchov@gnu.org>
|
||||||
# --------------------- #
|
|
||||||
|
|
||||||
.PHONY: update
|
export TAR_OPTIONS := --mode=u+w,go-w --owner=0 --group=0 --numeric-owner --sort=name
|
||||||
update: po-update scm-update
|
|
||||||
|
# When I released 4.3 somehow the INSTALL file was missing.
|
||||||
|
# When I tried to build it again, it was there. I have no idea what happened
|
||||||
|
# but add a new check to be sure it doesn't happen again.
|
||||||
|
mk_dist_files = AUTHORS ChangeLog COPYING INSTALL README src/mkconfig.h
|
||||||
|
|
||||||
|
dist: mk-distcheck
|
||||||
|
|
||||||
|
.PHONY: mk-distcheck
|
||||||
|
mk-distcheck: distdir
|
||||||
|
@echo "Checking for extra installed files..."
|
||||||
|
for fn in $(mk_dist_files); do \
|
||||||
|
test -f '$(distdir)'/"$$fn" \
|
||||||
|
|| { echo "Missing dist file: $$fn"; exit 1; }; \
|
||||||
|
done; true
|
||||||
|
|
||||||
|
|
||||||
# ---------------------------------- #
|
# ---------------------------------- #
|
||||||
# Alternative configuration checks. #
|
# Alternative configuration checks. #
|
||||||
# ---------------------------------- #
|
# ---------------------------------- #
|
||||||
|
|
||||||
|
CFGCHECK_CONFIGFLAGS =
|
||||||
|
CFGCHECK_BUILDFLAGS =
|
||||||
|
# We can't use our mondo warnings as these are used to compile gnulib modules
|
||||||
|
# as well, and that will fail.
|
||||||
|
CFGCHECK_MAKEFLAGS = # CFLAGS='$(AM_CFLAGS)'
|
||||||
|
|
||||||
|
# We don't support C90 anymore, strictly, but this test still works (with lots
|
||||||
|
# of warnings) and it helps us avoid egregious incompatibilities.
|
||||||
|
checkcfg.strict-c90: CFGCHECK_CONFIGFLAGS = CFLAGS='-std=c90 -pedantic'
|
||||||
|
checkcfg.strict-c90: CFGCHECK_MAKEFLAGS =
|
||||||
|
|
||||||
|
checkcfg.no-jobserver:CFGCHECK_CONFIGFLAGS = --disable-job-server
|
||||||
|
checkcfg.no-load: CFGCHECK_CONFIGFLAGS = --disable-load
|
||||||
|
checkcfg.no-guile: CFGCHECK_CONFIGFLAGS = --without-guile
|
||||||
|
checkcfg.no-spawn: CFGCHECK_CONFIGFLAGS = --disable-posix-spawn
|
||||||
|
checkcfg.no-sysglob: CFGCHECK_CONFIGFLAGS = make_cv_sys_gnu_glob=no
|
||||||
|
checkcfg.no-loadavg: CFGCHECK_CONFIGFLAGS = ac_cv_func_getloadavg=no \
|
||||||
|
ac_cv_have_decl_getloadavg=no \
|
||||||
|
gl_cv_have_raw_decl_getloadavg=no \
|
||||||
|
ac_cv_lib_util_getloadavg=no \
|
||||||
|
ac_cv_lib_getloadavg_getloadavg=no
|
||||||
|
checkcfg.no-sync: CFGCHECK_CONFIGFLAGS = CPPFLAGS=-DNO_OUTPUT_SYNC
|
||||||
|
checkcfg.no-archives: CFGCHECK_CONFIGFLAGS = CPPFLAGS=-DNO_ARCHIVES
|
||||||
|
|
||||||
|
CONFIG_CHECKS := \
|
||||||
|
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
|
.PHONY: check-alt-config
|
||||||
check-alt-config: \
|
check-alt-config: $(CONFIG_CHECKS)
|
||||||
checkcfg.--disable-job-server \
|
|
||||||
checkcfg.--disable-load \
|
|
||||||
checkcfg.--without-guile \
|
|
||||||
checkcfg.CPPFLAGS^-DNO_OUTPUT_SYNC \
|
|
||||||
checkcfg.CPPFLAGS^-DNO_ARCHIVES
|
|
||||||
|
|
||||||
# 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)
|
NR_MAKE = $(MAKE)
|
||||||
|
|
||||||
# Check builds both with build.sh and with make
|
# Check builds both with build.sh and with make
|
||||||
checkcfg.%: distdir
|
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)"
|
@echo "Building $@ (output in checkcfg.$*.log)"
|
||||||
@exec >'checkcfg.$*.log' 2>&1; \
|
exec >'checkcfg.$*.log' 2>&1; \
|
||||||
|
echo "Testing configure with $(CFGCHECK_CONFIGFLAGS)"; set -x; \
|
||||||
rm -rf $(distdir)/_build \
|
rm -rf $(distdir)/_build \
|
||||||
&& mkdir $(distdir)/_build \
|
&& mkdir $(distdir)/_build \
|
||||||
&& cd $(distdir)/_build \
|
&& cd $(distdir)/_build \
|
||||||
&& echo "Testing configure with $(subst ^,=,$*)" \
|
&& ../configure --srcdir=.. $(CFGCHECK_CONFIGFLAGS) \
|
||||||
&& ../configure --srcdir=.. $(subst ^,=,$*) \
|
$(AM_DISTCHECK_CONFIGURE_FLAGS) $(DISTCHECK_CONFIGURE_FLAGS)
|
||||||
$(AM_DISTCHECK_CONFIGURE_FLAGS) $(DISTCHECK_CONFIGURE_FLAGS) \
|
$(build.sh_SCRIPT)
|
||||||
CFLAGS='$(AM_CFLAGS)' \
|
$(nrmake_SCRIPT)
|
||||||
&& ./build.sh \
|
|
||||||
&& ./make $(AM_MAKEFLAGS) check \
|
# Try using Basic.mk. I can't test this on POSIX systems because it is only
|
||||||
&& rm -f *.o make \
|
# used for non-POSIX systems; POSIX systems can just use normal
|
||||||
&& $(NR_MAKE) $(AM_MAKEFLAGS) \
|
# configure/Makefile.in etc.
|
||||||
&& ./make $(AM_MAKEFLAGS) check
|
checkcfg.basicmk: checkcfg.% : distdir
|
||||||
|
@echo "Building $@ (output in checkcfg.$*.log)"
|
||||||
|
exec >'checkcfg.$*.log' 2>&1; \
|
||||||
|
echo "Testing Basic.mk SRCDIR=.."; set -x; \
|
||||||
|
rm -rf $(distdir)/_build \
|
||||||
|
&& mkdir $(distdir)/_build \
|
||||||
|
&& cd $(distdir)/_build \
|
||||||
|
&& ../configure --srcdir=.. \
|
||||||
|
$(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=.. $(CFGCHECK_MAKEFLAGS)
|
||||||
|
&& ./make $(AM_MAKEFLAGS) -f ../Basic.mk SRCDIR=.. check \
|
||||||
|
&& ./make $(AM_MAKEFLAGS) -f ../Basic.mk SRCDIR=.. clean
|
||||||
|
exec >>'checkcfg.$*.log' 2>&1; \
|
||||||
|
echo "Testing Basic.mk SRCDIR=."; set -x; \
|
||||||
|
&& rm -rf $(distdir)/_build \
|
||||||
|
&& cd $(distdir) \
|
||||||
|
&& ./configure \
|
||||||
|
$(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
|
||||||
|
|
||||||
|
|
||||||
## --------------- ##
|
## --------------- ##
|
||||||
@@ -271,19 +363,19 @@ local-check: po-check changelog-check
|
|||||||
# copyright-check writable-files
|
# copyright-check writable-files
|
||||||
|
|
||||||
changelog-check:
|
changelog-check:
|
||||||
if head $(top_srcdir)/ChangeLog | grep 'Version $(VERSION)' >/dev/null; then \
|
if head $(top_srcdir)/ChangeLog | grep 'Version $(PACKAGE_VERSION)' >/dev/null; then \
|
||||||
:; \
|
:; \
|
||||||
else \
|
else \
|
||||||
echo "$(VERSION) not in ChangeLog" 1>&2; \
|
echo "$(PACKAGE_VERSION) not in ChangeLog" 1>&2; \
|
||||||
exit 1; \
|
exit 1; \
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Verify that all source files using _() are listed in po/POTFILES.in.
|
# Verify that all source files using _() are listed in po/POTFILES.in.
|
||||||
# Ignore makeint.h; it defines _().
|
# Ignore src/makeint.h; it defines _().
|
||||||
po-check:
|
po-check:
|
||||||
if test -f po/POTFILES.in; then \
|
if test -f po/POTFILES.in; then \
|
||||||
grep '^[^#]' po/POTFILES.in | sort > $@-1; \
|
grep '^[^#]' po/POTFILES.in | sort > $@-1; \
|
||||||
$(PERL) -wn -e 'if (/\b_\(/) { $$ARGV eq "./makeint.h" || print "$$ARGV\n" and close ARGV }' `find . -name '*.[ch]'` | sed 's,^\./,,' | sort > $@-2; \
|
find [a-z]* -name '*.[ch]' | xargs grep -l '\b_(' | grep -v src/makeint.h | sort > $@-2; \
|
||||||
diff -u $@-1 $@-2 || exit 1; \
|
diff -u $@-1 $@-2 || exit 1; \
|
||||||
rm -f $@-1 $@-2; \
|
rm -f $@-1 $@-2; \
|
||||||
fi
|
fi
|
||||||
@@ -303,16 +395,16 @@ gnuweb-dir = www/server/standards
|
|||||||
|
|
||||||
# Get the GNU make web page boilerplate etc.
|
# Get the GNU make web page boilerplate etc.
|
||||||
update-makeweb:
|
update-makeweb:
|
||||||
[ -d '$(MAKEWEBDIR)' ] || mkdir -p '$(MAKEWEBDIR)'
|
test -d '$(MAKEWEBDIR)' || mkdir -p '$(MAKEWEBDIR)'
|
||||||
[ -d '$(MAKEWEBDIR)'/CVS ] \
|
test -d '$(MAKEWEBDIR)'/CVS \
|
||||||
&& { cd '$(MAKEWEBDIR)' && $(CVS) update; } \
|
&& { cd '$(MAKEWEBDIR)' && $(CVS) update; } \
|
||||||
|| { mkdir -p '$(dir $(MAKEWEBDIR))' && cd '$(dir $(MAKEWEBDIR))' \
|
|| { mkdir -p '$(dir $(MAKEWEBDIR))' && cd '$(dir $(MAKEWEBDIR))' \
|
||||||
&& $(CVS) -d $(makeweb-repo) co -d '$(notdir $(MAKEWEBDIR))' make; }
|
&& $(CVS) -d $(makeweb-repo) co -d '$(notdir $(MAKEWEBDIR))' make; }
|
||||||
|
|
||||||
# Get the GNU web page boilerplate etc.
|
# Get the GNU web page boilerplate etc.
|
||||||
update-gnuweb:
|
update-gnuweb:
|
||||||
[ -d '$(GNUWEBDIR)' ] || mkdir -p '$(GNUWEBDIR)'
|
test -d '$(GNUWEBDIR)' || mkdir -p '$(GNUWEBDIR)'
|
||||||
[ -d '$(GNUWEBDIR)/$(gnuweb-dir)'/CVS ] \
|
test -d '$(GNUWEBDIR)/$(gnuweb-dir)'/CVS \
|
||||||
&& { cd '$(GNUWEBDIR)/$(gnuweb-dir)' && $(CVS) update; } \
|
&& { cd '$(GNUWEBDIR)/$(gnuweb-dir)' && $(CVS) update; } \
|
||||||
|| { cd '$(GNUWEBDIR)' && $(CVS) -d $(gnuweb-repo) co '$(gnuweb-dir)'; }
|
|| { cd '$(GNUWEBDIR)' && $(CVS) -d $(gnuweb-repo) co '$(gnuweb-dir)'; }
|
||||||
|
|
||||||
@@ -321,15 +413,64 @@ gendocs: update-gnuweb update-makeweb
|
|||||||
cd doc \
|
cd doc \
|
||||||
&& rm -rf doc/manual \
|
&& rm -rf doc/manual \
|
||||||
&& $(GNULIBDIR)/build-aux/gendocs.sh --email '$(BUGLIST)' \
|
&& $(GNULIBDIR)/build-aux/gendocs.sh --email '$(BUGLIST)' \
|
||||||
make 'GNU Make Manual'
|
make '$(PACKAGE_NAME) Manual'
|
||||||
find '$(MAKEWEBDIR)'/manual \( -name CVS -prune \) -o \( -name '[!.]*' -type f -exec rm -f '{}' \; \)
|
find '$(MAKEWEBDIR)'/manual \( -name CVS -prune \) -o \( -name '[!.]*' -type f -exec rm -f '{}' \; \)
|
||||||
cp -r doc/manual '$(MAKEWEBDIR)'
|
cp -r doc/manual '$(MAKEWEBDIR)'
|
||||||
@echo 'Status of $(MAKEWEBDIR) repo:' && cd '$(MAKEWEBDIR)' \
|
@echo 'Status of $(MAKEWEBDIR) repo:' && cd '$(MAKEWEBDIR)' \
|
||||||
&& cvs -q -n update | grep -v '^M ' \
|
&& cvs -q -n update | grep -v '^M '
|
||||||
&& echo '- cvs add <new files>' \
|
@echo '- cvs add <new files>' \
|
||||||
&& echo '- cvs remove <deleted files>' \
|
&& echo '- cvs remove <deleted files>' \
|
||||||
&& echo '- cvs commit' \
|
&& echo '- cvs commit' \
|
||||||
&& echo '- cvs tag make-$(subst .,-,$(VERSION))'
|
&& echo '- cvs tag make-$(subst .,-,$(PACKAGE_VERSION))'
|
||||||
|
|
||||||
|
|
||||||
|
## --------------------------------------------- ##
|
||||||
|
## Submitting Coverity cov-build results to Scan ##
|
||||||
|
## --------------------------------------------- ##
|
||||||
|
|
||||||
|
# Note you must have set COVERITY_TOKEN and COVERITY_EMAIL properly
|
||||||
|
# to submit results. COVERITY_PATH can be set to the root of the
|
||||||
|
# cov-build tools if it's not already on your PATH.
|
||||||
|
|
||||||
|
COV_BUILD_FILE := cov-build.tgz
|
||||||
|
|
||||||
|
.PHONY: cov-build cov-submit
|
||||||
|
|
||||||
|
cov-build: $(COV_BUILD_FILE)
|
||||||
|
|
||||||
|
$(COV_BUILD_FILE): $(filter %.c %.h,$(DISTFILES))
|
||||||
|
$(MAKE) distdir
|
||||||
|
@echo "Running Coverity cov-build"
|
||||||
|
rm -rf '$(distdir)'/_build
|
||||||
|
mkdir '$(distdir)'/_build
|
||||||
|
cd '$(distdir)'/_build \
|
||||||
|
&& ../configure --srcdir=.. \
|
||||||
|
$(AM_DISTCHECK_CONFIGURE_FLAGS) $(DISTCHECK_CONFIGURE_FLAGS) \
|
||||||
|
$(CFGCHECK_MAKEFLAGS)
|
||||||
|
PATH="$${COVERITY_PATH:+$$COVERITY_PATH/bin:}$$PATH"; \
|
||||||
|
cd '$(distdir)'/_build \
|
||||||
|
&& cov-build --dir cov-int ../build.sh
|
||||||
|
rm -f '$@'
|
||||||
|
(cd '$(distdir)'/_build && tar czf - cov-int) > '$@'
|
||||||
|
|
||||||
|
cov-submit: $(COV_BUILD_FILE)-submitted
|
||||||
|
|
||||||
|
$(COV_BUILD_FILE)-submitted: $(COV_BUILD_FILE)
|
||||||
|
@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 '$(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="$(PACKAGE_VERSION)$$ext" \
|
||||||
|
--form description="$(PACKAGE_NAME) $$type" \
|
||||||
|
'https://scan.coverity.com/builds?project=gmake'
|
||||||
|
cp '$<' '$@'
|
||||||
|
|
||||||
|
|
||||||
## ------------------------- ##
|
## ------------------------- ##
|
||||||
## Make release targets. ##
|
## Make release targets. ##
|
||||||
@@ -337,11 +478,12 @@ gendocs: update-gnuweb update-makeweb
|
|||||||
|
|
||||||
.PHONY: tag-release
|
.PHONY: tag-release
|
||||||
tag-release:
|
tag-release:
|
||||||
case '$(VERSION)' in \
|
case '$(PACKAGE_VERSION)' in \
|
||||||
(*.*.9*) message=" candidate" ;; \
|
(*.*.9*) message=" candidate" ;; \
|
||||||
(*) message= ;; \
|
(*) message= ;; \
|
||||||
esac; \
|
esac; \
|
||||||
$(GIT) tag -m "GNU Make release$$message $(VERSION)" -u '$(GPG_FINGERPRINT)' '$(VERSION)'
|
$(GIT) tag -m "$(PACKAGE_NAME) release$$message $(PACKAGE_VERSION)" -u '$(GPG_KEYID)' '$(PACKAGE_VERSION)'
|
||||||
|
|
||||||
|
|
||||||
## ------------------------- ##
|
## ------------------------- ##
|
||||||
## GNU FTP upload artifacts. ##
|
## GNU FTP upload artifacts. ##
|
||||||
@@ -352,7 +494,7 @@ tag-release:
|
|||||||
# you're SOL! :)
|
# you're SOL! :)
|
||||||
|
|
||||||
GPG = gpg
|
GPG = gpg
|
||||||
GPGFLAGS = -u $(GPG_FINGERPRINT)
|
GPGFLAGS = -u $(GPG_KEYID)
|
||||||
|
|
||||||
DIST_ARCHIVES_SIG = $(addsuffix .sig,$(DIST_ARCHIVES))
|
DIST_ARCHIVES_SIG = $(addsuffix .sig,$(DIST_ARCHIVES))
|
||||||
DIST_ARCHIVES_DIRECTIVE = $(addsuffix .directive.asc,$(DIST_ARCHIVES))
|
DIST_ARCHIVES_DIRECTIVE = $(addsuffix .directive.asc,$(DIST_ARCHIVES))
|
||||||
@@ -366,19 +508,19 @@ distsign: $(DIST_ARCHIVES_SIG) $(DIST_ARCHIVES_DIRECTIVE)
|
|||||||
$(GPG) $(GPGFLAGS) -o "$@" -b "$<"
|
$(GPG) $(GPGFLAGS) -o "$@" -b "$<"
|
||||||
|
|
||||||
%.directive.asc: %
|
%.directive.asc: %
|
||||||
@echo "Creating directive file '$@':"
|
@echo "Creating signed directive file '$@':"
|
||||||
@( \
|
@( \
|
||||||
echo 'version: 1.1'; \
|
echo 'version: 1.2'; \
|
||||||
echo 'directory: make'; \
|
echo 'directory: make'; \
|
||||||
echo 'filename: $*'; \
|
echo 'filename: $*'; \
|
||||||
echo 'comment: Official upload of GNU make version $(VERSION)'; \
|
echo 'comment: Official upload of $(PACKAGE_NAME) version $(PACKAGE_VERSION)'; \
|
||||||
) > "$*.directive"
|
) > "$*.directive"
|
||||||
$(GPG) $(GPGFLAGS) -o "$@" --clearsign "$*.directive"
|
$(GPG) $(GPGFLAGS) -o "$@" --clearsign "$*.directive"
|
||||||
@rm -f "$*.directive"
|
@rm -f "$*.directive"
|
||||||
|
|
||||||
# Upload the artifacts
|
# Upload the artifacts
|
||||||
|
|
||||||
FTPPUT = ncftpput
|
FTPPUT := $(firstword $(shell command -v ncftpput) $(wildcard $(GNULIBDIR)/build-aux/ncftpput-ftp) invalid)
|
||||||
gnu-upload-host = ftp-upload.gnu.org
|
gnu-upload-host = ftp-upload.gnu.org
|
||||||
gnu-upload-dir = /incoming
|
gnu-upload-dir = /incoming
|
||||||
|
|
||||||
@@ -392,7 +534,7 @@ $(UPLOADS): $(DIST_ARCHIVES) $(DIST_ARCHIVES_SIG) $(DIST_ARCHIVES_DIRECTIVE)
|
|||||||
# Rebuild Makefile.in if this file is modifed.
|
# Rebuild Makefile.in if this file is modifed.
|
||||||
Makefile.in: maintMakefile
|
Makefile.in: maintMakefile
|
||||||
|
|
||||||
# Copyright (C) 1997-2016 Free Software Foundation, Inc.
|
# Copyright (C) 1997-2022 Free Software Foundation, Inc.
|
||||||
# This file is part of GNU Make.
|
# This file is part of GNU Make.
|
||||||
#
|
#
|
||||||
# GNU Make is free software; you can redistribute it and/or modify it under
|
# GNU Make is free software; you can redistribute it and/or modify it under
|
||||||
@@ -406,4 +548,4 @@ Makefile.in: maintMakefile
|
|||||||
# details.
|
# details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License along with
|
# You should have received a copy of the GNU General Public License along with
|
||||||
# this program. If not, see <http://www.gnu.org/licenses/>.
|
# this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|||||||
281
make-gdb.py
Normal file
281
make-gdb.py
Normal file
@@ -0,0 +1,281 @@
|
|||||||
|
"""GDB pretty-printer macros for GNU Make."""
|
||||||
|
|
||||||
|
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('*')
|
||||||
|
if tn not in _TYPES:
|
||||||
|
_TYPES[tn] = gdb.lookup_type(tn)
|
||||||
|
while tn != tname:
|
||||||
|
# Want a pointer type
|
||||||
|
t = tn
|
||||||
|
tn += '*'
|
||||||
|
_TYPES[tn] = _TYPES[t].pointer()
|
||||||
|
return _TYPES[tname]
|
||||||
|
|
||||||
|
|
||||||
|
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):
|
||||||
|
"""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()
|
||||||
|
|
||||||
|
|
||||||
|
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."""
|
||||||
|
|
||||||
|
def __init__(self, val):
|
||||||
|
"""Create a FileLocation object."""
|
||||||
|
self.val = val
|
||||||
|
|
||||||
|
def to_string(self):
|
||||||
|
"""Convert a FileLocation to a string."""
|
||||||
|
if int(self.val['filenm']):
|
||||||
|
return "%s:%d" % (str(self.val['filenm']), self.val['lineno'])
|
||||||
|
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."""
|
||||||
|
|
||||||
|
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']:
|
||||||
|
a = '?='
|
||||||
|
else:
|
||||||
|
a = '='
|
||||||
|
flags = []
|
||||||
|
s = str(self.val['flavor'])
|
||||||
|
if s != 'f_bogus':
|
||||||
|
flags.append(s)
|
||||||
|
s = str(self.val['origin'])
|
||||||
|
if s != 'o_default':
|
||||||
|
flags.append(s)
|
||||||
|
s = str(self.val['export'])
|
||||||
|
if s != 'v_default':
|
||||||
|
flags.append(s)
|
||||||
|
return '%s[%s]: "%s" %s "%s"' % (
|
||||||
|
self.val['fileinfo'], ','.join(flags),
|
||||||
|
self.val['name'].string(), a, self.val['value'].string())
|
||||||
|
|
||||||
|
|
||||||
|
class HashTablePrinter(object):
|
||||||
|
"""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 range(0, self.val['ht_size']):
|
||||||
|
v = lst[i]
|
||||||
|
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."""
|
||||||
|
|
||||||
|
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)
|
||||||
|
yield (nm, ptr)
|
||||||
|
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."""
|
||||||
|
|
||||||
|
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
|
||||||
|
ptr = self.val.address
|
||||||
|
i = 0
|
||||||
|
while not isNullptr(ptr):
|
||||||
|
nm = '[%d] ' % (i)
|
||||||
|
yield (nm, ptr['set'])
|
||||||
|
if int(ptr['set']) == int(VariableSetListPrinter.GLOBALSET):
|
||||||
|
yield (nm, "global_variable_set")
|
||||||
|
else:
|
||||||
|
yield (nm, str(ptr['set'].dereference()))
|
||||||
|
i += 1
|
||||||
|
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)
|
||||||
5
make.lnk
5
make.lnk
@@ -1,5 +0,0 @@
|
|||||||
FROM LIB:cres.o "commands.o"+"job.o"+"dir.o"+"file.o"+"misc.o"+"main.o"+"read.o"+"remake.o"+"rule.o"+"implicit.o"+"default.o"+"variable.o"+"expand.o"+"function.o"+"vpath.o"+"version.o"+"ar.o"+"arscan.o"+"signame.o"+"remote-stub.o"+"getopt.o"+"getopt1.o"+"alloca.o"+"amiga.o"+"hash.o"+"strcache.o"+"output.o"
|
|
||||||
TO "make.new"
|
|
||||||
LIB glob/glob.lib LIB:sc.lib LIB:amiga.lib
|
|
||||||
QUIET
|
|
||||||
|
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
Microsoft Visual Studio Solution File, Format Version 8.00
|
|
||||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "make_msvc.net2003", "make_msvc_net2003.vcproj", "{E96B5060-3240-4723-91C9-E64F1C877A04}"
|
|
||||||
ProjectSection(ProjectDependencies) = postProject
|
|
||||||
EndProjectSection
|
|
||||||
EndProject
|
|
||||||
Global
|
|
||||||
GlobalSection(SolutionConfiguration) = preSolution
|
|
||||||
Debug = Debug
|
|
||||||
Release = Release
|
|
||||||
EndGlobalSection
|
|
||||||
GlobalSection(ProjectConfiguration) = postSolution
|
|
||||||
{E96B5060-3240-4723-91C9-E64F1C877A04}.Debug.ActiveCfg = Debug|Win32
|
|
||||||
{E96B5060-3240-4723-91C9-E64F1C877A04}.Debug.Build.0 = Debug|Win32
|
|
||||||
{E96B5060-3240-4723-91C9-E64F1C877A04}.Release.ActiveCfg = Release|Win32
|
|
||||||
{E96B5060-3240-4723-91C9-E64F1C877A04}.Release.Build.0 = Release|Win32
|
|
||||||
EndGlobalSection
|
|
||||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
|
||||||
EndGlobalSection
|
|
||||||
GlobalSection(ExtensibilityAddIns) = postSolution
|
|
||||||
EndGlobalSection
|
|
||||||
EndGlobal
|
|
||||||
@@ -1,340 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="Windows-1252"?>
|
|
||||||
<VisualStudioProject
|
|
||||||
ProjectType="Visual C++"
|
|
||||||
Version="7.10"
|
|
||||||
Name="make_msvc.net2003"
|
|
||||||
ProjectGUID="{E96B5060-3240-4723-91C9-E64F1C877A04}"
|
|
||||||
Keyword="Win32Proj">
|
|
||||||
<Platforms>
|
|
||||||
<Platform
|
|
||||||
Name="Win32"/>
|
|
||||||
</Platforms>
|
|
||||||
<Configurations>
|
|
||||||
<Configuration
|
|
||||||
Name="Debug|Win32"
|
|
||||||
OutputDirectory="Debug"
|
|
||||||
IntermediateDirectory="Debug"
|
|
||||||
ConfigurationType="1"
|
|
||||||
CharacterSet="2">
|
|
||||||
<Tool
|
|
||||||
Name="VCCLCompilerTool"
|
|
||||||
Optimization="0"
|
|
||||||
AdditionalIncludeDirectories=".;w32/include;glob"
|
|
||||||
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_H=1;WINDOWS32=1"
|
|
||||||
MinimalRebuild="TRUE"
|
|
||||||
BasicRuntimeChecks="3"
|
|
||||||
RuntimeLibrary="1"
|
|
||||||
ForceConformanceInForLoopScope="TRUE"
|
|
||||||
UsePrecompiledHeader="0"
|
|
||||||
WarningLevel="4"
|
|
||||||
SuppressStartupBanner="TRUE"
|
|
||||||
Detect64BitPortabilityProblems="FALSE"
|
|
||||||
DebugInformationFormat="4"/>
|
|
||||||
<Tool
|
|
||||||
Name="VCCustomBuildTool"/>
|
|
||||||
<Tool
|
|
||||||
Name="VCLinkerTool"
|
|
||||||
OutputFile="$(OutDir)/make_msvc.net2003.exe"
|
|
||||||
LinkIncremental="2"
|
|
||||||
GenerateDebugInformation="TRUE"
|
|
||||||
ProgramDatabaseFile="$(OutDir)/make_msvc.net2003.pdb"
|
|
||||||
SubSystem="1"
|
|
||||||
TargetMachine="1"/>
|
|
||||||
<Tool
|
|
||||||
Name="VCMIDLTool"/>
|
|
||||||
<Tool
|
|
||||||
Name="VCPostBuildEventTool"/>
|
|
||||||
<Tool
|
|
||||||
Name="VCPreBuildEventTool"
|
|
||||||
Description="Copying config.h.W32 to config.h"
|
|
||||||
CommandLine="if not exist config.h copy config.h.W32 config.h"/>
|
|
||||||
<Tool
|
|
||||||
Name="VCPreLinkEventTool"/>
|
|
||||||
<Tool
|
|
||||||
Name="VCResourceCompilerTool"/>
|
|
||||||
<Tool
|
|
||||||
Name="VCWebServiceProxyGeneratorTool"/>
|
|
||||||
<Tool
|
|
||||||
Name="VCXMLDataGeneratorTool"/>
|
|
||||||
<Tool
|
|
||||||
Name="VCWebDeploymentTool"/>
|
|
||||||
<Tool
|
|
||||||
Name="VCManagedWrapperGeneratorTool"/>
|
|
||||||
<Tool
|
|
||||||
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
|
|
||||||
</Configuration>
|
|
||||||
<Configuration
|
|
||||||
Name="Release|Win32"
|
|
||||||
OutputDirectory="Release"
|
|
||||||
IntermediateDirectory="Release"
|
|
||||||
ConfigurationType="1"
|
|
||||||
CharacterSet="2">
|
|
||||||
<Tool
|
|
||||||
Name="VCCLCompilerTool"
|
|
||||||
AdditionalIncludeDirectories=".;w32/include;glob"
|
|
||||||
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;HAVE_CONFIG_H=1;WINDOWS32=1"
|
|
||||||
RuntimeLibrary="0"
|
|
||||||
ForceConformanceInForLoopScope="TRUE"
|
|
||||||
UsePrecompiledHeader="0"
|
|
||||||
WarningLevel="4"
|
|
||||||
Detect64BitPortabilityProblems="FALSE"
|
|
||||||
DebugInformationFormat="3"/>
|
|
||||||
<Tool
|
|
||||||
Name="VCCustomBuildTool"/>
|
|
||||||
<Tool
|
|
||||||
Name="VCLinkerTool"
|
|
||||||
OutputFile="$(OutDir)/make_msvc.net2003.exe"
|
|
||||||
LinkIncremental="1"
|
|
||||||
GenerateDebugInformation="TRUE"
|
|
||||||
SubSystem="1"
|
|
||||||
OptimizeReferences="2"
|
|
||||||
EnableCOMDATFolding="2"
|
|
||||||
TargetMachine="1"/>
|
|
||||||
<Tool
|
|
||||||
Name="VCMIDLTool"/>
|
|
||||||
<Tool
|
|
||||||
Name="VCPostBuildEventTool"/>
|
|
||||||
<Tool
|
|
||||||
Name="VCPreBuildEventTool"
|
|
||||||
Description="Copying config.h.W32 to config.h"
|
|
||||||
CommandLine="if not exist config.h copy config.h.W32 config.h"/>
|
|
||||||
<Tool
|
|
||||||
Name="VCPreLinkEventTool"/>
|
|
||||||
<Tool
|
|
||||||
Name="VCResourceCompilerTool"/>
|
|
||||||
<Tool
|
|
||||||
Name="VCWebServiceProxyGeneratorTool"/>
|
|
||||||
<Tool
|
|
||||||
Name="VCXMLDataGeneratorTool"/>
|
|
||||||
<Tool
|
|
||||||
Name="VCWebDeploymentTool"/>
|
|
||||||
<Tool
|
|
||||||
Name="VCManagedWrapperGeneratorTool"/>
|
|
||||||
<Tool
|
|
||||||
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
|
|
||||||
</Configuration>
|
|
||||||
</Configurations>
|
|
||||||
<References>
|
|
||||||
</References>
|
|
||||||
<Files>
|
|
||||||
<Filter
|
|
||||||
Name="src"
|
|
||||||
Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
|
|
||||||
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
|
|
||||||
<File
|
|
||||||
RelativePath=".\ar.c">
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath=".\arscan.c">
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath=".\commands.c">
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath=".\default.c">
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath=".\dir.c">
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath=".\expand.c">
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath=".\file.c">
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath=".\function.c">
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath=".\getloadavg.c">
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath=".\getopt.c">
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath=".\getopt1.c">
|
|
||||||
</File>
|
|
||||||
|
|
||||||
<File
|
|
||||||
RelativePath=".\guile.c">
|
|
||||||
</File>
|
|
||||||
|
|
||||||
<File
|
|
||||||
RelativePath=".\hash.c">
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath=".\strcache.c">
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath=".\implicit.c">
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath=".\job.c">
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath=".\load.c">
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath=".\output.c">
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath=".\main.c">
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath=".\misc.c">
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath=".\read.c">
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath=".\remake.c">
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath=".\remote-stub.c">
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath=".\rule.c">
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath=".\signame.c">
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath=".\variable.c">
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath=".\version.c">
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath=".\vpath.c">
|
|
||||||
</File>
|
|
||||||
<Filter
|
|
||||||
Name="w32"
|
|
||||||
Filter="">
|
|
||||||
<File
|
|
||||||
RelativePath=".\w32\compat\dirent.c">
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath=".\w32\compat\posixfcn.c">
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath=".\w32\subproc\misc.c">
|
|
||||||
<FileConfiguration
|
|
||||||
Name="Debug|Win32">
|
|
||||||
<Tool
|
|
||||||
Name="VCCLCompilerTool"
|
|
||||||
ObjectFile="$(IntDir)/$(InputName)1.obj"/>
|
|
||||||
</FileConfiguration>
|
|
||||||
<FileConfiguration
|
|
||||||
Name="Release|Win32">
|
|
||||||
<Tool
|
|
||||||
Name="VCCLCompilerTool"
|
|
||||||
ObjectFile="$(IntDir)/$(InputName)1.obj"/>
|
|
||||||
</FileConfiguration>
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath=".\w32\pathstuff.c">
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath=".\w32\w32os.c">
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath=".\w32\subproc\sub_proc.c">
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath=".\w32\subproc\w32err.c">
|
|
||||||
</File>
|
|
||||||
</Filter>
|
|
||||||
<Filter
|
|
||||||
Name="glob"
|
|
||||||
Filter="">
|
|
||||||
<File
|
|
||||||
RelativePath=".\glob\fnmatch.c">
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath=".\glob\glob.c">
|
|
||||||
</File>
|
|
||||||
</Filter>
|
|
||||||
</Filter>
|
|
||||||
<Filter
|
|
||||||
Name="include"
|
|
||||||
Filter="h;hpp;hxx;hm;inl;inc;xsd"
|
|
||||||
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
|
|
||||||
<File
|
|
||||||
RelativePath=".\commands.h">
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath=".\config.h">
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath=".\debug.h">
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath=".\dep.h">
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath=".\filedef.h">
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath=".\getopt.h">
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath=".\gettext.h">
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath=".\gmk-default.h">
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath=".\hash.h">
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath=".\job.h">
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath=".\output.h">
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath=".\makeint.h">
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath=".\rule.h">
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath=".\variable.h">
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath=".\vmsdir.h">
|
|
||||||
</File>
|
|
||||||
<Filter
|
|
||||||
Name="w32"
|
|
||||||
Filter="">
|
|
||||||
<File
|
|
||||||
RelativePath=".\w32\include\dirent.h">
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath=".\w32\include\pathstuff.h">
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath=".\w32\subproc\proc.h">
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath=".\w32\include\sub_proc.h">
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath=".\w32\include\w32err.h">
|
|
||||||
</File>
|
|
||||||
</Filter>
|
|
||||||
<Filter
|
|
||||||
Name="glob"
|
|
||||||
Filter="">
|
|
||||||
<File
|
|
||||||
RelativePath=".\glob\fnmatch.h">
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath=".\glob\glob.h">
|
|
||||||
</File>
|
|
||||||
</Filter>
|
|
||||||
</Filter>
|
|
||||||
</Files>
|
|
||||||
<Globals>
|
|
||||||
</Globals>
|
|
||||||
</VisualStudioProject>
|
|
||||||
25
makefile.com
25
makefile.com
@@ -71,14 +71,19 @@ $ if (p3.nes."WALL")
|
|||||||
$ then
|
$ then
|
||||||
$ gosub check_cc_qual
|
$ gosub check_cc_qual
|
||||||
$ endif
|
$ endif
|
||||||
$ filelist = "alloca ar arscan commands default dir expand file function " + -
|
$ filelist = "[.src]ar [.src]arscan [.src]commands [.src]default [.src]dir " + -
|
||||||
"guile hash implicit job load main misc read remake " + -
|
"[.src]expand [.src]file [.src]function [.src]guile " + -
|
||||||
"remote-stub rule output signame variable version " + -
|
"[.src]hash [.src]implicit [.src]job [.src]load [.src]main " + -
|
||||||
"vmsfunctions vmsify vpath vms_progname vms_exit " + -
|
"[.src]misc [.src]read [.src]remake [.src]remote-stub " + -
|
||||||
"vms_export_symbol [.glob]glob [.glob]fnmatch getopt1 " + -
|
"[.src]rule [.src]output [.src]signame [.src]variable " + -
|
||||||
"getopt strcache"
|
"[.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"
|
||||||
$!
|
$!
|
||||||
$ copy config.h-vms config.h
|
$ copy [.src]config.h-vms [.src]config.h
|
||||||
|
$ copy [.lib]fnmatch.in.h [.lib]fnmatch.h
|
||||||
|
$ copy [.lib]glob.in.h [.lib]glob.h
|
||||||
$ n=0
|
$ n=0
|
||||||
$ open/write optf make.opt
|
$ open/write optf make.opt
|
||||||
$ loop:
|
$ loop:
|
||||||
@@ -141,7 +146,7 @@ $ else
|
|||||||
$ objdir := []
|
$ objdir := []
|
||||||
$ write optf objdir+p1
|
$ write optf objdir+p1
|
||||||
$ endif
|
$ endif
|
||||||
$ cc'ccopt'/nested=none/include=([],[.glob])/obj='objdir' -
|
$ cc'ccopt'/nested=none/include=([],[.src],[.lib])/obj='objdir' -
|
||||||
/define=("allocated_variable_expand_for_file=alloc_var_expand_for_file",-
|
/define=("allocated_variable_expand_for_file=alloc_var_expand_for_file",-
|
||||||
"unlink=remove","HAVE_CONFIG_H","VMS") -
|
"unlink=remove","HAVE_CONFIG_H","VMS") -
|
||||||
'p1'
|
'p1'
|
||||||
@@ -149,7 +154,7 @@ $ exit
|
|||||||
$ endsubroutine : compileit
|
$ endsubroutine : compileit
|
||||||
$!
|
$!
|
||||||
$!-----------------------------------------------------------------------------
|
$!-----------------------------------------------------------------------------
|
||||||
$!Copyright (C) 1996-2016 Free Software Foundation, Inc.
|
$!Copyright (C) 1996-2022 Free Software Foundation, Inc.
|
||||||
$!This file is part of GNU Make.
|
$!This file is part of GNU Make.
|
||||||
$!
|
$!
|
||||||
$!GNU Make is free software; you can redistribute it and/or modify it under
|
$!GNU Make is free software; you can redistribute it and/or modify it under
|
||||||
@@ -163,4 +168,4 @@ $!FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
|||||||
$!details.
|
$!details.
|
||||||
$!
|
$!
|
||||||
$!You should have received a copy of the GNU General Public License along with
|
$!You should have received a copy of the GNU General Public License along with
|
||||||
$!this program. If not, see <http://www.gnu.org/licenses/>.
|
$!this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|||||||
180
makefile.vms
180
makefile.vms
@@ -1,180 +0,0 @@
|
|||||||
# -*-Makefile-*- to build GNU make on VMS
|
|
||||||
#
|
|
||||||
# Copyright (C) 1996-2016 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 <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
# VMS extensions from GNU Make 3.60 imported by
|
|
||||||
# Klaus Kämpf (kkaempf@rmi.de)
|
|
||||||
# Modified for version 3.78.1 by Hartmut.Becker@compaq.com.
|
|
||||||
# Modified for version 3.80 by zinser@decus.de
|
|
||||||
# Modified for versions 3.81, 3.99.90 by Hartmut Becker
|
|
||||||
|
|
||||||
CC = cc
|
|
||||||
CP = copy
|
|
||||||
|
|
||||||
%.obj: %.c
|
|
||||||
$(CC) $(CFLAGS)/obj=$@ $<
|
|
||||||
#
|
|
||||||
# Makefile for GNU Make
|
|
||||||
#
|
|
||||||
|
|
||||||
ifeq ($(CC),cc)
|
|
||||||
cinclude = /nested=none/include=([],[.glob])
|
|
||||||
cprefix = /prefix=(all,except=(glob,globfree))
|
|
||||||
cwarn = /standard=relaxed/warn=(disable=questcompare)
|
|
||||||
CFLAGS = $(defines) $(cinclude)$(cprefix)$(cwarn)
|
|
||||||
else
|
|
||||||
CFLAGS = $(defines) $(cinclude)
|
|
||||||
endif
|
|
||||||
#LDFLAGS = /deb
|
|
||||||
LDFLAGS =
|
|
||||||
|
|
||||||
ifeq ($(CC),cc)
|
|
||||||
defines = /define=("unlink=remove","HAVE_CONFIG_H","VMS","allocated_variable_expand_for_file=alloc_var_expand_for_file")
|
|
||||||
else
|
|
||||||
ifeq ($(ARCH),VAX)
|
|
||||||
defines = /define=("HAVE_CONFIG_H","GCC_IS_NATIVE","VAX")
|
|
||||||
else
|
|
||||||
defines = /define=("HAVE_CONFIG_H","GCC_IS_NATIVE")
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
LOAD_AVG = /define="NO_LDAV"
|
|
||||||
|
|
||||||
# If you don't want archive support, comment these out.
|
|
||||||
ARCHIVES = ,ar.obj,arscan.obj
|
|
||||||
ARCHIVES_SRC = ar.c arscan.c
|
|
||||||
|
|
||||||
# If your system needs extra libraries loaded in, define them here.
|
|
||||||
# System V probably need -lPW for alloca.
|
|
||||||
# if on vax, uncomment the following line
|
|
||||||
#LOADLIBES = ,c.opt/opt
|
|
||||||
ifeq ($(CC),cc)
|
|
||||||
#LOADLIBES =,sys$$library:vaxcrtl.olb/lib
|
|
||||||
CRT0 =
|
|
||||||
else
|
|
||||||
LOADLIBES =,gnu_cc_library:libgcc.olb/lib
|
|
||||||
endif
|
|
||||||
|
|
||||||
# If your system doesn't have alloca, or the one provided is bad,
|
|
||||||
# get it from the Emacs distribution and define these.
|
|
||||||
#ALLOCA = ,alloca.obj
|
|
||||||
#ALLOCASRC = alloca.c
|
|
||||||
|
|
||||||
# If there are remote execution facilities defined,
|
|
||||||
# enable them with switches here (see remote-*.c).
|
|
||||||
REMOTE =
|
|
||||||
|
|
||||||
# Any extra object files your system needs.
|
|
||||||
extras = ,signame.obj,remote-stub.obj,vmsfunctions.obj,vmsify.obj
|
|
||||||
#,directory.obj
|
|
||||||
# as an alternative:
|
|
||||||
glob = ,[.glob]glob.obj,[.glob]fnmatch.obj
|
|
||||||
getopt = ,getopt.obj,getopt1.obj
|
|
||||||
# Directory to install 'make' in.
|
|
||||||
bindir = []
|
|
||||||
# Directory to install the man page in.
|
|
||||||
mandir = []
|
|
||||||
# Number to put on the man page filename.
|
|
||||||
manext = 1
|
|
||||||
|
|
||||||
guile = ,guile.obj
|
|
||||||
|
|
||||||
objs = commands.obj,job.obj,output.obj,dir.obj,file.obj,misc.obj,hash.obj,\
|
|
||||||
load.obj,main.obj,read.obj,remake.obj,rule.obj,implicit.obj,\
|
|
||||||
default.obj,variable.obj,expand.obj,function.obj,strcache.obj,\
|
|
||||||
vpath.obj,version.obj,vms_progname.obj,vms_exit.obj,\
|
|
||||||
vms_export_symbol.obj$(guile)$(ARCHIVES)$(extras)$(getopt)$(glob)
|
|
||||||
|
|
||||||
srcs = commands.c job.c output.c dir.c file.c misc.c guile.c hash.c \
|
|
||||||
load.c main.c read.c remake.c rule.c implicit.c \
|
|
||||||
default.c variable.c expand.c function.c strcache.c \
|
|
||||||
vpath.c version.c vmsfunctions.c vmsify.c vms_progname.c vms_exit.c \
|
|
||||||
vms_export_symbol.c $(ARCHIVES_SRC) $(ALLOCASRC) \
|
|
||||||
commands.h dep.h filedef.h job.h output.h makeint.h rule.h variable.h
|
|
||||||
|
|
||||||
|
|
||||||
.PHONY: all doc
|
|
||||||
all: config.h make.exe
|
|
||||||
|
|
||||||
doc: make.info make.dvi
|
|
||||||
|
|
||||||
|
|
||||||
make.exe: $(objs)
|
|
||||||
$(LD)$(LDFLAGS)/exe=$@ $^$(LOADLIBES)$(CRT0)
|
|
||||||
|
|
||||||
.PHONY: clean realclean
|
|
||||||
clean:
|
|
||||||
-purge [...]
|
|
||||||
-$(RM) make.exe;,*.obj;
|
|
||||||
-$(RM) [.glob]*.obj;
|
|
||||||
|
|
||||||
ar.obj: ar.c makeint.h config.h gnumake.h gettext.h filedef.h hash.h dep.h \
|
|
||||||
[.glob]fnmatch.h
|
|
||||||
arscan.obj: arscan.c makeint.h config.h gnumake.h gettext.h
|
|
||||||
commands.obj: commands.c makeint.h config.h gnumake.h gettext.h filedef.h \
|
|
||||||
hash.h dep.h variable.h job.h output.h commands.h
|
|
||||||
default.obj: default.c makeint.h config.h gnumake.h gettext.h filedef.h \
|
|
||||||
hash.h variable.h rule.h dep.h job.h output.h commands.h
|
|
||||||
dir.obj: dir.c makeint.h config.h gnumake.h gettext.h hash.h filedef.h \
|
|
||||||
dep.h [.glob]glob.h
|
|
||||||
expand.obj: expand.c makeint.h config.h gnumake.h gettext.h filedef.h \
|
|
||||||
hash.h job.h output.h commands.h variable.h rule.h
|
|
||||||
file.obj: file.c makeint.h config.h gnumake.h gettext.h filedef.h hash.h \
|
|
||||||
dep.h job.h output.h commands.h variable.h debug.h
|
|
||||||
[.glob]fnmatch.obj: [.glob]fnmatch.c config.h [.glob]fnmatch.h
|
|
||||||
function.obj: function.c makeint.h config.h gnumake.h gettext.h filedef.h \
|
|
||||||
hash.h variable.h dep.h job.h output.h commands.h debug.h
|
|
||||||
getopt.obj: getopt.c config.h gettext.h getopt.h
|
|
||||||
getopt1.obj: getopt1.c config.h getopt.h
|
|
||||||
[.glob]glob.obj: [.glob]glob.c config.h [.glob]fnmatch.h [.glob]glob.h
|
|
||||||
guile.obj: guile.c makeint.h config.h gnumake.h gettext.h
|
|
||||||
hash.obj: hash.c makeint.h config.h gnumake.h gettext.h hash.h
|
|
||||||
implicit.obj: implicit.c makeint.h config.h gnumake.h gettext.h filedef.h \
|
|
||||||
hash.h rule.h dep.h debug.h variable.h job.h output.h commands.h
|
|
||||||
job.obj: job.c makeint.h config.h gnumake.h gettext.h job.h output.h debug.h \
|
|
||||||
filedef.h hash.h commands.h variable.h debug.h vmsjobs.c
|
|
||||||
load.obj: load.c makeint.h config.h gnumake.h gettext.h
|
|
||||||
main.obj: main.c makeint.h config.h gnumake.h gettext.h filedef.h hash.h \
|
|
||||||
dep.h variable.h job.h output.h commands.h rule.h debug.h getopt.h
|
|
||||||
misc.obj: misc.c makeint.h config.h gnumake.h gettext.h filedef.h hash.h \
|
|
||||||
dep.h debug.h
|
|
||||||
output.obj: output.c makeint.h config.h gnumake.h gettext.h job.h output.h
|
|
||||||
read.obj: read.c makeint.h config.h gnumake.h gettext.h [.glob]glob.h \
|
|
||||||
filedef.h hash.h dep.h job.h output.h commands.h variable.h rule.h \
|
|
||||||
debug.h
|
|
||||||
remake.obj: remake.c makeint.h config.h gnumake.h gettext.h filedef.h \
|
|
||||||
hash.h job.h output.h commands.h dep.h variable.h debug.h
|
|
||||||
remote-stub.obj: remote-stub.c makeint.h config.h gnumake.h gettext.h \
|
|
||||||
filedef.h hash.h job.h output.h commands.h
|
|
||||||
rule.obj: rule.c makeint.h config.h gnumake.h gettext.h filedef.h hash.h \
|
|
||||||
dep.h job.h output.h commands.h variable.h rule.h
|
|
||||||
signame.obj: signame.c makeint.h config.h gnumake.h gettext.h
|
|
||||||
strcache.obj: strcache.c makeint.h config.h gnumake.h gettext.h hash.h
|
|
||||||
variable.obj: variable.c makeint.h config.h gnumake.h gettext.h filedef.h \
|
|
||||||
hash.h dep.h job.h output.h commands.h variable.h rule.h
|
|
||||||
version.obj: version.c config.h
|
|
||||||
vmsfunctions.obj: vmsfunctions.c makeint.h config.h gnumake.h gettext.h \
|
|
||||||
debug.h job.h output.h vmsdir.h
|
|
||||||
vmsify.obj: vmsify.c
|
|
||||||
vpath.obj: vpath.c makeint.h config.h gnumake.h gettext.h filedef.h hash.h \
|
|
||||||
variable.h
|
|
||||||
vms_progname.obj: vms_progname.c
|
|
||||||
vms_exit.obj: vms_exit.c
|
|
||||||
vms_export_symbol.obj: vms_export_symbol.c
|
|
||||||
|
|
||||||
config.h: config.h-vms
|
|
||||||
$(CP) $< $@
|
|
||||||
712
misc.c
712
misc.c
@@ -1,712 +0,0 @@
|
|||||||
/* Miscellaneous generic support functions for GNU Make.
|
|
||||||
Copyright (C) 1988-2016 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 <http://www.gnu.org/licenses/>. */
|
|
||||||
|
|
||||||
#include "makeint.h"
|
|
||||||
#include "filedef.h"
|
|
||||||
#include "dep.h"
|
|
||||||
#include "debug.h"
|
|
||||||
|
|
||||||
/* GNU make no longer supports pre-ANSI89 environments. */
|
|
||||||
|
|
||||||
#include <stdarg.h>
|
|
||||||
|
|
||||||
#ifdef HAVE_FCNTL_H
|
|
||||||
# include <fcntl.h>
|
|
||||||
#else
|
|
||||||
# include <sys/file.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Compare strings *S1 and *S2.
|
|
||||||
Return negative if the first is less, positive if it is greater,
|
|
||||||
zero if they are equal. */
|
|
||||||
|
|
||||||
int
|
|
||||||
alpha_compare (const void *v1, const void *v2)
|
|
||||||
{
|
|
||||||
const char *s1 = *((char **)v1);
|
|
||||||
const char *s2 = *((char **)v2);
|
|
||||||
|
|
||||||
if (*s1 != *s2)
|
|
||||||
return *s1 - *s2;
|
|
||||||
return strcmp (s1, s2);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Discard each backslash-newline combination from LINE.
|
|
||||||
Backslash-backslash-newline combinations become backslash-newlines.
|
|
||||||
This is done by copying the text at LINE into itself. */
|
|
||||||
|
|
||||||
void
|
|
||||||
collapse_continuations (char *line)
|
|
||||||
{
|
|
||||||
char *in, *out, *p;
|
|
||||||
|
|
||||||
in = strchr (line, '\n');
|
|
||||||
if (in == 0)
|
|
||||||
return;
|
|
||||||
|
|
||||||
out = in;
|
|
||||||
while (out > line && out[-1] == '\\')
|
|
||||||
--out;
|
|
||||||
|
|
||||||
while (*in != '\0')
|
|
||||||
{
|
|
||||||
/* BS_WRITE gets the number of quoted backslashes at
|
|
||||||
the end just before IN, and BACKSLASH gets nonzero
|
|
||||||
if the next character is quoted. */
|
|
||||||
unsigned int backslash = 0;
|
|
||||||
unsigned int bs_write = 0;
|
|
||||||
for (p = in - 1; p >= line && *p == '\\'; --p)
|
|
||||||
{
|
|
||||||
if (backslash)
|
|
||||||
++bs_write;
|
|
||||||
backslash = !backslash;
|
|
||||||
|
|
||||||
/* It should be impossible to go back this far without exiting,
|
|
||||||
but if we do, we can't get the right answer. */
|
|
||||||
if (in == out - 1)
|
|
||||||
abort ();
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Output the appropriate number of backslashes. */
|
|
||||||
while (bs_write-- > 0)
|
|
||||||
*out++ = '\\';
|
|
||||||
|
|
||||||
/* Skip the newline. */
|
|
||||||
++in;
|
|
||||||
|
|
||||||
if (backslash)
|
|
||||||
{
|
|
||||||
/* Backslash/newline handling:
|
|
||||||
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. */
|
|
||||||
while (ISBLANK (*in))
|
|
||||||
++in;
|
|
||||||
if (! posix_pedantic)
|
|
||||||
while (out > line && ISBLANK (out[-1]))
|
|
||||||
--out;
|
|
||||||
*out++ = ' ';
|
|
||||||
}
|
|
||||||
else
|
|
||||||
/* If the newline isn't quoted, put it in the output. */
|
|
||||||
*out++ = '\n';
|
|
||||||
|
|
||||||
/* Now copy the following line to the output.
|
|
||||||
Stop when we find backslashes followed by a newline. */
|
|
||||||
while (*in != '\0')
|
|
||||||
if (*in == '\\')
|
|
||||||
{
|
|
||||||
p = in + 1;
|
|
||||||
while (*p == '\\')
|
|
||||||
++p;
|
|
||||||
if (*p == '\n')
|
|
||||||
{
|
|
||||||
in = p;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
while (in < p)
|
|
||||||
*out++ = *in++;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
*out++ = *in++;
|
|
||||||
}
|
|
||||||
|
|
||||||
*out = '\0';
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Print N spaces (used in debug for target-depth). */
|
|
||||||
|
|
||||||
void
|
|
||||||
print_spaces (unsigned int n)
|
|
||||||
{
|
|
||||||
while (n-- > 0)
|
|
||||||
putchar (' ');
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* Return a string whose contents concatenate the NUM strings provided
|
|
||||||
This string lives in static, re-used memory. */
|
|
||||||
|
|
||||||
const char *
|
|
||||||
concat (unsigned int num, ...)
|
|
||||||
{
|
|
||||||
static unsigned int rlen = 0;
|
|
||||||
static char *result = NULL;
|
|
||||||
unsigned int ri = 0;
|
|
||||||
va_list args;
|
|
||||||
|
|
||||||
va_start (args, num);
|
|
||||||
|
|
||||||
while (num-- > 0)
|
|
||||||
{
|
|
||||||
const char *s = va_arg (args, const char *);
|
|
||||||
unsigned int l = xstrlen (s);
|
|
||||||
|
|
||||||
if (l == 0)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
if (ri + l > rlen)
|
|
||||||
{
|
|
||||||
rlen = ((rlen ? rlen : 60) + l) * 2;
|
|
||||||
result = xrealloc (result, rlen);
|
|
||||||
}
|
|
||||||
|
|
||||||
memcpy (result + ri, s, l);
|
|
||||||
ri += l;
|
|
||||||
}
|
|
||||||
|
|
||||||
va_end (args);
|
|
||||||
|
|
||||||
/* Get some more memory if we don't have enough space for the
|
|
||||||
terminating '\0'. */
|
|
||||||
if (ri == rlen)
|
|
||||||
{
|
|
||||||
rlen = (rlen ? rlen : 60) * 2;
|
|
||||||
result = xrealloc (result, rlen);
|
|
||||||
}
|
|
||||||
|
|
||||||
result[ri] = '\0';
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef HAVE_STRERROR
|
|
||||||
#undef strerror
|
|
||||||
char *
|
|
||||||
strerror (int errnum)
|
|
||||||
{
|
|
||||||
extern int errno, sys_nerr;
|
|
||||||
#ifndef __DECC
|
|
||||||
extern char *sys_errlist[];
|
|
||||||
#endif
|
|
||||||
static char buf[] = "Unknown error 12345678901234567890";
|
|
||||||
|
|
||||||
if (errno < sys_nerr)
|
|
||||||
return sys_errlist[errnum];
|
|
||||||
|
|
||||||
sprintf (buf, _("Unknown error %d"), errnum);
|
|
||||||
return buf;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Like malloc but get fatal error if memory is exhausted. */
|
|
||||||
/* Don't bother if we're using dmalloc; it provides these for us. */
|
|
||||||
|
|
||||||
#ifndef HAVE_DMALLOC_H
|
|
||||||
|
|
||||||
#undef xmalloc
|
|
||||||
#undef xcalloc
|
|
||||||
#undef xrealloc
|
|
||||||
#undef xstrdup
|
|
||||||
|
|
||||||
void *
|
|
||||||
xmalloc (unsigned int size)
|
|
||||||
{
|
|
||||||
/* Make sure we don't allocate 0, for pre-ISO implementations. */
|
|
||||||
void *result = malloc (size ? size : 1);
|
|
||||||
if (result == 0)
|
|
||||||
OUT_OF_MEM();
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void *
|
|
||||||
xcalloc (unsigned int size)
|
|
||||||
{
|
|
||||||
/* Make sure we don't allocate 0, for pre-ISO implementations. */
|
|
||||||
void *result = calloc (size ? size : 1, 1);
|
|
||||||
if (result == 0)
|
|
||||||
OUT_OF_MEM();
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void *
|
|
||||||
xrealloc (void *ptr, unsigned int size)
|
|
||||||
{
|
|
||||||
void *result;
|
|
||||||
|
|
||||||
/* Some older implementations of realloc() don't conform to ISO. */
|
|
||||||
if (! size)
|
|
||||||
size = 1;
|
|
||||||
result = ptr ? realloc (ptr, size) : malloc (size);
|
|
||||||
if (result == 0)
|
|
||||||
OUT_OF_MEM();
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
char *
|
|
||||||
xstrdup (const char *ptr)
|
|
||||||
{
|
|
||||||
char *result;
|
|
||||||
|
|
||||||
#ifdef HAVE_STRDUP
|
|
||||||
result = strdup (ptr);
|
|
||||||
#else
|
|
||||||
result = malloc (strlen (ptr) + 1);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (result == 0)
|
|
||||||
OUT_OF_MEM();
|
|
||||||
|
|
||||||
#ifdef HAVE_STRDUP
|
|
||||||
return result;
|
|
||||||
#else
|
|
||||||
return strcpy (result, ptr);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif /* HAVE_DMALLOC_H */
|
|
||||||
|
|
||||||
char *
|
|
||||||
xstrndup (const char *str, unsigned int length)
|
|
||||||
{
|
|
||||||
char *result;
|
|
||||||
|
|
||||||
#ifdef HAVE_STRNDUP
|
|
||||||
result = strndup (str, length);
|
|
||||||
if (result == 0)
|
|
||||||
OUT_OF_MEM();
|
|
||||||
#else
|
|
||||||
result = xmalloc (length + 1);
|
|
||||||
if (length > 0)
|
|
||||||
strncpy (result, str, length);
|
|
||||||
result[length] = '\0';
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* Limited INDEX:
|
|
||||||
Search through the string STRING, which ends at LIMIT, for the character C.
|
|
||||||
Returns a pointer to the first occurrence, or nil if none is found.
|
|
||||||
Like INDEX except that the string searched ends where specified
|
|
||||||
instead of at the first null. */
|
|
||||||
|
|
||||||
char *
|
|
||||||
lindex (const char *s, const char *limit, int c)
|
|
||||||
{
|
|
||||||
while (s < limit)
|
|
||||||
if (*s++ == c)
|
|
||||||
return (char *)(s - 1);
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Return the address of the first whitespace or null in the string S. */
|
|
||||||
|
|
||||||
char *
|
|
||||||
end_of_token (const char *s)
|
|
||||||
{
|
|
||||||
END_OF_TOKEN (s);
|
|
||||||
return (char *)s;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Return the address of the first nonwhitespace or null in the string S. */
|
|
||||||
|
|
||||||
char *
|
|
||||||
next_token (const char *s)
|
|
||||||
{
|
|
||||||
NEXT_TOKEN (s);
|
|
||||||
return (char *)s;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Find the next token in PTR; return the address of it, and store the length
|
|
||||||
of the token into *LENGTHPTR if LENGTHPTR is not nil. Set *PTR to the end
|
|
||||||
of the token, so this function can be called repeatedly in a loop. */
|
|
||||||
|
|
||||||
char *
|
|
||||||
find_next_token (const char **ptr, unsigned int *lengthptr)
|
|
||||||
{
|
|
||||||
const char *p = next_token (*ptr);
|
|
||||||
|
|
||||||
if (*p == '\0')
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
*ptr = end_of_token (p);
|
|
||||||
if (lengthptr != 0)
|
|
||||||
*lengthptr = *ptr - p;
|
|
||||||
|
|
||||||
return (char *)p;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* Copy a chain of 'struct dep'. For 2nd expansion deps, dup the name. */
|
|
||||||
|
|
||||||
struct dep *
|
|
||||||
copy_dep_chain (const struct dep *d)
|
|
||||||
{
|
|
||||||
struct dep *firstnew = 0;
|
|
||||||
struct dep *lastnew = 0;
|
|
||||||
|
|
||||||
while (d != 0)
|
|
||||||
{
|
|
||||||
struct dep *c = xmalloc (sizeof (struct dep));
|
|
||||||
memcpy (c, d, sizeof (struct dep));
|
|
||||||
|
|
||||||
if (c->need_2nd_expansion)
|
|
||||||
c->name = xstrdup (c->name);
|
|
||||||
|
|
||||||
c->next = 0;
|
|
||||||
if (firstnew == 0)
|
|
||||||
firstnew = lastnew = c;
|
|
||||||
else
|
|
||||||
lastnew = lastnew->next = c;
|
|
||||||
|
|
||||||
d = d->next;
|
|
||||||
}
|
|
||||||
|
|
||||||
return firstnew;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Free a chain of struct nameseq.
|
|
||||||
For struct dep chains use free_dep_chain. */
|
|
||||||
|
|
||||||
void
|
|
||||||
free_ns_chain (struct nameseq *ns)
|
|
||||||
{
|
|
||||||
while (ns != 0)
|
|
||||||
{
|
|
||||||
struct nameseq *t = ns;
|
|
||||||
ns = ns->next;
|
|
||||||
free_ns (t);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#if !HAVE_STRCASECMP && !HAVE_STRICMP && !HAVE_STRCMPI
|
|
||||||
/* If we don't have strcasecmp() (from POSIX), or anything that can substitute
|
|
||||||
for it, define our own version. */
|
|
||||||
|
|
||||||
int
|
|
||||||
strcasecmp (const char *s1, const char *s2)
|
|
||||||
{
|
|
||||||
while (1)
|
|
||||||
{
|
|
||||||
int c1 = (int) *(s1++);
|
|
||||||
int c2 = (int) *(s2++);
|
|
||||||
|
|
||||||
if (isalpha (c1))
|
|
||||||
c1 = tolower (c1);
|
|
||||||
if (isalpha (c2))
|
|
||||||
c2 = tolower (c2);
|
|
||||||
|
|
||||||
if (c1 != '\0' && c1 == c2)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
return (c1 - c2);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if !HAVE_STRNCASECMP && !HAVE_STRNICMP && !HAVE_STRNCMPI
|
|
||||||
/* If we don't have strncasecmp() (from POSIX), or anything that can
|
|
||||||
substitute for it, define our own version. */
|
|
||||||
|
|
||||||
int
|
|
||||||
strncasecmp (const char *s1, const char *s2, int n)
|
|
||||||
{
|
|
||||||
while (n-- > 0)
|
|
||||||
{
|
|
||||||
int c1 = (int) *(s1++);
|
|
||||||
int c2 = (int) *(s2++);
|
|
||||||
|
|
||||||
if (isalpha (c1))
|
|
||||||
c1 = tolower (c1);
|
|
||||||
if (isalpha (c2))
|
|
||||||
c2 = tolower (c2);
|
|
||||||
|
|
||||||
if (c1 != '\0' && c1 == c2)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
return (c1 - c2);
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
#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
|
|
||||||
get_path_max (void)
|
|
||||||
{
|
|
||||||
static unsigned int value;
|
|
||||||
|
|
||||||
if (value == 0)
|
|
||||||
{
|
|
||||||
long int x = pathconf ("/", _PC_PATH_MAX);
|
|
||||||
if (x > 0)
|
|
||||||
value = x;
|
|
||||||
else
|
|
||||||
return MAXPATHLEN;
|
|
||||||
}
|
|
||||||
|
|
||||||
return value;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
45
mk/Amiga.mk
Normal file
45
mk/Amiga.mk
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
# GNU -*-Makefile-*- to build GNU make on Amiga
|
||||||
|
#
|
||||||
|
# Amiga overrides for use with Basic.mk.
|
||||||
|
#
|
||||||
|
# Copyright (C) 2017-2022 Free Software Foundation, Inc.
|
||||||
|
# This file is part of GNU Make.
|
||||||
|
#
|
||||||
|
# GNU Make is free software; you can redistribute it and/or modify it under
|
||||||
|
# the terms of the GNU General Public License as published by the Free Software
|
||||||
|
# Foundation; either version 3 of the License, or (at your option) any later
|
||||||
|
# version.
|
||||||
|
#
|
||||||
|
# GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||||
|
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||||
|
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
||||||
|
# details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License along with
|
||||||
|
# this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
CC = sc
|
||||||
|
LD = $(CC) Link
|
||||||
|
|
||||||
|
MKDIR.cmd = makedir $1
|
||||||
|
RM.cmd = delete $1
|
||||||
|
CP.cmd = copy $1 To $2
|
||||||
|
|
||||||
|
CPPFLAGS =
|
||||||
|
CFLAGS =
|
||||||
|
LDFLAGS =
|
||||||
|
|
||||||
|
prog_SOURCES += $(alloca_SOURCES) $(loadavg_SOURCES) $(glob_SOURCES) $(amiga_SOURCES)
|
||||||
|
|
||||||
|
BUILT_SOURCES += $(lib)alloca.h $(lib)fnmatch.h $(lib)glob.h
|
||||||
|
|
||||||
|
extra_CPPFLAGS = IDir $(OUTDIR)src IDir $(SRCDIR)/src IDir $(OUTDIR)lib IDir $(SRCDIR)/lib
|
||||||
|
|
||||||
|
C_SOURCE =
|
||||||
|
OUTPUT_OPTION =
|
||||||
|
LDFLAGS = From LIB:cres.o
|
||||||
|
LDLIBS = Lib LIB:sc.lib LIB:amiga.lib
|
||||||
|
LINK_OUTPUT = To $@
|
||||||
|
|
||||||
|
$(OUTDIR)src/config.h: $(SRCDIR)/src/config.ami
|
||||||
|
$(call CP.cmd,$<,$@)
|
||||||
@@ -1,5 +1,8 @@
|
|||||||
# Makefile.am to create libw32.a for mingw32 host.
|
# GNU -*-Makefile-*- to build GNU make on POSIX systems
|
||||||
# Copyright (C) 1997-2016 Free Software Foundation, Inc.
|
#
|
||||||
|
# POSIX overrides for use with Basic.mk.
|
||||||
|
#
|
||||||
|
# Copyright (C) 2017-2022 Free Software Foundation, Inc.
|
||||||
# This file is part of GNU Make.
|
# This file is part of GNU Make.
|
||||||
#
|
#
|
||||||
# GNU Make is free software; you can redistribute it and/or modify it under
|
# GNU Make is free software; you can redistribute it and/or modify it under
|
||||||
@@ -13,13 +16,13 @@
|
|||||||
# details.
|
# details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License along with
|
# You should have received a copy of the GNU General Public License along with
|
||||||
# this program. If not, see <http://www.gnu.org/licenses/>.
|
# this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
AUTOMAKE_OPTIONS = subdir-objects
|
# Very little is needed here since the default Basic.mk assumes POSIX
|
||||||
|
|
||||||
noinst_LIBRARIES = libw32.a
|
prog_SOURCES += $(src)/posixos.c
|
||||||
|
|
||||||
libw32_a_SOURCES = subproc/misc.c subproc/sub_proc.c subproc/w32err.c \
|
extra_CPPFLAGS += @GUILE_CFLAGS@
|
||||||
compat/posixfcn.c pathstuff.c w32os.c
|
extra_LDFLAGS += @AM_LDFLAGS@
|
||||||
|
LDLIBS += @LIBOBJS@ @gl_LIBOBS@ @ALLOCA@
|
||||||
libw32_a_CPPFLAGS = -I$(srcdir)/include -I$(srcdir)/subproc -I$(top_srcdir)
|
LDLIBS += @GUILE_LIBS@ @GETLOADAVG_LIBS@ @LIBINTL@ @LIBS@
|
||||||
97
mk/VMS.mk
Normal file
97
mk/VMS.mk
Normal file
@@ -0,0 +1,97 @@
|
|||||||
|
# GNU -*-Makefile-*- to build GNU make on VMS
|
||||||
|
#
|
||||||
|
# VMS overrides for use with Basic.mk.
|
||||||
|
#
|
||||||
|
# Copyright (C) 2017-2022 Free Software Foundation, Inc.
|
||||||
|
# This file is part of GNU Make.
|
||||||
|
#
|
||||||
|
# GNU Make is free software; you can redistribute it and/or modify it under
|
||||||
|
# the terms of the GNU General Public License as published by the Free Software
|
||||||
|
# Foundation; either version 3 of the License, or (at your option) any later
|
||||||
|
# version.
|
||||||
|
#
|
||||||
|
# GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||||
|
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||||
|
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
||||||
|
# details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License along with
|
||||||
|
# this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
src = [.src]
|
||||||
|
lib = [.lib]
|
||||||
|
SRCDIR = []
|
||||||
|
|
||||||
|
OBJEXT = .obj
|
||||||
|
EXEEXT = .exe
|
||||||
|
|
||||||
|
e =
|
||||||
|
s = $e $e
|
||||||
|
c = ,
|
||||||
|
|
||||||
|
defs = HAVE_CONFIG_H
|
||||||
|
|
||||||
|
ifeq ($(CC),cc)
|
||||||
|
defs += VMS unlink=remove allocated_variable_expand_for_file=alloc_var_expand_for_file
|
||||||
|
else
|
||||||
|
defs += GCC_IS_NATIVE
|
||||||
|
ifeq ($(ARCH),VAX)
|
||||||
|
defs += VAX
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
extra_CPPFLAGS = /define=($(subst $s,$c,$(patsubst %,"%",$(defs))))
|
||||||
|
|
||||||
|
cinclude = /nested=none/include=($(src),$(lib))
|
||||||
|
ifeq ($(CC),cc)
|
||||||
|
cprefix = /prefix=(all,except=(glob,globfree))
|
||||||
|
cwarn = /standard=relaxed/warn=(disable=questcompare)
|
||||||
|
endif
|
||||||
|
|
||||||
|
extra_CFLAGS = $(cinclude)$(cprefix)$(cwarn)
|
||||||
|
|
||||||
|
#extra_LDFLAGS = /deb
|
||||||
|
extra_LDFLAGS =
|
||||||
|
|
||||||
|
# If your system needs extra libraries loaded in, define them here.
|
||||||
|
# System V probably need -lPW for alloca.
|
||||||
|
# if on vax, uncomment the following line
|
||||||
|
#LDLIBS = ,c.opt/opt
|
||||||
|
ifeq ($(CC),cc)
|
||||||
|
#LDLIBS =,sys$$library:vaxcrtl.olb/lib
|
||||||
|
else
|
||||||
|
LDLIBS =,gnu_cc_library:libgcc.olb/lib
|
||||||
|
endif
|
||||||
|
|
||||||
|
# If your system doesn't have alloca, or the one provided is bad,
|
||||||
|
# uncomment this
|
||||||
|
#ALLOCA = $(alloca_SOURCES)
|
||||||
|
|
||||||
|
# If your system doesn't have alloca.h, or the one provided is bad,
|
||||||
|
# uncomment this
|
||||||
|
#BUILT_SOURCES += $(lib)alloca.h
|
||||||
|
|
||||||
|
prog_SOURCES += $(ALLOCA) $(glob_SOURCES) $(vms_SOURCES)
|
||||||
|
|
||||||
|
BUILT_SOURCES += $(lib)fnmatch.h $(lib)glob.h
|
||||||
|
|
||||||
|
COMPILE.cmd = $(CC) $(extra_CFLAGS)$(CFLAGS)/obj=$@ $(extra_CPPFLAGS)$(CPPFLAGS) $1
|
||||||
|
|
||||||
|
LINK.cmd = $(LD)$(extra_LDFLAGS)$(LDFLAGS)/exe=$@ $(subst $s,$c,$1)$(LDLIBS)
|
||||||
|
|
||||||
|
# Don't know how to do this
|
||||||
|
CHECK.cmd =
|
||||||
|
|
||||||
|
MKDIR.cmd = create/dir $1
|
||||||
|
RM.cmd = delete $1
|
||||||
|
CP.cmd = copy $1 $2
|
||||||
|
|
||||||
|
define CLEANSPACE
|
||||||
|
-purge [...]
|
||||||
|
-delete $(PROG);
|
||||||
|
-delete $(src)*.$(OBJEXT);
|
||||||
|
endef
|
||||||
|
|
||||||
|
|
||||||
|
$(OUTDIR)$(src)config.h: $(SRCDIR)$(src)config.h-vms
|
||||||
|
$(call CP.cmd,$<,$@)
|
||||||
122
mk/Windows32.mk
Normal file
122
mk/Windows32.mk
Normal file
@@ -0,0 +1,122 @@
|
|||||||
|
# GNU -*-Makefile-*- to build GNU make on Windows
|
||||||
|
#
|
||||||
|
# Windows overrides for use with Basic.mk.
|
||||||
|
#
|
||||||
|
# Copyright (C) 2017-2022 Free Software Foundation, Inc.
|
||||||
|
# This file is part of GNU Make.
|
||||||
|
#
|
||||||
|
# GNU Make is free software; you can redistribute it and/or modify it under
|
||||||
|
# the terms of the GNU General Public License as published by the Free Software
|
||||||
|
# Foundation; either version 3 of the License, or (at your option) any later
|
||||||
|
# version.
|
||||||
|
#
|
||||||
|
# GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||||
|
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||||
|
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
||||||
|
# details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License along with
|
||||||
|
# this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
# TARGET_TYPE can be either "release" or "debug"
|
||||||
|
TARGET_TYPE = release
|
||||||
|
|
||||||
|
# TOOLCHAIN can be either "msvc" or "gcc"
|
||||||
|
TOOLCHAIN = msvc
|
||||||
|
|
||||||
|
# Translate a POSIX path into a Windows path. Don't bother with drives.
|
||||||
|
# Used only inside recipes, with DOS/CMD tools that require it.
|
||||||
|
P2W = $(subst /,\,$1)
|
||||||
|
|
||||||
|
prog_SOURCES += $(loadavg_SOURCES) $(glob_SOURCES) $(w32_SOURCES)
|
||||||
|
|
||||||
|
BUILT_SOURCES += $(lib)alloca.h $(lib)fnmatch.h $(lib)glob.h
|
||||||
|
|
||||||
|
w32_LIBS = kernel32 user32 gdi32 winspool comdlg32 advapi32 shell32 ole32 \
|
||||||
|
oleaut32 uuid odbc32 odbccp32
|
||||||
|
|
||||||
|
CPPFLAGS =
|
||||||
|
CFLAGS =
|
||||||
|
LDFLAGS =
|
||||||
|
|
||||||
|
# --- Visual Studio
|
||||||
|
msvc_CC = cl.exe
|
||||||
|
msvc_LD = link.exe
|
||||||
|
|
||||||
|
msvc_CPPFLAGS = /DHAVE_CONFIG_H /DWINDOWS32 /DWIN32 /D_CONSOLE
|
||||||
|
msvc_CPPFLAGS += /I$(OUTDIR)src /I$(SRCDIR)/src /I$(SRCDIR)/src/w32/include /I$(OUTDIR)lib /I$(SRCDIR)/lib
|
||||||
|
|
||||||
|
msvc_CFLAGS = /nologo /MT /W4 /EHsc
|
||||||
|
msvc_CFLAGS += /FR$(OUTDIR) /Fp$(BASE_PROG).pch /Fd$(BASE_PROG).pdb
|
||||||
|
|
||||||
|
msvc_LDFLAGS = /nologo /SUBSYSTEM:console /PDB:$(BASE_PROG).pdb
|
||||||
|
|
||||||
|
msvc_LDLIBS = $(addsuffix .lib,$(w32_LIBS))
|
||||||
|
|
||||||
|
msvc_C_SOURCE = /c
|
||||||
|
msvc_OUTPUT_OPTION = /Fo$@
|
||||||
|
msvc_LINK_OUTPUT = /OUT:$@
|
||||||
|
|
||||||
|
release_msvc_OUTDIR = ./WinRel/
|
||||||
|
release_msvc_CPPFLAGS = /D NDEBUG
|
||||||
|
release_msvc_CFLAGS = /O2
|
||||||
|
|
||||||
|
debug_msvc_OUTDIR = ./WinDebug/
|
||||||
|
debug_msvc_CPPFLAGS = /D _DEBUG
|
||||||
|
debug_msvc_CFLAGS = /Zi /Od
|
||||||
|
debug_msvc_LDFLAGS = /DEBUG
|
||||||
|
|
||||||
|
# --- GCC
|
||||||
|
gcc_CC = gcc
|
||||||
|
gcc_LD = $(gcc_CC)
|
||||||
|
|
||||||
|
release_gcc_OUTDIR = ./GccRel/
|
||||||
|
debug_gcc_OUTDIR = ./GccDebug/
|
||||||
|
|
||||||
|
gcc_CPPFLAGS = -DHAVE_CONFIG_H -I$(OUTDIR)src -I$(SRCDIR)/src -I$(SRCDIR)/src/w32/include -I$(OUTDIR)lib -I$(SRCDIR)/lib
|
||||||
|
gcc_CFLAGS = -mthreads -Wall -std=gnu99 -gdwarf-2 -g3
|
||||||
|
gcc_LDFLAGS = -mthreads -gdwarf-2 -g3
|
||||||
|
gcc_LDLIBS = $(addprefix -l,$(w32_libs))
|
||||||
|
|
||||||
|
gcc_C_SOURCE = -c
|
||||||
|
gcc_OUTPUT_OPTION = -o $@
|
||||||
|
gcc_LINK_OUTPUT = -o $@
|
||||||
|
|
||||||
|
debug_gcc_CFLAGS = -O0
|
||||||
|
release_gcc_CFLAGS = -O2
|
||||||
|
|
||||||
|
# ---
|
||||||
|
|
||||||
|
LINK.cmd = $(LD) $(extra_LDFLAGS) $(LDFLAGS) $(TARGET_ARCH) $1 $(LDLIBS) $(LINK_OUTPUT)
|
||||||
|
|
||||||
|
CHECK.cmd = cmd /c cd tests \& .\run_make_tests.bat -make ../$(PROG)
|
||||||
|
|
||||||
|
MKDIR.cmd = cmd /c mkdir $(call P2W,$1)
|
||||||
|
RM.cmd = cmd /c del /F /Q $(call P2W,$1)
|
||||||
|
CP.cmd = cmd /c copy /Y $(call P2W,$1 $2)
|
||||||
|
|
||||||
|
CC = $($(TOOLCHAIN)_CC)
|
||||||
|
LD = $($(TOOLCHAIN)_LD)
|
||||||
|
|
||||||
|
C_SOURCE = $($(TOOLCHAIN)_C_SOURCE)
|
||||||
|
OUTPUT_OPTION = $($(TOOLCHAIN)_OUTPUT_OPTION)
|
||||||
|
LINK_OUTPUT = $($(TOOLCHAIN)_LINK_OUTPUT)
|
||||||
|
|
||||||
|
OUTDIR = $($(TARGET_TYPE)_$(TOOLCHAIN)_OUTDIR)
|
||||||
|
|
||||||
|
OBJEXT = obj
|
||||||
|
EXEEXT = .exe
|
||||||
|
|
||||||
|
_CUSTOM = $($(TOOLCHAIN)_$1) $($(TARGET_TYPE)_$1) $($(TARGET_TYPE)_$(TOOLCHAIN)_$1)
|
||||||
|
|
||||||
|
# I'm not sure why this builds gnumake rather than make...?
|
||||||
|
PROG = $(OUTDIR)gnumake$(EXEEXT)
|
||||||
|
BASE_PROG = $(basename $(PROG))
|
||||||
|
|
||||||
|
extra_CPPFLAGS = $(call _CUSTOM,CPPFLAGS)
|
||||||
|
extra_CFLAGS = $(call _CUSTOM,CFLAGS)
|
||||||
|
extra_LDFLAGS = $(call _CUSTOM,LDFLAGS)
|
||||||
|
LDLIBS = $(call _CUSTOM,LDLIBS)
|
||||||
|
|
||||||
|
$(OUTDIR)src/config.h: $(SRCDIR)/src/config.h.W32
|
||||||
|
$(call CP.cmd,$<,$@)
|
||||||
43
mk/msdosdjgpp.mk
Normal file
43
mk/msdosdjgpp.mk
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
# GNU -*-Makefile-*- to build GNU make on MS-DOS with DJGPP
|
||||||
|
#
|
||||||
|
# MS-DOS overrides for use with Basic.mk.
|
||||||
|
#
|
||||||
|
# Copyright (C) 2017-2022 Free Software Foundation, Inc.
|
||||||
|
# This file is part of GNU Make.
|
||||||
|
#
|
||||||
|
# GNU Make is free software; you can redistribute it and/or modify it under
|
||||||
|
# the terms of the GNU General Public License as published by the Free Software
|
||||||
|
# Foundation; either version 3 of the License, or (at your option) any later
|
||||||
|
# version.
|
||||||
|
#
|
||||||
|
# GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||||
|
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||||
|
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
||||||
|
# details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License along with
|
||||||
|
# this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
OBJEXT = o
|
||||||
|
EXEEXT = .exe
|
||||||
|
|
||||||
|
CC = gcc
|
||||||
|
|
||||||
|
# Translate a POSIX path into a Windows path. Don't bother with drives.
|
||||||
|
# Used only inside recipes, with DOS/CMD tools that require it.
|
||||||
|
P2W = $(subst /,\,$1)
|
||||||
|
|
||||||
|
prog_SOURCES += $(loadavg_SOURCES) $(glob_SOURCES)
|
||||||
|
|
||||||
|
BUILT_SOURCES += $(lib)alloca.h $(lib)fnmatch.h $(lib)glob.h
|
||||||
|
|
||||||
|
INCLUDEDIR = c:/djgpp/include
|
||||||
|
LIBDIR = c:/djgpp/lib
|
||||||
|
LOCALEDIR = c:/djgpp/share
|
||||||
|
|
||||||
|
MKDIR.cmd = command.com /c mkdir $(call P2W,$1)
|
||||||
|
RM.cmd = command.com /c del /F /Q $(call P2W,$1)
|
||||||
|
CP.cmd = command.com /c copy /Y $(call P2W,$1 $2)
|
||||||
|
|
||||||
|
$(OUTDIR)src/config.h: $(SRCDIR)/src/configh.dos
|
||||||
|
$(call CP.cmd,$<,$@)
|
||||||
84
os.h
84
os.h
@@ -1,84 +0,0 @@
|
|||||||
/* Declarations for operating system interfaces for GNU Make.
|
|
||||||
Copyright (C) 2016 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 <http://www.gnu.org/licenses/>. */
|
|
||||||
|
|
||||||
|
|
||||||
/* This section provides OS-specific functions to support the jobserver. */
|
|
||||||
|
|
||||||
#ifdef MAKE_JOBSERVER
|
|
||||||
|
|
||||||
/* Returns 1 if the jobserver is enabled, else 0. */
|
|
||||||
unsigned int jobserver_enabled ();
|
|
||||||
|
|
||||||
/* Called in the master instance to set up the jobserver initially. */
|
|
||||||
unsigned int jobserver_setup (int job_slots);
|
|
||||||
|
|
||||||
/* Called in a child instance to connect to the jobserver. */
|
|
||||||
unsigned int jobserver_parse_auth (const char* auth);
|
|
||||||
|
|
||||||
/* Returns an allocated buffer used to pass to child instances. */
|
|
||||||
char *jobserver_get_auth ();
|
|
||||||
|
|
||||||
/* Clear this instance's jobserver configuration. */
|
|
||||||
void jobserver_clear ();
|
|
||||||
|
|
||||||
/* Recover all the jobserver tokens and return the number we got. */
|
|
||||||
unsigned int jobserver_acquire_all ();
|
|
||||||
|
|
||||||
/* Release a jobserver token. If it fails and is_fatal is 1, fatal. */
|
|
||||||
void jobserver_release (int is_fatal);
|
|
||||||
|
|
||||||
/* Notify the jobserver that a child exited. */
|
|
||||||
void jobserver_signal ();
|
|
||||||
|
|
||||||
/* Get ready to start a non-recursive child. */
|
|
||||||
void jobserver_pre_child ();
|
|
||||||
|
|
||||||
/* Complete starting a non-recursive child. */
|
|
||||||
void jobserver_post_child ();
|
|
||||||
|
|
||||||
/* Set up to acquire a new token. */
|
|
||||||
void jobserver_pre_acquire ();
|
|
||||||
|
|
||||||
/* Wait until we can acquire a jobserver token.
|
|
||||||
TIMEOUT is 1 if we have other jobs waiting for the load to go down;
|
|
||||||
in this case we won't wait forever, so we can check the load.
|
|
||||||
Returns 1 if we got a token, or 0 if we stopped waiting due to a child
|
|
||||||
exiting or a timeout. */
|
|
||||||
unsigned int jobserver_acquire (int timeout);
|
|
||||||
|
|
||||||
#else
|
|
||||||
|
|
||||||
#define jobserver_enabled() (0)
|
|
||||||
#define jobserver_setup(_slots) (0)
|
|
||||||
#define jobserver_parse_auth(_auth) (0)
|
|
||||||
#define jobserver_get_auth() (NULL)
|
|
||||||
#define jobserver_clear() (void)(0)
|
|
||||||
#define jobserver_release(_fatal) (void)(0)
|
|
||||||
#define jobserver_acquire_all() (0)
|
|
||||||
#define jobserver_signal() (void)(0)
|
|
||||||
#define jobserver_pre_child(_r) (void)(0)
|
|
||||||
#define jobserver_post_child(_r) (void)(0)
|
|
||||||
#define jobserver_pre_acquire() (void)(0)
|
|
||||||
#define jobserver_acquire(_tmout) (0)
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Create a "bad" file descriptor for stdin when parallel jobs are run. */
|
|
||||||
#if !defined(VMD) && !defined(WINDOWS32) && !defined(_AMIGA) && !defined(__MSDOS__)
|
|
||||||
int get_bad_stdin ();
|
|
||||||
#else
|
|
||||||
# define get_bad_stdin() (-1)
|
|
||||||
#endif
|
|
||||||
19
po/.gitignore
vendored
19
po/.gitignore
vendored
@@ -1,15 +1,4 @@
|
|||||||
Makefile.in.in
|
*
|
||||||
Makevars.template
|
!.gitignore
|
||||||
POTFILES
|
!LINGUAS
|
||||||
Rules-quot
|
!POTFILES.in
|
||||||
boldquot.sed
|
|
||||||
en@boldquot.header
|
|
||||||
en@quot.header
|
|
||||||
insert-header.sin
|
|
||||||
make.pot
|
|
||||||
quot.sed
|
|
||||||
remove-potcdate.sin
|
|
||||||
remove-potcdate.sed
|
|
||||||
stamp-po
|
|
||||||
*.gmo
|
|
||||||
*.po
|
|
||||||
|
|||||||
35
po/LINGUAS
35
po/LINGUAS
@@ -1,5 +1,30 @@
|
|||||||
# Set of available languages: 25 languages
|
be
|
||||||
|
bg
|
||||||
be cs da de es fi fr ga gl he hr id it ja ko lt nl pl pt_BR ru sv tr uk vi zh_CN
|
cs
|
||||||
|
da
|
||||||
# Can't seem to get en@quot and en@boldquot to build properly?
|
de
|
||||||
|
es
|
||||||
|
fi
|
||||||
|
fr
|
||||||
|
ga
|
||||||
|
gl
|
||||||
|
he
|
||||||
|
hr
|
||||||
|
id
|
||||||
|
it
|
||||||
|
ja
|
||||||
|
ko
|
||||||
|
lt
|
||||||
|
nl
|
||||||
|
pl
|
||||||
|
pt
|
||||||
|
pt_BR
|
||||||
|
ro
|
||||||
|
ru
|
||||||
|
sr
|
||||||
|
sv
|
||||||
|
tr
|
||||||
|
uk
|
||||||
|
vi
|
||||||
|
zh_CN
|
||||||
|
zh_TW
|
||||||
|
|||||||
59
po/Makevars
59
po/Makevars
@@ -1,59 +0,0 @@
|
|||||||
# This is a -*-Makefile-*-
|
|
||||||
# Copyright (C) 2002-2016 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 <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
|
|
||||||
# Makefile variables for PO directory in any package using GNU gettext.
|
|
||||||
|
|
||||||
# Usually the message domain is the same as the package name.
|
|
||||||
DOMAIN = $(PACKAGE)
|
|
||||||
|
|
||||||
# These two variables depend on the location of this directory.
|
|
||||||
subdir = po
|
|
||||||
top_builddir = ..
|
|
||||||
|
|
||||||
# These options get passed to xgettext.
|
|
||||||
XGETTEXT_OPTIONS = --keyword=_ --keyword=N_
|
|
||||||
|
|
||||||
# This is the copyright holder that gets inserted into the header of the
|
|
||||||
# $(DOMAIN).pot file. Set this to the copyright holder of the surrounding
|
|
||||||
# package. (Note that the msgstr strings, extracted from the package's
|
|
||||||
# sources, belong to the copyright holder of the package.) Translators are
|
|
||||||
# expected to transfer the copyright for their translations to this person
|
|
||||||
# or entity, or to disclaim their copyright. The empty string stands for
|
|
||||||
# the public domain; in this case the translators are expected to disclaim
|
|
||||||
# their copyright.
|
|
||||||
COPYRIGHT_HOLDER = Free Software Foundation, Inc.
|
|
||||||
|
|
||||||
# This is the email address or URL to which the translators shall report
|
|
||||||
# bugs in the untranslated strings:
|
|
||||||
# - Strings which are not entire sentences, see the maintainer guidelines
|
|
||||||
# in the GNU gettext documentation, section 'Preparing Strings'.
|
|
||||||
# - Strings which use unclear terms or require additional context to be
|
|
||||||
# understood.
|
|
||||||
# - Strings which make invalid assumptions about notation of date, time or
|
|
||||||
# money.
|
|
||||||
# - Pluralisation problems.
|
|
||||||
# - Incorrect English spelling.
|
|
||||||
# - Incorrect formatting.
|
|
||||||
# It can be your email address, or a mailing list address where translators
|
|
||||||
# can write to without being subscribed, or the URL of a web page through
|
|
||||||
# which the translators can contact you.
|
|
||||||
MSGID_BUGS_ADDRESS = bug-make@gnu.org
|
|
||||||
|
|
||||||
# This is the list of locale categories, beyond LC_MESSAGES, for which the
|
|
||||||
# message catalogs shall be used. It is usually empty.
|
|
||||||
EXTRA_LOCALE_CATEGORIES =
|
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
# List of source files containing translatable strings.
|
# List of source files containing translatable strings.
|
||||||
# Copyright (C) 2000-2016 Free Software Foundation, Inc.
|
# Copyright (C) 2000-2022 Free Software Foundation, Inc.
|
||||||
# This file is part of GNU Make.
|
# This file is part of GNU Make.
|
||||||
#
|
#
|
||||||
# GNU Make is free software; you can redistribute it and/or modify it under
|
# GNU Make is free software; you can redistribute it and/or modify it under
|
||||||
@@ -13,35 +13,36 @@
|
|||||||
# details.
|
# details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License along with
|
# You should have received a copy of the GNU General Public License along with
|
||||||
# this program. If not, see <http://www.gnu.org/licenses/>.
|
# this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
ar.c
|
src/ar.c
|
||||||
arscan.c
|
src/arscan.c
|
||||||
commands.c
|
src/commands.c
|
||||||
dir.c
|
src/dir.c
|
||||||
expand.c
|
src/expand.c
|
||||||
file.c
|
src/file.c
|
||||||
function.c
|
src/function.c
|
||||||
getopt.c
|
src/getopt.c
|
||||||
guile.c
|
src/guile.c
|
||||||
hash.c
|
src/hash.c
|
||||||
implicit.c
|
src/implicit.c
|
||||||
job.c
|
src/job.c
|
||||||
job.h
|
src/load.c
|
||||||
load.c
|
src/main.c
|
||||||
main.c
|
src/misc.c
|
||||||
misc.c
|
src/output.c
|
||||||
output.c
|
src/output.h
|
||||||
posixos.c
|
src/posixos.c
|
||||||
read.c
|
src/read.c
|
||||||
remake.c
|
src/remake.c
|
||||||
remote-cstms.c
|
src/remote-cstms.c
|
||||||
rule.c
|
src/rule.c
|
||||||
signame.c
|
src/shuffle.c
|
||||||
strcache.c
|
src/signame.c
|
||||||
variable.c
|
src/strcache.c
|
||||||
variable.h
|
src/variable.c
|
||||||
vmsfunctions.c
|
src/variable.h
|
||||||
vmsjobs.c
|
src/vmsfunctions.c
|
||||||
vpath.c
|
src/vmsjobs.c
|
||||||
w32/w32os.c
|
src/vpath.c
|
||||||
|
src/w32/w32os.c
|
||||||
|
|||||||
428
posixos.c
428
posixos.c
@@ -1,428 +0,0 @@
|
|||||||
/* POSIX-based operating system interface for GNU Make.
|
|
||||||
Copyright (C) 2016 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 <http://www.gnu.org/licenses/>. */
|
|
||||||
|
|
||||||
#include "makeint.h"
|
|
||||||
|
|
||||||
#include <stdio.h>
|
|
||||||
|
|
||||||
#ifdef HAVE_FCNTL_H
|
|
||||||
# include <fcntl.h>
|
|
||||||
#endif
|
|
||||||
#if defined(HAVE_PSELECT) && defined(HAVE_SYS_SELECT_H)
|
|
||||||
# include <sys/select.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "debug.h"
|
|
||||||
#include "job.h"
|
|
||||||
#include "os.h"
|
|
||||||
|
|
||||||
#ifdef MAKE_JOBSERVER
|
|
||||||
|
|
||||||
/* This section provides OS-specific functions to support the jobserver. */
|
|
||||||
|
|
||||||
/* These track the state of the jobserver pipe. Passed to child instances. */
|
|
||||||
static int job_fds[2] = { -1, -1 };
|
|
||||||
|
|
||||||
/* Used to signal read() that a SIGCHLD happened. Always CLOEXEC.
|
|
||||||
If we use pselect() this will never be created and always -1.
|
|
||||||
*/
|
|
||||||
static int job_rfd = -1;
|
|
||||||
|
|
||||||
/* Token written to the pipe (could be any character...) */
|
|
||||||
static char token = '+';
|
|
||||||
|
|
||||||
static int
|
|
||||||
make_job_rfd ()
|
|
||||||
{
|
|
||||||
#ifdef HAVE_PSELECT
|
|
||||||
/* Pretend we succeeded. */
|
|
||||||
return 0;
|
|
||||||
#else
|
|
||||||
EINTRLOOP (job_rfd, dup (job_fds[0]));
|
|
||||||
if (job_rfd >= 0)
|
|
||||||
CLOSE_ON_EXEC (job_rfd);
|
|
||||||
|
|
||||||
return job_rfd;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
unsigned int
|
|
||||||
jobserver_setup (int slots)
|
|
||||||
{
|
|
||||||
int r;
|
|
||||||
|
|
||||||
EINTRLOOP (r, pipe (job_fds));
|
|
||||||
if (r < 0)
|
|
||||||
pfatal_with_name (_("creating jobs pipe"));
|
|
||||||
|
|
||||||
if (make_job_rfd () < 0)
|
|
||||||
pfatal_with_name (_("duping jobs pipe"));
|
|
||||||
|
|
||||||
while (slots--)
|
|
||||||
{
|
|
||||||
EINTRLOOP (r, write (job_fds[1], &token, 1));
|
|
||||||
if (r != 1)
|
|
||||||
pfatal_with_name (_("init jobserver pipe"));
|
|
||||||
}
|
|
||||||
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
unsigned int
|
|
||||||
jobserver_parse_auth (const char *auth)
|
|
||||||
{
|
|
||||||
/* Given the command-line parameter, parse it. */
|
|
||||||
if (sscanf (auth, "%d,%d", &job_fds[0], &job_fds[1]) != 2)
|
|
||||||
OS (fatal, NILF,
|
|
||||||
_("internal error: invalid --jobserver-auth string '%s'"), auth);
|
|
||||||
|
|
||||||
DB (DB_JOBS,
|
|
||||||
(_("Jobserver client (fds %d,%d)\n"), job_fds[0], job_fds[1]));
|
|
||||||
|
|
||||||
#ifdef HAVE_FCNTL_H
|
|
||||||
# define FD_OK(_f) (fcntl ((_f), F_GETFD) != -1)
|
|
||||||
#else
|
|
||||||
# define FD_OK(_f) 1
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Make sure our pipeline is valid, and (possibly) create a duplicate pipe,
|
|
||||||
that will be closed in the SIGCHLD handler. If this fails with EBADF,
|
|
||||||
the parent has closed the pipe on us because it didn't think we were a
|
|
||||||
submake. If so, warn and default to -j1. */
|
|
||||||
|
|
||||||
if (!FD_OK (job_fds[0]) || !FD_OK (job_fds[1]) || make_job_rfd () < 0)
|
|
||||||
{
|
|
||||||
if (errno != EBADF)
|
|
||||||
pfatal_with_name (_("jobserver pipeline"));
|
|
||||||
|
|
||||||
job_fds[0] = job_fds[1] = -1;
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
char *
|
|
||||||
jobserver_get_auth ()
|
|
||||||
{
|
|
||||||
char *auth = xmalloc ((INTSTR_LENGTH * 2) + 2);
|
|
||||||
sprintf (auth, "%d,%d", job_fds[0], job_fds[1]);
|
|
||||||
return auth;
|
|
||||||
}
|
|
||||||
|
|
||||||
unsigned int
|
|
||||||
jobserver_enabled ()
|
|
||||||
{
|
|
||||||
return job_fds[0] >= 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
jobserver_clear ()
|
|
||||||
{
|
|
||||||
if (job_fds[0] >= 0)
|
|
||||||
close (job_fds[0]);
|
|
||||||
if (job_fds[1] >= 0)
|
|
||||||
close (job_fds[1]);
|
|
||||||
if (job_rfd >= 0)
|
|
||||||
close (job_rfd);
|
|
||||||
|
|
||||||
job_fds[0] = job_fds[1] = job_rfd = -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
jobserver_release (int is_fatal)
|
|
||||||
{
|
|
||||||
int r;
|
|
||||||
EINTRLOOP (r, write (job_fds[1], &token, 1));
|
|
||||||
if (r != 1)
|
|
||||||
{
|
|
||||||
if (is_fatal)
|
|
||||||
pfatal_with_name (_("write jobserver"));
|
|
||||||
perror_with_name ("write", "");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
unsigned int
|
|
||||||
jobserver_acquire_all ()
|
|
||||||
{
|
|
||||||
unsigned int tokens = 0;
|
|
||||||
|
|
||||||
/* Close the write side, so the read() won't hang. */
|
|
||||||
close (job_fds[1]);
|
|
||||||
job_fds[1] = -1;
|
|
||||||
|
|
||||||
while (1)
|
|
||||||
{
|
|
||||||
char intake;
|
|
||||||
int r;
|
|
||||||
EINTRLOOP (r, read (job_fds[0], &intake, 1));
|
|
||||||
if (r != 1)
|
|
||||||
return tokens;
|
|
||||||
++tokens;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Prepare the jobserver to start a child process. */
|
|
||||||
void
|
|
||||||
jobserver_pre_child (int recursive)
|
|
||||||
{
|
|
||||||
/* If it's not a recursive make, avoid polutting the jobserver pipes. */
|
|
||||||
if (!recursive && job_fds[0] >= 0)
|
|
||||||
{
|
|
||||||
CLOSE_ON_EXEC (job_fds[0]);
|
|
||||||
CLOSE_ON_EXEC (job_fds[1]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
jobserver_post_child (int recursive)
|
|
||||||
{
|
|
||||||
#if defined(F_GETFD) && defined(F_SETFD)
|
|
||||||
if (!recursive && job_fds[0] >= 0)
|
|
||||||
for (int i = 0; i < 2; ++i)
|
|
||||||
{
|
|
||||||
int flags;
|
|
||||||
EINTRLOOP (flags, fcntl (job_fds[i], F_GETFD));
|
|
||||||
if (flags >= 0)
|
|
||||||
{
|
|
||||||
int r;
|
|
||||||
EINTRLOOP (r, fcntl (job_fds[i], F_SETFD, flags & ~FD_CLOEXEC));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
jobserver_signal ()
|
|
||||||
{
|
|
||||||
if (job_rfd >= 0)
|
|
||||||
{
|
|
||||||
close (job_rfd);
|
|
||||||
job_rfd = -1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
jobserver_pre_acquire ()
|
|
||||||
{
|
|
||||||
/* Make sure we have a dup'd FD. */
|
|
||||||
if (job_rfd < 0 && job_fds[0] >= 0 && make_job_rfd () < 0)
|
|
||||||
pfatal_with_name (_("duping jobs pipe"));
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef HAVE_PSELECT
|
|
||||||
|
|
||||||
/* Use pselect() to atomically wait for both a signal and a file descriptor.
|
|
||||||
It also provides a timeout facility so we don't need to use SIGALRM.
|
|
||||||
|
|
||||||
This method relies on the fact that SIGCHLD will be blocked everywhere,
|
|
||||||
and only unblocked (atomically) within the pselect() call, so we can
|
|
||||||
never miss a SIGCHLD.
|
|
||||||
*/
|
|
||||||
unsigned int
|
|
||||||
jobserver_acquire (int timeout)
|
|
||||||
{
|
|
||||||
sigset_t empty;
|
|
||||||
fd_set readfds;
|
|
||||||
struct timespec spec;
|
|
||||||
struct timespec *specp = NULL;
|
|
||||||
int r;
|
|
||||||
char intake;
|
|
||||||
|
|
||||||
sigemptyset (&empty);
|
|
||||||
|
|
||||||
FD_ZERO (&readfds);
|
|
||||||
FD_SET (job_fds[0], &readfds);
|
|
||||||
|
|
||||||
if (timeout)
|
|
||||||
{
|
|
||||||
/* Alarm after one second (is this too granular?) */
|
|
||||||
spec.tv_sec = 1;
|
|
||||||
spec.tv_nsec = 0;
|
|
||||||
specp = &spec;
|
|
||||||
}
|
|
||||||
|
|
||||||
r = pselect (job_fds[0]+1, &readfds, NULL, NULL, specp, &empty);
|
|
||||||
|
|
||||||
if (r == -1)
|
|
||||||
{
|
|
||||||
/* Better be SIGCHLD. */
|
|
||||||
if (errno != EINTR)
|
|
||||||
pfatal_with_name (_("pselect jobs pipe"));
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (r == 0)
|
|
||||||
/* Timeout. */
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
/* The read FD is ready: read it! */
|
|
||||||
EINTRLOOP (r, read (job_fds[0], &intake, 1));
|
|
||||||
if (r < 0)
|
|
||||||
pfatal_with_name (_("read jobs pipe"));
|
|
||||||
|
|
||||||
/* What does it mean if read() returns 0? It shouldn't happen because only
|
|
||||||
the master make can reap all the tokens and close the write side...?? */
|
|
||||||
return r > 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
#else
|
|
||||||
|
|
||||||
/* This method uses a "traditional" UNIX model for waiting on both a signal
|
|
||||||
and a file descriptor. However, it's complex and since we have a SIGCHLD
|
|
||||||
handler installed we need to check ALL system calls for EINTR: painful!
|
|
||||||
|
|
||||||
Read a token. As long as there's no token available we'll block. We
|
|
||||||
enable interruptible system calls before the read(2) so that if we get a
|
|
||||||
SIGCHLD while we're waiting, we'll return with EINTR and we can process the
|
|
||||||
death(s) and return tokens to the free pool.
|
|
||||||
|
|
||||||
Once we return from the read, we immediately reinstate restartable system
|
|
||||||
calls. This allows us to not worry about checking for EINTR on all the
|
|
||||||
other system calls in the program.
|
|
||||||
|
|
||||||
There is one other twist: there is a span between the time reap_children()
|
|
||||||
does its last check for dead children and the time the read(2) call is
|
|
||||||
entered, below, where if a child dies we won't notice. This is extremely
|
|
||||||
serious as it could cause us to deadlock, given the right set of events.
|
|
||||||
|
|
||||||
To avoid this, we do the following: before we reap_children(), we dup(2)
|
|
||||||
the read FD on the jobserver pipe. The read(2) call below uses that new
|
|
||||||
FD. In the signal handler, we close that FD. That way, if a child dies
|
|
||||||
during the section mentioned above, the read(2) will be invoked with an
|
|
||||||
invalid FD and will return immediately with EBADF. */
|
|
||||||
|
|
||||||
static RETSIGTYPE
|
|
||||||
job_noop (int sig UNUSED)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Set the child handler action flags to FLAGS. */
|
|
||||||
static void
|
|
||||||
set_child_handler_action_flags (int set_handler, int set_alarm)
|
|
||||||
{
|
|
||||||
struct sigaction sa;
|
|
||||||
|
|
||||||
#ifdef __EMX__
|
|
||||||
/* The child handler must be turned off here. */
|
|
||||||
signal (SIGCHLD, SIG_DFL);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
memset (&sa, '\0', sizeof sa);
|
|
||||||
sa.sa_handler = child_handler;
|
|
||||||
sa.sa_flags = set_handler ? 0 : SA_RESTART;
|
|
||||||
|
|
||||||
#if defined SIGCHLD
|
|
||||||
if (sigaction (SIGCHLD, &sa, NULL) < 0)
|
|
||||||
pfatal_with_name ("sigaction: SIGCHLD");
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined SIGCLD && SIGCLD != SIGCHLD
|
|
||||||
if (sigaction (SIGCLD, &sa, NULL) < 0)
|
|
||||||
pfatal_with_name ("sigaction: SIGCLD");
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined SIGALRM
|
|
||||||
if (set_alarm)
|
|
||||||
{
|
|
||||||
/* If we're about to enter the read(), set an alarm to wake up in a
|
|
||||||
second so we can check if the load has dropped and we can start more
|
|
||||||
work. On the way out, turn off the alarm and set SIG_DFL. */
|
|
||||||
if (set_handler)
|
|
||||||
{
|
|
||||||
sa.sa_handler = job_noop;
|
|
||||||
sa.sa_flags = 0;
|
|
||||||
if (sigaction (SIGALRM, &sa, NULL) < 0)
|
|
||||||
pfatal_with_name ("sigaction: SIGALRM");
|
|
||||||
alarm (1);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
alarm (0);
|
|
||||||
sa.sa_handler = SIG_DFL;
|
|
||||||
sa.sa_flags = 0;
|
|
||||||
if (sigaction (SIGALRM, &sa, NULL) < 0)
|
|
||||||
pfatal_with_name ("sigaction: SIGALRM");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
unsigned int
|
|
||||||
jobserver_acquire (int timeout)
|
|
||||||
{
|
|
||||||
char intake;
|
|
||||||
int got_token;
|
|
||||||
int saved_errno;
|
|
||||||
|
|
||||||
/* Set interruptible system calls, and read() for a job token. */
|
|
||||||
set_child_handler_action_flags (1, timeout);
|
|
||||||
|
|
||||||
EINTRLOOP (got_token, read (job_rfd, &intake, 1));
|
|
||||||
saved_errno = errno;
|
|
||||||
|
|
||||||
set_child_handler_action_flags (0, timeout);
|
|
||||||
|
|
||||||
if (got_token == 1)
|
|
||||||
return 1;
|
|
||||||
|
|
||||||
/* If the error _wasn't_ expected (EINTR or EBADF), fatal. Otherwise,
|
|
||||||
go back and reap_children(), and try again. */
|
|
||||||
errno = saved_errno;
|
|
||||||
|
|
||||||
if (errno != EINTR && errno != EBADF)
|
|
||||||
pfatal_with_name (_("read jobs pipe"));
|
|
||||||
|
|
||||||
if (errno == EBADF)
|
|
||||||
DB (DB_JOBS, ("Read returned EBADF.\n"));
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* MAKE_JOBSERVER */
|
|
||||||
|
|
||||||
/* Create a "bad" file descriptor for stdin when parallel jobs are run. */
|
|
||||||
int
|
|
||||||
get_bad_stdin ()
|
|
||||||
{
|
|
||||||
static int bad_stdin = -1;
|
|
||||||
|
|
||||||
/* Set up a bad standard input that reads from a broken pipe. */
|
|
||||||
|
|
||||||
if (bad_stdin == -1)
|
|
||||||
{
|
|
||||||
/* Make a file descriptor that is the read end of a broken pipe.
|
|
||||||
This will be used for some children's standard inputs. */
|
|
||||||
int pd[2];
|
|
||||||
if (pipe (pd) == 0)
|
|
||||||
{
|
|
||||||
/* Close the write side. */
|
|
||||||
(void) close (pd[1]);
|
|
||||||
/* Save the read side. */
|
|
||||||
bad_stdin = pd[0];
|
|
||||||
|
|
||||||
/* Set the descriptor to close on exec, so it does not litter any
|
|
||||||
child's descriptor table. When it is dup2'd onto descriptor 0,
|
|
||||||
that descriptor will not close on exec. */
|
|
||||||
CLOSE_ON_EXEC (bad_stdin);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return bad_stdin;
|
|
||||||
}
|
|
||||||
@@ -4,28 +4,27 @@ $!
|
|||||||
$! This is used for building off the master instead of a release tarball.
|
$! This is used for building off the master instead of a release tarball.
|
||||||
$!
|
$!
|
||||||
$!
|
$!
|
||||||
$!
|
|
||||||
$! First try ODS-5, Pathworks V6 or UNZIP name.
|
$! First try ODS-5, Pathworks V6 or UNZIP name.
|
||||||
$!
|
$!
|
||||||
$ config_template = f$search("sys$disk:[]config*h-vms.template")
|
$ config_template = f$search("sys$disk:[.src]mkconfig*h.in")
|
||||||
$ if config_template .eqs. ""
|
$ if config_template .eqs. ""
|
||||||
$ then
|
$ then
|
||||||
$!
|
$!
|
||||||
$! Try NFS, VMStar, or Pathworks V5 ODS-2 encoded name.
|
$! Try NFS, VMStar, or Pathworks V5 ODS-2 encoded name.
|
||||||
$!
|
$!
|
||||||
$ config_template = f$search("sys$disk:[]config.h-vms*template")
|
$ config_template = f$search("sys$disk:[.src]mkconfig.h*in")
|
||||||
$ if config_template .eqs. ""
|
$ if config_template .eqs. ""
|
||||||
$ then
|
$ then
|
||||||
$ write sys$output "Could not find config.h-vms*template!"
|
$ write sys$output "Could not find mkconfig.h.in!"
|
||||||
$ exit 44
|
$ exit 44
|
||||||
$ endif
|
$ endif
|
||||||
$ endif
|
$ endif
|
||||||
$ config_template_file = f$parse(config_template,,,"name")
|
$ config_template_file = f$parse(config_template,,,"name")
|
||||||
$ config_template_type = f$parse(config_template,,,"type")
|
$ config_template_type = f$parse(config_template,,,"type")
|
||||||
$ config_template = "sys$disk:[]" + config_template_file + config_template_type
|
$ config_template = "sys$disk:[.src]" + config_template_file + config_template_type
|
||||||
$!
|
$!
|
||||||
$!
|
$!
|
||||||
$! Pull the package and version from configure.ac
|
$! Pull the version from configure.ac
|
||||||
$!
|
$!
|
||||||
$ open/read ac_file sys$disk:[]configure.ac
|
$ open/read ac_file sys$disk:[]configure.ac
|
||||||
$ac_read_loop:
|
$ac_read_loop:
|
||||||
@@ -39,21 +38,26 @@ $ version = f$element (0,"]",version)
|
|||||||
$ac_read_loop_end:
|
$ac_read_loop_end:
|
||||||
$ close ac_file
|
$ close ac_file
|
||||||
$!
|
$!
|
||||||
$ if (package .eqs. "") .or. (version .eqs. "")
|
$ if (version .eqs. "")
|
||||||
$ then
|
$ then
|
||||||
$ write sys$output "Unable to determine package and/or version!"
|
$ write sys$output "Unable to determine version!"
|
||||||
$ exit 44
|
$ exit 44
|
||||||
$ endif
|
$ endif
|
||||||
$!
|
$!
|
||||||
$!
|
$!
|
||||||
$ outfile = "sys$disk:[]config.h-vms"
|
$ outfile = "sys$disk:[.src]mkconfig.h"
|
||||||
$!
|
$!
|
||||||
$! Note the pipe command is close to the length of 255, which is the
|
$! Note the pipe command is close to the length of 255, which is the
|
||||||
$! maximum token length prior to VMS V8.2:
|
$! maximum token length prior to VMS V8.2:
|
||||||
$! %DCL-W-TKNOVF, command element is too long - shorten
|
$! %DCL-W-TKNOVF, command element is too long - shorten
|
||||||
$ pipe (write sys$output "sub/%PACKAGE%/''package'/WHOLE/NOTYPE" ;-
|
$! PDS: Blown out; someone else will have to figure this out
|
||||||
write sys$output "sub/%VERSION%/''version'/WHOLE/NOTYPE" ;-
|
$ pipe (write sys$output "sub,@PACKAGE@,make,WHOLE/NOTYPE" ;-
|
||||||
|
write sys$output "sub,@PACKAGE_BUGREPORT@,bug-make@gnu.org,WHOLE/NOTYPE" ;-
|
||||||
|
write sys$output "sub,@PACKAGE_NAME@,GNU Make,WHOLE/NOTYPE" ;-
|
||||||
|
write sys$output "sub,@PACKAGE_TARNAME@,make,WHOLE/NOTYPE" ;-
|
||||||
|
write sys$output "sub,@PACKAGE_URL@,https://www.gnu.org/software/make/,WHOLE/NOTYPE" ;-
|
||||||
|
write sys$output "sub,@PACKAGE_VERSION@,''version',WHOLE/NOTYPE" ;-
|
||||||
write sys$output "exit") |-
|
write sys$output "exit") |-
|
||||||
edit/edt 'config_template'/out='outfile'/command=sys$pipe >nla0:
|
edit/edt 'config_template'/out='outfile'/command=sys$pipe >nla0:
|
||||||
$!
|
$!
|
||||||
$ write sys$output package, ", version: ", version, " prepared for VMS"
|
$ write sys$output "GNU Make version: ", version, " prepared for VMS"
|
||||||
|
|||||||
@@ -1,6 +0,0 @@
|
|||||||
@echo off
|
|
||||||
@echo Windows32 SCM build preparation of config.h.W32 and NMakefile.
|
|
||||||
if not exist config.h.W32 copy config.h.W32.template config.h.W32
|
|
||||||
if not exist config.h copy config.h.W32 config.h
|
|
||||||
if not exist NMakefile copy NMakefile.template NMakefile
|
|
||||||
@echo Preparation complete. Run build_w32.bat to compile and link.
|
|
||||||
63
scripts/copyright-update
Executable file
63
scripts/copyright-update
Executable file
@@ -0,0 +1,63 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
#
|
||||||
|
# Copyright (C) 2014-2022 Free Software Foundation, Inc.
|
||||||
|
# This file is part of GNU Make.
|
||||||
|
#
|
||||||
|
# Update GNU make copyrights using gnulib update-copyright
|
||||||
|
|
||||||
|
EXCLUDE='^\(\.[a-z].*\|.*/\.[a-z].*\|.*COPYING\|src/hash\.[ch]\|ChangeLog.*\|.*/ChangeLog.*\|INSTALL\|doc/make\.texi\|bootstrap\)$'
|
||||||
|
|
||||||
|
update=${UPDATE_COPYRIGHT:-${GNULIB_SRCDIR:-../../gnulib}/build-aux/update-copyright}
|
||||||
|
|
||||||
|
die () { echo "$*"; exit 1; }
|
||||||
|
|
||||||
|
getfiles () {
|
||||||
|
git ls-files | grep -v "$EXCLUDE"
|
||||||
|
}
|
||||||
|
|
||||||
|
run () {
|
||||||
|
cmd=$(command -v "$update") || die "Cannot locate update-copyright ($update)"
|
||||||
|
test -x "$cmd" || die "Cannot locate update-copyright ($update)"
|
||||||
|
|
||||||
|
force=false
|
||||||
|
|
||||||
|
case $1 in
|
||||||
|
(-v) getfiles | sort; exit 0 ;;
|
||||||
|
(-f) force=true ;;
|
||||||
|
(--) : ;;
|
||||||
|
(-*) echo "usage: $0 [-v]"; exit 1 ;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
if $force; then
|
||||||
|
: just do it
|
||||||
|
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
|
||||||
|
|
||||||
|
# We use intervals
|
||||||
|
export UPDATE_COPYRIGHT_USE_INTERVALS=1
|
||||||
|
|
||||||
|
"$cmd" $(getfiles)
|
||||||
|
|
||||||
|
echo "*** Update doc/make.texi copyright by hand!"
|
||||||
|
echo "*** Update src/main.c:print_version() copyright by hand!"
|
||||||
|
|
||||||
|
exit 0
|
||||||
|
}
|
||||||
|
|
||||||
|
run "$@"
|
||||||
|
|
||||||
|
# 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/>.
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
/* Running commands on Amiga
|
/* Running commands on Amiga
|
||||||
Copyright (C) 1995-2016 Free Software Foundation, Inc.
|
Copyright (C) 1995-2022 Free Software Foundation, Inc.
|
||||||
This file is part of GNU Make.
|
This file is part of GNU Make.
|
||||||
|
|
||||||
GNU Make is free software; you can redistribute it and/or modify it under the
|
GNU Make is free software; you can redistribute it and/or modify it under the
|
||||||
@@ -12,7 +12,7 @@ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|||||||
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License along with
|
You should have received a copy of the GNU General Public License along with
|
||||||
this program. If not, see <http://www.gnu.org/licenses/>. */
|
this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||||
|
|
||||||
#include "makeint.h"
|
#include "makeint.h"
|
||||||
#include "variable.h"
|
#include "variable.h"
|
||||||
@@ -42,7 +42,7 @@ MyExecute (char **argv)
|
|||||||
buffer = AllocMem (len, MEMF_ANY);
|
buffer = AllocMem (len, MEMF_ANY);
|
||||||
|
|
||||||
if (!buffer)
|
if (!buffer)
|
||||||
O (fatal, NILF, "MyExecute: Cannot allocate space for calling a command\n");
|
O (fatal, NILF, "MyExecute: Cannot allocate space for calling a command");
|
||||||
|
|
||||||
ptr = buffer;
|
ptr = buffer;
|
||||||
|
|
||||||
@@ -51,9 +51,8 @@ MyExecute (char **argv)
|
|||||||
if (((*aptr)[0] == ';' && !(*aptr)[1]))
|
if (((*aptr)[0] == ';' && !(*aptr)[1]))
|
||||||
{
|
{
|
||||||
*ptr ++ = '"';
|
*ptr ++ = '"';
|
||||||
strcpy (ptr, *aptr);
|
ptr = stpcpy (ptr, *aptr);
|
||||||
ptr += strlen (ptr);
|
*(ptr++) = '"';
|
||||||
*ptr ++ = '"';
|
|
||||||
}
|
}
|
||||||
else if ((*aptr)[0] == '@' && (*aptr)[1] == '@' && !(*aptr)[2])
|
else if ((*aptr)[0] == '@' && (*aptr)[1] == '@' && !(*aptr)[2])
|
||||||
{
|
{
|
||||||
@@ -61,10 +60,7 @@ MyExecute (char **argv)
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
ptr = stpcpy (ptr, *aptr);
|
||||||
strcpy (ptr, *aptr);
|
|
||||||
ptr += strlen (ptr);
|
|
||||||
}
|
|
||||||
*ptr ++ = ' ';
|
*ptr ++ = ' ';
|
||||||
*ptr = 0;
|
*ptr = 0;
|
||||||
}
|
}
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
/* Definitions for amiga specific things
|
/* Definitions for amiga specific things
|
||||||
Copyright (C) 1995-2016 Free Software Foundation, Inc.
|
Copyright (C) 1995-2022 Free Software Foundation, Inc.
|
||||||
This file is part of GNU Make.
|
This file is part of GNU Make.
|
||||||
|
|
||||||
GNU Make is free software; you can redistribute it and/or modify it under the
|
GNU Make is free software; you can redistribute it and/or modify it under the
|
||||||
@@ -12,7 +12,7 @@ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|||||||
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License along with
|
You should have received a copy of the GNU General Public License along with
|
||||||
this program. If not, see <http://www.gnu.org/licenses/>. */
|
this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||||
|
|
||||||
int MyExecute (char ** argv);
|
int MyExecute (char ** argv);
|
||||||
char * wildcard_expansion (char * wc, char * o);
|
char * wildcard_expansion (char * wc, char * o);
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
/* Interface to 'ar' archives for GNU Make.
|
/* Interface to 'ar' archives for GNU Make.
|
||||||
Copyright (C) 1988-2016 Free Software Foundation, Inc.
|
Copyright (C) 1988-2022 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This file is part of GNU Make.
|
This file is part of GNU Make.
|
||||||
|
|
||||||
@@ -13,7 +13,7 @@ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|||||||
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License along with
|
You should have received a copy of the GNU General Public License along with
|
||||||
this program. If not, see <http://www.gnu.org/licenses/>. */
|
this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||||
|
|
||||||
#include "makeint.h"
|
#include "makeint.h"
|
||||||
|
|
||||||
@@ -22,6 +22,7 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
|
|||||||
#include "filedef.h"
|
#include "filedef.h"
|
||||||
#include "dep.h"
|
#include "dep.h"
|
||||||
#include <fnmatch.h>
|
#include <fnmatch.h>
|
||||||
|
#include <intprops.h>
|
||||||
|
|
||||||
/* Return nonzero if NAME is an archive-member reference, zero if not. An
|
/* Return nonzero if NAME is an archive-member reference, zero if not. An
|
||||||
archive-member reference is a name like 'lib(member)' where member is a
|
archive-member reference is a name like 'lib(member)' where member is a
|
||||||
@@ -35,7 +36,7 @@ ar_name (const char *name)
|
|||||||
const char *p = strchr (name, '(');
|
const char *p = strchr (name, '(');
|
||||||
const char *end;
|
const char *end;
|
||||||
|
|
||||||
if (p == 0 || p == name)
|
if (p == NULL || p == name)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
end = p + strlen (p) - 1;
|
end = p + strlen (p) - 1;
|
||||||
@@ -60,6 +61,9 @@ ar_parse_name (const char *name, char **arname_p, char **memname_p)
|
|||||||
|
|
||||||
*arname_p = xstrdup (name);
|
*arname_p = xstrdup (name);
|
||||||
p = strchr (*arname_p, '(');
|
p = strchr (*arname_p, '(');
|
||||||
|
/* This is never called unless ar_name() is true so p cannot be NULL. */
|
||||||
|
if (!p)
|
||||||
|
OS (fatal, NILF, "Internal: ar_parse_name: bad name '%s'", *arname_p);
|
||||||
*(p++) = '\0';
|
*(p++) = '\0';
|
||||||
p[strlen (p) - 1] = '\0';
|
p[strlen (p) - 1] = '\0';
|
||||||
*memname_p = p;
|
*memname_p = p;
|
||||||
@@ -69,11 +73,11 @@ ar_parse_name (const char *name, char **arname_p, char **memname_p)
|
|||||||
/* This function is called by 'ar_scan' to find which member to look at. */
|
/* This function is called by 'ar_scan' to find which member to look at. */
|
||||||
|
|
||||||
/* ARGSUSED */
|
/* ARGSUSED */
|
||||||
static long int
|
static intmax_t
|
||||||
ar_member_date_1 (int desc UNUSED, const char *mem, int truncated,
|
ar_member_date_1 (int desc UNUSED, const char *mem, int truncated,
|
||||||
long int hdrpos UNUSED, long int datapos UNUSED,
|
long int hdrpos UNUSED, long int datapos UNUSED,
|
||||||
long int size UNUSED, long int date,
|
long int size UNUSED, intmax_t date,
|
||||||
int uid UNUSED, int gid UNUSED, int mode UNUSED,
|
int uid UNUSED, int gid UNUSED, unsigned int mode UNUSED,
|
||||||
const void *name)
|
const void *name)
|
||||||
{
|
{
|
||||||
return ar_name_equal (name, mem, truncated) ? date : 0;
|
return ar_name_equal (name, mem, truncated) ? date : 0;
|
||||||
@@ -86,7 +90,7 @@ ar_member_date (const char *name)
|
|||||||
{
|
{
|
||||||
char *arname;
|
char *arname;
|
||||||
char *memname;
|
char *memname;
|
||||||
long int val;
|
intmax_t val;
|
||||||
|
|
||||||
ar_parse_name (name, &arname, &memname);
|
ar_parse_name (name, &arname, &memname);
|
||||||
|
|
||||||
@@ -111,7 +115,7 @@ ar_member_date (const char *name)
|
|||||||
|
|
||||||
free (arname);
|
free (arname);
|
||||||
|
|
||||||
return (val <= 0 ? (time_t) -1 : (time_t) val);
|
return 0 < val && val <= TYPE_MAXIMUM (time_t) ? val : -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Set the archive-member NAME's modtime to now. */
|
/* Set the archive-member NAME's modtime to now. */
|
||||||
@@ -186,7 +190,7 @@ struct ar_glob_state
|
|||||||
#ifdef VMS
|
#ifdef VMS
|
||||||
char *suffix;
|
char *suffix;
|
||||||
#endif
|
#endif
|
||||||
unsigned int size;
|
size_t size;
|
||||||
struct nameseq *chain;
|
struct nameseq *chain;
|
||||||
unsigned int n;
|
unsigned int n;
|
||||||
};
|
};
|
||||||
@@ -194,11 +198,11 @@ struct ar_glob_state
|
|||||||
/* This function is called by 'ar_scan' to match one archive
|
/* This function is called by 'ar_scan' to match one archive
|
||||||
element against the pattern in STATE. */
|
element against the pattern in STATE. */
|
||||||
|
|
||||||
static long int
|
static intmax_t
|
||||||
ar_glob_match (int desc UNUSED, const char *mem, int truncated UNUSED,
|
ar_glob_match (int desc UNUSED, const char *mem, int truncated UNUSED,
|
||||||
long int hdrpos UNUSED, long int datapos UNUSED,
|
long int hdrpos UNUSED, long int datapos UNUSED,
|
||||||
long int size UNUSED, long int date UNUSED, int uid UNUSED,
|
long int size UNUSED, intmax_t date UNUSED, int uid UNUSED,
|
||||||
int gid UNUSED, int mode UNUSED, const void *arg)
|
int gid UNUSED, unsigned int mode UNUSED, const void *arg)
|
||||||
{
|
{
|
||||||
struct ar_glob_state *state = (struct ar_glob_state *)arg;
|
struct ar_glob_state *state = (struct ar_glob_state *)arg;
|
||||||
|
|
||||||
@@ -218,13 +222,13 @@ ar_glob_match (int desc UNUSED, const char *mem, int truncated UNUSED,
|
|||||||
++state->n;
|
++state->n;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0L;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Return nonzero if PATTERN contains any metacharacters.
|
/* Return nonzero if PATTERN contains any metacharacters.
|
||||||
Metacharacters can be quoted with backslashes if QUOTE is nonzero. */
|
Metacharacters can be quoted with backslashes if QUOTE is nonzero. */
|
||||||
static int
|
static int
|
||||||
glob_pattern_p (const char *pattern, int quote)
|
ar_glob_pattern_p (const char *pattern, int quote)
|
||||||
{
|
{
|
||||||
const char *p;
|
const char *p;
|
||||||
int opened = 0;
|
int opened = 0;
|
||||||
@@ -258,7 +262,7 @@ glob_pattern_p (const char *pattern, int quote)
|
|||||||
Return a malloc'd chain of matching elements (or nil if none). */
|
Return a malloc'd chain of matching elements (or nil if none). */
|
||||||
|
|
||||||
struct nameseq *
|
struct nameseq *
|
||||||
ar_glob (const char *arname, const char *member_pattern, unsigned int size)
|
ar_glob (const char *arname, const char *member_pattern, size_t size)
|
||||||
{
|
{
|
||||||
struct ar_glob_state state;
|
struct ar_glob_state state;
|
||||||
struct nameseq *n;
|
struct nameseq *n;
|
||||||
@@ -267,7 +271,7 @@ ar_glob (const char *arname, const char *member_pattern, unsigned int size)
|
|||||||
#ifdef VMS
|
#ifdef VMS
|
||||||
char *vms_member_pattern;
|
char *vms_member_pattern;
|
||||||
#endif
|
#endif
|
||||||
if (! glob_pattern_p (member_pattern, 1))
|
if (! ar_glob_pattern_p (member_pattern, 1))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
/* Scan the archive for matches.
|
/* Scan the archive for matches.
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
/* Library function for scanning an archive file.
|
/* Library function for scanning an archive file.
|
||||||
Copyright (C) 1987-2016 Free Software Foundation, Inc.
|
Copyright (C) 1987-2022 Free Software Foundation, Inc.
|
||||||
This file is part of GNU Make.
|
This file is part of GNU Make.
|
||||||
|
|
||||||
GNU Make is free software; you can redistribute it and/or modify it under the
|
GNU Make is free software; you can redistribute it and/or modify it under the
|
||||||
@@ -12,7 +12,7 @@ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|||||||
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License along with
|
You should have received a copy of the GNU General Public License along with
|
||||||
this program. If not, see <http://www.gnu.org/licenses/>. */
|
this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||||
|
|
||||||
#include "makeint.h"
|
#include "makeint.h"
|
||||||
|
|
||||||
@@ -40,7 +40,7 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
|
|||||||
#include <rmsdef.h>
|
#include <rmsdef.h>
|
||||||
|
|
||||||
/* This symbol should be present in lbrdef.h. */
|
/* This symbol should be present in lbrdef.h. */
|
||||||
#ifndef LBR$_HDRTRUNC
|
#if !defined LBR$_HDRTRUNC
|
||||||
#pragma extern_model save
|
#pragma extern_model save
|
||||||
#pragma extern_model globalvalue
|
#pragma extern_model globalvalue
|
||||||
extern unsigned int LBR$_HDRTRUNC;
|
extern unsigned int LBR$_HDRTRUNC;
|
||||||
@@ -75,9 +75,9 @@ static void *VMS_lib_idx;
|
|||||||
|
|
||||||
static const void *VMS_saved_arg;
|
static const void *VMS_saved_arg;
|
||||||
|
|
||||||
static long int (*VMS_function) ();
|
static intmax_t (*VMS_function) ();
|
||||||
|
|
||||||
static long int VMS_function_ret;
|
static intmax_t VMS_function_ret;
|
||||||
|
|
||||||
|
|
||||||
/* This is a callback procedure for lib$get_index */
|
/* This is a callback procedure for lib$get_index */
|
||||||
@@ -137,8 +137,8 @@ VMS_get_member_info(struct dsc$descriptor_s *module, unsigned long *rfa)
|
|||||||
|
|
||||||
#ifdef TEST
|
#ifdef TEST
|
||||||
/* When testing this code, it is useful to know the length returned */
|
/* When testing this code, it is useful to know the length returned */
|
||||||
printf("Input length = %d, actual = %d\n",
|
printf ("Input length = %d, actual = %u\n",
|
||||||
bufdesc.dsc$w_length, buffer_length);
|
bufdesc.dsc$w_length, buffer_length);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Conversion from VMS time to C time.
|
/* Conversion from VMS time to C time.
|
||||||
@@ -203,7 +203,7 @@ VMS_get_member_info(struct dsc$descriptor_s *module, unsigned long *rfa)
|
|||||||
Returns -2 if archive has invalid format.
|
Returns -2 if archive has invalid format.
|
||||||
Returns 0 if have scanned successfully. */
|
Returns 0 if have scanned successfully. */
|
||||||
|
|
||||||
long int
|
intmax_t
|
||||||
ar_scan (const char *archive, ar_member_func_t function, const void *varg)
|
ar_scan (const char *archive, ar_member_func_t function, const void *varg)
|
||||||
{
|
{
|
||||||
char *vms_archive;
|
char *vms_archive;
|
||||||
@@ -375,7 +375,42 @@ struct ar_hdr
|
|||||||
#ifndef AR_HDR_SIZE
|
#ifndef AR_HDR_SIZE
|
||||||
# define AR_HDR_SIZE (sizeof (struct ar_hdr))
|
# define AR_HDR_SIZE (sizeof (struct ar_hdr))
|
||||||
#endif
|
#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.
|
/* Takes three arguments ARCHIVE, FUNCTION and ARG.
|
||||||
|
|
||||||
Open the archive named ARCHIVE, find its members one by one,
|
Open the archive named ARCHIVE, find its members one by one,
|
||||||
@@ -403,7 +438,7 @@ struct ar_hdr
|
|||||||
Returns -2 if archive has invalid format.
|
Returns -2 if archive has invalid format.
|
||||||
Returns 0 if have scanned successfully. */
|
Returns 0 if have scanned successfully. */
|
||||||
|
|
||||||
long int
|
intmax_t
|
||||||
ar_scan (const char *archive, ar_member_func_t function, const void *arg)
|
ar_scan (const char *archive, ar_member_func_t function, const void *arg)
|
||||||
{
|
{
|
||||||
#ifdef AIAMAG
|
#ifdef AIAMAG
|
||||||
@@ -414,30 +449,27 @@ ar_scan (const char *archive, ar_member_func_t function, const void *arg)
|
|||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
char *namemap = 0;
|
char *namemap = 0;
|
||||||
|
unsigned int namemap_size = 0;
|
||||||
int desc = open (archive, O_RDONLY, 0);
|
int desc = open (archive, O_RDONLY, 0);
|
||||||
if (desc < 0)
|
if (desc < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
#ifdef SARMAG
|
#ifdef SARMAG
|
||||||
{
|
{
|
||||||
char buf[SARMAG];
|
char buf[SARMAG];
|
||||||
int nread;
|
int nread;
|
||||||
EINTRLOOP (nread, read (desc, buf, SARMAG));
|
nread = readbuf (desc, buf, SARMAG);
|
||||||
if (nread != SARMAG || memcmp (buf, ARMAG, SARMAG))
|
if (nread != SARMAG || memcmp (buf, ARMAG, SARMAG))
|
||||||
{
|
goto invalid;
|
||||||
(void) close (desc);
|
|
||||||
return -2;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
#ifdef AIAMAG
|
#ifdef AIAMAG
|
||||||
{
|
{
|
||||||
int nread;
|
int nread;
|
||||||
EINTRLOOP (nread, read (desc, &fl_header, FL_HSZ));
|
nread = readbuf (desc, &fl_header, FL_HSZ);
|
||||||
if (nread != FL_HSZ)
|
if (nread != FL_HSZ)
|
||||||
{
|
goto invalid;
|
||||||
(void) close (desc);
|
|
||||||
return -2;
|
|
||||||
}
|
|
||||||
#ifdef AIAMAGBIG
|
#ifdef AIAMAGBIG
|
||||||
/* If this is a "big" archive, then set the flag and
|
/* If this is a "big" archive, then set the flag and
|
||||||
re-read the header into the "big" structure. */
|
re-read the header into the "big" structure. */
|
||||||
@@ -450,27 +482,18 @@ ar_scan (const char *archive, ar_member_func_t function, const void *arg)
|
|||||||
/* seek back to beginning of archive */
|
/* seek back to beginning of archive */
|
||||||
EINTRLOOP (o, lseek (desc, 0, 0));
|
EINTRLOOP (o, lseek (desc, 0, 0));
|
||||||
if (o < 0)
|
if (o < 0)
|
||||||
{
|
goto invalid;
|
||||||
(void) close (desc);
|
|
||||||
return -2;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* re-read the header into the "big" structure */
|
/* re-read the header into the "big" structure */
|
||||||
EINTRLOOP (nread, read (desc, &fl_header_big, FL_HSZ_BIG));
|
nread = readbuf (desc, &fl_header_big, FL_HSZ_BIG);
|
||||||
if (nread != FL_HSZ_BIG)
|
if (nread != FL_HSZ_BIG)
|
||||||
{
|
goto invalid;
|
||||||
(void) close (desc);
|
|
||||||
return -2;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
/* Check to make sure this is a "normal" archive. */
|
/* Check to make sure this is a "normal" archive. */
|
||||||
if (memcmp (fl_header.fl_magic, AIAMAG, SAIAMAG))
|
if (memcmp (fl_header.fl_magic, AIAMAG, SAIAMAG))
|
||||||
{
|
goto invalid;
|
||||||
(void) close (desc);
|
|
||||||
return -2;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
{
|
{
|
||||||
@@ -480,12 +503,9 @@ ar_scan (const char *archive, ar_member_func_t function, const void *arg)
|
|||||||
unsigned short int buf;
|
unsigned short int buf;
|
||||||
#endif
|
#endif
|
||||||
int nread;
|
int nread;
|
||||||
EINTRLOOP (nread, read (desc, &buf, sizeof (buf)));
|
nread = readbuf (desc, &buf, sizeof (buf));
|
||||||
if (nread != sizeof (buf) || buf != ARMAG)
|
if (nread != sizeof (buf) || buf != ARMAG)
|
||||||
{
|
goto invalid;
|
||||||
(void) close (desc);
|
|
||||||
return -2;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
@@ -493,7 +513,7 @@ ar_scan (const char *archive, ar_member_func_t function, const void *arg)
|
|||||||
/* Now find the members one by one. */
|
/* Now find the members one by one. */
|
||||||
{
|
{
|
||||||
#ifdef SARMAG
|
#ifdef SARMAG
|
||||||
register long int member_offset = SARMAG;
|
long int member_offset = SARMAG;
|
||||||
#else
|
#else
|
||||||
#ifdef AIAMAG
|
#ifdef AIAMAG
|
||||||
long int member_offset;
|
long int member_offset;
|
||||||
@@ -520,43 +540,46 @@ ar_scan (const char *archive, ar_member_func_t function, const void *arg)
|
|||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
#ifndef M_XENIX
|
#ifndef M_XENIX
|
||||||
register long int member_offset = sizeof (int);
|
long int member_offset = sizeof (int);
|
||||||
#else /* Xenix. */
|
#else /* Xenix. */
|
||||||
register long int member_offset = sizeof (unsigned short int);
|
long int member_offset = sizeof (unsigned short int);
|
||||||
#endif /* Not Xenix. */
|
#endif /* Not Xenix. */
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
while (1)
|
while (1)
|
||||||
{
|
{
|
||||||
register int nread;
|
ssize_t nread;
|
||||||
struct ar_hdr member_header;
|
struct ar_hdr member_header;
|
||||||
#ifdef AIAMAGBIG
|
#ifdef AIAMAGBIG
|
||||||
struct ar_hdr_big member_header_big;
|
struct ar_hdr_big member_header_big;
|
||||||
#endif
|
#endif
|
||||||
#ifdef AIAMAG
|
#ifdef AIAMAG
|
||||||
char name[256];
|
# define ARNAME_MAX 255
|
||||||
|
char name[ARNAME_MAX + 1];
|
||||||
int name_len;
|
int name_len;
|
||||||
long int dateval;
|
intmax_t dateval;
|
||||||
int uidval, gidval;
|
int uidval, gidval;
|
||||||
long int data_offset;
|
long int data_offset;
|
||||||
#else
|
#else
|
||||||
char namebuf[sizeof member_header.ar_name + 1];
|
# define ARNAME_MAX (int)sizeof(member_header.ar_name)
|
||||||
|
char namebuf[ARNAME_MAX + 1];
|
||||||
char *name;
|
char *name;
|
||||||
int is_namemap; /* Nonzero if this entry maps long names. */
|
int is_namemap; /* Nonzero if this entry maps long names. */
|
||||||
int long_name = 0;
|
int long_name = 0;
|
||||||
#endif
|
#endif
|
||||||
long int eltsize;
|
long int eltsize;
|
||||||
int eltmode;
|
unsigned int eltmode;
|
||||||
long int fnval;
|
intmax_t eltdate;
|
||||||
|
int eltuid, eltgid;
|
||||||
|
intmax_t fnval;
|
||||||
off_t o;
|
off_t o;
|
||||||
|
|
||||||
|
memset(&member_header, '\0', sizeof (member_header));
|
||||||
|
|
||||||
EINTRLOOP (o, lseek (desc, member_offset, 0));
|
EINTRLOOP (o, lseek (desc, member_offset, 0));
|
||||||
if (o < 0)
|
if (o < 0)
|
||||||
{
|
goto invalid;
|
||||||
(void) close (desc);
|
|
||||||
return -2;
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef AIAMAG
|
#ifdef AIAMAG
|
||||||
#define AR_MEMHDR_SZ(x) (sizeof(x) - sizeof (x._ar_name))
|
#define AR_MEMHDR_SZ(x) (sizeof(x) - sizeof (x._ar_name))
|
||||||
@@ -564,27 +587,23 @@ ar_scan (const char *archive, ar_member_func_t function, const void *arg)
|
|||||||
#ifdef AIAMAGBIG
|
#ifdef AIAMAGBIG
|
||||||
if (big_archive)
|
if (big_archive)
|
||||||
{
|
{
|
||||||
EINTRLOOP (nread, read (desc, &member_header_big,
|
nread = readbuf (desc, &member_header_big,
|
||||||
AR_MEMHDR_SZ(member_header_big)));
|
AR_MEMHDR_SZ(member_header_big));
|
||||||
|
|
||||||
if (nread != AR_MEMHDR_SZ(member_header_big))
|
if (nread != AR_MEMHDR_SZ(member_header_big))
|
||||||
{
|
goto invalid;
|
||||||
(void) close (desc);
|
|
||||||
return -2;
|
|
||||||
}
|
|
||||||
|
|
||||||
sscanf (member_header_big.ar_namlen, "%4d", &name_len);
|
sscanf (member_header_big.ar_namlen, "%4d", &name_len);
|
||||||
EINTRLOOP (nread, read (desc, name, name_len));
|
if (name_len < 1 || name_len > ARNAME_MAX)
|
||||||
|
goto invalid;
|
||||||
|
|
||||||
|
nread = readbuf (desc, name, name_len);
|
||||||
if (nread != name_len)
|
if (nread != name_len)
|
||||||
{
|
goto invalid;
|
||||||
(void) close (desc);
|
|
||||||
return -2;
|
|
||||||
}
|
|
||||||
|
|
||||||
name[name_len] = 0;
|
name[name_len] = '\0';
|
||||||
|
|
||||||
sscanf (member_header_big.ar_date, "%12ld", &dateval);
|
sscanf (member_header_big.ar_date, "%12" SCNdMAX, &dateval);
|
||||||
sscanf (member_header_big.ar_uid, "%12d", &uidval);
|
sscanf (member_header_big.ar_uid, "%12d", &uidval);
|
||||||
sscanf (member_header_big.ar_gid, "%12d", &gidval);
|
sscanf (member_header_big.ar_gid, "%12d", &gidval);
|
||||||
sscanf (member_header_big.ar_mode, "%12o", &eltmode);
|
sscanf (member_header_big.ar_mode, "%12o", &eltmode);
|
||||||
@@ -596,27 +615,23 @@ ar_scan (const char *archive, ar_member_func_t function, const void *arg)
|
|||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
EINTRLOOP (nread, read (desc, &member_header,
|
nread = readbuf (desc, &member_header,
|
||||||
AR_MEMHDR_SZ(member_header)));
|
AR_MEMHDR_SZ(member_header));
|
||||||
|
|
||||||
if (nread != AR_MEMHDR_SZ(member_header))
|
if (nread != AR_MEMHDR_SZ(member_header))
|
||||||
{
|
goto invalid;
|
||||||
(void) close (desc);
|
|
||||||
return -2;
|
|
||||||
}
|
|
||||||
|
|
||||||
sscanf (member_header.ar_namlen, "%4d", &name_len);
|
sscanf (member_header.ar_namlen, "%4d", &name_len);
|
||||||
EINTRLOOP (nread, read (desc, name, name_len));
|
if (name_len < 1 || name_len > ARNAME_MAX)
|
||||||
|
goto invalid;
|
||||||
|
|
||||||
|
nread = readbuf (desc, name, name_len);
|
||||||
if (nread != name_len)
|
if (nread != name_len)
|
||||||
{
|
goto invalid;
|
||||||
(void) close (desc);
|
|
||||||
return -2;
|
|
||||||
}
|
|
||||||
|
|
||||||
name[name_len] = 0;
|
name[name_len] = '\0';
|
||||||
|
|
||||||
sscanf (member_header.ar_date, "%12ld", &dateval);
|
sscanf (member_header.ar_date, "%12" SCNdMAX, &dateval);
|
||||||
sscanf (member_header.ar_uid, "%12d", &uidval);
|
sscanf (member_header.ar_uid, "%12d", &uidval);
|
||||||
sscanf (member_header.ar_gid, "%12d", &gidval);
|
sscanf (member_header.ar_gid, "%12d", &gidval);
|
||||||
sscanf (member_header.ar_mode, "%12o", &eltmode);
|
sscanf (member_header.ar_mode, "%12o", &eltmode);
|
||||||
@@ -634,7 +649,7 @@ ar_scan (const char *archive, ar_member_func_t function, const void *arg)
|
|||||||
eltmode, arg);
|
eltmode, arg);
|
||||||
|
|
||||||
#else /* Not AIAMAG. */
|
#else /* Not AIAMAG. */
|
||||||
EINTRLOOP (nread, read (desc, &member_header, AR_HDR_SIZE));
|
nread = readbuf (desc, &member_header, AR_HDR_SIZE);
|
||||||
if (nread == 0)
|
if (nread == 0)
|
||||||
/* No data left means end of file; that is OK. */
|
/* No data left means end of file; that is OK. */
|
||||||
break;
|
break;
|
||||||
@@ -656,15 +671,12 @@ ar_scan (const char *archive, ar_member_func_t function, const void *arg)
|
|||||||
)
|
)
|
||||||
#endif
|
#endif
|
||||||
)
|
)
|
||||||
{
|
goto invalid;
|
||||||
(void) close (desc);
|
|
||||||
return -2;
|
|
||||||
}
|
|
||||||
|
|
||||||
name = namebuf;
|
name = namebuf;
|
||||||
memcpy (name, member_header.ar_name, sizeof member_header.ar_name);
|
memcpy (name, member_header.ar_name, sizeof member_header.ar_name);
|
||||||
{
|
{
|
||||||
register char *p = name + sizeof member_header.ar_name;
|
char *p = name + sizeof member_header.ar_name;
|
||||||
do
|
do
|
||||||
*p = '\0';
|
*p = '\0';
|
||||||
while (p > name && *--p == ' ');
|
while (p > name && *--p == ' ');
|
||||||
@@ -679,6 +691,7 @@ ar_scan (const char *archive, ar_member_func_t function, const void *arg)
|
|||||||
is_namemap = (!strcmp (name, "//")
|
is_namemap = (!strcmp (name, "//")
|
||||||
|| !strcmp (name, "ARFILENAMES/"));
|
|| !strcmp (name, "ARFILENAMES/"));
|
||||||
#endif /* Not AIAMAG. */
|
#endif /* Not AIAMAG. */
|
||||||
|
|
||||||
/* On some systems, there is a slash after each member name. */
|
/* On some systems, there is a slash after each member name. */
|
||||||
if (*p == '/')
|
if (*p == '/')
|
||||||
*p = '\0';
|
*p = '\0';
|
||||||
@@ -693,23 +706,35 @@ ar_scan (const char *archive, ar_member_func_t function, const void *arg)
|
|||||||
&& (name[0] == ' ' || name[0] == '/')
|
&& (name[0] == ' ' || name[0] == '/')
|
||||||
&& namemap != 0)
|
&& namemap != 0)
|
||||||
{
|
{
|
||||||
name = namemap + atoi (name + 1);
|
const char* err;
|
||||||
|
unsigned int name_off = make_toui (name + 1, &err);
|
||||||
|
size_t name_len;
|
||||||
|
|
||||||
|
if (err|| name_off >= namemap_size)
|
||||||
|
goto invalid;
|
||||||
|
|
||||||
|
name = namemap + name_off;
|
||||||
|
name_len = strlen (name);
|
||||||
|
if (name_len < 1)
|
||||||
|
goto invalid;
|
||||||
long_name = 1;
|
long_name = 1;
|
||||||
}
|
}
|
||||||
else if (name[0] == '#'
|
else if (name[0] == '#'
|
||||||
&& name[1] == '1'
|
&& name[1] == '1'
|
||||||
&& name[2] == '/')
|
&& name[2] == '/')
|
||||||
{
|
{
|
||||||
int namesize = atoi (name + 3);
|
const char* err;
|
||||||
|
unsigned int name_len = make_toui (name + 3, &err);
|
||||||
|
|
||||||
name = alloca (namesize + 1);
|
if (err || name_len == 0 || name_len >= MIN (PATH_MAX, INT_MAX))
|
||||||
EINTRLOOP (nread, read (desc, name, namesize));
|
goto invalid;
|
||||||
if (nread != namesize)
|
|
||||||
{
|
name = alloca (name_len + 1);
|
||||||
close (desc);
|
nread = readbuf (desc, name, name_len);
|
||||||
return -2;
|
if (nread < 0 || (unsigned int) nread != name_len)
|
||||||
}
|
goto invalid;
|
||||||
name[namesize] = '\0';
|
|
||||||
|
name[name_len] = '\0';
|
||||||
|
|
||||||
long_name = 1;
|
long_name = 1;
|
||||||
}
|
}
|
||||||
@@ -717,8 +742,16 @@ ar_scan (const char *archive, ar_member_func_t function, const void *arg)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifndef M_XENIX
|
#ifndef M_XENIX
|
||||||
sscanf (TOCHAR (member_header.ar_mode), "%o", &eltmode);
|
#define PARSE_INT(_m, _t, _b, _n) \
|
||||||
eltsize = atol (TOCHAR (member_header.ar_size));
|
(_t) parse_int (TOCHAR (member_header._m), sizeof (member_header._m), \
|
||||||
|
_b, TYPE_MAXIMUM (_t), _n, archive, name)
|
||||||
|
|
||||||
|
eltmode = PARSE_INT (ar_mode, unsigned int, 8, "mode");
|
||||||
|
eltsize = PARSE_INT (ar_size, long, 10, "size");
|
||||||
|
eltdate = PARSE_INT (ar_date, intmax_t, 10, "date");
|
||||||
|
eltuid = PARSE_INT (ar_uid, int, 10, "uid");
|
||||||
|
eltgid = PARSE_INT (ar_gid, int, 10, "gid");
|
||||||
|
#undef PARSE_INT
|
||||||
#else /* Xenix. */
|
#else /* Xenix. */
|
||||||
eltmode = (unsigned short int) member_header.ar_mode;
|
eltmode = (unsigned short int) member_header.ar_mode;
|
||||||
eltsize = member_header.ar_size;
|
eltsize = member_header.ar_size;
|
||||||
@@ -728,9 +761,7 @@ ar_scan (const char *archive, ar_member_func_t function, const void *arg)
|
|||||||
(*function) (desc, name, ! long_name, member_offset,
|
(*function) (desc, name, ! long_name, member_offset,
|
||||||
member_offset + AR_HDR_SIZE, eltsize,
|
member_offset + AR_HDR_SIZE, eltsize,
|
||||||
#ifndef M_XENIX
|
#ifndef M_XENIX
|
||||||
atol (TOCHAR (member_header.ar_date)),
|
eltdate, eltuid, eltgid,
|
||||||
atoi (TOCHAR (member_header.ar_uid)),
|
|
||||||
atoi (TOCHAR (member_header.ar_gid)),
|
|
||||||
#else /* Xenix. */
|
#else /* Xenix. */
|
||||||
member_header.ar_date,
|
member_header.ar_date,
|
||||||
member_header.ar_uid,
|
member_header.ar_uid,
|
||||||
@@ -759,10 +790,7 @@ ar_scan (const char *archive, ar_member_func_t function, const void *arg)
|
|||||||
sscanf (member_header.ar_nxtmem, "%12ld", &member_offset);
|
sscanf (member_header.ar_nxtmem, "%12ld", &member_offset);
|
||||||
|
|
||||||
if (lseek (desc, member_offset, 0) != member_offset)
|
if (lseek (desc, member_offset, 0) != member_offset)
|
||||||
{
|
goto invalid;
|
||||||
(void) close (desc);
|
|
||||||
return -2;
|
|
||||||
}
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
/* If this member maps archive names, we must read it in. The
|
/* If this member maps archive names, we must read it in. The
|
||||||
@@ -773,13 +801,13 @@ ar_scan (const char *archive, ar_member_func_t function, const void *arg)
|
|||||||
char *clear;
|
char *clear;
|
||||||
char *limit;
|
char *limit;
|
||||||
|
|
||||||
namemap = alloca (eltsize);
|
if (eltsize > INT_MAX)
|
||||||
EINTRLOOP (nread, read (desc, namemap, eltsize));
|
goto invalid;
|
||||||
|
namemap = alloca (eltsize + 1);
|
||||||
|
nread = readbuf (desc, namemap, eltsize);
|
||||||
if (nread != eltsize)
|
if (nread != eltsize)
|
||||||
{
|
goto invalid;
|
||||||
(void) close (desc);
|
namemap_size = eltsize;
|
||||||
return -2;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* The names are separated by newlines. Some formats have
|
/* The names are separated by newlines. Some formats have
|
||||||
a trailing slash. Null terminate the strings for
|
a trailing slash. Null terminate the strings for
|
||||||
@@ -794,6 +822,7 @@ ar_scan (const char *archive, ar_member_func_t function, const void *arg)
|
|||||||
clear[-1] = '\0';
|
clear[-1] = '\0';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
*limit = '\0';
|
||||||
|
|
||||||
is_namemap = 0;
|
is_namemap = 0;
|
||||||
}
|
}
|
||||||
@@ -807,6 +836,10 @@ ar_scan (const char *archive, ar_member_func_t function, const void *arg)
|
|||||||
|
|
||||||
close (desc);
|
close (desc);
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
invalid:
|
||||||
|
close (desc);
|
||||||
|
return -2;
|
||||||
}
|
}
|
||||||
#endif /* !VMS */
|
#endif /* !VMS */
|
||||||
|
|
||||||
@@ -868,11 +901,11 @@ ar_name_equal (const char *name, const char *mem, int truncated)
|
|||||||
|
|
||||||
#ifndef VMS
|
#ifndef VMS
|
||||||
/* ARGSUSED */
|
/* ARGSUSED */
|
||||||
static long int
|
static intmax_t
|
||||||
ar_member_pos (int desc UNUSED, const char *mem, int truncated,
|
ar_member_pos (int desc UNUSED, const char *mem, int truncated,
|
||||||
long int hdrpos, long int datapos UNUSED, long int size UNUSED,
|
long int hdrpos, long int datapos UNUSED, long int size UNUSED,
|
||||||
long int date UNUSED, int uid UNUSED, int gid UNUSED,
|
intmax_t date UNUSED, int uid UNUSED, int gid UNUSED,
|
||||||
int mode UNUSED, const void *name)
|
unsigned int mode UNUSED, const void *name)
|
||||||
{
|
{
|
||||||
if (!ar_name_equal (name, mem, truncated))
|
if (!ar_name_equal (name, mem, truncated))
|
||||||
return 0;
|
return 0;
|
||||||
@@ -889,12 +922,13 @@ ar_member_pos (int desc UNUSED, const char *mem, int truncated,
|
|||||||
int
|
int
|
||||||
ar_member_touch (const char *arname, const char *memname)
|
ar_member_touch (const char *arname, const char *memname)
|
||||||
{
|
{
|
||||||
long int pos = ar_scan (arname, ar_member_pos, memname);
|
intmax_t pos = ar_scan (arname, ar_member_pos, memname);
|
||||||
|
off_t opos;
|
||||||
int fd;
|
int fd;
|
||||||
struct ar_hdr ar_hdr;
|
struct ar_hdr ar_hdr;
|
||||||
off_t o;
|
off_t o;
|
||||||
int r;
|
int r;
|
||||||
unsigned int ui;
|
int datelen;
|
||||||
struct stat statbuf;
|
struct stat statbuf;
|
||||||
|
|
||||||
if (pos < 0)
|
if (pos < 0)
|
||||||
@@ -902,43 +936,37 @@ ar_member_touch (const char *arname, const char *memname)
|
|||||||
if (!pos)
|
if (!pos)
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
|
opos = (off_t) pos;
|
||||||
|
|
||||||
EINTRLOOP (fd, open (arname, O_RDWR, 0666));
|
EINTRLOOP (fd, open (arname, O_RDWR, 0666));
|
||||||
if (fd < 0)
|
if (fd < 0)
|
||||||
return -3;
|
return -3;
|
||||||
/* Read in this member's header */
|
/* Read in this member's header */
|
||||||
EINTRLOOP (o, lseek (fd, pos, 0));
|
EINTRLOOP (o, lseek (fd, opos, 0));
|
||||||
if (o < 0)
|
if (o < 0)
|
||||||
goto lose;
|
goto lose;
|
||||||
EINTRLOOP (r, read (fd, &ar_hdr, AR_HDR_SIZE));
|
r = readbuf (fd, &ar_hdr, AR_HDR_SIZE);
|
||||||
if (r != AR_HDR_SIZE)
|
|
||||||
goto lose;
|
|
||||||
/* Write back the header, thus touching the archive file. */
|
|
||||||
EINTRLOOP (o, lseek (fd, pos, 0));
|
|
||||||
if (o < 0)
|
|
||||||
goto lose;
|
|
||||||
EINTRLOOP (r, write (fd, &ar_hdr, AR_HDR_SIZE));
|
|
||||||
if (r != AR_HDR_SIZE)
|
if (r != AR_HDR_SIZE)
|
||||||
goto lose;
|
goto lose;
|
||||||
/* The file's mtime is the time we we want. */
|
/* The file's mtime is the time we we want. */
|
||||||
EINTRLOOP (r, fstat (fd, &statbuf));
|
EINTRLOOP (r, fstat (fd, &statbuf));
|
||||||
if (r < 0)
|
if (r < 0)
|
||||||
goto lose;
|
goto lose;
|
||||||
#if defined(ARFMAG) || defined(ARFZMAG) || defined(AIAMAG) || defined(WINDOWS32)
|
|
||||||
/* Advance member's time to that time */
|
/* Advance member's time to that time */
|
||||||
for (ui = 0; ui < sizeof ar_hdr.ar_date; ui++)
|
#if defined(ARFMAG) || defined(ARFZMAG) || defined(AIAMAG) || defined(WINDOWS32)
|
||||||
ar_hdr.ar_date[ui] = ' ';
|
datelen = snprintf (TOCHAR (ar_hdr.ar_date), sizeof ar_hdr.ar_date,
|
||||||
sprintf (TOCHAR (ar_hdr.ar_date), "%lu", (long unsigned) statbuf.st_mtime);
|
"%" PRIdMAX, (intmax_t) statbuf.st_mtime);
|
||||||
#ifdef AIAMAG
|
if (! (0 <= datelen && datelen < (int) sizeof ar_hdr.ar_date))
|
||||||
ar_hdr.ar_date[strlen (ar_hdr.ar_date)] = ' ';
|
goto lose;
|
||||||
#endif
|
memset (ar_hdr.ar_date + datelen, ' ', sizeof ar_hdr.ar_date - datelen);
|
||||||
#else
|
#else
|
||||||
ar_hdr.ar_date = statbuf.st_mtime;
|
ar_hdr.ar_date = statbuf.st_mtime;
|
||||||
#endif
|
#endif
|
||||||
/* Write back this member's header */
|
/* Write back this member's header */
|
||||||
EINTRLOOP (o, lseek (fd, pos, 0));
|
EINTRLOOP (o, lseek (fd, opos, 0));
|
||||||
if (o < 0)
|
if (o < 0)
|
||||||
goto lose;
|
goto lose;
|
||||||
EINTRLOOP (r, write (fd, &ar_hdr, AR_HDR_SIZE));
|
r = writebuf (fd, &ar_hdr, AR_HDR_SIZE);
|
||||||
if (r != AR_HDR_SIZE)
|
if (r != AR_HDR_SIZE)
|
||||||
goto lose;
|
goto lose;
|
||||||
close (fd);
|
close (fd);
|
||||||
@@ -954,17 +982,21 @@ ar_member_touch (const char *arname, const char *memname)
|
|||||||
|
|
||||||
#ifdef TEST
|
#ifdef TEST
|
||||||
|
|
||||||
long int
|
intmax_t
|
||||||
describe_member (int desc, const char *name, int truncated,
|
describe_member (int desc, const char *name, int truncated,
|
||||||
long int hdrpos, long int datapos, long int size,
|
long int hdrpos, long int datapos, long int size,
|
||||||
long int date, int uid, int gid, int mode, const void *arg)
|
intmax_t date, int uid, int gid, unsigned int mode,
|
||||||
|
const void *arg)
|
||||||
{
|
{
|
||||||
extern char *ctime ();
|
extern char *ctime ();
|
||||||
|
time_t d = date;
|
||||||
|
char const *ds;
|
||||||
|
|
||||||
printf (_("Member '%s'%s: %ld bytes at %ld (%ld).\n"),
|
printf (_("Member '%s'%s: %ld bytes at %ld (%ld).\n"),
|
||||||
name, truncated ? _(" (name might be truncated)") : "",
|
name, truncated ? _(" (name might be truncated)") : "",
|
||||||
size, hdrpos, datapos);
|
size, hdrpos, datapos);
|
||||||
printf (_(" Date %s"), ctime (&date));
|
ds = ctime (&d);
|
||||||
|
printf (_(" Date %s"), ds ? ds : "?");
|
||||||
printf (_(" uid = %d, gid = %d, mode = 0%o.\n"), uid, gid, mode);
|
printf (_(" uid = %d, gid = %d, mode = 0%o.\n"), uid, gid, mode);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
/* Command processing for GNU Make.
|
/* Command processing for GNU Make.
|
||||||
Copyright (C) 1988-2016 Free Software Foundation, Inc.
|
Copyright (C) 1988-2022 Free Software Foundation, Inc.
|
||||||
This file is part of GNU Make.
|
This file is part of GNU Make.
|
||||||
|
|
||||||
GNU Make is free software; you can redistribute it and/or modify it under the
|
GNU Make is free software; you can redistribute it and/or modify it under the
|
||||||
@@ -12,10 +12,11 @@ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|||||||
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License along with
|
You should have received a copy of the GNU General Public License along with
|
||||||
this program. If not, see <http://www.gnu.org/licenses/>. */
|
this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||||
|
|
||||||
#include "makeint.h"
|
#include "makeint.h"
|
||||||
#include "filedef.h"
|
#include "filedef.h"
|
||||||
|
#include "os.h"
|
||||||
#include "dep.h"
|
#include "dep.h"
|
||||||
#include "variable.h"
|
#include "variable.h"
|
||||||
#include "job.h"
|
#include "job.h"
|
||||||
@@ -30,12 +31,6 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
|
|||||||
#else
|
#else
|
||||||
# define FILE_LIST_SEPARATOR ' '
|
# define FILE_LIST_SEPARATOR ' '
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
int remote_kill (int id, int sig);
|
|
||||||
|
|
||||||
#ifndef HAVE_UNISTD_H
|
|
||||||
int getpid ();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
static unsigned long
|
static unsigned long
|
||||||
@@ -60,10 +55,13 @@ dep_hash_cmp (const void *x, const void *y)
|
|||||||
return strcmp (dep_name (dx), dep_name (dy));
|
return strcmp (dep_name (dx), dep_name (dy));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Set FILE's automatic variables up. */
|
/* Set FILE's automatic variables up.
|
||||||
|
* Use STEM to set $*.
|
||||||
|
* If STEM is 0, then set FILE->STEM and $* to the target name with any
|
||||||
|
* suffix in the .SUFFIXES list stripped off. */
|
||||||
|
|
||||||
void
|
void
|
||||||
set_file_variables (struct file *file)
|
set_file_variables (struct file *file, const char *stem)
|
||||||
{
|
{
|
||||||
struct dep *d;
|
struct dep *d;
|
||||||
const char *at, *percent, *star, *less;
|
const char *at, *percent, *star, *less;
|
||||||
@@ -74,7 +72,7 @@ set_file_variables (struct file *file)
|
|||||||
|
|
||||||
if (ar_name (file->name))
|
if (ar_name (file->name))
|
||||||
{
|
{
|
||||||
unsigned int len;
|
size_t len;
|
||||||
const char *cp;
|
const char *cp;
|
||||||
char *p;
|
char *p;
|
||||||
|
|
||||||
@@ -97,13 +95,13 @@ set_file_variables (struct file *file)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* $* is the stem from an implicit or static pattern rule. */
|
/* $* is the stem from an implicit or static pattern rule. */
|
||||||
if (file->stem == 0)
|
if (stem == 0)
|
||||||
{
|
{
|
||||||
/* In Unix make, $* is set to the target name with
|
/* In Unix make, $* is set to the target name with
|
||||||
any suffix in the .SUFFIXES list stripped off for
|
any suffix in the .SUFFIXES list stripped off for
|
||||||
explicit rules. We store this in the 'stem' member. */
|
explicit rules. We store this in the 'stem' member. */
|
||||||
const char *name;
|
const char *name;
|
||||||
unsigned int len;
|
size_t len;
|
||||||
|
|
||||||
#ifndef NO_ARCHIVES
|
#ifndef NO_ARCHIVES
|
||||||
if (ar_name (file->name))
|
if (ar_name (file->name))
|
||||||
@@ -120,29 +118,29 @@ set_file_variables (struct file *file)
|
|||||||
|
|
||||||
for (d = enter_file (strcache_add (".SUFFIXES"))->deps; d ; d = d->next)
|
for (d = enter_file (strcache_add (".SUFFIXES"))->deps; d ; d = d->next)
|
||||||
{
|
{
|
||||||
unsigned int slen = strlen (dep_name (d));
|
const char *dn = dep_name (d);
|
||||||
if (len > slen && strneq (dep_name (d), name + (len - slen), slen))
|
size_t slen = strlen (dn);
|
||||||
|
if (len > slen && memcmp (dn, name + (len - slen), slen) == 0)
|
||||||
{
|
{
|
||||||
file->stem = strcache_add_len (name, len - slen);
|
file->stem = stem = strcache_add_len (name, len - slen);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (d == 0)
|
if (d == 0)
|
||||||
file->stem = "";
|
file->stem = stem = "";
|
||||||
}
|
}
|
||||||
star = file->stem;
|
star = stem;
|
||||||
|
|
||||||
/* $< is the first not order-only dependency. */
|
/* $< is the first not order-only dependency. */
|
||||||
less = "";
|
less = "";
|
||||||
for (d = file->deps; d != 0; d = d->next)
|
for (d = file->deps; d != 0; d = d->next)
|
||||||
if (!d->ignore_mtime)
|
if (!d->ignore_mtime && !d->ignore_automatic_vars && !d->need_2nd_expansion)
|
||||||
{
|
{
|
||||||
if (!d->need_2nd_expansion)
|
less = dep_name (d);
|
||||||
less = dep_name (d);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (file->cmds == default_file->cmds)
|
if (file->cmds != 0 && file->cmds == default_file->cmds)
|
||||||
/* This file got its commands from .DEFAULT.
|
/* This file got its commands from .DEFAULT.
|
||||||
In this case $< is the same as $@. */
|
In this case $< is the same as $@. */
|
||||||
less = at;
|
less = at;
|
||||||
@@ -161,14 +159,14 @@ set_file_variables (struct file *file)
|
|||||||
|
|
||||||
{
|
{
|
||||||
static char *plus_value=0, *bar_value=0, *qmark_value=0;
|
static char *plus_value=0, *bar_value=0, *qmark_value=0;
|
||||||
static unsigned int plus_max=0, bar_max=0, qmark_max=0;
|
static size_t plus_max=0, bar_max=0, qmark_max=0;
|
||||||
|
|
||||||
unsigned int qmark_len, plus_len, bar_len;
|
size_t qmark_len, plus_len, bar_len;
|
||||||
char *cp;
|
char *cp;
|
||||||
char *caret_value;
|
char *caret_value;
|
||||||
char *qp;
|
char *qp;
|
||||||
char *bp;
|
char *bp;
|
||||||
unsigned int len;
|
size_t len;
|
||||||
|
|
||||||
struct hash_table dep_hash;
|
struct hash_table dep_hash;
|
||||||
void **slot;
|
void **slot;
|
||||||
@@ -180,7 +178,7 @@ set_file_variables (struct file *file)
|
|||||||
bar_len = 0;
|
bar_len = 0;
|
||||||
for (d = file->deps; d != 0; d = d->next)
|
for (d = file->deps; d != 0; d = d->next)
|
||||||
{
|
{
|
||||||
if (!d->need_2nd_expansion)
|
if (!d->need_2nd_expansion && !d->ignore_automatic_vars)
|
||||||
{
|
{
|
||||||
if (d->ignore_mtime)
|
if (d->ignore_mtime)
|
||||||
bar_len += strlen (dep_name (d)) + 1;
|
bar_len += strlen (dep_name (d)) + 1;
|
||||||
@@ -202,7 +200,7 @@ set_file_variables (struct file *file)
|
|||||||
|
|
||||||
qmark_len = plus_len + 1; /* Will be this or less. */
|
qmark_len = plus_len + 1; /* Will be this or less. */
|
||||||
for (d = file->deps; d != 0; d = d->next)
|
for (d = file->deps; d != 0; d = d->next)
|
||||||
if (! d->ignore_mtime && ! d->need_2nd_expansion)
|
if (! d->ignore_mtime && ! d->need_2nd_expansion && ! d->ignore_automatic_vars)
|
||||||
{
|
{
|
||||||
const char *c = dep_name (d);
|
const char *c = dep_name (d);
|
||||||
|
|
||||||
@@ -216,8 +214,7 @@ set_file_variables (struct file *file)
|
|||||||
#endif
|
#endif
|
||||||
len = strlen (c);
|
len = strlen (c);
|
||||||
|
|
||||||
memcpy (cp, c, len);
|
cp = mempcpy (cp, c, len);
|
||||||
cp += len;
|
|
||||||
*cp++ = FILE_LIST_SEPARATOR;
|
*cp++ = FILE_LIST_SEPARATOR;
|
||||||
if (! (d->changed || always_make_flag))
|
if (! (d->changed || always_make_flag))
|
||||||
qmark_len -= len + 1; /* Don't space in $? for this one. */
|
qmark_len -= len + 1; /* Don't space in $? for this one. */
|
||||||
@@ -249,7 +246,7 @@ set_file_variables (struct file *file)
|
|||||||
|
|
||||||
for (d = file->deps; d != 0; d = d->next)
|
for (d = file->deps; d != 0; d = d->next)
|
||||||
{
|
{
|
||||||
if (d->need_2nd_expansion)
|
if (d->need_2nd_expansion || d->ignore_automatic_vars)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
slot = hash_find_slot (&dep_hash, d);
|
slot = hash_find_slot (&dep_hash, d);
|
||||||
@@ -271,7 +268,7 @@ set_file_variables (struct file *file)
|
|||||||
{
|
{
|
||||||
const char *c;
|
const char *c;
|
||||||
|
|
||||||
if (d->need_2nd_expansion || hash_find_item (&dep_hash, d) != d)
|
if (d->need_2nd_expansion || d->ignore_automatic_vars || hash_find_item (&dep_hash, d) != d)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
c = dep_name (d);
|
c = dep_name (d);
|
||||||
@@ -287,19 +284,16 @@ set_file_variables (struct file *file)
|
|||||||
|
|
||||||
if (d->ignore_mtime)
|
if (d->ignore_mtime)
|
||||||
{
|
{
|
||||||
memcpy (bp, c, len);
|
bp = mempcpy (bp, c, len);
|
||||||
bp += len;
|
|
||||||
*bp++ = FILE_LIST_SEPARATOR;
|
*bp++ = FILE_LIST_SEPARATOR;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
memcpy (cp, c, len);
|
cp = mempcpy (cp, c, len);
|
||||||
cp += len;
|
|
||||||
*cp++ = FILE_LIST_SEPARATOR;
|
*cp++ = FILE_LIST_SEPARATOR;
|
||||||
if (d->changed || always_make_flag)
|
if (d->changed || always_make_flag)
|
||||||
{
|
{
|
||||||
memcpy (qp, c, len);
|
qp = mempcpy (qp, c, len);
|
||||||
qp += len;
|
|
||||||
*qp++ = FILE_LIST_SEPARATOR;
|
*qp++ = FILE_LIST_SEPARATOR;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -328,20 +322,19 @@ set_file_variables (struct file *file)
|
|||||||
void
|
void
|
||||||
chop_commands (struct commands *cmds)
|
chop_commands (struct commands *cmds)
|
||||||
{
|
{
|
||||||
unsigned int nlines, idx;
|
unsigned short nlines;
|
||||||
|
unsigned short i;
|
||||||
char **lines;
|
char **lines;
|
||||||
|
|
||||||
/* If we don't have any commands,
|
/* If we don't have any commands, or we already parsed them, never mind. */
|
||||||
or we already parsed them, never mind. */
|
if (!cmds || cmds->command_lines != NULL)
|
||||||
|
|
||||||
if (!cmds || cmds->command_lines != 0)
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/* Chop CMDS->commands up into lines in CMDS->command_lines. */
|
/* Chop CMDS->commands up into lines in CMDS->command_lines. */
|
||||||
|
|
||||||
if (one_shell)
|
if (one_shell)
|
||||||
{
|
{
|
||||||
int l = strlen (cmds->commands);
|
size_t l = strlen (cmds->commands);
|
||||||
|
|
||||||
nlines = 1;
|
nlines = 1;
|
||||||
lines = xmalloc (nlines * sizeof (char *));
|
lines = xmalloc (nlines * sizeof (char *));
|
||||||
@@ -353,25 +346,27 @@ chop_commands (struct commands *cmds)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
const char *p;
|
const char *p = cmds->commands;
|
||||||
|
size_t max = 5;
|
||||||
|
|
||||||
nlines = 5;
|
nlines = 0;
|
||||||
lines = xmalloc (nlines * sizeof (char *));
|
lines = xmalloc (max * sizeof (char *));
|
||||||
idx = 0;
|
|
||||||
p = cmds->commands;
|
|
||||||
while (*p != '\0')
|
while (*p != '\0')
|
||||||
{
|
{
|
||||||
const char *end = p;
|
const char *end = p;
|
||||||
find_end:;
|
find_end:;
|
||||||
end = strchr (end, '\n');
|
end = strchr (end, '\n');
|
||||||
if (end == 0)
|
if (end == NULL)
|
||||||
end = p + strlen (p);
|
end = p + strlen (p);
|
||||||
else if (end > p && end[-1] == '\\')
|
else if (end > p && end[-1] == '\\')
|
||||||
{
|
{
|
||||||
int backslash = 1;
|
int backslash = 1;
|
||||||
const char *b;
|
if (end > p + 1)
|
||||||
for (b = end - 2; b >= p && *b == '\\'; --b)
|
{
|
||||||
backslash = !backslash;
|
const char *b;
|
||||||
|
for (b = end - 2; b >= p && *b == '\\'; --b)
|
||||||
|
backslash = !backslash;
|
||||||
|
}
|
||||||
if (backslash)
|
if (backslash)
|
||||||
{
|
{
|
||||||
++end;
|
++end;
|
||||||
@@ -379,40 +374,36 @@ chop_commands (struct commands *cmds)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (idx == nlines)
|
if (nlines == USHRT_MAX)
|
||||||
|
ON (fatal, &cmds->fileinfo,
|
||||||
|
_("Recipe has too many lines (limit %hu)"), nlines);
|
||||||
|
|
||||||
|
if (nlines == max)
|
||||||
{
|
{
|
||||||
nlines += 2;
|
max += 2;
|
||||||
lines = xrealloc (lines, nlines * sizeof (char *));
|
lines = xrealloc (lines, max * sizeof (char *));
|
||||||
}
|
}
|
||||||
lines[idx++] = xstrndup (p, end - p);
|
|
||||||
|
lines[nlines++] = xstrndup (p, (size_t) (end - p));
|
||||||
p = end;
|
p = end;
|
||||||
if (*p != '\0')
|
if (*p != '\0')
|
||||||
++p;
|
++p;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (idx != nlines)
|
|
||||||
{
|
|
||||||
nlines = idx;
|
|
||||||
lines = xrealloc (lines, nlines * sizeof (char *));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Finally, set the corresponding CMDS->lines_flags elements and the
|
/* Finally, set the corresponding CMDS->lines_flags elements and the
|
||||||
CMDS->any_recurse flag. */
|
CMDS->any_recurse flag. */
|
||||||
|
|
||||||
if (nlines > USHRT_MAX)
|
|
||||||
ON (fatal, &cmds->fileinfo, _("Recipe has too many lines (%ud)"), nlines);
|
|
||||||
|
|
||||||
cmds->ncommand_lines = nlines;
|
cmds->ncommand_lines = nlines;
|
||||||
cmds->command_lines = lines;
|
cmds->command_lines = lines;
|
||||||
|
|
||||||
cmds->any_recurse = 0;
|
cmds->any_recurse = 0;
|
||||||
cmds->lines_flags = xmalloc (nlines);
|
cmds->lines_flags = xmalloc (nlines);
|
||||||
|
|
||||||
for (idx = 0; idx < nlines; ++idx)
|
for (i = 0; i < nlines; ++i)
|
||||||
{
|
{
|
||||||
unsigned char flags = 0;
|
unsigned char flags = 0;
|
||||||
const char *p = lines[idx];
|
const char *p = lines[i];
|
||||||
|
|
||||||
while (ISBLANK (*p) || *p == '-' || *p == '@' || *p == '+')
|
while (ISBLANK (*p) || *p == '-' || *p == '@' || *p == '+')
|
||||||
switch (*(p++))
|
switch (*(p++))
|
||||||
@@ -429,12 +420,12 @@ chop_commands (struct commands *cmds)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* If no explicit '+' was given, look for MAKE variable references. */
|
/* If no explicit '+' was given, look for MAKE variable references. */
|
||||||
if (!(flags & COMMANDS_RECURSE)
|
if (! ANY_SET (flags, COMMANDS_RECURSE)
|
||||||
&& (strstr (p, "$(MAKE)") != 0 || strstr (p, "${MAKE}") != 0))
|
&& (strstr (p, "$(MAKE)") != 0 || strstr (p, "${MAKE}") != 0))
|
||||||
flags |= COMMANDS_RECURSE;
|
flags |= COMMANDS_RECURSE;
|
||||||
|
|
||||||
cmds->lines_flags[idx] = flags;
|
cmds->lines_flags[i] = flags;
|
||||||
cmds->any_recurse |= flags & COMMANDS_RECURSE ? 1 : 0;
|
cmds->any_recurse |= ANY_SET (flags, COMMANDS_RECURSE) ? 1 : 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -466,12 +457,17 @@ execute_file_commands (struct file *file)
|
|||||||
|
|
||||||
initialize_file_variables (file, 0);
|
initialize_file_variables (file, 0);
|
||||||
|
|
||||||
set_file_variables (file);
|
set_file_variables (file, file->stem);
|
||||||
|
|
||||||
/* If this is a loaded dynamic object, unload it before remaking.
|
/* Some systems don't support overwriting a loaded object so if this one
|
||||||
Some systems don't support overwriting a loaded object. */
|
unload it before remaking. Keep its name in .LOADED: it will be rebuilt
|
||||||
if (file->loaded)
|
and loaded again. If rebuilding or loading again fail, then we'll exit
|
||||||
unload_file (file->name);
|
anyway and it won't matter. */
|
||||||
|
if (file->loaded && unload_file (file->name) == 0)
|
||||||
|
{
|
||||||
|
file->loaded = 0;
|
||||||
|
file->unloaded = 1;
|
||||||
|
}
|
||||||
|
|
||||||
/* Start the commands running. */
|
/* Start the commands running. */
|
||||||
new_job (file);
|
new_job (file);
|
||||||
@@ -480,11 +476,11 @@ execute_file_commands (struct file *file)
|
|||||||
/* This is set while we are inside fatal_error_signal,
|
/* This is set while we are inside fatal_error_signal,
|
||||||
so things can avoid nonreentrant operations. */
|
so things can avoid nonreentrant operations. */
|
||||||
|
|
||||||
int handling_fatal_signal = 0;
|
volatile sig_atomic_t handling_fatal_signal = 0;
|
||||||
|
|
||||||
/* Handle fatal signals. */
|
/* Handle fatal signals. */
|
||||||
|
|
||||||
RETSIGTYPE
|
void
|
||||||
fatal_error_signal (int sig)
|
fatal_error_signal (int sig)
|
||||||
{
|
{
|
||||||
#ifdef __MSDOS__
|
#ifdef __MSDOS__
|
||||||
@@ -509,7 +505,7 @@ fatal_error_signal (int sig)
|
|||||||
#ifdef WINDOWS32
|
#ifdef WINDOWS32
|
||||||
extern HANDLE main_thread;
|
extern HANDLE main_thread;
|
||||||
|
|
||||||
/* Windows creates a sperate thread for handling Ctrl+C, so we need
|
/* Windows creates a separate thread for handling Ctrl+C, so we need
|
||||||
to suspend the main thread, or else we will have race conditions
|
to suspend the main thread, or else we will have race conditions
|
||||||
when both threads call reap_children. */
|
when both threads call reap_children. */
|
||||||
if (main_thread)
|
if (main_thread)
|
||||||
@@ -517,12 +513,12 @@ fatal_error_signal (int sig)
|
|||||||
DWORD susp_count = SuspendThread (main_thread);
|
DWORD susp_count = SuspendThread (main_thread);
|
||||||
|
|
||||||
if (susp_count != 0)
|
if (susp_count != 0)
|
||||||
fprintf (stderr, "SuspendThread: suspend count = %ld\n", susp_count);
|
fprintf (stderr, "SuspendThread: suspend count = %lu\n", susp_count);
|
||||||
else if (susp_count == (DWORD)-1)
|
else if (susp_count == (DWORD)-1)
|
||||||
{
|
{
|
||||||
DWORD ierr = GetLastError ();
|
DWORD ierr = GetLastError ();
|
||||||
|
|
||||||
fprintf (stderr, "SuspendThread: error %ld: %s\n",
|
fprintf (stderr, "SuspendThread: error %lu: %s\n",
|
||||||
ierr, map_windows32_error_to_string (ierr));
|
ierr, map_windows32_error_to_string (ierr));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -533,6 +529,10 @@ fatal_error_signal (int sig)
|
|||||||
It is blocked now while we run this handler. */
|
It is blocked now while we run this handler. */
|
||||||
signal (sig, SIG_DFL);
|
signal (sig, SIG_DFL);
|
||||||
|
|
||||||
|
temp_stdin_unlink ();
|
||||||
|
osync_clear ();
|
||||||
|
jobserver_clear ();
|
||||||
|
|
||||||
/* A termination signal won't be sent to the entire
|
/* A termination signal won't be sent to the entire
|
||||||
process group, but it means we want to kill the children. */
|
process group, but it means we want to kill the children. */
|
||||||
|
|
||||||
@@ -540,7 +540,7 @@ fatal_error_signal (int sig)
|
|||||||
{
|
{
|
||||||
struct child *c;
|
struct child *c;
|
||||||
for (c = children; c != 0; c = c->next)
|
for (c = children; c != 0; c = c->next)
|
||||||
if (!c->remote)
|
if (!c->remote && c->pid > 0)
|
||||||
(void) kill (c->pid, SIGTERM);
|
(void) kill (c->pid, SIGTERM);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -561,7 +561,7 @@ fatal_error_signal (int sig)
|
|||||||
/* Remote children won't automatically get signals sent
|
/* Remote children won't automatically get signals sent
|
||||||
to the process group, so we must send them. */
|
to the process group, so we must send them. */
|
||||||
for (c = children; c != 0; c = c->next)
|
for (c = children; c != 0; c = c->next)
|
||||||
if (c->remote)
|
if (c->remote && c->pid > 0)
|
||||||
(void) remote_kill (c->pid, sig);
|
(void) remote_kill (c->pid, sig);
|
||||||
|
|
||||||
for (c = children; c != 0; c = c->next)
|
for (c = children; c != 0; c = c->next)
|
||||||
@@ -597,7 +597,7 @@ fatal_error_signal (int sig)
|
|||||||
#else
|
#else
|
||||||
/* Signal the same code; this time it will really be fatal. The signal
|
/* Signal the same code; this time it will really be fatal. The signal
|
||||||
will be unblocked when we return and arrive then to kill us. */
|
will be unblocked when we return and arrive then to kill us. */
|
||||||
if (kill (getpid (), sig) < 0)
|
if (kill (make_pid (), sig) < 0)
|
||||||
pfatal_with_name ("kill");
|
pfatal_with_name ("kill");
|
||||||
#endif /* not WINDOWS32 */
|
#endif /* not WINDOWS32 */
|
||||||
#endif /* not Amiga */
|
#endif /* not Amiga */
|
||||||
@@ -662,7 +662,7 @@ delete_child_targets (struct child *child)
|
|||||||
{
|
{
|
||||||
struct dep *d;
|
struct dep *d;
|
||||||
|
|
||||||
if (child->deleted)
|
if (child->deleted || child->pid < 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/* Delete the target file if it changed. */
|
/* Delete the target file if it changed. */
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user