3 if test -f config.sh; then TOP=.;
4 elif test -f ../config.sh; then TOP=..;
5 elif test -f ../../config.sh; then TOP=../..;
6 elif test -f ../../../config.sh; then TOP=../../..;
7 elif test -f ../../../../config.sh; then TOP=../../../..;
9 echo "Can't find config.sh."; exit 1
15 */*) cd `expr X$0 : 'X\(.*\)/'` ;;
17 echo "Extracting mcon/mlint (with variable substitutions)"
18 cat >mlint <<!GROK!THIS!
20 eval "exec perl -S \$0 \$*"
21 if \$running_under_some_shell;
23 # $Id: mlint.SH,v 3.0.1.3 1994/05/06 15:20:42 ram Exp $
25 # Copyright (c) 1991-1993, Raphael Manfredi
27 # You may redistribute only under the terms of the Artistic Licence,
28 # as specified in the README file that comes with the distribution.
29 # You may reuse parts of this distribution only within the terms of
30 # that same Artistic Licence; a copy of which may be found at the root
31 # of the source tree for dist 3.0.
33 # Original Author: Harlan Stenn <harlan@mumps.pfcs.com>
36 # Revision 3.0.1.3 1994/05/06 15:20:42 ram
37 # patch23: added -L switch to override public unit repository path
39 # Revision 3.0.1.2 1994/01/24 14:21:00 ram
40 # patch16: added ~/.dist_profile awareness
42 # Revision 3.0.1.1 1993/08/19 06:42:27 ram
43 # patch1: leading config.sh searching was not aborting properly
45 # Revision 3.0 1993/08/18 12:10:17 ram
46 # Baseline for dist 3.0 netwide release.
52 \$version = '$VERSION';
53 \$patchlevel = '$PATCHLEVEL';
57 $spitshell >>mlint <<'!NO!SUBS!'
58 &profile; # Read ~/.dist_profile
60 &usage unless &Getopts("hklVL:");
63 print STDERR "metalint $version PL$patchlevel\n";
70 $MC = $opt_L if $opt_L; # May override library path
71 $MC = &tilda_expand($MC); # ~name expansion
72 chop($WD = `pwd`); # Working directory
73 chdir $MC || die "Can't chdir to $MC: $!\n";
74 chop($MC = `pwd`); # Real metalint lib path (no symbolic links)
75 chdir $WD || die "Can't chdir back to $WD: $!\n";
77 &init; # Various initializations
78 `mkdir .MT 2>&1` unless -d '.MT'; # For private temporary files
80 &locate_units; # Fill in @ARGV with a unit list
81 &extract_dependencies; # Extract dependencies from units
82 &sanity_checks; # Perform sanity checks
85 print "Leaving subdirectory .MT unremoved so you can peruse it.\n"
90 print "Done.\n" unless $opt_s;
92 # General initializations
94 &init_except; # Token which have upper-cased letters
95 &init_depend; # The %Depend array records control line handling
98 # Record the exceptions -- all symbols but these are lower case
107 $Except{'RCSfile'}++;
108 $Except{'Revision'}++;
113 # Print out metalint's usage and exits
116 Usage: metalint [-hklsV] [-L dir]
117 -h : print this help message and exits.
118 -k : keep temporary directory.
119 -l : also report problems from library units.
121 -L : specify main units repository.
122 -V : print version number and exits.
128 $grep -v '^;#' pl/locate.pl >>mlint
129 $grep -v '^;#' pl/lint.pl >>mlint
130 $grep -v '^;#' pl/init.pl >>mlint
131 $grep -v '^;#' pl/extract.pl >>mlint
132 $grep -v '^;#' pl/obsolete.pl >>mlint
133 $grep -v '^;#' pl/tsort.pl >>mlint
134 $grep -v '^;#' ../pl/tilde.pl >>mlint
135 $grep -v '^;#' ../pl/profile.pl >>mlint