Commit | Line | Data |
---|---|---|
d8875586 MBT |
1 | ?RCS: $Id: Oldsym.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: Oldsym.U,v $ | |
12 | ?RCS: Revision 3.0.1.1 1997/02/28 15:06:58 ram | |
13 | ?RCS: patch61: added support for src.U | |
14 | ?RCS: | |
15 | ?RCS: Revision 3.0 1993/08/18 12:05:13 ram | |
16 | ?RCS: Baseline for dist 3.0 netwide release. | |
17 | ?RCS: | |
18 | ?X: | |
19 | ?X: This unit follows the creation of the config.sh file. It adds some | |
20 | ?X: special symbols: defines from patchlevel.h file if any and CONFIG, | |
21 | ?X: which is set to true. Then, we try to keep all the new symbols that | |
22 | ?X: may come from a hint file or a previous config.sh file. | |
23 | ?X: | |
24 | ?MAKE:Oldsym: Config_sh Options test hint src sed sort uniq | |
25 | ?MAKE: -pick add $@ %< | |
26 | ?T:CONFIG sym tmp | |
27 | ?F:!UU | |
28 | : add special variables | |
29 | $test -f $src/patchlevel.h && \ | |
30 | awk '/^#define/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh | |
31 | echo "CONFIG=true" >>config.sh | |
32 | ||
33 | : propagate old symbols | |
34 | if $test -f UU/config.sh; then | |
35 | ?X: Make sure each symbol is unique in oldconfig.sh | |
36 | <UU/config.sh $sort | $uniq >UU/oldconfig.sh | |
37 | ?X: | |
38 | ?X: All the symbols that appear twice come only from config.sh (hence the | |
39 | ?X: two config.sh in the command line). These symbols will be removed by | |
40 | ?X: the uniq -u command. The oldsyms file thus contains all the symbols | |
41 | ?X: that did not appear in the produced config.sh (Larry Wall). | |
42 | ?X: | |
43 | ?X: Do not touch the -u flag of uniq. This means you too, Jarkko. | |
44 | ?X: | |
45 | $sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' \ | |
46 | config.sh config.sh UU/oldconfig.sh |\ | |
47 | $sort | $uniq -u >UU/oldsyms | |
48 | set X `cat UU/oldsyms` | |
49 | shift | |
50 | case $# in | |
51 | 0) ;; | |
52 | *) | |
53 | cat <<EOM | |
54 | Hmm...You had some extra variables I don't know about...I'll try to keep 'em... | |
55 | EOM | |
56 | echo ": Variables propagated from previous config.sh file." >>config.sh | |
57 | for sym in `cat UU/oldsyms`; do | |
58 | echo " Propagating $hint variable "'$'"$sym..." | |
59 | eval 'tmp="$'"${sym}"'"' | |
60 | echo "$tmp" | \ | |
61 | sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh | |
62 | done | |
63 | ;; | |
64 | esac | |
65 | fi | |
66 |