This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Use a real compile to test for stdbool.h.
[metaconfig.git] / U / modified / Oldsym.U
CommitLineData
9b04e79a 1?RCS: $Id: Oldsym.U 1 2006-08-24 12:32:52Z rmanfredi $
959f3c4c 2?RCS:
9b04e79a 3?RCS: Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi
41322e17 4?RCS:
959f3c4c
JH
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
9b04e79a 9?RCS: of the source tree for dist 4.0.
959f3c4c
JH
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:
41322e17 18?X:
959f3c4c 19?X: This unit follows the creation of the config.sh file. It adds some
ff429c2d 20?X: special symbols: defines from patchlevel.h file if any and PERL_CONFIG_SH,
959f3c4c
JH
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.
41322e17 23?X:
9b04e79a 24?MAKE:Oldsym: Config_sh cat test hint src sed sort uniq perl_patchlevel
959f3c4c 25?MAKE: -pick add $@ %<
9b04e79a 26?T:PERL_CONFIG_SH PERL_PATCHLEVEL sym tmp
41322e17 27?F:!UU
959f3c4c
JH
28: add special variables
29$test -f $src/patchlevel.h && \
30awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
fbfb996d 31echo "PERL_PATCHLEVEL='$perl_patchlevel'" >>config.sh
ff429c2d 32echo "PERL_CONFIG_SH=true" >>config.sh
959f3c4c
JH
33
34: propagate old symbols
35if $test -f UU/config.sh; then
36?X: Make sure each symbol is unique in oldconfig.sh
a3e4b67c 37 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
959f3c4c
JH
38?X:
39?X: All the symbols that appear twice come only from config.sh (hence the
40?X: two config.sh in the command line). These symbols will be removed by
41?X: the uniq -u command. The oldsyms file thus contains all the symbols
42?X: that did not appear in the produced config.sh (Larry Wall).
43?X:
41322e17 44?X: Do not touch the -u flag of uniq. This means you too, Jarkko.
9b04e79a
MB
45?X:
46 $sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' \
47 config.sh config.sh UU/oldconfig.sh |\
48 $sort | $uniq -u >UU/oldsyms
02f3b9d4 49 set X `$cat UU/oldsyms`
959f3c4c
JH
50 shift
51 case $# in
52 0) ;;
53 *)
02f3b9d4 54 $cat <<EOM
959f3c4c
JH
55Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
56EOM
9b04e79a 57 echo ": Variables propagated from previous config.sh file." >>config.sh
02f3b9d4 58 for sym in `$cat UU/oldsyms`; do
959f3c4c
JH
59 echo " Propagating $hint variable "'$'"$sym..."
60 eval 'tmp="$'"${sym}"'"'
61 echo "$tmp" | \
62 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
63 done
64 ;;
65 esac
66fi
67