This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perl5.000 patch.0f: [enable metaconfig (PL48) users to regenerate Configure]
[perl5.git] / U / Extract.U
CommitLineData
5f51ce50
AD
1?RCS: $Id: Extract.U,v 3.0.1.1 1994/10/29 15:51:46 ram Exp $
2?RCS:
3?RCS: Copyright (c) 1991-1993, 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 3.0.
10?RCS:
11?RCS: This private version for perl5 will also extract files from
12?RCS: extension MANIFEST. (ext/Blah/MANIFEST).
13?RCS:
14?RCS: $Log: Extract.U,v $
15?RCS: Revision 3.0.1.1 1994/10/29 15:51:46 ram
16?RCS: patch36: added ?F: line for metalint file checking
17?RCS:
18?RCS: Revision 3.0 1993/08/18 12:04:52 ram
19?RCS: Baseline for dist 3.0 netwide release.
20?RCS:
21?X:
22?X: This unit produces a shell script which can be doted in order to extract
23?X: .SH files with variable substitutions.
24?X:
25?MAKE:Extract: Nothing
26?MAKE: -pick add $@ %<
27?F:./extract !config_h.SH
28?T:CONFIG dir file shlist xxx
29: script used to extract .SH files with variable substitutions
30cat >extract <<'EOS'
31CONFIG=true
32echo "Doing variable substitutions on .SH files..."
33if test -f MANIFEST; then
34 shlist=`awk '{print $1}' <MANIFEST | grep '\.SH'`
35 : Pick up possible extension manifests.
36 for dir in ext/* ; do
37 if test -f $dir/MANIFEST; then
38 xxx=`awk '{print $1}' < $dir/MANIFEST |
39 sed -n "/\.SH$/ s@^@$dir/@p"`
40 shlist="$shlist $xxx"
41 fi
42 done
43 set x $shlist
44else
45 echo "(Looking for .SH files under the current directory.)"
46 set x `find . -name "*.SH" -print`
47fi
48shift
49case $# in
500) set x *.SH; shift;;
51esac
52if test ! -f $1; then
53 shift
54fi
55for file in $*; do
56 case "$file" in
57 */*)
58 dir=`expr X$file : 'X\(.*\)/'`
59 file=`expr X$file : 'X.*/\(.*\)'`
60 (cd $dir && . ./$file)
61 ;;
62 *)
63 . ./$file
64 ;;
65 esac
66done
67if test -f config_h.SH; then
68 if test ! -f config.h; then
69 : oops, they left it out of MANIFEST, probably, so do it anyway.
70 . ./config_h.SH
71 fi
72fi
73EOS
74