path: root/mcon/U/Oldsym.U
diff options
Diffstat (limited to 'mcon/U/Oldsym.U')
1 files changed, 62 insertions, 0 deletions
diff --git a/mcon/U/Oldsym.U b/mcon/U/Oldsym.U
new file mode 100644
index 0000000..c49cb64
--- /dev/null
+++ b/mcon/U/Oldsym.U
@@ -0,0 +1,62 @@
+?RCS: $Id: Oldsym.U,v 1997/02/28 15:06:58 ram Exp $
+?RCS: Copyright (c) 1991-1993, Raphael Manfredi
+?RCS: You may redistribute only under the terms of the Artistic Licence,
+?RCS: as specified in the README file that comes with the distribution.
+?RCS: You may reuse parts of this distribution only within the terms of
+?RCS: that same Artistic Licence; a copy of which may be found at the root
+?RCS: of the source tree for dist 3.0.
+?RCS: $Log: Oldsym.U,v $
+?RCS: Revision 1997/02/28 15:06:58 ram
+?RCS: patch61: added support for src.U
+?RCS: Revision 3.0 1993/08/18 12:05:13 ram
+?RCS: Baseline for dist 3.0 netwide release.
+?X: This unit follows the creation of the file. It adds some
+?X: special symbols: defines from patchlevel.h file if any and CONFIG,
+?X: which is set to true. Then, we try to keep all the new symbols that
+?X: may come from a hint file or a previous file.
+?MAKE:Oldsym: Config_sh test hint src
+?MAKE: -pick add $@ %<
+?T:CONFIG sym tmp s
+: add special variables
+$test -f $src/patchlevel.h && \
+awk '/^#define/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>
+echo "CONFIG=true" >>
+: propagate old symbols
+if $test -f UU/; then
+?X: Make sure each symbol is unique in
+ <UU/ sort | uniq >UU/
+?X: All the symbols that appear twice come only from (hence the
+?X: two in the command line). These symbols will be removed by
+?X: the uniq -u command. The oldsyms file thus contains all the symbols
+?X: that did not appear in the produced (Larry Wall).
+ sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' UU/ |\
+ sort | uniq -u >UU/oldsyms
+ set X `cat UU/oldsyms`
+ shift
+ case $# in
+ 0) ;;
+ *)
+ cat <<EOM
+Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
+ echo "# Variables propagated from previous file." >>
+ for sym in `cat UU/oldsyms`; do
+ echo " Propagating $hint variable "'$'"$sym..."
+ eval 'tmp="$'"${sym}"'"'
+ echo "$tmp" | \
+ sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>
+ done
+ ;;
+ esac