- if (!-f 'workdir/Makefile') {
- open(IN, '../../Makefile') or die $!;
- open(OUT, '>workdir/Makefile') or die $!;
- print OUT "srcdir=.\n\n";
- while (<IN>) {
- last if /^gen:/;
- }
- print OUT $_;
- while (<IN>) {
- last if /^clean:/;
- print OUT $_;
- }
- close IN;
- close OUT;
- }
- my $need_autoconf;
- my $conf_opts;
- open(IN, "../$diff") or die $!;
- while (<IN>) {
- if (!defined $conf_opts) {
- $conf_opts = '' if /^---/;
- if (m#^\s*\./configure( .+)#) {
- $conf_opts = $1;
- }
- }
- if (m#^--- orig/(configure\.in|/aclocal\.m4)#) {
- $need_autoconf = 1;
- last;
- }
- }
- close IN;