Ticket #110: autom4te.diff
File autom4te.diff, 2.0 KB (added by , 8 years ago) |
---|
-
autom4te
old new 41 41 use Autom4te::General; 42 42 use Autom4te::XFile; 43 43 use File::Basename; 44 use File::Temp; 44 45 use strict; 45 46 46 47 # Data directory. … … 64 65 my $tcache; 65 66 my $ocache; 66 67 my $icache_file; 68 my $response_fh; 67 69 68 70 my $flock_implemented = 'yes'; 69 71 … … 231 233 { 232 234 my (@file) = @_; 233 235 my @res; 236 237 if ($^O eq 'os2') 238 { 239 # On OS/2, there is a 32K limit on the program arguments size but 240 # the options may grow more. Use a response file. 241 242 $response_fh = new File::Temp(UNLINK => 1); 243 } 244 234 245 foreach my $file (@file) 235 246 { 236 247 my $arg = shell_quote ($file); 237 248 if ($file =~ /\.m4f$/) 238 249 { 239 $arg = "--reload-state=$arg"; 250 if ($^O eq 'os2') 251 { 252 $arg = "--reload-state=$arg" ."\n"; 253 } 254 else 255 { 256 $arg = "--reload-state=$arg"; 257 } 240 258 # If the user downgraded M4 from 1.6 to 1.4.x after freezing 241 259 # the file, then we ensure the frozen __m4_version__ will 242 260 # not cause m4_init to make the wrong decision about the 243 261 # current M4 version. 244 $arg .= " --undefine=__m4_version__" 245 unless grep {/__m4_version__/} @m4_builtin; 262 if ($^O eq 'os2') 263 { 264 $arg .= "--undefine=__m4_version__" 265 unless grep {/__m4_version__/} @m4_builtin; 266 } 267 else 268 { 269 $arg .= " --undefine=__m4_version__" 270 unless grep {/__m4_version__/} @m4_builtin; 271 } 246 272 } 247 push @res, $arg; 273 if ($^O eq 'os2') 274 { 275 # remove leading and trailing ' 276 $arg =~ s/'//g; 277 print $response_fh $arg . "\n"; 278 } 279 else 280 { 281 push @res, $arg; 282 } 248 283 } 284 285 if ($^O eq 'os2') 286 { 287 $response_fh->flush; 288 push @res, "\@$response_fh"; 289 } 290 249 291 return join ' ', @res; 250 292 } 251 293