This is a live mirror of the Perl 5 development currently hosted at
Populate metaconfig branch.
[metaconfig.git] / U / modified / Oldsym.U
1?RCS: $Id: Oldsym.U,v 1997/02/28 15:06:58 ram Exp $
3?RCS: Copyright (c) 1991-1993, Raphael Manfredi
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 3.0.
11?RCS: $Log: Oldsym.U,v $
12?RCS: Revision 1997/02/28 15:06:58 ram
13?RCS: patch61: added support for src.U
15?RCS: Revision 3.0 1993/08/18 12:05:13 ram
16?RCS: Baseline for dist 3.0 netwide release.
19?X: This unit follows the creation of the file. It adds some
20?X: special symbols: defines from patchlevel.h file if any and CONFIGDOTSH,
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 file.
24?MAKE:Oldsym: Config_sh cat test hint src
25?MAKE: -pick add $@ %<
26?T:CONFIGDOTSH sym tmp s
27?X: Command line options can be saved by the Options.U unit in the
28?X: temporary file UU/cmdline.opt.
29: Add in command line options if available
30$test -f UU/cmdline.opt && $cat UU/cmdline.opt >>
32: add special variables
33$test -f $src/patchlevel.h && \
34awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>
35echo "CONFIGDOTSH=true" >>
37: propagate old symbols
38if $test -f UU/; then
39?X: Make sure each symbol is unique in
40 <UU/ sort | uniq >UU/
42?X: All the symbols that appear twice come only from (hence the
43?X: two in the command line). These symbols will be removed by
44?X: the uniq -u command. The oldsyms file thus contains all the symbols
45?X: that did not appear in the produced (Larry Wall).
47 sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' UU/ |\
48 sort | uniq -u >UU/oldsyms
49 set X `cat UU/oldsyms`
50 shift
51 case $# in
52 0) ;;
53 *)
54 cat <<EOM
55Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
57 echo "# Variables propagated from previous file." >>
58 for sym in `cat UU/oldsyms`; do
59 echo " Propagating $hint variable "'$'"$sym..."
60 eval 'tmp="$'"${sym}"'"'
61 echo "$tmp" | \
62 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>
63 done
64 ;;
65 esac