Commit | Line | Data |
---|---|---|
d8875586 MBT |
1 | ?RCS: $Id: Warn.U 1 2006-08-24 12:32:52Z rmanfredi $ |
2 | ?RCS: | |
3 | ?RCS: Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi | |
4 | ?RCS: | |
5 | ?RCS: You may redistribute only under the terms of the Artistic Licence, | |
6 | ?RCS: as specified in the README file that comes with the distribution. | |
7 | ?RCS: You may reuse parts of this distribution only within the terms of | |
8 | ?RCS: that same Artistic Licence; a copy of which may be found at the root | |
9 | ?RCS: of the source tree for dist 4.0. | |
10 | ?RCS: | |
11 | ?RCS: $Log: Extract.U,v $ | |
12 | ?X: | |
13 | ?X: This unit produces a shell script which can be run in order to emit | |
14 | ?X: an important warning to the user, which will be remembered and shown | |
15 | ?X: at the end of the Configure run as well. | |
16 | ?X: | |
17 | ?X: A typical use would be: | |
18 | ?X: | |
19 | ?X: ./warn <<EOM | |
20 | ?X: Problem with your C compiler: can't turn debugging on. | |
21 | ?X: EOM | |
22 | ?X: | |
23 | ?X: or: | |
24 | ?X: | |
25 | ?X: ./warn "Problem with your C compiler: can't turn debugging on." | |
26 | ?X: | |
27 | ?X: Which will both display to the user: | |
28 | ?X: | |
29 | ?X: *** WARNING: | |
30 | ?X: *** Problem with your C compiler: can't turn debugging on. | |
31 | ?X: *** | |
32 | ?X: | |
33 | ?MAKE:Warn: startsh eunicefix | |
34 | ?MAKE: -pick add $@ %< | |
35 | ?F:./warn | |
36 | : script used to emit important warnings | |
37 | cat >warn <<EOS | |
38 | $startsh | |
39 | ?X: Read the whole warning message from stdin into a temporary file | |
40 | ?X: when no argument was supplied. | |
41 | if test \$# -gt 0; then | |
42 | echo "\$@" >msg | |
43 | else | |
44 | cat >msg | |
45 | fi | |
46 | ?X: Emit the warning, prefixing all lines with '*** ' | |
47 | echo "*** WARNING:" >&4 | |
48 | sed -e 's/^/*** /' <msg >&4 | |
49 | echo "*** " >&4 | |
50 | ?X: Save the warning in the logs, which will be shown again at the end | |
51 | cat msg >>config.msg | |
52 | echo " " >>config.msg | |
53 | rm -f msg | |
54 | EOS | |
55 | chmod +x warn | |
56 | $eunicefix warn | |
57 |