vms/gen_shrfls.pl more general config.sh parsing
Charles Lane [Wed, 7 Nov 2001 09:23:28 +0000 (04:23 -0500)]
Message-Id: <011107092325.11726@DUPHY4.Physics.Drexel.Edu>

(Also i seems that an unrelated experimental patch
 to lib/ExtUtils/MM_Unix.pm was accidentally included.)

p4raw-id: //depot/perl@12883

lib/ExtUtils/MM_Unix.pm
vms/gen_shrfls.pl

index e6c6766..8b236fc 100644 (file)
@@ -397,6 +397,9 @@ sub cflags {
        $pollute = '$(PERL_MALLOC_DEF)';
     }
 
+    $self->{CCFLAGS}  =~ s/([()])/\\$1/g;
+    $self->{OPTIMIZE} =~ s/([()])/\\$1/g;
+
     return $self->{CFLAGS} = qq{
 CCFLAGS = $self->{CCFLAGS}
 OPTIMIZE = $self->{OPTIMIZE}
@@ -502,6 +505,7 @@ sub const_config {
     foreach $m (@{$self->{CONFIG}}){
        # SITE*EXP macros are defined in &constants; avoid duplicates here
        next if $once_only{$m} or $m eq 'sitelibexp' or $m eq 'sitearchexp';
+       $self->{uc $m} =~ s/([()])/\\$1/g;
        push @m, "\U$m\E = ".$self->{uc $m}."\n";
        $once_only{$m} = 1;
     }
index d393b0f..a0ade7e 100644 (file)
@@ -75,13 +75,13 @@ if ($docc) {
   $config = $dir . "config.sh";
   open CONFIG, "< $config";
   while(<CONFIG>) {
-    $use_threads++ if /usethreads='define'/;
-    $use_mymalloc++ if /usemymalloc='Y'/;
-    $care_about_case++ if /d_vms_case_sensitive_symbols='define'/;
-    $debugging_enabled++ if /usedebugging_perl='Y'/;
-    $hide_mymalloc++ if /embedmymalloc='Y'/;
+    $use_threads++ if /usethreads='(define|yes|true|t|y|1)'/i;
+    $use_mymalloc++ if /usemymalloc='(define|yes|true|t|y1)'/i;
+    $care_about_case++ if /d_vms_case_sensitive_symbols='(define|yes|true|t|y|1)'/i;
+    $debugging_enabled++ if /usedebugging_perl='(define|yes|true|t|y|1)'/i;
+    $hide_mymalloc++ if /embedmymalloc='(define|yes|true|t|y|1)'/i;
     $isgcc++ if /gccversion='[^']/;
-    $use_perlio++ if /useperlio='define'/;
+    $use_perlio++ if /useperlio='(define|yes|true|t|y|1)'/i;
   }
   close CONFIG;