Skip to content
This repository
Browse code

Configure output cleanup. Retasks --verbose to include the old output…

… for some steps; --verbose=2 now does what --verbose used to do.

Configure steps should not output anything under normal circumstances.  If you really feel the need to give some status info, set
$Configure::Step::result to a short string.


git-svn-id: https://svn.parrot.org/parrot/trunk@5564 d31e2699-5ff4-0310-a27c-f18f2fbe73fe
  • Loading branch information...
commit ab81b8c29893b785380139c79fb22bc0c0094013 1 parent 597f8d4
Brent Royal-Gordon authored March 06, 2004
6  Configure.pl
@@ -31,6 +31,11 @@ =head3 General Options
31 31
 Tells Configure.pl to output extra information about the configuration
32 32
 data it is setting.
33 33
 
  34
+=item C<--verbose=2>
  35
+
  36
+Tells Configure.pl to output information about i<every> setting added or 
  37
+changed.
  38
+
34 39
 =item C<--nomanicheck>
35 40
 
36 41
 Tells Configure.pl not to run the MANIFEST check.
@@ -444,6 +449,7 @@ END
444 449
    --help               Show this text
445 450
    --version            Show version information
446 451
    --verbose            Output extra information
  452
+   --verbose=2          Output every setting change
447 453
    --nomanicheck        Don't check the MANIFEST
448 454
    --maintainer         Create imcc's parser and lexer files. Needs a working
449 455
                         parser and lexer.
4  config/auto/alignptrs.pl
@@ -19,7 +19,7 @@ package Configure::Step;
19 19
 
20 20
 $description="Determining your minimum pointer alignment...";
21 21
 
22  
-@args=qw(miniparrot);
  22
+@args=qw(miniparrot verbose);
23 23
 
24 24
 sub runstep {
25 25
   my ($miniparrot) = @_;
@@ -33,7 +33,7 @@ sub runstep {
33 33
   # HP-UX 10.20/32 hangs in this test.
34 34
   # We currently don't need this configure setting,
35 35
   # so we just do not test and set some value here
36  
-  print(" not tested (4) ");
  36
+  print(" not tested (4) ") if $_[1];
37 37
   Configure::Data->set(ptr_alignment => 4);
38 38
   return;
39 39
 
8  config/auto/cgoto.pl
@@ -20,11 +20,11 @@ package Configure::Step;
20 20
 
21 21
 $description="Determining if your compiler supports computed goto...";
22 22
 
23  
-@args=qw(cgoto miniparrot);
  23
+@args=qw(cgoto miniparrot verbose);
24 24
 
25 25
 sub runstep {
26 26
   my $test;
27  
-  my ($cgoto, $miniparrot) = @_;
  27
+  my ($cgoto, $miniparrot, $verbose) = @_;
28 28
 
29 29
   $cgoto = 0 if (defined $miniparrot);
30 30
 
@@ -54,10 +54,10 @@ sub runstep {
54 54
                                 $(INC)/oplib/core_ops_cgp.h $(OPS)/core_ops_cgp.c',
55 55
       cg_flag       => '-DHAVE_COMPUTED_GOTO'
56 56
     );
57  
-    print " (yes) ";
  57
+    print " (yes) " if $verbose;
58 58
   }
59 59
   else {
60  
-    print " (no) ";
  60
+    print " (no) " if $verbose;
61 61
     Configure::Data->set(
62 62
       cg_h    => '',
63 63
       cg_c    => '',
9  config/auto/env.pl
@@ -19,6 +19,7 @@ package Configure::Step;
19 19
 use Parrot::Configure::Step ':auto';
20 20
 
21 21
 $description="Determining if your C library has setenv / unsetenv...";
  22
+@args=qw(verbose);
22 23
 
23 24
 sub runstep {
24 25
     my ($setenv, $unsetenv) = (0, 0);
@@ -48,16 +49,16 @@ sub runstep {
48 49
     );
49 50
 
50 51
     if ($setenv && $unsetenv) {
51  
-	print " (both) ";
  52
+	print " (both) " if $_[0];
52 53
     }
53 54
     elsif ($setenv) {
54  
-	print " (setenv) ";
  55
+	print " (setenv) " if $_[0];
55 56
     }
56 57
     elsif ($unsetenv) {
57  
-	print " (unsetenv) ";
  58
+	print " (unsetenv) " if $_[0];
58 59
     }
59 60
     else {
60  
-	print " (no) ";
  61
+	print " (no) " if $_[0];
61 62
     }
62 63
 }
63 64
 
4  config/auto/funcptr.pl
@@ -20,7 +20,7 @@ package Configure::Step;
20 20
 
21 21
 $description="Verifying that the compiler supports function pointer casts...";
22 22
 
23  
-@args=();
  23
+@args=qw(verbose);
24 24
 
25 25
 sub runstep {
26 26
   my $jitcapable=Configure::Data->get('jitcapable');
@@ -45,7 +45,7 @@ END
45 45
       exit(-1);
46 46
     }
47 47
     cc_clean();
48  
-    print " (yes) ";
  48
+    print " (yes) " if $_[0];
49 49
   }
50 50
 }
51 51
 
8  config/auto/gc.pl
@@ -41,13 +41,13 @@ package Configure::Step;
41 41
 use vars qw($description @args);
42 42
 use Parrot::Configure::Step ':auto';
43 43
 
44  
-$description="Determining what allocator to use ...";
  44
+$description="Determining what allocator to use...";
45 45
 
46 46
 # valid libc/malloc/malloc-trace/gc
47  
-@args=qw(gc);
  47
+@args=qw(gc verbose);
48 48
 
49 49
 sub runstep {
50  
-  my ($gc) = @_;
  50
+  my ($gc, $verbose) = @_;
51 51
 
52 52
   if (!defined($gc)) {
53 53
     # default is GC in resources.c
@@ -109,7 +109,7 @@ sub runstep {
109 109
       gc_flag  => '',
110 110
     );
111 111
   }
112  
-  print(" ($gc) ");
  112
+  print(" ($gc) ") if $verbose;
113 113
 }
114 114
 
115 115
 1;
6  config/auto/gcc.pl
@@ -20,7 +20,7 @@ package Configure::Step;
20 20
 
21 21
 $description="Determining if your C compiler is actually gcc...";
22 22
 
23  
-@args=qw(miniparrot);
  23
+@args=qw(miniparrot verbose);
24 24
 
25 25
 sub runstep {
26 26
   my ($miniparrot) = @_;
@@ -41,7 +41,7 @@ sub runstep {
41 41
   my $major = $gnuc{__GNUC__};
42 42
   my $minor = $gnuc{__GNUC_MINOR__};
43 43
   unless (defined $major) {
44  
-    print " (no) ";
  44
+    print " (no) " if $_[1];
45 45
     return;
46 46
   }
47 47
   if ($major =~ tr/0-9//c) {
@@ -54,7 +54,7 @@ sub runstep {
54 54
     $gccversion = $major;
55 55
     $gccversion .= ".$minor" if defined $minor;
56 56
   }
57  
-  print " (yep: $gccversion )";
  57
+  print " (yep: $gccversion )" if $_[1];
58 58
 
59 59
   if ($gccversion) {
60 60
     # If using gcc, crank up its warnings as much as possible and make it
8  config/auto/inline.pl
@@ -19,11 +19,11 @@ package Configure::Step;
19 19
 
20 20
 $description="Determining if your compiler supports inline...";
21 21
 
22  
-@args=qw(inline);
  22
+@args=qw(inline verbose);
23 23
 
24 24
 sub runstep {
25 25
     my $test;
26  
-    my ($inline) = @_;
  26
+    my ($inline, $verbose) = @_;
27 27
 
28 28
     if (defined $inline) {
29 29
 	$test = $inline;
@@ -46,10 +46,10 @@ sub runstep {
46 46
 	    cc_clean();
47 47
 	}
48 48
 	if ($test) {
49  
-	    print " ($test) ";
  49
+	    print " ($test) " if $verbose;
50 50
 	}
51 51
 	else {
52  
-	    print " no ";
  52
+	    print " no " if $verbose;
53 53
 	    $test = '';
54 54
 	}
55 55
     }
4  config/auto/isreg.pl
@@ -19,6 +19,8 @@ package Configure::Step;
19 19
 
20 20
 $description="Determining if your C library has a working S_ISREG...";
21 21
 
  22
+@args=qw(verbose);
  23
+
22 24
 sub runstep {
23 25
     my $test = 0;
24 26
 
@@ -32,7 +34,7 @@ sub runstep {
32 34
     Configure::Data->set(
33 35
 	isreg  => $test
34 36
     );
35  
-    print $test ? " (Yep) " : " (no) "
  37
+    print($test ? " (Yep) " : " (no) ") if $_[0];
36 38
 }
37 39
 
38 40
 1;
16  config/auto/jit.pl
@@ -18,14 +18,12 @@ package Configure::Step;
18 18
 use vars qw($description @args);
19 19
 use Parrot::Configure::Step qw(copy_if_diff);
20 20
 
21  
-print "\n";
22  
-
23 21
 $description = "Determining architecture, OS and JIT capability...";
24 22
 
25  
-@args=qw(jitcapable miniparrot execcapable);
  23
+@args=qw(jitcapable miniparrot execcapable verbose);
26 24
 
27 25
 sub runstep {
28  
-    my ($set_jitcapable, $miniparrot, $set_execcapable) = @_;
  26
+    my ($set_jitcapable, $miniparrot, $set_execcapable, $verbose) = @_;
29 27
 
30 28
     if (defined $miniparrot) {
31 29
       Configure::Data->set(
@@ -90,7 +88,7 @@ sub runstep {
90 88
   my $jitcapable               =  0;
91 89
   my $execcapable              =  0;
92 90
 
93  
-print "-e \"jit/$cpuarch/core.jit\" = ", -e "jit/$cpuarch/core.jit" ? 'yes' : 'no', "\n";
  91
+print("-e \"jit/$cpuarch/core.jit\" = ", -e "jit/$cpuarch/core.jit" ? 'yes' : 'no', "\n") if $verbose;
94 92
 
95 93
   if (-e "jit/$cpuarch/core.jit") {
96 94
     $jitcapable = 1;
@@ -155,21 +153,21 @@ sub runstep {
155 153
 
156 154
     # test for executable malloced memory
157 155
     if (-e "config/auto/jit/test_exec_$osname.in") {
158  
-      print " (has_exec_protect ";
  156
+      print " (has_exec_protect " if $verbose;
159 157
       cc_gen("config/auto/jit/test_exec_$osname.in");
160 158
       eval { cc_build(); };
161 159
       if ($@) {
162  
-	print " $@) ";
  160
+	print " $@) " if $verbose;
163 161
       }
164 162
       else {
165 163
 	if (cc_run(0) !~ /ok/ && cc_run(1) =~ /ok/) {
166 164
 	  Configure::Data->set(
167 165
 	    has_exec_protect => 1
168 166
 	  );
169  
-	  print "yes) ";
  167
+	  print "yes) " if $verbose;
170 168
 	}
171 169
 	else {
172  
-	  print "no) ";
  170
+	  print "no) " if $verbose;
173 171
 	}
174 172
       }
175 173
       cc_clean();
8  config/auto/memalign.pl
@@ -19,14 +19,14 @@ package Configure::Step;
19 19
 
20 20
 $description="Determining if your C library supports memalign...";
21 21
 
22  
-@args=qw(miniparrot);
  22
+@args=qw(miniparrot verbose);
23 23
 
24 24
 sub runstep {
25  
-    my ($miniparrot) = @_;
  25
+    my ($miniparrot, $verbose) = @_;
26 26
 
27 27
     if ($miniparrot) {
28 28
         Configure::Data->set(memalign => '');
29  
-	print "(skipped) ";
  29
+	print "(skipped) " if $verbose;
30 30
 	return;
31 31
     }
32 32
 
@@ -60,7 +60,7 @@ sub runstep {
60 60
     my $f = $test2 ? 'posix_memalign' :
61 61
             $test  ? 'memalign'       : '';
62 62
     Configure::Data->set( memalign => $f );
63  
-    print $test ? " (Yep:$f) " : " (no) "
  63
+    print($test ? " (Yep:$f) " : " (no) ") if $verbose;
64 64
 }
65 65
 
66 66
 1;
10  config/auto/signal.pl
@@ -19,10 +19,10 @@ package Configure::Step;
19 19
 
20 20
 $description = "Determining some signal stuff...";
21 21
 
22  
-@args=qw(miniparrot);
  22
+@args=qw(miniparrot verbose);
23 23
 
24 24
 sub runstep {
25  
-    my ($miniparrot) = @_;
  25
+    my ($miniparrot, $verbose) = @_;
26 26
     Configure::Data->set(
27 27
 	has___sighandler_t => undef,
28 28
 	has_sigatomic_t  => undef,
@@ -39,7 +39,7 @@ sub runstep {
39 39
 	Configure::Data->set(
40 40
 	    has___sighandler_t => 'define'
41 41
 	);
42  
-	print " (__sighandler_t)";
  42
+	print " (__sighandler_t)" if $verbose;
43 43
     }
44 44
     cc_clean();
45 45
 
@@ -49,7 +49,7 @@ sub runstep {
49 49
 	Configure::Data->set(
50 50
 	    has_sigaction => 'define'
51 51
 	);
52  
-	print " (sigaction)";
  52
+	print " (sigaction)" if $verbose;
53 53
     }
54 54
     cc_clean();
55 55
 
@@ -60,7 +60,7 @@ sub runstep {
60 60
 	    has_setitimer    => 'define',
61 61
 	    has_sig_atomic_t    => 'define'
62 62
 	);
63  
-	print " (setitimer) ";
  63
+	print " (setitimer) " if $verbose;
64 64
     }
65 65
     cc_clean();
66 66
 
8  config/gen/icu.pl
@@ -17,15 +17,15 @@ package Configure::Step;
17 17
 use strict;
18 18
 use vars qw($description @args);
19 19
 
20  
-$description="Configuring ICU ...";
  20
+$description="Configuring ICU if requested...";
21 21
 
22  
-@args=qw(buildicu);
  22
+@args=qw(buildicu verbose);
23 23
 
24 24
 sub runstep {
25  
-  my ($buildicu) = @_;
  25
+  my ($buildicu, $verbose) = @_;
26 26
 
27 27
   unless ($buildicu) {
28  
-    print " [Skipped] ";
  28
+    print " [Skipped] " if $verbose;
29 29
     return;
30 30
   }
31 31
 
6  config/gen/parrot_include.pl
@@ -18,7 +18,7 @@ package Configure::Step;
18 18
 use vars qw($description @args);
19 19
 use Parrot::Configure::Step ':gen';
20 20
 
21  
-$description="Generating runtime/parrot/include ... ";
  21
+$description="Generating runtime/parrot/include...";
22 22
 
23 23
 my @files = qw(
24 24
     include/parrot/chartype.h
@@ -39,7 +39,7 @@ package Configure::Step;
39 39
 );
40 40
 my $destdir = 'runtime/parrot/include';
41 41
 
42  
-@args=();
  42
+@args=qw(verbose);
43 43
 
44 44
 sub runstep {
45 45
     # need vtable.h now
@@ -58,7 +58,7 @@ sub runstep {
58 58
 		!x
59 59
 	    ) {
60 60
 		$inc = $2;
61  
-		print "$2 ";
  61
+		print "$2 " if $_[0];
62 62
 		$prefix = ($4 || '');
63 63
 		$subst = ($6 || '');
64 64
 		$in_def = $1;
4  config/gen/platform.pl
@@ -20,7 +20,7 @@ package Configure::Step;
20 20
 
21 21
 $description="Moving platform files into place...";
22 22
 
23  
-@args=qw(miniparrot);
  23
+@args=qw(miniparrot verbose);
24 24
 
25 25
 sub runstep {
26 26
   my $platform=lc $^O;
@@ -40,7 +40,7 @@ sub runstep {
40 40
 
41 41
   open PLATFORM_H, "> include/parrot/platform.h"
42 42
       or die "Can't open include/parrot/platform.h: $!";
43  
-  print " platform='$platform' ";
  43
+  print " platform='$platform' " if $_[1];
44 44
 
45 45
   print PLATFORM_H <<HERE;
46 46
 #if !defined(PARROT_PLATFORM_H_GUARD)
2  config/init/data.pl
@@ -132,7 +132,7 @@ sub runstep {
132 132
     @c{@_};
133 133
   };
134 134
 
135  
-  *set=$verbose
  135
+  *set=defined($verbose) && $verbose == 2
136 136
     ? sub {
137 137
       shift;
138 138
       return unless (defined ($_[0]));
12  config/init/hints.pl
@@ -21,29 +21,29 @@ package Configure::Step;
21 21
 
22 22
 $description="Loading platform and local hints files...";
23 23
 
24  
-@args = qw( cc );
  24
+@args = qw( cc verbose );
25 25
 
26 26
 sub runstep {
27 27
   my $hints = "config/init/hints/" . lc($^O) . ".pl";
28 28
   my $hints_used = 0;
29  
-  print "[ ";
  29
+  print "[ " if $_[1];
30 30
   if(-e $hints) {
31  
-    print "$hints ";
  31
+    print "$hints " if $_[1];
32 32
     do $hints;
33 33
     die $@ if $@;
34 34
     $hints_used++;
35 35
   }
36 36
   $hints = "config/init/hints/local.pl";
37 37
   if(-e $hints) {
38  
-    print "$hints ";
  38
+    print "$hints " if $_[1];
39 39
     do $hints;
40 40
     die $@ if $@;
41 41
     $hints_used++;
42 42
   }
43 43
   if ($hints_used == 0) {
44  
-    print "(no hints) ";
  44
+    print "(no hints) " if $_[1];
45 45
   }
46  
-  print "]";
  46
+  print "]" if $_[1];
47 47
 }
48 48
 
49 49
 1;
4  config/init/optimize.pl
@@ -21,7 +21,7 @@ package Configure::Step;
21 21
 
22 22
 $description="Enabling optimization...";
23 23
 
24  
-@args=();
  24
+@args=qw(verbose);
25 25
 
26 26
 sub runstep {
27 27
   if (Configure::Data->get('optimize')) {
@@ -34,7 +34,7 @@ sub runstep {
34 34
                         );
35 35
   }
36 36
   else {
37  
-    print "(none requested) ";
  37
+    print "(none requested) " if $_[0];
38 38
   }
39 39
 }
40 40
 
5  lib/Parrot/Configure/RunSteps.pm
@@ -81,7 +81,8 @@ sub runsteps {
81 81
 		die "No config/$_" unless -e "config/$_";
82 82
 		require "config/$_";
83 83
 		print "\n$Configure::Step::description";
84  
-		print "\n" if $args{verbose};
  84
+		print '.' x (70-length $Configure::Step::description);
  85
+		print "\n" if $args{verbose} && $args{verbose} == 2;
85 86
 
86 87
         $Configure::Step::result='done';
87 88
 
@@ -90,7 +91,7 @@ sub runsteps {
90 91
 			Configure::Step::runstep(@args{@Configure::Step::args});
91 92
 		}
92 93
 
93  
-		print "..." if $args{verbose};
  94
+		print "..." if $args{verbose} && $args{verbose} == 2;
94 95
 		print "$Configure::Step::result." unless m{^inter/} && $args{ask};
95 96
 	}
96 97
 }

0 notes on commit ab81b8c

Please sign in to comment.
Something went wrong with that request. Please try again.