4 use File::Basename qw(basename dirname);
7 # List explicitly here the variables you want Configure to
8 # generate. Metaconfig only looks for shell variables, so you
9 # have to mention them as if they were shell variables, not
10 # %Config entries. Thus you write
12 # to ensure Configure will look for $Config{startperl}.
15 # This forces PL files to create target in same directory as PL file.
16 # This is so that make depend always knows where to find PL derivatives.
19 $file = basename($0, '.PL');
20 $file .= '.com' if $^O eq 'VMS';
22 open OUT,">$file" or die "Can't create $file: $!";
24 print "Extracting $file (with variable substitutions)\n";
26 # In this section, perl variables will be expanded during extraction.
27 # You can use $Config{...} to use Configure variables.
29 print OUT <<"!GROK!THIS!";
31 eval 'exec $Config{perlpath} -S \$0 \${1+"\$@"}'
32 if \$running_under_some_shell;
35 # In the following, perl variables are not expanded during extraction.
37 print OUT <<'!NO!SUBS!';
42 use File::Path qw(mkpath);
45 # Make sure read permissions for all are set:
46 if (defined umask && (umask() & 0444)) {
47 umask (umask() & ~0444);
51 use vars qw($opt_D $opt_d $opt_r $opt_l $opt_h $opt_a $opt_Q $opt_e);
52 die "-r and -a options are mutually exclusive\n" if ($opt_r and $opt_a);
53 my @inc_dirs = inc_dirs() if $opt_a;
57 my $Dest_dir = $opt_d || $Config{installsitearch};
58 die "Destination directory $Dest_dir doesn't exist or isn't a directory\n"
71 @isatype{@isatype} = (1) x @isatype;
76 @ARGV = ('-') unless @ARGV;
78 build_preamble_if_necessary();
87 my ($t, $tab, %curargs, $new, $eval_index, $dir, $name, $args, $outfile);
88 my ($incl, $incl_type, $next);
89 while (defined (my $file = next_file())) {
90 if (-l $file and -d $file) {
91 link_if_possible($file) if ($opt_l);
95 # Recover from header files with unbalanced cpp directives
99 # $eval_index goes into ``#line'' directives, to help locate syntax errors:
106 ($outfile = $file) =~ s/\.h$/.ph/ || next;
107 print "$file -> $outfile\n" unless $opt_Q;
108 if ($file =~ m|^(.*)/|) {
110 mkpath "$Dest_dir/$dir";
113 if ($opt_a) { # automagic mode: locate header file in @inc_dirs
114 foreach (@inc_dirs) {
120 open(IN,"$file") || (($Exit = 1),(warn "Can't open $file: $!\n"),next);
121 open(OUT,">$Dest_dir/$outfile") || die "Can't create $outfile: $!\n";
125 "require '_h2ph_pre.ph';\n\n",
126 "no warnings 'redefine';\n\n";
128 while (defined (local $_ = next_line($file))) {
130 if (s/^define\s+(\w+)//) {
134 s/\(\w+\s*\(\*\)\s*\(\w*\)\)\s*(-?\d+)/$1/; # (int (*)(foo_t))0
135 if (s/^\(([\w,\s]*)\)//) {
140 foreach my $arg (split(/,\s*/,$args)) {
141 $arg =~ s/^\s*([^\s].*[^\s])\s*$/$1/;
144 $args =~ s/\b(\w)/\$$1/g;
145 $args = "local($args) = \@_;\n$t ";
149 $new =~ s/(["\\])/\\$1/g; #"]);
151 $new = reindent($new);
152 $args = reindent($args);
154 $new =~ s/(['\\])/\\$1/g; #']);
157 "eval \"\\n#line $eval_index $outfile\\n\" . 'sub $name $proto\{\n$t ${args}eval q($new);\n$t}' unless defined(\&$name);\n";
161 "eval 'sub $name $proto\{\n$t ${args}eval q($new);\n$t}' unless defined(\&$name);\n";
164 print OUT "unless(defined(\&$name)) {\n sub $name $proto\{\n\t${args}eval q($new);\n }\n}\n";
170 $new = 1 if $new eq '';
171 $new = reindent($new);
172 $args = reindent($args);
174 $new =~ s/(['\\])/\\$1/g; #']);
177 print OUT $t,"eval \"\\n#line $eval_index $outfile\\n\" . 'sub $name () {",$new,";}' unless defined(\&$name);\n";
180 print OUT $t,"eval 'sub $name () {",$new,";}' unless defined(\&$name);\n";
183 # Shunt around such directives as `#define FOO FOO':
184 next if " \&$name" eq $new;
186 print OUT $t,"unless(defined(\&$name)) {\n sub $name () {\t",$new,";}\n}\n";
189 } elsif (/^(include|import|include_next)\s*[<\"](.*)[>\"]/) {
192 if (($incl_type eq 'include_next') ||
193 ($opt_e && exists($bad_file{$incl}))) {
194 $incl =~ s/\.h$/.ph/;
198 $t = "\t" x ($tab / 8) . ' ' x ($tab % 8);
199 print OUT ($t, "my(\@REM);\n");
200 if ($incl_type eq 'include_next') {
202 "my(\%INCD) = map { \$INC{\$_} => 1 } ",
203 "(grep { \$_ eq \"$incl\" } ",
206 "\@REM = map { \"\$_/$incl\" } ",
207 "(grep { not exists(\$INCD{\"\$_/$incl\"})",
208 " and -f \"\$_/$incl\" } \@INC);\n");
211 "\@REM = map { \"\$_/$incl\" } ",
212 "(grep {-r \"\$_/$incl\" } \@INC);\n");
215 "require \"\$REM[0]\" if \@REM;\n");
217 $t = "\t" x ($tab / 8) . ' ' x ($tab % 8);
221 "warn(\$\@) if \$\@;\n");
223 $incl =~ s/\.h$/.ph/;
224 print OUT $t,"require '$incl';\n";
226 } elsif (/^ifdef\s+(\w+)/) {
227 print OUT $t,"if(defined(&$1)) {\n";
229 $t = "\t" x ($tab / 8) . ' ' x ($tab % 8);
230 } elsif (/^ifndef\s+(\w+)/) {
231 print OUT $t,"unless(defined(&$1)) {\n";
233 $t = "\t" x ($tab / 8) . ' ' x ($tab % 8);
234 } elsif (s/^if\s+//) {
239 print OUT $t,"if($new) {\n";
241 $t = "\t" x ($tab / 8) . ' ' x ($tab % 8);
242 } elsif (s/^elif\s+//) {
248 $t = "\t" x ($tab / 8) . ' ' x ($tab % 8);
249 print OUT $t,"}\n elsif($new) {\n";
251 $t = "\t" x ($tab / 8) . ' ' x ($tab % 8);
254 $t = "\t" x ($tab / 8) . ' ' x ($tab % 8);
255 print OUT $t,"} else {\n";
257 $t = "\t" x ($tab / 8) . ' ' x ($tab % 8);
260 $t = "\t" x ($tab / 8) . ' ' x ($tab % 8);
262 } elsif(/^undef\s+(\w+)/) {
263 print OUT $t, "undef(&$1) if defined(&$1);\n";
264 } elsif(/^error\s+(".*")/) {
265 print OUT $t, "die($1);\n";
266 } elsif(/^error\s+(.*)/) {
267 print OUT $t, "die(\"", quotemeta($1), "\");\n";
268 } elsif(/^warning\s+(.*)/) {
269 print OUT $t, "warn(\"", quotemeta($1), "\");\n";
270 } elsif(/^ident\s+(.*)/) {
271 print OUT $t, "# $1\n";
273 } elsif (/^\s*(typedef\s*)?enum\s*(\s+[a-zA-Z_]\w*\s*)?/) { # { for vi
274 until(/\{[^}]*\}.*;/ || /;/) {
275 last unless defined ($next = next_line($file));
277 # drop "#define FOO FOO" in enums
278 $next =~ s/^\s*#\s*define\s+(\w+)\s+\1\s*$//;
280 print OUT "# $next\n" if $opt_D;
282 s/#\s*if.*?#\s*endif//g; # drop #ifdefs
285 next unless /^\s?(typedef\s?)?enum\s?([a-zA-Z_]\w*)?\s?\{(.*)\}\s?([a-zA-Z_]\w*)?\s?;/;
286 (my $enum_subs = $3) =~ s/\s//g;
287 my @enum_subs = split(/,/, $enum_subs);
289 foreach my $enum (@enum_subs) {
290 my ($enum_name, $enum_value) = $enum =~ /^([a-zA-Z_]\w*)(=.+)?$/;
291 $enum_value =~ s/^=//;
292 $enum_val = (length($enum_value) ? $enum_value : $enum_val + 1);
295 "eval(\"\\n#line $eval_index $outfile\\n",
296 "sub $enum_name () \{ $enum_val; \}\") ",
297 "unless defined(\&$enum_name);\n");
301 "eval(\"sub $enum_name () \{ $enum_val; \}\") ",
302 "unless defined(\&$enum_name);\n");
305 } elsif (/^(?:__extension__\s+)?(?:extern|static)\s+(?:__)?inline(?:__)?\s+/
306 and !/;\s*$/ and !/{\s*}\s*$/)
308 # This is a hack to parse the inline functions in the glibc headers.
309 # Warning: massive kludge ahead. We suppose inline functions
310 # are mainly constructed like macros.
312 last unless defined ($next = next_line($file));
314 undef $_, last if $next =~ /__THROW\s*;/
315 or $next =~ /^(__extension__|extern|static)\b/;
317 print OUT "# $next\n" if $opt_D;
318 last if $next =~ /^}|^{.*}\s*$/;
320 next if not defined; # because it's only a prototype
321 s/\b(__extension__|extern|static|(?:__)?inline(?:__)?)\b//g;
322 # violently drop #ifdefs
323 s/#\s*if.*?#\s*endif//g
324 and print OUT "# some #ifdef were dropped here -- fill in the blanks\n";
325 if (s/^(?:\w|\s|\*)*\s(\w+)\s*//) {
328 warn "name not found"; next; # shouldn't occur...
331 if (s/^\(([^()]*)\)\s*(\w+\s*)*//) {
332 for my $arg (split /,/, $1) {
333 if ($arg =~ /(\w+)\s*$/) {
341 ? "local(" . (join ',', map "\$$_", @args) . ") = \@_;\n$t "
344 my $proto = @args ? '' : '() ';
346 s/\breturn\b//g; # "return" doesn't occur in macros usually...
348 # try to find and perlify local C variables
349 our @local_variables = (); # needs to be a our(): (?{...}) bug workaround
352 my $typelist = join '|', keys %isatype;
354 (?:(?:un)?signed\s+)?
358 (?{ push @local_variables, $1 })
362 (?:(?:un)?signed\s+)?
366 (?{ push @local_variables, $1 })
370 $new =~ s/&$_\b/\$$_/g for @local_variables;
371 $new =~ s/(["\\])/\\$1/g; #"]);
372 # now that's almost like a macro (we hope)
376 $Is_converted{$file} = 1;
377 if ($opt_e && exists($bad_file{$file})) {
378 unlink($Dest_dir . '/' . $outfile);
382 queue_includes_from($file) if $opt_a;
386 if ($opt_e && (scalar(keys %bad_file) > 0)) {
387 warn "Was unable to convert the following files:\n";
388 warn "\t" . join("\n\t",sort(keys %bad_file)) . "\n";
396 $joined_args = join('|', keys(%curargs));
399 s/^\&\&// && do { $new .= " &&"; next;}; # handle && operator
400 s/^\&([\(a-z\)]+)/$1/i; # hack for things that take the address of
401 s/^(\s+)// && do {$new .= ' '; next;};
402 s/^0X([0-9A-F]+)[UL]*//i
405 if (length $hex > 8 && !$Config{use64bitint}) {
406 # Croak if nv_preserves_uv_bits < 64 ?
407 $new .= hex(substr($hex, -8)) +
408 2**32 * hex(substr($hex, 0, -8));
409 # The above will produce "errorneus" code
410 # if the hex constant was e.g. inside UINT64_C
411 # macro, but then again, h2ph is an approximation.
413 $new .= lc("0x$hex");
416 s/^(-?\d+\.\d+E[-+]?\d+)[FL]?//i && do {$new .= $1; next;};
417 s/^(\d+)\s*[LU]*//i && do {$new .= $1; next;};
418 s/^("(\\"|[^"])*")// && do {$new .= $1; next;};
419 s/^'((\\"|[^"])*)'// && do {
421 $new .= "ord('\$$1')";
427 # replace "sizeof(foo)" with "{foo}"
428 # also, remove * (C dereference operator) to avoid perl syntax
429 # problems. Where the %sizeof array comes from is anyone's
430 # guess (c2ph?), but this at least avoids fatal syntax errors.
431 # Behavior is undefined if sizeof() delimiters are unbalanced.
432 # This code was modified to able to handle constructs like this:
433 # sizeof(*(p)), which appear in the HP-UX 10.01 header files.
434 s/^sizeof\s*\(// && do {
436 my $lvl = 1; # already saw one open paren
437 # tack { on the front, and skip it in the loop
440 # find balanced closing paren
441 while ($index <= length($_) && $lvl > 0) {
442 $lvl++ if substr($_, $index, 1) eq "(";
443 $lvl-- if substr($_, $index, 1) eq ")";
446 # tack } on the end, replacing )
447 substr($_, $index - 1, 1) = "}";
448 # remove pesky * operators within the sizeof argument
449 substr($_, 0, $index - 1) =~ s/\*//g;
453 /\(([\w\s]+)[\*\s]*\)\s*[\w\(]/ && do {
455 foreach (split /\s+/, $1) { # Make sure all the words are types,
456 unless($isatype{$_} or $_ eq 'struct' or $_ eq 'union'){
462 s/\([\w\s]+[\*\s]*\)// && next; # then eliminate them.
465 # struct/union member, including arrays:
466 s/^([_A-Z]\w*(\[[^\]]+\])?((\.|->)[_A-Z]\w*(\[[^\]]+\])?)+)//i && do {
468 $id =~ s/(\.|(->))([^\.\-]*)/->\{$3\}/g;
469 $id =~ s/\b([^\$])($joined_args)/$1\$$2/g if length($joined_args);
470 while($id =~ /\[\s*([^\$\&\d\]]+)\]/) {
473 if(exists($curargs{$index})) {
478 $id =~ s/\[\s*([^\$\&\d\]]+)\]/[$index]/;
482 s/^([_a-zA-Z]\w*)// && do {
484 if ($id eq 'struct' || $id eq 'union') {
488 } elsif ($id =~ /^((un)?signed)|(long)|(short)$/) {
489 while (s/^\s+(\w+)//) { $id .= ' ' . $1; }
494 $new .= '->' if /^[\[\{]/;
495 } elsif ($id eq 'defined') {
498 s/^\s*\((\w),/("$1",/ if $id =~ /^_IO[WR]*$/i; # cheat
500 } elsif ($isatype{$id}) {
501 if ($new =~ /{\s*$/) {
503 } elsif ($new =~ /\(\s*$/ && /^[\s*]*\)/) {
507 $new .= q(').$id.q(');
510 if ($inif && $new !~ /defined\s*\($/) {
511 $new .= '(defined(&' . $id . ') ? &' . $id . ' : 0)';
520 s/^(.)// && do { if ($1 ne '#') { $new .= $1; } next;};
529 my $pre_sub_tri_graphs = 1;
531 READ: while (not eof IN) {
534 next unless length $in;
537 if ($pre_sub_tri_graphs) {
538 # Preprocess all tri-graphs
539 # including things stuck in quoted string constants.
540 $in =~ s/\?\?=/#/g; # | ??=| #|
541 $in =~ s/\?\?\!/|/g; # | ??!| ||
542 $in =~ s/\?\?'/^/g; # | ??'| ^|
543 $in =~ s/\?\?\(/[/g; # | ??(| [|
544 $in =~ s/\?\?\)/]/g; # | ??)| ]|
545 $in =~ s/\?\?\-/~/g; # | ??-| ~|
546 $in =~ s/\?\?\//\\/g; # | ??/| \|
547 $in =~ s/\?\?</{/g; # | ??<| {|
548 $in =~ s/\?\?>/}/g; # | ??>| }|
550 if ($in =~ /^\#ifdef __LANGUAGE_PASCAL__/) {
551 # Tru64 disassembler.h evilness: mixed C and Pascal.
557 if ($in =~ /^extern inline / && # Inlined assembler.
558 $^O eq 'linux' && $file =~ m!(?:^|/)asm/[^/]+\.h$!) {
564 if ($in =~ s/\\$//) { # \-newline
567 } elsif ($in =~ s/^([^"'\\\/]+)//) { # Passthrough
569 } elsif ($in =~ s/^(\\.)//) { # \...
571 } elsif ($in =~ /^'/) { # '...
572 if ($in =~ s/^('(\\.|[^'\\])*')//) {
577 } elsif ($in =~ /^"/) { # "...
578 if ($in =~ s/^("(\\.|[^"\\])*")//) {
583 } elsif ($in =~ s/^\/\/.*//) { # //...
585 } elsif ($in =~ m/^\/\*/) { # /*...
586 # C comment removal adapted from perlfaq6:
587 if ($in =~ s/^\/\*[^*]*\*+([^\/*][^*]*\*+)*\///) {
589 } else { # Incomplete /* */
592 } elsif ($in =~ s/^(\/)//) { # /...
594 } elsif ($in =~ s/^([^\'\"\\\/]+)//) {
596 } elsif ($^O eq 'linux' &&
597 $file =~ m!(?:^|/)linux/byteorder/pdp_endian\.h$! &&
598 $in =~ s!\'T KNOW!!) {
599 $out =~ s!I DON$!I_DO_NOT_KNOW!;
602 warn "Cannot parse $file:\n$in\n";
603 $bad_file{$file} = 1;
608 die "Cannot parse:\n$in\n";
613 last READ if $out =~ /\S/;
620 # Handle recursive subdirectories without getting a grotesquely big stack.
621 # Could this be implemented using File::Find?
629 if ($file eq '-' or -f $file or -l $file) {
635 print STDERR "Skipping directory `$file'\n";
640 print STDERR "Skipping `$file': not a file or directory\n";
648 # Put all the files in $directory into @ARGV for processing.
651 my ($directory) = @_;
653 $directory =~ s:/$::;
655 opendir DIR, $directory;
656 foreach (readdir DIR) {
657 next if ($_ eq '.' or $_ eq '..');
659 # expand_glob() is going to be called until $ARGV[0] isn't a
660 # directory; so push directories, and unshift everything else.
661 if (-d "$directory/$_") { push @ARGV, "$directory/$_" }
662 else { unshift @ARGV, "$directory/$_" }
668 # Given $file, a symbolic link to a directory in the C include directory,
669 # make an equivalent symbolic link in $Dest_dir, if we can figure out how.
670 # Otherwise, just duplicate the file or directory.
674 my $target = eval 'readlink($dirlink)';
676 if ($target =~ m:^\.\./: or $target =~ m:^/:) {
677 # The target of a parent or absolute link could leave the $Dest_dir
678 # hierarchy, so let's put all of the contents of $dirlink (actually,
679 # the contents of $target) into @ARGV; as a side effect down the
680 # line, $dirlink will get created as an _actual_ directory.
681 expand_glob($dirlink);
683 if (-l "$Dest_dir/$dirlink") {
684 unlink "$Dest_dir/$dirlink" or
685 print STDERR "Could not remove link $Dest_dir/$dirlink: $!\n";
688 if (eval 'symlink($target, "$Dest_dir/$dirlink")') {
689 print "Linking $target -> $Dest_dir/$dirlink\n";
691 # Make sure that the link _links_ to something:
692 if (! -e "$Dest_dir/$target") {
693 mkpath("$Dest_dir/$target", 0755) or
694 print STDERR "Could not create $Dest_dir/$target/\n";
697 print STDERR "Could not symlink $target -> $Dest_dir/$dirlink: $!\n";
703 # Push all #included files in $file onto our stack, except for STDIN
704 # and files we've already processed.
705 sub queue_includes_from
710 return if ($file eq "-");
712 open HEADER, $file or return;
713 while (defined($line = <HEADER>)) {
714 while (/\\$/) { # Handle continuation lines
719 if ($line =~ /^#\s*include\s+<(.*?)>/) {
720 push(@ARGV, $1) unless $Is_converted{$1};
727 # Determine include directories; $Config{usrinc} should be enough for (all
728 # non-GCC?) C compilers, but gcc uses an additional include directory.
731 my $from_gcc = `$Config{cc} -v 2>&1`;
732 $from_gcc =~ s:^Reading specs from (.*?)/specs\b.*:$1/include:s;
734 length($from_gcc) ? ($from_gcc, $Config{usrinc}) : ($Config{usrinc});
738 # Create "_h2ph_pre.ph", if it doesn't exist or was built by a different
740 sub build_preamble_if_necessary
742 # Increment $VERSION every time this function is modified:
744 my $preamble = "$Dest_dir/_h2ph_pre.ph";
746 # Can we skip building the preamble file?
748 # Extract version number from first line of preamble:
749 open PREAMBLE, $preamble or die "Cannot open $preamble: $!";
750 my $line = <PREAMBLE>;
751 $line =~ /(\b\d+\b)/;
752 close PREAMBLE or die "Cannot close $preamble: $!";
754 # Don't build preamble if a compatible preamble exists:
755 return if $1 == $VERSION;
758 my (%define) = _extract_cc_defines();
760 open PREAMBLE, ">$preamble" or die "Cannot open $preamble: $!";
761 print PREAMBLE "# This file was created by h2ph version $VERSION\n";
763 foreach (sort keys %define) {
765 print PREAMBLE "# $_=$define{$_}\n";
768 if ($define{$_} =~ /^(\d+)U?L{0,2}$/i) {
770 "unless (defined &$_) { sub $_() { $1 } }\n\n";
771 } elsif ($define{$_} =~ /^\w+$/) {
773 "unless (defined &$_) { sub $_() { &$define{$_} } }\n\n";
776 "unless (defined &$_) { sub $_() { \"",
777 quotemeta($define{$_}), "\" } }\n\n";
780 close PREAMBLE or die "Cannot close $preamble: $!";
784 # %Config contains information on macros that are pre-defined by the
785 # system's compiler. We need this information to make the .ph files
786 # function with perl as the .h files do with cc.
787 sub _extract_cc_defines
790 my $allsymbols = join " ",
791 @Config{'ccsymbols', 'cppsymbols', 'cppccsymbols'};
793 # Split compiler pre-definitions into `key=value' pairs:
794 foreach (split /\s+/, $allsymbols) {
795 /(.+?)=(.+)/ and $define{$1} = $2;
798 print STDERR "$_: $1 -> $2\n";
808 ##############################################################################
813 h2ph - convert .h C header files to .ph Perl header files
817 B<h2ph [-d destination directory] [-r | -a] [-l] [headerfiles]>
822 converts any C header files specified to the corresponding Perl header file
824 It is most easily run while in /usr/include:
826 cd /usr/include; h2ph * sys/*
830 cd /usr/include; h2ph * sys/* arpa/* netinet/*
834 cd /usr/include; h2ph -r -l .
836 The output files are placed in the hierarchy rooted at Perl's
837 architecture dependent library directory. You can specify a different
838 hierarchy with a B<-d> switch.
840 If run with no arguments, filters standard input to standard output.
846 =item -d destination_dir
848 Put the resulting B<.ph> files beneath B<destination_dir>, instead of
849 beneath the default Perl library location (C<$Config{'installsitsearch'}>).
853 Run recursively; if any of B<headerfiles> are directories, then run I<h2ph>
854 on all files in those directories (and their subdirectories, etc.). B<-r>
855 and B<-a> are mutually exclusive.
859 Run automagically; convert B<headerfiles>, as well as any B<.h> files
860 which they include. This option will search for B<.h> files in all
861 directories which your C compiler ordinarily uses. B<-a> and B<-r> are
866 Symbolic links will be replicated in the destination directory. If B<-l>
867 is not specified, then links are skipped over.
871 Put ``hints'' in the .ph files which will help in locating problems with
872 I<h2ph>. In those cases when you B<require> a B<.ph> file containing syntax
873 errors, instead of the cryptic
875 [ some error condition ] at (eval mmm) line nnn
877 you will see the slightly more helpful
879 [ some error condition ] at filename.ph line nnn
881 However, the B<.ph> files almost double in size when built using B<-h>.
885 Include the code from the B<.h> file as a comment in the B<.ph> file.
886 This is primarily used for debugging I<h2ph>.
890 ``Quiet'' mode; don't print out the names of the files being converted.
896 No environment variables are used.
915 The usual warnings if it can't read or write the files involved.
919 Doesn't construct the %sizeof array for you.
921 It doesn't handle all C constructs, but it does attempt to isolate
922 definitions inside evals so that you can get at the definitions
923 that it can translate.
925 It's only intended as a rough tool.
926 You may need to dicker with the files produced.
928 You have to run this program by hand; it's not run as part of the Perl
931 Doesn't handle complicated expressions built piecemeal, a la:
941 Doesn't necessarily locate all of your C compiler's internally-defined
948 close OUT or die "Can't close $file: $!";
949 chmod 0755, $file or die "Can't reset permissions for $file: $!\n";
950 exec("$Config{'eunicefix'} $file") if $Config{'eunicefix'} ne ':';