On Wed, Jun 15, 2005 at 10:14:11AM -0500, Steve Peters wrote:
> On Wed, Jun 15, 2005 at 09:39:53AM -0500, Steve Peters wrote:
> 
> > When you try running Perl-5.8.6 with a -f (which isn't valid), 
> > you'll see 
> >   > perl -f
> >   Unrecognized switch: -f  (-h will show valid options).
> > 
> > When currently running blead, Perl waits patiently for STDIN, 
> > even though not compiled to do site customization.  The 
> > following patch makes all the -f related code fully 
> > dependent on USE_SITECUSTOMIZE.  It also quiets a warning on
> > the noisy aCC compiler on HP-UX.
> > 
> 
> Hold this thought for a minute.  ext/Devel/DProf/t/DProf.t expects
> the -f flag is available no matter what.  I'll have a patch for
> ext/Devel/DProf/t/DProf.t shortly.
> 

OK, the attached includes changes to both perl.c and 
ext/Devel/DProf/t/DProf.t to support -f only when available.

Steve Peters
[EMAIL PROTECTED]
--- perl.c.old  Tue Jun 14 04:20:15 2005
+++ perl.c      Wed Jun 15 09:28:56 2005
@@ -1282,7 +1282,9 @@
     register SV *sv;
     register char *s;
     const char *cddir = Nullch;
+#ifdef USE_SITECUSTOMIZE
     bool minus_f = FALSE;
+#endif
 
     PL_fdscript = -1;
     PL_suidscript = -1;
@@ -1376,11 +1378,13 @@
            sv_catpv(PL_e_script, "\n");
            break;
 
+#ifdef USE_SITECUSTOMIZE
        case 'f':
            minus_f = TRUE;
            s++;
            goto reswitch;
 
+#endif
        case 'I':       /* -I handled both here and in moreswitches() */
            forbid_setid("-I");
            if (!*++s && (s=argv[1]) != Nullch) {
--- ext/Devel/DProf/t/DProf.t.old       Fri Mar 18 08:29:42 2005
+++ ext/Devel/DProf/t/DProf.t   Wed Jun 15 11:25:36 2005
@@ -17,6 +17,7 @@
 }
 
 use Benchmark qw( timediff timestr );
+use Config;
 use Getopt::Std 'getopts';
 getopts('vI:p:');
 
@@ -45,10 +46,11 @@
        my $test = shift;
        my @results;
        local $ENV{PERL5LIB} = $perl5lib;
+        my $opt_f = $Config{ccflags} =~ /USE_SITECUSTOMIZE/ ? '-f' : '';
        my $opt_d = '-d:DProf';
-
+        
        my $t_start = new Benchmark;
-        open( R, "$perl -f \"$opt_d\" $test |" ) || warn "$0: Can't run. $!\n";
+        open( R, "$perl $opt_f \"$opt_d\" $test |" ) || warn "$0: Can't run. 
$!\n";
        @results = <R>;
        close R or warn "Could not close: $!";
        my $t_total = timediff( new Benchmark, $t_start );

Reply via email to